public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Python API equivalent of 'info sharedlibrary'
@ 2023-03-04 17:30 Dominik Czarnota
  2023-03-10 14:50 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Czarnota @ 2023-03-04 17:30 UTC (permalink / raw)
  To: gdb

Hi,

Is there any Python API equivalent of getting information about shared
libraries through the `info sharedlibrary` command?

If not, is there any chance that this gets added?

I know there is `gdb.objfiles()` but it seems it goes over all object
files [0] and does not really provide as much information as the `info
sharedlibrary` command [1].

In our plugin we try to figure out the exact path of the glibc library
and we want to support all possible use cases (gdb, gdbserver,
LD_PRELOAD, gdbstub from QEMU-user etc.). Of course this will always
be a heuristic since we can never know if a libc.so is actually a libc
and so on. We are currently parsing the output of the `info
sharedlibrary` command but this gets more and more complicated which
is not great... [2].

[0] https://github.com/bminor/binutils-gdb/blob/d1702fea87aa62dff7de465464097dba63cc8c0f/gdb/python/py-progspace.c#L343-L369
[1] https://github.com/bminor/binutils-gdb/blob/d1702fea87aa62dff7de465464097dba63cc8c0f/gdb/solib.c#L1062-L1163
[2] https://github.com/pwndbg/pwndbg/pull/1602/files

Best regards
Dominik 'Disconnect3d' Czarnota

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Python API equivalent of 'info sharedlibrary'
  2023-03-04 17:30 Python API equivalent of 'info sharedlibrary' Dominik Czarnota
@ 2023-03-10 14:50 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2023-03-10 14:50 UTC (permalink / raw)
  To: Dominik Czarnota via Gdb; +Cc: Dominik Czarnota

>>>>> Dominik Czarnota via Gdb <gdb@sourceware.org> writes:

> Is there any Python API equivalent of getting information about shared
> libraries through the `info sharedlibrary` command?

No.

> If not, is there any chance that this gets added?

It would certainly be ok to add, but I don't know of anybody with plans
to work on it.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-10 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-04 17:30 Python API equivalent of 'info sharedlibrary' Dominik Czarnota
2023-03-10 14:50 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).