This is the mail archive of the archer@sourceware.org mailing list for the Archer 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: plan for python inferiors, threads, and events


On Fri, Dec 12, 2008 at 11:52 AM, Paul Pluzhnikov
<ppluzhnikov@google.com> wrote:

> On Fri, Dec 12, 2008 at 11:11 AM, Tom Tromey <tromey@redhat.com> wrote:

>> class gdb.InferiorThread
>>  This represents a single inferior thread.
...
>>  * Maybe ptid?  The thread id.
>
> Yes, for the same reason as pid.

And more:

At Google, we keep a list of all live threads in the process,
and threads could be given names. We also have code which dumps
all thread stacks after printing their names.

We loose all that with 'info thread', output from which looks
like this:

(gdb) info thread
  23 Thread 0x2aaaae6d6960 (LWP 22113)  0x00002aaaabb82ea9 in syscall ()
  22 Thread 0x2aaaae6b5960 (LWP 22112)  0x000000000280ac2c in sys_futex ()
  21 Thread 0x2aaaae6a4960 (LWP 22111)  0x000000000280ac2c in sys_futex ()
...
  10 Thread 0x2aaaadeb7960 (LWP 22100)  0x00002aaaabb82ea9 in syscall ()
  9 Thread 0x2aaaad890960 (LWP 22099)  0x000000000280ac2c in sys_futex ()
  8 Thread 0x2aaaad87f960 (LWP 22098)  0x000000000280ac2c in sys_futex ()
  7 Thread 0x2aaaad85e960 (LWP 22097)  0x000000000280ac2c in sys_futex ()
  6 Thread 0x2aaaad83d960 (LWP 22096)  0x00002aaaabb82ea9 in syscall ()
  5 Thread 0x2aaaad51c960 (LWP 22095)  0x00002aaaabb82ea9 in syscall ()
  3 Thread 0x2aaaad4f3960 (LWP 22093)  0x00002aaaabb7db96 in poll ()
  2 Thread 0x2aaaad4eb960 (LWP 22092)  0x00002aaaabb7db96 in poll ()
* 1 Thread 0x2aaaabe07550 (LWP 22089)  0x00002aaaabb82ea9 in syscall ()

With 100+ threads in some processes, it's not easy to figure out
which thread one wants to look at ...

So I figured I'd just ask gdb.threads() for a list of threads, search
our live threads list for a matching thread, and print its name.

But all gdb.threads() gives me is just a list of 1, 2, 3, 5, ...
gdb thread IDs, useless for what I want to do :(

Thanks,
-- 
Paul Pluzhnikov


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