[R-SIG-Mac] Debugging package code in Xcode?

Neil Tiffin neilt at neiltiffin.com
Wed Jul 8 16:20:52 CEST 2009


I am not sure that even if you answer these questions that I can help,  
but I'll try.

How did you start gdb?  What commands?  Exactly what process did you  
attach to?  What is in xcode and what is not?

How exactly are you trying to set the break point?  And what does gdb  
respond with when you set it from the command line?

Was anything compiled from xcode?

Was rgl.so compiled with debug symbols turned on?

Was X11gui compiled with debug symbols turned on?

Xcode integration with gdb is a complicated situation.  Just because  
xcode can see something does not really mean that gdb can see it,  
although it usually works with Apple magic.  Are you indicating that  
gdb can see the source file or that xcode can see the source file?

Running x11, R, and rgl all in debug mode would seem a real  
challenge.  Not being an x11 expert, I would also raise the question  
with people familiar with X11 debugging in Mac OS X.  I would start  
with breakpoints only in rgl.so (which is probably what you are trying  
to do) and not x11gui.cpp:300.

You might want to run gdb without xcode and see what's going on.   
You'll have to wade through a bunch of command line stuff, but you do  
get direct feedback without it being absorbed by xcode.


On Jul 8, 2009, at 8:53 AM, Duncan Murdoch wrote:

> Neil Tiffin wrote:
>> You might research gdb fb command (future-break.)  It allows you  
>> to  set a breakpoint in code that is not loaded when the debugger  
>> is  started.  I believe you would have to use the debugger console  
>> not the  GUI with a syntax like "fb rgl.so:function_name".
> But it is loaded when I want to set the breakpoint.  I can see the  
> source file, set a breakpoint in it, but it doesn't work.  I opened  
> the gdb console (thanks for the suggestion),  and I see warnings like
> Warning - No location found for "x11gui.cpp:300"
> when I try to set a breakpoint in rgl.  How do I tell it where to  
> find the location corresponding to that file?
> Duncan Murdoch
>> On Jul 8, 2009, at 5:57 AM, Duncan Murdoch wrote:
>>> I'd like to use Xcode to debug the rgl package, which is crashing   
>>> sometimes in X11 on OSX.   In the past, I've done this for  
>>> debugging  R itself, and have a project set up for that.  I can  
>>> attach to the  process ID, and then I see rgl.so is loaded, but I  
>>> can't see how to  set a breakpoint in the rgl.so code.
>>> Has anyone else done this before?  Can you point me to step-by- 
>>> step  instructions?
>>> Duncan Murdoch
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> R-SIG-Mac at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

More information about the R-SIG-Mac mailing list