This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC PATCH 0/3] Pretty-printing for errno


On 09/06/2017 10:03 PM, Zack Weinberg wrote:

> So, changes to both gdb and libthread_db seem to be required here.  I
> do think that _in principle_ it ought to be possible to use
> libthread_db to retrieve the address of thread-local data even if the
> inferior is not linked with libpthread; glibc has quite a few
> thread-specific variables (errno most prominent, of course, but also
> h_errno, _res, etc), and so might any library which can be used from
> both single- and multithreaded programs.
> 
> This is really not code I feel comfortable hacking up, though, and
> it's probably more of a project than I have time for, in any case.

Sounds like a promising approach though.  I'd like to see this path
explored a bit more.  I'll keep this in my TODO, even though it's
not likely to bubble up very soon.  Thanks for the discussion/ideas!

> 
> ...
>>> called when the module is loaded; what would I need to add to that so
>>> that the macro is defined (if it isn't already)?
>>
>> I'm hoping that other people more experienced with the gdb
>> Python API can chime in.  My idea was just to call
>>   gdb.execute ("macro define errno (*(int *) __errno_location ())")
>> somewhere around your Python code.
> 
> I'll tinker with that.  Thanks.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]