Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Paul Pluzhnikov" <ppluzhnikov@google.com>
To: gdb-patches@sourceware.org
Cc: "Doug Evans" <dje@google.com>
Subject: [RFC] Fix for mishandling of "break 'pthread_create@GLIBC_2.2.5'"
Date: Tue, 13 May 2008 19:11:00 -0000	[thread overview]
Message-ID: <8ac60eac0805131135h5e9dd46ev8b7f39e660bf0bb7@mail.gmail.com> (raw)

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.


             reply	other threads:[~2008-05-13 18:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-13 19:11 Paul Pluzhnikov [this message]
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

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=8ac60eac0805131135h5e9dd46ev8b7f39e660bf0bb7@mail.gmail.com \
    --to=ppluzhnikov@google.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /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