FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Demangling Patch

 
Post new topic   Reply to topic     Forum Index -> GDB Patches
View previous topic :: View next topic  
Author Message
teqdruid



Joined: 11 May 2004
Posts: 390
Location: UMD

PostPosted: Wed Mar 30, 2005 10:17 pm    Post subject: Demangling Patch Reply with quote

OK.. so instead of patches, I've put in the files that I've had to modify. If you download the source for GDB 6.3, you should just be able to copy the files from the trunk/gdb directory and overwrite the sources files in GDB6.3's gdb source directory with them, you should be able to compile GDB with name demangling support.... which doesn't currently work.

The d_demangle routine seems to work, but the modifications I've made to GDB still aren't making it call it all of the time.

Any suggestions?
Back to top
View user's profile Send private message Send e-mail AIM Address
afb



Joined: 26 Jan 2005
Posts: 137
Location: Sweden

PostPosted: Thu Mar 31, 2005 4:27 am    Post subject: Reply with quote

It gave internal errors here, and then shows a corrupt stack ?

Quote:

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 "i686-pc-linux-gnu"...
dwarf2read.c:5446: internal-error: could not find partial DIE in cache
Back to top
View user's profile Send private message
teqdruid



Joined: 11 May 2004
Posts: 390
Location: UMD

PostPosted: Thu Mar 31, 2005 2:34 pm    Post subject: Reply with quote

Does this happen without the patch?
Back to top
View user's profile Send private message Send e-mail AIM Address
afb



Joined: 26 Jan 2005
Posts: 137
Location: Sweden

PostPosted: Thu Mar 31, 2005 4:22 pm    Post subject: Reply with quote

It does (sorry). Will hunt around, for known GDB bugs.
Back to top
View user's profile Send private message
afb



Joined: 26 Jan 2005
Posts: 137
Location: Sweden

PostPosted: Thu Mar 31, 2005 4:29 pm    Post subject: Reply with quote

The new GDB 6.3 can handle C programs OK.
The system GDB 5.3 can handle D programs,
but without the name demangling of course.

But GDB 6.3 cannot handle D programs.
Neither with patch nor without, and also
it doesn't matter if using DMD or GDC... ?

Confused
Back to top
View user's profile Send private message
afb



Joined: 26 Jan 2005
Posts: 137
Location: Sweden

PostPosted: Thu Mar 31, 2005 4:39 pm    Post subject: Reply with quote

Here's how I compiled it:
Code:

./configure --prefix=/opt/gdc && make


(Fedora Core 1, which I'm just about to update to
Fedora Core 3 instead since I don't require the old
FC1 for work anymore - after backpaddling to RH9)
Back to top
View user's profile Send private message
teqdruid



Joined: 11 May 2004
Posts: 390
Location: UMD

PostPosted: Thu Mar 31, 2005 4:40 pm    Post subject: Reply with quote

I've been using GDB 6.3 to "debug" D programs for awhile. I'm able to run the program, and I can view stack traces upon segfaults. Can't do much more than that since the DWARF2 line numbers that DMD outputs are wrong.

It's definately a bug in GDB- it should be able to run. If you can be specific about the problem, and include a sample to replicate the issue, report it to the GDB dev team.

Can you post the D code that you're trying to run, along with the steps you're taking to compile it, and run gdb?
Back to top
View user's profile Send private message Send e-mail AIM Address
afb



Joined: 26 Jan 2005
Posts: 137
Location: Sweden

PostPosted: Thu Mar 31, 2005 4:42 pm    Post subject: Reply with quote

Program (crash.d)
Code:

void test()
{
  int *p = null;
  *p = 1;
}

void main()
{
  test();
}


Compilation:
Code:

dmd -g crash.d
gdc -o crash -g crash.d
Back to top
View user's profile Send private message
teqdruid



Joined: 11 May 2004
Posts: 390
Location: UMD

PostPosted: Thu Mar 31, 2005 4:48 pm    Post subject: Reply with quote

When I compile that code with DMD then run it in my stock GDB (no patches) I get:
Code:
teqdruid@teqdruid:~/workspace/test$ gdb test2
GNU gdb 6.3-debian
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-linux"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".

(gdb) run
Starting program: /home/teqdruid/workspace/test/test2
[Thread debugging using libthread_db enabled]
[New Thread -1209542976 (LWP 9580)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1209542976 (LWP 9580)]
_D5test24testFZv () at test2.d:4
4         *p = 1;
(gdb) bt
#0  _D5test24testFZv () at test2.d:4
#1  0x0804ab58 in _Dmain () at test2.d:9
#2  0x0804abcb in main ()
(gdb)


Can you post the full gdb log? Just copy everything off the console including the command you use to invoke gdb.
Back to top
View user's profile Send private message Send e-mail AIM Address
afb



Joined: 26 Jan 2005
Posts: 137
Location: Sweden

PostPosted: Thu Mar 31, 2005 4:56 pm    Post subject: Reply with quote

Seems like you have a lot of Debian patches in yours ?

Code:

$ gdb ./crash
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 "i686-pc-linux-gnu"...
dwarf2read.c:5446: internal-error: could not find partial DIE in cache

A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
dwarf2read.c:5446: internal-error: could not find partial DIE in cache

A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
Using host libthread_db library "/lib/tls/libthread_db.so.1".



And then:
Code:

(gdb) run
Starting program: /tmp/crash
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1084366720 (LWP 1283)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1084366720 (LWP 1283)]
0x080565c5 in ?? ()
(gdb) bt
#0  0x080565c5 in ?? ()
#1  0xbff52618 in ?? ()
#2  0x080565d8 in ?? ()
#3  0xbff52648 in ?? ()
#4  0x080493a6 in ?? ()
#5  0x00000001 in ?? ()
#6  0x09bf1140 in ?? ()
#7  0xbff52648 in ?? ()
#8  0x0804934b in ?? ()
#9  0x00000000 in ?? ()
#10 0xbfff1b23 in ?? ()
#11 0x00000000 in ?? ()
#12 0x00ea4238 in __DTOR_END__ () from /lib/tls/libc.so.6
#13 0xbff52704 in ?? ()
#14 0xbff5270c in ?? ()
#15 0xbff52678 in ?? ()
#16 0x08049327 in ?? ()
#17 0x00000001 in ?? ()
#18 0xbff52704 in ?? ()
#19 0xbff52678 in ?? ()
#20 0x080564fa in ?? ()
#21 0x00000000 in ?? ()
#22 0x00ea4238 in __DTOR_END__ () from /lib/tls/libc.so.6
#23 0x00000000 in ?? ()
#24 0x00ea4238 in __DTOR_END__ () from /lib/tls/libc.so.6
#25 0x00ae0020 in __libc_missing_32bit_uids () from /lib/ld-linux.so.2
#26 0x08056528 in ?? ()
#27 0xbff526d8 in ?? ()
#28 0x00d83770 in __libc_start_main () from /lib/tls/libc.so.6
Previous frame inner to this frame (corrupt stack?)
(gdb)


I'll try with the patches from Fedora Core dev tomorrow.
Like you say, it looks like a GDB bug (as in: not the patch)
Back to top
View user's profile Send private message
teqdruid



Joined: 11 May 2004
Posts: 390
Location: UMD

PostPosted: Thu Mar 31, 2005 5:05 pm    Post subject: Reply with quote

Wow.. that's messed up.

You're right, the one I showed you has some debian patches, however I get approximately the same when I use the patched version. The patches were applied against gdb6.3 downloaded off the gdb website.

The only other thing you might want to try is compiling the program (with DMD) without the -g switch. The debugging information that DMD puts in the program is pretty much all bunk right now anyway, so it doesn't help.
Back to top
View user's profile Send private message Send e-mail AIM Address
afb



Joined: 26 Jan 2005
Posts: 137
Location: Sweden

PostPosted: Fri Apr 01, 2005 1:37 am    Post subject: Reply with quote

Nope, it didn't help (got the same results,
this time using the Fedora Core dev SRPM)

Code:

GNU gdb Red Hat Linux (6.3.0.0-1.9rh)
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"...
../../gdb-6.3/gdb/dwarf2read.c:5446: internal-error: could not find partial DIE in cache

A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y


So I still think we need a GDB 5.3 version too ?
(since GDB 6.3 won't work on all Linux distros)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> GDB Patches All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group