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]

Watchpoints stopping GDB on specific threads


Folks,

GDB currently has support for conditional breakpoint stops on specific
threads, by issuing the command "break <location> thread <id>".

I'm looking forward to have the same functionality for watchpoints. So
whenever GDB detects a watchpoint trigger, it would verify the current
thread and would stop only if the thread matches the ID we provided in a
command like "watch <address> thread <id>". if no ID is provided, GDB
would stop at every thread as usual (assuming a threaded watchpoint
support).

This is useful to conduct debugging sessions on applications with a
great number of threads, being able to inspect just the thread we're
interested in. It would also take advantage of the upcomming threaded
watchpoint support, hopefully.

At a first glance, i'd need to work in a different way than the
breakpoint case, because the entire watchpoint expression is handled by
a expression parser. It automatically processes the "thread <id>"
parameter and of course gives an error because that's not recognized. Do
you have any idea on how this could be solved in a clever way? We could
start parsing the expression from the end, and try to locate the "thread
<id>" parameter, and then hand over the remaining parameters to the
expression parser. What do you think?

Best regards,

-- 
Luis Machado
Software Engineer 
IBM Linux Technology Center
LoP Toolchain/Debuggers' team
Phone: +55 19-2132-2218
T/L: 839-2218
e-mail: luisgpm@vnet.linux.ibm.com


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