This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: gdb/456: gdb can't find certain source files from files compiled -gdwarf-2 with newer gcc's (?)
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 4 Apr 2002 06:08:02 -0000
- Subject: Re: gdb/456: gdb can't find certain source files from files compiled -gdwarf-2 with newer gcc's (?)
- Reply-to: Daniel Jacobowitz <drow at mvista dot com>
The following reply was made to PR gdb/456; it has been noted by GNATS.
From: Daniel Jacobowitz <drow@mvista.com>
To: dje@transmeta.com
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/456: gdb can't find certain source files from files compiled -gdwarf-2 with newer gcc's (?)
Date: Thu, 4 Apr 2002 01:06:04 -0500
--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Thu, Apr 04, 2002 at 05:18:45AM -0000, dje@transmeta.com wrote:
>
> >Number: 456
> >Category: gdb
> >Synopsis: gdb can't find certain source files from files compiled -gdwarf-2 with newer gcc's (?)
> >Confidential: no
> >Severity: serious
> >Priority: medium
> >Responsible: unassigned
> >State: open
> >Class: sw-bug
> >Submitter-Id: net
> >Arrival-Date: Wed Apr 03 21:28:01 PST 2002
> >Closed-Date:
> >Last-Modified:
> >Originator: dje@transmeta.com
> >Release: unknown-1.0
> >Organization:
> >Environment:
> i386-linux
> >Description:
> gcc -gdwarf-2 use to emit source location information by omitting
> the directory table, and including the directory with the file name.
> gdb can cope with the missing directory entry and find the source file.
>
> newer gcc's are different. they emit separate directory and file names
> in dwarf2 output. gdb can no longer find (certain) source files compiled this way.
>
> maybe this is intended. maybe users have to deal with this.
> it is a pain though.
> >How-To-Repeat:
... Here's a typescript of exactly what you described. Read it with
less -R, or you'll be buried in the stupid ESC sequences in my shell
prompt.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=typescript
Content-Transfer-Encoding: quoted-printable
Script started on Thu Apr 4 01:02:18 2002
=1B]0;drow@nevyn:~/dir=07=0D=1B[m=1B[23m=1B[24m=1B[Jdrow@nevyn:~/dir% =1B[K=
m=08mkdir -p src/bar obj/bar/gen=0D=0D
=1B]0;drow@nevyn: mkdir -p src/bar obj/bar/gen=07=1B]0;drow@nevyn:~/dir=07=
=0D=1B[m=1B[23m=1B[24m=1B[Jdrow@nevyn:~/dir% =1B[Kc=08cat <<EOF >obj/bar/ge=
n/foo.inc=0D=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[Kv=08void=0D=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[Kf=08foo ()=0D=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[K{=08{ =0D=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[K =08 printf ("this is foo\n");=0D=
=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[K}=0D=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[KE=08EOF=0D=0D
=1B]0;drow@nevyn: cat <<EOF >obj/bar/gen/foo.inc\nvoid\nfoo ()\n{ \n print=
...=07=1B]0;drow@nevyn:~/dir=07=0D=1B[m=1B[23m=1B[24m=1B[Jdrow@nevyn:~/dir%=
=1B[Kc=08cat <<EOF >src/bar/foo.c=0D=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[K#=08#include "gen/foo.inc"=0D=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[Ki=08int=0D=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[Km=08main ()=0D=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[K{=08{ =0D=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[K =08 foo ();=0D=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[K}=0D=0D
=0D=1B[m=1B[23m=1B[24m=1B[Jheredoc> =1B[KE=08EOF=0D=0D
=1B]0;drow@nevyn: cat <<EOF >src/bar/foo.c\n#include "gen/foo.inc"\nint\nma=
...=07=1B]0;drow@nevyn:~/dir=07=0D=1B[m=1B[23m=1B[24m=1B[Jdrow@nevyn:~/dir%=
=1B[Kc=08cd obj/bar=0D=0D
=1B]0;drow@nevyn: cd obj/bar=07=1B]0;drow@nevyn:~/dir/obj/bar=07=0D=1B[m=1B=
[23m=1B[24m=1B[Jdrow@nevyn:~/dir/obj/bar% =1B[Kg=08gcc-2.95 -gdwarf-2 -dA -=
save-temps -I. ../../src/bar/foo.c=0D=0D
=1B]0;drow@nevyn: gcc-2.95 -gdwarf-2 -dA -save-temps -I. ../../src/bar/foo.=
c=07=1B]0;drow@nevyn:~/dir/obj/bar=07=0D=1B[m=1B[23m=1B[24m=1B[Jdrow@nevyn:=
~/dir/obj/bar% =1B[Kc=08cd ..=0D=0D
=1B]0;drow@nevyn: cd ..=07=1B]0;drow@nevyn:~/dir/obj=07=0D=1B[m=1B[23m=1B[2=
4m=1B[Jdrow@nevyn:~/dir/obj% =1B[Kg=08gdb bar/a.p=08 =08out=0D=0D
=1B]0;drow@nevyn: gdb bar/a.out=07GNU gdb 5.1.1=0D
Copyright 2002 Free Software Foundation, Inc.=0D
GDB is free software, covered by the GNU General Public License, and you ar=
e=0D
welcome to change it and/or distribute copies of it under certain condition=
s.=0D
Type "show copying" to see the conditions.=0D
There is absolutely no warranty for GDB. Type "show warranty" for details.=
=0D
This GDB was configured as "i386-linux"...=0D
(gdb) break foo=0D
Breakpoint 1 at 0x80483f6: file gen/foo.inc, line 4.=0D
(gdb) run=0D
Starting program: /home/drow/dir/obj/bar/a.out =0D
=0D
Breakpoint 1, foo () at gen/foo.inc:4=0D
4 printf ("this is foo\n");=0D
(gdb) quit=0D
The program is running. Exit anyway? (y or n) y=0D
=1B]0;drow@nevyn:~/dir/obj=07=0D=1B[m=1B[23m=1B[24m=1B[Jdrow@nevyn:~/dir/ob=
j% =1B[Kc=08cd bar=0D=0D
=1B]0;drow@nevyn: cd bar=07=1B]0;drow@nevyn:~/dir/obj/bar=07=0D=1B[m=1B[23m=
=1B[24m=1B[Jdrow@nevyn:~/dir/obj/bar% =1B[Kg=08gcc-3.0 -gdwarf-2 -save-temp=
s -dA -I. ../../src/bar/foo.c=0D=0D
=1B]0;drow@nevyn: gcc-3.0 -gdwarf-2 -save-temps -dA -I. ../../src/bar/foo.c=
=07=1B]0;drow@nevyn:~/dir/obj/bar=07=0D=1B[m=1B[23m=1B[24m=1B[Jdrow@nevyn:~=
/dir/obj/bar% =1B[Kc=08cd ..=0D=0D
=1B]0;drow@nevyn: cd ..=07=1B]0;drow@nevyn:~/dir/obj=07=0D=1B[m=1B[23m=1B[2=
4m=1B[Jdrow@nevyn:~/dir/obj% =1B[Kg=08gdb bar/a.out=0D=0D
=1B]0;drow@nevyn: gdb bar/a.out=07GNU gdb 5.1.1=0D
Copyright 2002 Free Software Foundation, Inc.=0D
GDB is free software, covered by the GNU General Public License, and you ar=
e=0D
welcome to change it and/or distribute copies of it under certain condition=
s.=0D
Type "show copying" to see the conditions.=0D
There is absolutely no warranty for GDB. Type "show warranty" for details.=
=0D
This GDB was configured as "i386-linux"...=0D
(gdb) b foo=0D
Breakpoint 1 at 0x8048432: file gen/foo.inc, line 4.=0D
(gdb) r=0D
Starting program: /home/drow/dir/obj/bar/a.out =0D
=0D
Breakpoint 1, foo () at gen/foo.inc:4=0D
4 printf ("this is foo\n");=0D
(gdb) quit=0D
The program is running. Exit anyway? (y or n) y=0D
=1B]0;drow@nevyn:~/dir/obj=07=0D=1B[m=1B[23m=1B[24m=1B[Jdrow@nevyn:~/dir/ob=
j% =1B[K=0D=0D
Script done on Thu Apr 4 01:04:02 2002
--fUYQa+Pmc3FrFX/N--