www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Making sense of Access Violation

reply Tydr Schnubbis <fake address.dude> writes:
I'm making a multithreaded gui app which gives me an Access Violation 
exception.  I'm not sure how to figure out where it originates from.  If 
I use the msvc 6 debugger, I get a crash address.  But msvc doesn't show 
me where in the code that address is, so I'm still stuck.

Is there a tool like gnu's addr2line that will give me a file and line 
number?  I couldn't make addr2line work with the exe that dmd creates.
Apr 21 2006
parent reply Tydr Schnubbis <fake address.dude> writes:
Tydr Schnubbis wrote:
 I'm making a multithreaded gui app which gives me an Access Violation 
 exception.  I'm not sure how to figure out where it originates from.  If 
 I use the msvc 6 debugger, I get a crash address.  But msvc doesn't show 
 me where in the code that address is, so I'm still stuck.
 
 Is there a tool like gnu's addr2line that will give me a file and line 
 number?  I couldn't make addr2line work with the exe that dmd creates.

Ok, I'm now trying to use WinDbg. I read somewhere to set a breakpoint on _main, but how? First I use the "Open Executable..." command, and that works. I've also set it to download symbols automatically. So far, so good. Then, if type "bp _main" it says "Bp expression '_main' could not be resolved, adding deferred bp", for "bm _main" it says "No matching code symbols found, no breakpoints set." What am I doing wrong?
Apr 21 2006
parent reply Tydr Schnubbis <fake address.dude> writes:
Tydr Schnubbis wrote:
 Tydr Schnubbis wrote:
 I'm making a multithreaded gui app which gives me an Access Violation 
 exception.  I'm not sure how to figure out where it originates from.  If 
 I use the msvc 6 debugger, I get a crash address.  But msvc doesn't show 
 me where in the code that address is, so I'm still stuck.
 
 Is there a tool like gnu's addr2line that will give me a file and line 
 number?  I couldn't make addr2line work with the exe that dmd creates.

Ok, I'm now trying to use WinDbg. I read somewhere to set a breakpoint on _main, but how? First I use the "Open Executable..." command, and that works. I've also set it to download symbols automatically. So far, so good. Then, if type "bp _main" it says "Bp expression '_main' could not be resolved, adding deferred bp", for "bm _main" it says "No matching code symbols found, no breakpoints set." What am I doing wrong?

code file a couple of times when fooling around with it, but I can't remember how I did it. Does anyone know?
Apr 21 2006
parent Tydr Schnubbis <fake address.dude> writes:
Tydr Schnubbis wrote:
 Tydr Schnubbis wrote:
 Tydr Schnubbis wrote:
 I'm making a multithreaded gui app which gives me an Access Violation 
 exception.  I'm not sure how to figure out where it originates from.  If 
 I use the msvc 6 debugger, I get a crash address.  But msvc doesn't show 
 me where in the code that address is, so I'm still stuck.
 
 Is there a tool like gnu's addr2line that will give me a file and line 
 number?  I couldn't make addr2line work with the exe that dmd creates.

Ok, I'm now trying to use WinDbg. I read somewhere to set a breakpoint on _main, but how? First I use the "Open Executable..." command, and that works. I've also set it to download symbols automatically. So far, so good. Then, if type "bp _main" it says "Bp expression '_main' could not be resolved, adding deferred bp", for "bm _main" it says "No matching code symbols found, no breakpoints set." What am I doing wrong?

code file a couple of times when fooling around with it, but I can't remember how I did it. Does anyone know?

Nevermind, I can just open them manually. Seems that to set breakpoints, I have to use the mangled symbols, but at least it works. :)
Apr 21 2006