Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa/symtab] Fix breakpoints by full path
@ 2004-09-20  0:17 Daniel Jacobowitz
  2004-09-20 16:59 ` Jim Blandy
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2004-09-20  0:17 UTC (permalink / raw)
  To: gdb-patches

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  <dan@debian.org>

	* 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);


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

* Re: [rfa/symtab] Fix breakpoints by full path
  2004-09-20  0:17 [rfa/symtab] Fix breakpoints by full path Daniel Jacobowitz
@ 2004-09-20 16:59 ` Jim Blandy
  2004-09-20 18:31   ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Blandy @ 2004-09-20 16:59 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches


Daniel Jacobowitz <drow@false.org> writes:
> 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?

Yep.

(Working on the Dwarf 2 ICU patch.)


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

* Re: [rfa/symtab] Fix breakpoints by full path
  2004-09-20 16:59 ` Jim Blandy
@ 2004-09-20 18:31   ` Daniel Jacobowitz
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2004-09-20 18:31 UTC (permalink / raw)
  To: gdb-patches

On Mon, Sep 20, 2004 at 11:57:51AM -0500, Jim Blandy wrote:
> > Tested on i386-pc-linux-gnu, no regressions, fixes the new failure in
> > fullname.exp.  OK?
> 
> Yep.

Thanks, checked in.

> (Working on the Dwarf 2 ICU patch.)

Also thanks!

-- 
Daniel Jacobowitz


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

end of thread, other threads:[~2004-09-20 18:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-20  0:17 [rfa/symtab] Fix breakpoints by full path Daniel Jacobowitz
2004-09-20 16:59 ` Jim Blandy
2004-09-20 18:31   ` Daniel Jacobowitz

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