gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging on Linux with non-fragile ABI?


From: Richard Frith-Macdonald
Subject: Re: Debugging on Linux with non-fragile ABI?
Date: Mon, 18 Nov 2019 11:04:10 +0000


> On 18 Nov 2019, at 09:35, David Chisnall <address@hidden> wrote:
> 
> Hi,
> 
> Neither debugger currently knows anything about the non-fragile ABI. The 
> Apple runtimes have a few introspection functions that are called without 
> acquiring the necessary locks, which are intended to be called by the 
> debugger, but someone needs to write the relevant code in either gdb or lldb 
> and let me know what hooks they'd like.  The lldb code is relatively 
> approachable and the Objective-C runtime interfaces are quite well 
> abstracted, so it would be fairly simple to add.
> 
> Note that lldb probably does not give you the correct layout, especially for 
> anything that is not a base class.  It looks as if it's relying on the 
> compiler's guess of where ivars will be, which is not always correct in the 
> non-fragile ABI.
> 
> Materialising ivar offsets is relatively easy.  The change is basically to 
> use a different symbol name for the ivar offsets.
> 
> If no one has the time or inclination to do this, then I'd recommend calling 
> the runtime introspection functions directly from the {g,ll}db command line.  
> These will give you the correct layouts.  It's a little bit clunky (though 
> would be easy to wrap in a plug-in function), but these can give you the type 
> and offset of each ivar and let you write some pointer arithmetic that shows 
> you the correct ivar.

Interesting.  I'd very much like to see support for nonfragile objects in 
debuggers.
How could this work for core dumps?  Is it even possible to examine instance 
variables in core dumps when the nonfragile ABI is used?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]