www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Debugging

reply Mike Swieton <mike swieton.net> writes:
Has anyone here been debugging code with GDB? Is there any trick or anything
to it? I've been trying and I've been seeing some very strange stack traces
(things in impossible orders, etc). Anyone else seen this? Suggestions?

Mike Swieton
__
About the use of language: it is impossible to sharpen a pencil with a blunt
axe. It is equally vain to try to do it with ten blunt axes instead.
	- Edsger Dijkstra
May 31 2004
parent reply hellcatv hotmail.com writes:
well you can set breakpoints at anywhere in the file
you can print local vars using the var name and class or struct vars by
prefixing things with this.

the function names contain the gem that is the actual function name about 1/3
the way down the name of the function-- a keen eye should be able to spot it
amidst all the module-sounding garbage :-)

I haven't figured out how to call functions but I suspect if I mangled them
correctly (i.e. with all the module garbage around them) then it would properly
work...
good luck

In article <pan.2004.06.01.03.59.58.423280 swieton.net>, Mike Swieton says...
Has anyone here been debugging code with GDB? Is there any trick or anything
to it? I've been trying and I've been seeing some very strange stack traces
(things in impossible orders, etc). Anyone else seen this? Suggestions?

Mike Swieton
__
About the use of language: it is impossible to sharpen a pencil with a blunt
axe. It is equally vain to try to do it with ten blunt axes instead.
	- Edsger Dijkstra
May 31 2004
parent Mike Swieton <mike swieton.net> writes:
On Tue, 01 Jun 2004 05:00:17 +0000, hellcatv wrote:

 well you can set breakpoints at anywhere in the file
 you can print local vars using the var name and class or struct vars by
 prefixing things with this.
 
 the function names contain the gem that is the actual function name about 1/3
 the way down the name of the function-- a keen eye should be able to spot it
 amidst all the module-sounding garbage :-)
 
 I haven't figured out how to call functions but I suspect if I mangled them
 correctly (i.e. with all the module garbage around them) then it would properly
 work...
 good luck
Thanks, but I'm afraid that's not quite the problem: I'm seeing stack traces that show function calls that can't be there. Example (probably should have posted this initially, even though it is relatively useless w/o context): Regarding 0-3: All reasonable through here. () Re 4-5: WaitNotifyAllImpl.wait() does not call WaitNotifyImpl.wait(). nitWaitNotifyAllFZv () awaitTerminationFZv () shouldn't see 5-6 in between. ent6fjtask6FJTaskZv () ent6fjtask6FJTaskZv () Re 8-10: Reasonable. Re 11: what's this invariant stuff? Why would Object's invariants (which it doesn't have, btw) run before _Dmain? The name mangling is a pain in the ass, but not a problem really. What gets me is that I don't understand what the program's doing. This is simply not a possible call sequence at all. I'm hoping I'm just using the debugger wrong, and there's something obvious I can fix here. Mike Swieton __ What would you attempt to do if you knew you would not fail? - Dr. Robert Schuller
Jun 01 2004