From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11589 invoked by alias); 20 Sep 2004 00:17:00 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11580 invoked from network); 20 Sep 2004 00:16:59 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 20 Sep 2004 00:16:59 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1C9BrX-0006U6-Nm for ; Sun, 19 Sep 2004 20:16:59 -0400 Date: Mon, 20 Sep 2004 00:17:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: [rfa/symtab] Fix breakpoints by full path Message-ID: <20040920001659.GA24644@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-09/txt/msg00308.txt.bz2 This patch fixes a bug in setting breakpoints by full path. The problem is two dangling users of source_full_path_of; the right way to set pst->fullname now is to use psymtab_to_fullname, which takes advantage of pst->dirname if it was available. source_full_path_of only considers the search path, which is less useful. Without the patch, this sequence would fail: cd tmp gcc -o tmp tmp.c cd .. gdb ./tmp/tmp break /path/to/tmp/tmp.c:1 But this one would succeed: cd tmp gcc -o tmp tmp.c cd .. gdb ./tmp/tmp interpreter-exec mi -file-list-exec-source-files break /path/to/tmp/tmp.c:1 (because -file-list-exec-source-files initialized fullname correctly). Tested on i386-pc-linux-gnu, no regressions, fixes the new failure in fullname.exp. OK? -- Daniel Jacobowitz 2004-09-19 Daniel Jacobowitz * symtab.c (lookup_partial_symtab): Use psymtab_to_fullname. (lookup_partial_symtab): Use symtab_to_fullname. Index: symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.137 diff -u -p -r1.137 symtab.c --- symtab.c 19 Sep 2004 22:49:23 -0000 1.137 +++ symtab.c 19 Sep 2004 23:32:40 -0000 @@ -272,8 +272,7 @@ lookup_partial_symtab (const char *name) this symtab and use its absolute path. */ if (full_path != NULL) { - if (pst->fullname == NULL) - source_full_path_of (pst->filename, &pst->fullname); + psymtab_to_fullname (pst); if (pst->fullname != NULL && FILENAME_CMP (full_path, pst->fullname) == 0) { @@ -284,8 +283,7 @@ lookup_partial_symtab (const char *name) if (real_path != NULL) { char *rp = NULL; - if (pst->fullname == NULL) - source_full_path_of (pst->filename, &pst->fullname); + psymtab_to_fullname (pst); if (pst->fullname != NULL) { rp = gdb_realpath (pst->fullname);