[llvm-dev] Debugging clang with debugger breakpoints ?

Zachary Turner via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 4 13:18:30 PST 2019


On Mon, Nov 4, 2019 at 1:11 PM Joan Lluch via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi David,
>
> Thank you for your patience but I still don’t get it:  I don’t see how
> that is a “command”, as it’s just a list of strings that state command
> options.
>
> This is the output you pasted after running the command:

> "/Users/joan/LLVM-9/llvm-project/build/Debug/bin/clang" "-cc1" "-triple"
"msp430" "-emit-llvm" "-disable-free" "-main-file-name" "main.c"
"-mrelocation-model" "static" "-mthread-model" "posix" "-fmath-errno"
"-masm-verbose" "-mconstructor-aliases" "-nostdsysteminc"
"-dwarf-column-info" "-debugger-tuning=gdb" "-target-linker-version" "305"
"-momit-leaf-frame-pointer" "-coverage-notes-file"
"/Users/joan/Documents-Local/Relay/RelayNou/main.gcno" "-resource-dir"
"/Users/joan/LLVM-9/llvm-project/build/Debug/lib/clang/9.0.1"
"-internal-isystem"
"/Users/joan/LLVM-9/llvm-project/build/Debug/bin/../msp430/include"
"-Oz" "-fdebug-compilation-dir" "/Users/joan/Documents-Local/Relay/RelayNou"
"-ferror-limit" "19" "-fmessage-length" "224" "-fobjc-runtime=gcc"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-slp"
"-faddrsig" "-o" "main.ll" "-x" "c" "main.c"

Yes it is a list of strings.  But the first string
"/Users/joan/LLVM-9/llvm-project/build/Debug/bin/clang"
is a command.  The rest are arguments.  So you should set your debugger to
run this command:

"/Users/joan/LLVM-9/llvm-project/build/Debug/bin/clang"

with these arguments:

"-cc1" "-triple" "msp430" "-emit-llvm" "-disable-free" "-main-file-name"
"main.c" "-mrelocation-model" "static" "-mthread-model" "posix"
"-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-nostdsysteminc"
"-dwarf-column-info" "-debugger-tuning=gdb" "-target-linker-version" "305"
"-momit-leaf-frame-pointer" "-coverage-notes-file"
"/Users/joan/Documents-Local/Relay/RelayNou/main.gcno" "-resource-dir"
"/Users/joan/LLVM-9/llvm-project/build/Debug/lib/clang/9.0.1"
"-internal-isystem"
"/Users/joan/LLVM-9/llvm-project/build/Debug/bin/../msp430/include"
"-Oz" "-fdebug-compilation-dir" "/Users/joan/Documents-Local/Relay/RelayNou"
"-ferror-limit" "19" "-fmessage-length" "224" "-fobjc-runtime=gcc"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-slp"
"-faddrsig" "-o" "main.ll" "-x" "c" "main.c"

Does that make sense?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191104/62a0e7f5/attachment.html>


More information about the llvm-dev mailing list