[llvm-dev] Debugging clang with debugger breakpoints ?

Joan Lluch via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 8 08:49:50 PST 2019


Hi 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


> On 8 Nov 2019, at 17:42, David Greene <greened at obbligato.org> wrote:
> 
> Joan Lluch via llvm-dev <llvm-dev at lists.llvm.org> writes:
> 
>> 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



More information about the llvm-dev mailing list