This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

symtab/1967: can't examine data of c++ code compiled w/ -gstabs+ on x86_64-linux


>Number:         1967
>Category:       symtab
>Synopsis:       can't examine data of c++ code compiled w/ -gstabs+ on x86_64-linux
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 08 21:08:00 UTC 2005
>Closed-Date:
>Last-Modified:
>Originator:     jonathan@cdnorthamerica.com
>Release:        6.3
>Organization:
>Environment:
GNU C++ version 3.4.3 (x86_64-redhat-linux)
GNU assembler version 2.15 (x86_64-unknown-linux-gnu) using BFD version 2.15
GNU gdb 6.3
>Description:
can't examine data of c++ code compiled with GNU g++ 3.4.3 using -gstabs+ option to generate debug info on x86_64-linux architecture; using -g appears to work o.k. :

jmw@ike:26>g++ -v
Reading specs from /usr/local/gcc-3.4/lib/gcc/x86_64-redhat-linux/3.4.3/specs
Configured with: ../gcc-3.4.3/configure --prefix=/usr/local/gcc-3.4 --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=x86_64-redhat-linux --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.4.3
 
jmw@ike:27>gdb -v
GNU gdb 6.3
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 "x86_64-redhat-linux-gnu".
 
jmw@ike:28>cat test.cpp
// ---- start test.cpp ---- //
  
class Foo
{
public:
  Foo() : i(5) {}
  void f() {}
private:
  int i;
};
  
int
main()
{
  Foo foo;
  foo.f();
}
  
// ---- end test.cpp ---- //
 
jmw@ike:29>g++ -gstabs+ test.cpp
 
jmw@ike:30>gdb a.out
GNU gdb 6.3
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 "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/tls/libthread_db.so.1".
  
(gdb) break Foo::f()
Breakpoint 1 at 0x400532: file test.cpp, line 7.
(gdb) run
Starting program: /home/jmw/src/gdb_gstabs_bug/a.out
  
Breakpoint 1, Foo::f (this=Cannot access memory at address 0x80bfffd188
) at test.cpp:7
7         void f() {}
(gdb) p *this
Cannot access memory at address 0x80bfffd188
(gdb) c
Continuing.
  
Program exited normally.
(gdb) quit
 
jmw@ike:31>g++ -g test.cpp
 
jmw@ike:32>gdb a.out
GNU gdb 6.3
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 "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/tls/libthread_db.so.1".
  
(gdb) break Foo::f()
Breakpoint 1 at 0x400532: file test.cpp, line 7.
(gdb) run
Starting program: /home/jmw/src/gdb_gstabs_bug/a.out
  
Breakpoint 1, Foo::f (this=0x7fbfffa7e0) at test.cpp:7
7         void f() {}
(gdb) p *this
$1 = {i = 5}
(gdb) c
Continuing.
  
Program exited normally.
(gdb) quit
 
>How-To-Repeat:
(see Description)
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++; name="test.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cpp"

Ly8gLS0tLSBzdGFydCB0ZXN0LmNwcCAtLS0tIC8vCgpjbGFzcyBGb28KewpwdWJsaWM6CiAgRm9v
KCkgOiBpKDUpIHt9CiAgdm9pZCBmKCkge30KcHJpdmF0ZToKICBpbnQgaTsKfTsKCmludAptYWlu
KCkKewogIEZvbyBmb287CiAgZm9vLmYoKTsKfQoKLy8gLS0tLSBlbmQgdGVzdC5jcHAgLS0tLSAv
Lwo=


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]