I want to understand some parts of ‘clang' by setting debug breakpoints.
I have successfully done so with “llc” but I found that debugger breakpoints do not work for ‘clang’
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.
Thanks in advance for any help.
John
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
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.I know how to use the debugger, this is what I attempt to debug:clang --target=msp430 -emit-llvm -c -S -Oz main.c
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.
> Hi All,
>
> I want to understand some parts of ‘clang' by setting debug breakpoints.
>
> I have successfully done so with “llc” but I found that debugger breakpoints do not work for ‘clang’
>
> 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.
David provided one answer but if your debugger supports it, an easier
way is to set the debugger to follow child processes. With gdb it would
be "set follow-fork-mode child".
-David
I’m using the default Xcode debugger which happens to be Apple’s version of LLDB. Is there something equivalent for it?.
Thanks
John
> I’m using the default Xcode debugger which happens to be Apple’s
> version of LLDB. Is there something equivalent for it?.
A really old SO post indicates not:
That may very well have changed since, I don't know. I don't use LLDB
at the moment.