<div dir="ltr">that command:<br><br>"/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"<br><br>Or wherever you had: -emit-llvm -S -g main.c (or something like that)<br>You now have:  "-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"<br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 4, 2019 at 12:29 PM Joan Lluch <<a href="mailto:joan.lluch@icloud.com">joan.lluch@icloud.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Hi David,<div><br></div><div>Thank you for your help. Please, can you elaborate on this?. The command line that I get with -### starts with this:</div><div><br></div><div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)"><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">clang version 9.0.1 (<a href="https://github.com/llvm/llvm-project.git" target="_blank">https://github.com/llvm/llvm-project.git</a> 6e38ee067b8fa08792f551fb565bbb8ada4864b1)</span></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">Target: msp430</span></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">Thread model: posix</span></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">InstalledDir: /Users/joan/LLVM-9/llvm-project/build/Debug/bin</span></div><div style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"> "/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"</span></div></div></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="margin:0px;line-height:normal;background-color:rgb(255,255,255)">So what should I set on the debugger?</div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)"><span style="font-family:Helvetica;font-size:12px"><br></span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)"><span style="font-family:Helvetica;font-size:12px">Thanks</span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)"><span style="font-family:Helvetica;font-size:12px"><br></span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Monaco;background-color:rgb(255,255,255)"><span style="font-family:Helvetica;font-size:12px">John</span></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div><blockquote type="cite"><div>On 4 Nov 2019, at 21:03, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Run clang with -### to get the underlying command line (the one that has the first argument "-cc1") and then run that command under the debugger instead.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 4, 2019 at 12:02 PM Joan Lluch via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi All,<br>
<br>
I want to understand some parts of ‘clang' by setting debug breakpoints. <br>
<br>
I have successfully done so with “llc” but I found that debugger breakpoints do not work for ‘clang’<br>
<br>
The apparent cause is that the clang code is run as a child process which is created in the ‘Execute' function of ‘Program.inc'. The debugger stops fine at breakpoints set on the main thread, but breakpoints do not work for any code that is executed as the child process. I am compiling with Xcode in case this makes a difference.<br>
<br>
Thanks in advance for any help.<br>
<br>
John<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div>