i looking clang equivalent of cl command /fc. need full paths build tool parse out , open code files errors.
you need specify fully-qualified or relative path file on command-line instead of passing in filename. in following example debugger won't know find "blah.cc" because compiled specifying filename:
~ pwd /mnt/scratch/myproject/src ~ clang++ blah.cc -c -o /mnt/scratch/myproject/build/blah.o ~ cd ../build ~ clang++ *.o -o myprogram ... however, if instead i'd done this:
~ pwd /mnt/scratch/myproject ~ clang++ /mnt/scratch/myproject/src/blah.cc -c -o /mnt/scratch/myproject/build/blah.o # or: ~ clang++ src/blah.cc -c -o build/blah.o # ... ... embeds fully-qualified or relative path debug sections.
if use partially qualified path, you'll have tell gdb code. can @ documentation here, though 2 gdb commands may helpful:
# cause gdb in "path2" instead of "path1" (gdb) set substitute-path path1 path2 # allows give list of directories search source. # note if give relative paths on command-line, it'll concatenate # these paths , relative path used @ compile-time. (gdb) set directories path [path ...]
Comments
Post a Comment