From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: pfee@talk21.com
Cc: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
Subject: Re: Enhancement - show old and new thread info when switching during debugging
Date: Fri, 29 Jul 2011 20:40:00 -0000 [thread overview]
Message-ID: <1311971792.2199.14.camel@soleil> (raw)
In-Reply-To: <1311957205.11694.YahooMailRC@web86707.mail.ird.yahoo.com>
On Fri, 2011-07-29 at 17:33 +0100, pfee@talk21.com wrote:
> [Switching to Thread 0x7ffff7fd67000 (LWP 4282) from Thread 0x7ffff7fd8740 (LWP
> 4279)]
An alternative is to add a hook:
(gdb) define hook-thread
Type commands for definition of "hook-thread".
End with a line saying just "end".
>thread
>end
(gdb) info thre
2 Thread 0xb7fe3b70 (LWP 2321) 0x0070c416 in __kernel_vsyscall ()
* 1 Thread 0xb7fe46c0 (LWP 2318) main (argc=1, argv=0xbffff244)
at sleepers.c:169
(gdb) thre 2
[Current thread is 1 (Thread 0xb7fe46c0 (LWP 2318))]
[Switching to thread 2 (Thread 0xb7fe3b70 (LWP 2321))]#0 0x0070c416 in __kernel_vsyscall ()
(gdb)
It would have been nice to do
if $argc >= 1
thread
end
so that the thread command without arg would not output twice the
current thread.
It is not clear to me why the command hook does not get the command
arguments.
execute_cmd_pre_hook calls
execute_user_command (c->hook_pre, (char *) 0);
If execute_command
calls first
execute_cmd_pre_hook (c);
then
execute_user_command (c, arg);
So, I suppose that by adding one argument to execute_cmd_pre_hook,
the hook could pass arg to execute_user_command.
(same for the post hook).
If that looks a good idea, it might become my 3rd gdb patch :).
Philippe
next prev parent reply other threads:[~2011-07-29 20:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-29 15:29 pfee
2011-07-29 16:01 ` Joel Brobecker
2011-07-29 16:33 ` pfee
2011-07-29 17:38 ` Joel Brobecker
2011-07-29 17:47 ` pfee
2011-07-29 20:40 ` Philippe Waroquiers [this message]
2011-07-30 2:44 ` Tom Tromey
2011-07-30 11:39 ` Joel Brobecker
2011-07-30 11:44 ` Pedro Alves
2011-07-30 14:12 ` pfee
2011-08-08 11:35 ` pfee
2011-08-08 15:07 ` Pedro Alves
2011-08-08 15:20 ` pfee
2011-08-09 15:25 ` pfee
2011-08-10 15:10 ` Pedro Alves
2011-08-16 16:01 ` pfee
2011-07-30 12:40 ` pfee
2011-07-30 11:32 ` Tom Tromey
2011-07-30 22:07 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1311971792.2199.14.camel@soleil \
--to=philippe.waroquiers@skynet.be \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=pfee@talk21.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox