From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11455 invoked by alias); 13 May 2008 18:36:37 -0000 Received: (qmail 11447 invoked by uid 22791); 13 May 2008 18:36:36 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 13 May 2008 18:36:05 +0000 Received: from zps36.corp.google.com (zps36.corp.google.com [172.25.146.36]) by smtp-out.google.com with ESMTP id m4DIZudp016974 for ; Tue, 13 May 2008 19:35:56 +0100 Received: from yw-out-1718.google.com (ywm5.prod.google.com [10.192.13.5]) by zps36.corp.google.com with ESMTP id m4DIZsSx008742 for ; Tue, 13 May 2008 11:35:54 -0700 Received: by yw-out-1718.google.com with SMTP id 5so3125961ywm.72 for ; Tue, 13 May 2008 11:35:54 -0700 (PDT) Received: by 10.150.212.16 with SMTP id k16mr164674ybg.81.1210703753872; Tue, 13 May 2008 11:35:53 -0700 (PDT) Received: by 10.151.99.13 with HTTP; Tue, 13 May 2008 11:35:53 -0700 (PDT) Message-ID: <8ac60eac0805131135h5e9dd46ev8b7f39e660bf0bb7@mail.gmail.com> Date: Tue, 13 May 2008 19:11:00 -0000 From: "Paul Pluzhnikov" To: gdb-patches@sourceware.org Subject: [RFC] Fix for mishandling of "break 'pthread_create@GLIBC_2.2.5'" Cc: "Doug Evans" MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00403.txt.bz2 Greetings, Gdb currently refuses to set a breakpoint on versioned symbols. Consider: $ cat t.c #include 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 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' or 'pthread_create@@GLIBC_2.1' (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 * linespec.c (locate_first_half): Rename to... (locate_first_half_1): ... this. (locate_first_half): New fn.