Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [commit] Use full paths for "info sources"
@ 2004-09-21 14:22 David Lecomber
  2004-09-21 15:30 ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: David Lecomber @ 2004-09-21 14:22 UTC (permalink / raw)
  To: patches, dan

Alas this fix doesn't seem to fix it for me..


[david@delmo FOO]$ ls
a.out  foo
[david@delmo FOO]$ ~/bin/gdb a.out
GNU gdb 20040920
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db
library "/lib/tls/libthread_db.so.1".
                                                                                                                                                                   
(gdb) info sources
Source files for which symbols have been read
in:                                                                                                                  
Source files for which symbols will be read in on
demand:                                                                                                                                                                   main.c, /home/david/FOO/foo/main.c
(gdb)



in contrast,


GNU gdb Red Hat Linux (6.0post-0.20040223.19rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host
libthread_db library "/lib/tls/libthread_db.so.1".
                                                                                                                                                                   
(gdb) info sources
Source files for which symbols have been read in:
                                                                                                                                                                   Source files for which symbols will be read in on demand:

foo/main.c
(gdb)
                                                                                                                                                              
                     

Cheers
d.                                                                                                                                              




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

* Re: [commit] Use full paths for "info sources"
  2004-09-21 14:22 [commit] Use full paths for "info sources" David Lecomber
@ 2004-09-21 15:30 ` Daniel Jacobowitz
  2004-09-24 21:16   ` Joel Brobecker
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2004-09-21 15:30 UTC (permalink / raw)
  To: David Lecomber; +Cc: patches, Joel Brobecker

On Tue, Sep 21, 2004 at 03:17:18PM +0100, David Lecomber wrote:
> Alas this fix doesn't seem to fix it for me..

Thanks for checking.

> [david@delmo FOO]$ ls
> a.out  foo
> [david@delmo FOO]$ ~/bin/gdb a.out
> GNU gdb 20040920
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for
> details.
> This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db
> library "/lib/tls/libthread_db.so.1".
>                                                                                                                                                                    
> (gdb) info sources
> Source files for which symbols have been read
> in:                                                                                                                  
> Source files for which symbols will be read in on
> demand:                                                                                                                                                                   main.c, /home/david/FOO/foo/main.c
> (gdb)

This appears to be a problem in the pseudo-symtab code.  It needs to
take into account (A) the parent psymtab's dirname field and (B) the
directory table.  This is the decode_for_pst_p block in
dwarf_decode_lines.

I want to continue working on intercu support for now, but if Joel
doesn't have a chance to look at this, I will later.

-- 
Daniel Jacobowitz


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

* Re: [commit] Use full paths for "info sources"
  2004-09-21 15:30 ` Daniel Jacobowitz
@ 2004-09-24 21:16   ` Joel Brobecker
  2004-10-13 23:12     ` David Lecomber
  0 siblings, 1 reply; 8+ messages in thread
From: Joel Brobecker @ 2004-09-24 21:16 UTC (permalink / raw)
  To: David Lecomber, patches

> This appears to be a problem in the pseudo-symtab code.  It needs to
> take into account (A) the parent psymtab's dirname field and (B) the
> directory table.  This is the decode_for_pst_p block in
> dwarf_decode_lines.
> 
> I want to continue working on intercu support for now, but if Joel
> doesn't have a chance to look at this, I will later.

I think I am looking at another instance of this same problem just
right now. I get 2 psymtabs with the same name.  I will look into it
anyway, I think it is more valuable for us if you work on intercu.
Just let me know if you have some time and would like to work on this,
so that we don't duplicate our efforts.

-- 
Joel


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

* Re: [commit] Use full paths for "info sources"
  2004-09-24 21:16   ` Joel Brobecker
@ 2004-10-13 23:12     ` David Lecomber
  2004-10-13 23:24       ` Joel Brobecker
  0 siblings, 1 reply; 8+ messages in thread
From: David Lecomber @ 2004-10-13 23:12 UTC (permalink / raw)
  To: Joel Brobecker, dan; +Cc: patches

> I think I am looking at another instance of this same problem just
> right now. I get 2 psymtabs with the same name.  I will look into it
> anyway, I think it is more valuable for us if you work on intercu.
> Just let me know if you have some time and would like to work on this,
> so that we don't duplicate our efforts.

Did either of you guys make any progress with this one - it's the one
where sources appear twice in the info sources list.  It crops up in a
few places, such as source files in the stack trace not being the same
as those listed in the info sources.  I last checked this 2004-9-20.

Cheers
David


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

* Re: [commit] Use full paths for "info sources"
  2004-10-13 23:12     ` David Lecomber
@ 2004-10-13 23:24       ` Joel Brobecker
  2004-10-14  0:08         ` David Lecomber
  0 siblings, 1 reply; 8+ messages in thread
From: Joel Brobecker @ 2004-10-13 23:24 UTC (permalink / raw)
  To: David Lecomber; +Cc: dan, patches

Hello David,

> Did either of you guys make any progress with this one - it's the one
> where sources appear twice in the info sources list.  It crops up in a
> few places, such as source files in the stack trace not being the same
> as those listed in the info sources.  I last checked this 2004-9-20.

Sorry, I haven't had time to look into this. I thought I had seen
something similar with one of our own testcases, but it turned out
to be an assembler problem that was causing the duplication that
I was seeing. I am currently quite busy with my work and with mips-irix.

But it's still in my TODO.

I haven't reviewed the entire thread yet. Was this something really
bad. Or is it just duplication we get in the output, and that's it?

-- 
Joel


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

* Re: [commit] Use full paths for "info sources"
  2004-10-13 23:24       ` Joel Brobecker
@ 2004-10-14  0:08         ` David Lecomber
  2004-10-16 23:56           ` Joel Brobecker
  0 siblings, 1 reply; 8+ messages in thread
From: David Lecomber @ 2004-10-14  0:08 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: dan, patches

Hi Joel,
> 
> I haven't reviewed the entire thread yet. Was this something really
> bad. Or is it just duplication we get in the output, and that's it?

One problem is that things appear in the info sources, and info source,
and in the stack traces, with different paths.  So once you've got your
definitive path for a file, you then see it referred to in a different
way when you start using it.  Work-roundable for the user I guess, but
less than ideal.

Cheers
David


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

* Re: [commit] Use full paths for "info sources"
  2004-10-14  0:08         ` David Lecomber
@ 2004-10-16 23:56           ` Joel Brobecker
  0 siblings, 0 replies; 8+ messages in thread
From: Joel Brobecker @ 2004-10-16 23:56 UTC (permalink / raw)
  To: David Lecomber; +Cc: dan, patches

> > I haven't reviewed the entire thread yet. Was this something really
> > bad. Or is it just duplication we get in the output, and that's it?
> 
> One problem is that things appear in the info sources, and info source,
> and in the stack traces, with different paths.  So once you've got your
> definitive path for a file, you then see it referred to in a different
> way when you start using it.  Work-roundable for the user I guess, but
> less than ideal.

I just had a look. I think I have a fix for it, but I might just have
opened a can of worms... In any case, I'm working on it.

-- 
Joel


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

* [commit] Use full paths for "info sources"
@ 2004-09-19 22:57 Daniel Jacobowitz
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2004-09-19 22:57 UTC (permalink / raw)
  To: gdb-patches

This patch changes the output of "info sources" to use the new *_to_fullname
functions.  This means that we consistently output full paths, instead of
outputting basenames, relative paths, or dubious full paths, depending on
how the file was compiled.  It also cuts down on some duplication, since we
now print a unique list of real pathnames.  I tried to write a testcase for
this, but couldn't manage to.

Jim approved this patch on gdb@.  Tested on i386-pc-linux-gnu with no
regressions, and checked in.

-- 
Daniel Jacobowitz

2004-09-19  Daniel Jacobowitz  <dan@debian.org>

	* symtab.c (output_source_filename): Mark first argument as const.
	(sources_info): Use symtab_to_fullname and psymtab_to_fullname
	for "info sources" output.

Index: gdb/symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.136
diff -u -p -r1.136 symtab.c
--- gdb/symtab.c	11 Sep 2004 10:24:51 -0000	1.136
+++ gdb/symtab.c	14 Sep 2004 23:35:12 -0000
@@ -69,7 +69,7 @@ static void variables_info (char *, int)
 
 static void sources_info (char *, int);
 
-static void output_source_filename (char *, int *);
+static void output_source_filename (const char *, int *);
 
 static int find_line_common (struct linetable *, int, int *);
 
@@ -2622,7 +2622,7 @@ filename_seen (const char *file, int add
    NAME is the name to print and *FIRST is nonzero if this is the first
    name printed.  Set *FIRST to zero.  */
 static void
-output_source_filename (char *name, int *first)
+output_source_filename (const char *name, int *first)
 {
   /* Since a single source file can result in several partial symbol
      tables, we need to avoid printing it more than once.  Note: if
@@ -2671,7 +2671,8 @@ sources_info (char *ignore, int from_tty
   first = 1;
   ALL_SYMTABS (objfile, s)
   {
-    output_source_filename (s->filename, &first);
+    const char *fullname = symtab_to_fullname (s);
+    output_source_filename (fullname ? fullname : s->filename, &first);
   }
   printf_filtered ("\n\n");
 
@@ -2682,7 +2683,8 @@ sources_info (char *ignore, int from_tty
   {
     if (!ps->readin)
       {
-	output_source_filename (ps->filename, &first);
+	const char *fullname = psymtab_to_fullname (ps);
+	output_source_filename (fullname ? fullname : ps->filename, &first);
       }
   }
   printf_filtered ("\n");


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

end of thread, other threads:[~2004-10-16 23:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-21 14:22 [commit] Use full paths for "info sources" David Lecomber
2004-09-21 15:30 ` Daniel Jacobowitz
2004-09-24 21:16   ` Joel Brobecker
2004-10-13 23:12     ` David Lecomber
2004-10-13 23:24       ` Joel Brobecker
2004-10-14  0:08         ` David Lecomber
2004-10-16 23:56           ` Joel Brobecker
  -- strict thread matches above, loose matches on Subject: below --
2004-09-19 22:57 Daniel Jacobowitz

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