This is the mail archive of the gdb-patches@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]

New mi commands for threads


Hi everyone,


I'd like to propose an implementation of -thread-info -thread-list-all-threads

Before posting patches, I'd like to discuss a little bit.
First should I post 2 patches or can I post only one for both ?

About -thread-info:
------------------
The only way to get information on a thread is the "info thread" cli command, this one sometimes takes a while to execute since it gets a lot of stuff (we already discusses on performance problem before, I won't bother you with that today) . I propose an implementation of -thread-info which take an optional argument (the thread ID). If not given, we'll get information on the current thread, that could be useful as well. If argument if given ... I'm sure you've figured out.
Both of these patch aim at getting rid of CLI command usage into GUI client like Eclipse.


Here is an output example of what is implemented:
-thread-info 3
^done,thread-id="3",frame={level="0",addr="0x00aeaaec",func="nanosleep",args=[],from="/lib/tls/libc.so.6"},thread-extra-info="bla bla bla"


As you can see I display "extra information" as well. These are not given by -thread-list-ids, and it's a good idea since extra info retrieval could also take a while.


About -thread-list-all-threads:
-------------------------------
It will display the same for all threads, plus the number of thread and the current thread id.
Example:
-thread-list-all-threads
^done,thread-list={thread-id="6",frame={level="0",addr="0x007b9939",func="__lll_mutex_lock_wait",args=[],from="/lib/tls/libpthread.so.0"},thread-extra-info="bla bla",thread-id="5",frame={level="0",addr="0x007b9939",func="__lll_mutex_lock_wait",args=[],from="/lib/tls/libpthread.so.0"},thread-extra-info="bla bla",thread-id="4",frame={level="0",addr="0x007b9939",func="__lll_mutex_lock_wait",args=[],from="/lib/tls/libpthread.so.0"},thread-extra-info="bla bla",thread-id="3",frame={level="0",addr="0x007b9939",func="__lll_mutex_lock_wait",args=[],from="/lib/tls/libpthread.so.0"},thread-extra-info="bla bla",thread-id="2",frame={level="0",addr="0x00e80aec",func="nanosleep",args=[],from="/lib/tls/libc.so.6"},thread-extra-info="bla bla",thread-id="1",frame={level="0",func="main",args=[],file="/project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/cvs/head/src/gdb/testsuite/gdb.mi/pthreads.c",fullname="/project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/cvs/head/src/gdb/testsuite/gdb.mi/pthreads.c",line="87"},line="87",file="/project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/cvs/head/src/gdb/testsuite/gdb.mi/pthreads.c",thread-extra-info="bla bla"},number-of-threads="6",current-thread-id="1"



Do you agree the output contains and format ?


Waiting for your feedback.
Denis



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