public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* duplicated source file names
@ 2003-08-14  6:59 John Williams
  2003-08-14 16:02 ` Keith Seitz
  0 siblings, 1 reply; 9+ messages in thread
From: John Williams @ 2003-08-14  6:59 UTC (permalink / raw)
  To: insight

Hi,

Debugging a linux kernel, there are many instances where source files of 
the same name but different in directories exist - for example super.c 
appears in several of the filesystem subdirectories.

However, when debugging this in insight, it only seems to be able to 
"recognise" one instance of a particular filename.  So, even though I 
type in the name of a function in the function drop down 
"ext2_read_super", which exists in fs/ext2/super.c, Insight displays the 
file /fs/super.c.

This is all on gdb5.0 under RH linux (but also same under Cygwin).

Is this a known issue?  IS there a way I can qualify the function name 
(or indeed source file) to specify *which* super.c it should find a 
function in?

Thanks,

John

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

* Re: duplicated source file names
  2003-08-14  6:59 duplicated source file names John Williams
@ 2003-08-14 16:02 ` Keith Seitz
  2003-08-14 21:52   ` John Williams
  0 siblings, 1 reply; 9+ messages in thread
From: Keith Seitz @ 2003-08-14 16:02 UTC (permalink / raw)
  To: jwilliams; +Cc: insight

On Thu, 2003-08-14 at 00:08, John Williams wrote:

> However, when debugging this in insight, it only seems to be able to 
> "recognise" one instance of a particular filename.  So, even though I 
> type in the name of a function in the function drop down 
> "ext2_read_super", which exists in fs/ext2/super.c, Insight displays the 
> file /fs/super.c.

This is a pretty well-known issue for me... I still have nightmares
about it. The problem is not really insight, as I recall. Here's how to
check:

Try a couple of things. Open a console window and enter the commands:

- "list ext2_read_super": Does it return the correct source?
- "info func ext2_read_super": Right info?
- "tk gdbtk_loc ext_read_super": Right info?

Send results to the list. I'm pretty sure that gdb is failing on this,
but it has been a while, and maybe they fixed it and Insight is behind
the times.

BTW, gdb/insight 5.0 is WAY old... Even if it is a gdb problem, I doubt
you're going to get much help with a release that several years old.

Keith


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

* Re: duplicated source file names
  2003-08-14 16:02 ` Keith Seitz
@ 2003-08-14 21:52   ` John Williams
  2003-08-14 23:28     ` Keith Seitz
  2003-08-15 15:52     ` Andrew Cagney
  0 siblings, 2 replies; 9+ messages in thread
From: John Williams @ 2003-08-14 21:52 UTC (permalink / raw)
  Cc: insight

Hi Keith,

Keith Seitz wrote:
> 
>>However, when debugging this in insight, it only seems to be able to 
>>"recognise" one instance of a particular filename.  So, even though I 
>>type in the name of a function in the function drop down 
>>"ext2_read_super", which exists in fs/ext2/super.c, Insight displays the 
>>file /fs/super.c.
> 
> This is a pretty well-known issue for me... I still have nightmares
> about it. The problem is not really insight, as I recall. Here's how to
> check:
> 
> Try a couple of things. Open a console window and enter the commands:
> 
> - "list ext2_read_super": Does it return the correct source?

Nope - it lists the "correct" line numbers from the wrong file.  I'm 
guessing this is a problem in the binutils addr2line, is that what it's for?

> - "info func ext2_read_super": Right info?

It says "super.c", then gives the corrent function declaration.

> - "tk gdbtk_loc ext_read_super": Right info?

I get - Error: invalid command name "gdbtk_loc"

> Send results to the list. I'm pretty sure that gdb is failing on this,
> but it has been a while, and maybe they fixed it and Insight is behind
> the times.
> 
> BTW, gdb/insight 5.0 is WAY old... Even if it is a gdb problem, I doubt
> you're going to get much help with a release that several years old.

Yeah I realise that - this is a cross-debugger for an embedded system, 
short of forward-porting it myself (*not* gonna happen!) I don't really 
have a lot of options.

I'm not too stressed about this, I can just rename the source file and 
rebuild the project as I need to, just wanted to know if there was 
something simple I might do.

Thanks,

John

> 
> Keith
> 


-- 
Dr John Williams, Research Fellow,
Reconfigurable Computing, School of ITEE
University of Queensland, Brisbane, Australia
Ph : (07) 3365 8305

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

* Re: duplicated source file names
  2003-08-14 21:52   ` John Williams
@ 2003-08-14 23:28     ` Keith Seitz
  2003-08-14 23:35       ` John Williams
  2003-08-15 15:52     ` Andrew Cagney
  1 sibling, 1 reply; 9+ messages in thread
From: Keith Seitz @ 2003-08-14 23:28 UTC (permalink / raw)
  To: jwilliams; +Cc: insight

On Thu, 2003-08-14 at 15:01, John Williams wrote:
> > - "list ext2_read_super": Does it return the correct source?
> 
> Nope - it lists the "correct" line numbers from the wrong file.  I'm 
> guessing this is a problem in the binutils addr2line, is that what it's for?

Close. Binutils doesn't really read debug info the way gdb does. They
both try to do the same thing, but gdb looks at it slightly differently.

> > - "tk gdbtk_loc ext_read_super": Right info?
>
> I get - Error: invalid command name "gdbtk_loc"

Oops. Should have been "gdb_loc" not "gdbtk_loc".

> Yeah I realise that - this is a cross-debugger for an embedded system, 
> short of forward-porting it myself (*not* gonna happen!) I don't really 
> have a lot of options.

Ah. Understood.

> I'm not too stressed about this, I can just rename the source file and 
> rebuild the project as I need to, just wanted to know if there was 
> something simple I might do.
> 

Yeah -- that's been the sad approach used by most. As I recall we have a
file in gdb that used to use the same filename as another file in bfd.
Instead fixing gdb, someone renamed gdb's file!

Keith


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

* Re: duplicated source file names
  2003-08-14 23:28     ` Keith Seitz
@ 2003-08-14 23:35       ` John Williams
  2003-08-14 23:42         ` Keith Seitz
  0 siblings, 1 reply; 9+ messages in thread
From: John Williams @ 2003-08-14 23:35 UTC (permalink / raw)
  Cc: insight

Keith Seitz wrote:
> On Thu, 2003-08-14 at 15:01, John Williams wrote:
> 
>>>- "list ext2_read_super": Does it return the correct source?
>>
>>Nope - it lists the "correct" line numbers from the wrong file.  I'm 
>>guessing this is a problem in the binutils addr2line, is that what it's for?
> 
> 
> Close. Binutils doesn't really read debug info the way gdb does. They
> both try to do the same thing, but gdb looks at it slightly differently.

OK.
>>I'm not too stressed about this, I can just rename the source file and 
>>rebuild the project as I need to, just wanted to know if there was 
>>something simple I might do.
> 
> Yeah -- that's been the sad approach used by most. As I recall we have a
> file in gdb that used to use the same filename as another file in bfd.
> Instead fixing gdb, someone renamed gdb's file!

ha!  well if it's good enough for gdb, it's good enough for me :)

I have the source of this cross-gdb and can build it myself, if I feel 
inspired one day I might look into it.  Recommend any resources (old 
mailing list archives perhaps?) where I might find info on how the bug 
was fixed?

Thanks,

John



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

* Re: duplicated source file names
  2003-08-14 23:35       ` John Williams
@ 2003-08-14 23:42         ` Keith Seitz
  0 siblings, 0 replies; 9+ messages in thread
From: Keith Seitz @ 2003-08-14 23:42 UTC (permalink / raw)
  To: jwilliams; +Cc: insight

On Thu, 2003-08-14 at 16:44, John Williams wrote:

> I have the source of this cross-gdb and can build it myself, if I feel 
> inspired one day I might look into it.  Recommend any resources (old 
> mailing list archives perhaps?) where I might find info on how the bug 
> was fixed?

I don't think it's ever been fixed. If it has, it's because of a massive
amount of work going on in the symbol readers and symbol table. You'd
not likely back-patch 5.0 (or event 5.3) with it.

I encourage you to file a bug on it. Heck, make their day: file a bug
and submit a dejagnu testcase for it! This way, there's one more failure
to track.

Keith


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

* Re: duplicated source file names
  2003-08-14 21:52   ` John Williams
  2003-08-14 23:28     ` Keith Seitz
@ 2003-08-15 15:52     ` Andrew Cagney
  2003-08-16 18:46       ` Tom Tromey
  2003-08-18 16:03       ` Steve Morgan
  1 sibling, 2 replies; 9+ messages in thread
From: Andrew Cagney @ 2003-08-15 15:52 UTC (permalink / raw)
  To: jwilliams; +Cc: insight

"It should work".

With out any other evidence, I'd assume this is fixed in a more recent 
set of developer tools (debugger, binutils, compiler, ...).  Perhaps 
look in GDB's bug database - http://www.gnu.org/software/gdb/bugs/.

BTW, the current reason for GDB having uniquely named files is for 
consistency and to avoid the build problems with:
	cc -c a/foo.c
	cc -c b/foo.c

enjoy,
Andrew

> Hi Keith,
> 
> Keith Seitz wrote:
> 
> However, when debugging this in insight, it only seems to be able to "recognise" one instance of a particular filename.  So, even though I type in the name of a function in the function drop down "ext2_read_super", which exists in fs/ext2/super.c, Insight displays the file /fs/super.c.
> 
> This is a pretty well-known issue for me... I still have nightmares
> about it. The problem is not really insight, as I recall. Here's how to
> check:
> 
> Try a couple of things. Open a console window and enter the commands:
> 
> - "list ext2_read_super": Does it return the correct source?
> 
> Nope - it lists the "correct" line numbers from the wrong file.  I'm guessing this is a problem in the binutils addr2line, is that what it's for?
> 
> - "info func ext2_read_super": Right info?
> 
> It says "super.c", then gives the corrent function declaration.
> 
> - "tk gdbtk_loc ext_read_super": Right info?
> 
> I get - Error: invalid command name "gdbtk_loc"
> 
> Send results to the list. I'm pretty sure that gdb is failing on this,
> but it has been a while, and maybe they fixed it and Insight is behind
> the times.
> 
> BTW, gdb/insight 5.0 is WAY old... Even if it is a gdb problem, I doubt
> you're going to get much help with a release that several years old.
> 
> Yeah I realise that - this is a cross-debugger for an embedded system, short of forward-porting it myself (*not* gonna happen!) I don't really have a lot of options.
> 
> I'm not too stressed about this, I can just rename the source file and rebuild the project as I need to, just wanted to know if there was something simple I might do.
> 
> Thanks,
> 
> John
> 
> 
> Keith


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

* Re: duplicated source file names
  2003-08-15 15:52     ` Andrew Cagney
@ 2003-08-16 18:46       ` Tom Tromey
  2003-08-18 16:03       ` Steve Morgan
  1 sibling, 0 replies; 9+ messages in thread
From: Tom Tromey @ 2003-08-16 18:46 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: jwilliams, insight

>>>>> "Andrew" == Andrew Cagney <ac131313@redhat.com> writes:

Andrew> With out any other evidence, I'd assume this is fixed in a more recent
Andrew> set of developer tools (debugger, binutils, compiler, ...).  Perhaps
Andrew> look in GDB's bug database - http://www.gnu.org/software/gdb/bugs/.

There was a discussion of this problem on the gdb list sometime last
year (or maybe earlier).  As I recall we ended up with a patch where,
if you specify the full path to a file, gdb will normalize it
internally and not be confused.

I don't know how this applies to insight, exactly.  I suppose from the
console you can type the name unambiguously.  And I doubt this change
is in 5.0.

Tom

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

* RE: duplicated source file names
  2003-08-15 15:52     ` Andrew Cagney
  2003-08-16 18:46       ` Tom Tromey
@ 2003-08-18 16:03       ` Steve Morgan
  1 sibling, 0 replies; 9+ messages in thread
From: Steve Morgan @ 2003-08-18 16:03 UTC (permalink / raw)
  To: 'Andrew Cagney', jwilliams; +Cc: insight

I have the same situation in 5.3.

I have found the function browser (Ctrl+F)
useful for setting breakpoints in this
case. It lists all functions across
identically named files.

Steve

-----Original Message-----
From: Andrew Cagney [mailto:ac131313@redhat.com]
Sent: Friday, August 15, 2003 11:34 AM
To: jwilliams@itee.uq.edu.au
Cc: insight@sources.redhat.com
Subject: Re: duplicated source file names


"It should work".

With out any other evidence, I'd assume this is fixed in a more recent
set of developer tools (debugger, binutils, compiler, ...).  Perhaps
look in GDB's bug database - http://www.gnu.org/software/gdb/bugs/.

BTW, the current reason for GDB having uniquely named files is for
consistency and to avoid the build problems with:
	cc -c a/foo.c
	cc -c b/foo.c

enjoy,
Andrew

> Hi Keith,
>
> Keith Seitz wrote:
>
> However, when debugging this in insight, it only seems to be able to
"recognise" one instance of a particular filename.  So, even though I type
in the name of a function in the function drop down "ext2_read_super", which
exists in fs/ext2/super.c, Insight displays the file /fs/super.c.
>
> This is a pretty well-known issue for me... I still have nightmares
> about it. The problem is not really insight, as I recall. Here's how to
> check:
>
> Try a couple of things. Open a console window and enter the commands:
>
> - "list ext2_read_super": Does it return the correct source?
>
> Nope - it lists the "correct" line numbers from the wrong file.  I'm
guessing this is a problem in the binutils addr2line, is that what it's for?
>
> - "info func ext2_read_super": Right info?
>
> It says "super.c", then gives the corrent function declaration.
>
> - "tk gdbtk_loc ext_read_super": Right info?
>
> I get - Error: invalid command name "gdbtk_loc"
>
> Send results to the list. I'm pretty sure that gdb is failing on this,
> but it has been a while, and maybe they fixed it and Insight is behind
> the times.
>
> BTW, gdb/insight 5.0 is WAY old... Even if it is a gdb problem, I doubt
> you're going to get much help with a release that several years old.
>
> Yeah I realise that - this is a cross-debugger for an embedded system,
short of forward-porting it myself (*not* gonna happen!) I don't really have
a lot of options.
>
> I'm not too stressed about this, I can just rename the source file and
rebuild the project as I need to, just wanted to know if there was something
simple I might do.
>
> Thanks,
>
> John
>
>
> Keith




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

end of thread, other threads:[~2003-08-18 16:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-14  6:59 duplicated source file names John Williams
2003-08-14 16:02 ` Keith Seitz
2003-08-14 21:52   ` John Williams
2003-08-14 23:28     ` Keith Seitz
2003-08-14 23:35       ` John Williams
2003-08-14 23:42         ` Keith Seitz
2003-08-15 15:52     ` Andrew Cagney
2003-08-16 18:46       ` Tom Tromey
2003-08-18 16:03       ` Steve Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).