Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to break Windbg when 'Access violation occured'

2,464 views
Skip to first unread message

suds1980

unread,
Feb 27, 2008, 5:22:12 AM2/27/08
to
Hi All:
I 'm debugging a third party dll and find that it'll will quit
abnormally.
after debug it I found that there is some exception was threw out from
a try block and then the dll call abort() to exit program .
I guess that because some code 'access violation' ,but I don't know
how to break the debugger if 'access violation' occurred .
Please anybody tell me how set a breakpoint if 'access violation'
occurred .

Thank you very much!

roge...@gmail.com

unread,
Feb 28, 2008, 9:11:23 AM2/28/08
to

Menu: Debug->Event Filters
Select Access violation and click Enabled

-- or --
Command line: sx e av

(This is usually on by default.)

Roger.

Kjell Gunnar

unread,
Feb 28, 2008, 9:18:16 AM2/28/08
to
You can controll how windbg handles excaption by Debug | Event Filters

See "Controlling Exceptions and Events" in the windbg help
Hovever the command:
sxe av
will cause windbg to stop when 'access violation'.

Note that if there is any other exception that cause the exit, windbg
will print out exception or code.
If it is a numeric code, you can use Debug | Event Filters and "add
button" to mak an edntry for this code.

0:001> sxe av
0:001> g
(1208.14a0): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=00000000 ebx=00000111 ecx=0012fe08 edx=00000000 esi=004064ec
edi=00000001
eip=00401fe7 esp=0012f7f8 ebp=0012f800 iopl=0 nv up ei pl nz
ac po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000
efl=00010212
CrashTest!CCrashTestDlg::OnButtonCrash+0x13:
00401fe7 c70005000000 mov dword ptr [eax],5 ds:
0023:00000000=????????

Regards
Kjell Gunnar

0 new messages