Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] Fix for mishandling of "break 'pthread_create@GLIBC_2.2.5'"
@ 2008-05-13 19:11 Paul Pluzhnikov
  2008-05-13 19:21 ` Daniel Jacobowitz
  0 siblings, 1 reply; 17+ messages in thread
From: Paul Pluzhnikov @ 2008-05-13 19:11 UTC (permalink / raw)
  To: gdb-patches; +Cc: Doug Evans

Greetings,

Gdb currently refuses to set a breakpoint on versioned symbols.
Consider:

$ cat t.c
#include <pthread.h>

void *fn(void *p) { return 0; }
int main()
{
    pthread_t tid;
    pthread_create(&tid, 0, fn, 0);
    pthread_join(tid, 0);
    return 0;
}

$ gcc -g -pthread -o t t.c && gdb --version && gdb -q ./t
GNU gdb 6.8.50.20080512-cvs
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
(gdb) b main
Breakpoint 1 at 0x8048412: file t.c, line 7.
(gdb) r
[Thread debugging using libthread_db enabled]

Breakpoint 1, main () at t.c:7
7           pthread_create(&tid, 0, fn, 0);
(gdb) b 'pthread_create@       << Hit TAB twice
pthread_create@@GLIBC_2.1  pthread_create@GLIBC_2.0
pthread_create@plt
(gdb) b 'pthread_create@@GLIBC_2.1'
Can't find member of namespace, class, struct, or union named
"pthread_create@@GLIBC_2.1"
Hint: try 'pthread_create@@GLIBC_2.1'<TAB> or 'pthread_create@@GLIBC_2.1'<ESC-?>
(Note leading single quote.)
(gdb) q


Attached patch fixes that problem, by stripping version info before
deciding whether the breakpoint location contains any components.

Thanks,
-- 
Paul Pluzhnikov

2008-05-13  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* linespec.c (locate_first_half): Rename to...
	(locate_first_half_1): ... this.
	(locate_first_half): New fn.


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

end of thread, other threads:[~2008-06-06  2:35 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-13 19:11 [RFC] Fix for mishandling of "break 'pthread_create@GLIBC_2.2.5'" Paul Pluzhnikov
2008-05-13 19:21 ` Daniel Jacobowitz
2008-05-13 22:16   ` Michael Snyder
2008-05-13 23:02   ` Paul Pluzhnikov
2008-05-13 23:16     ` Daniel Jacobowitz
2008-05-14  1:05       ` Paul Pluzhnikov
2008-05-14  8:16         ` Paul Pluzhnikov
2008-06-05 19:14           ` Daniel Jacobowitz
2008-06-06  2:14             ` Paul Pluzhnikov
2008-06-06  2:35               ` Daniel Jacobowitz
2008-05-14  4:26     ` David Miller
2008-05-14  4:30       ` Daniel Jacobowitz
2008-05-14 11:51         ` David Miller
2008-05-14 14:48           ` Daniel Jacobowitz
2008-05-14 17:33             ` David Miller
2008-05-14 18:05               ` Andreas Schwab
2008-05-14 18:09                 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox