From 0bfb26aa996a618b3160d7944f561353e46a2638 Mon Sep 17 00:00:00 2001 From: Peter Oberndorfer Date: Tue, 22 May 2007 20:25:03 +0200 Subject: [PATCH] winedbg: Show some info for msvcrt C++ exceptions. --- programs/winedbg/debugger.h | 9 +++++++++ programs/winedbg/tgt_active.c | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h index 3ad2bd34d3e..e09d5f3db34 100644 --- a/programs/winedbg/debugger.h +++ b/programs/winedbg/debugger.h @@ -141,6 +141,15 @@ struct dbg_breakpoint struct expr* condition; }; +/* used for C++ exceptions in msvcrt + * parameters: + * [0] CXX_FRAME_MAGIC + * [1] pointer to exception object + * [2] pointer to type + */ +#define CXX_EXCEPTION 0xe06d7363 +#define CXX_FRAME_MAGIC 0x19930520 + /* Wine extension; Windows doesn't have a name for this code. This is an undocumented exception understood by MS VC debugger, allowing the program to name a particular thread. Search google.com or deja.com for "0x406d1388" diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c index 21e896601b0..16982011b92 100644 --- a/programs/winedbg/tgt_active.c +++ b/programs/winedbg/tgt_active.c @@ -381,6 +381,14 @@ static DWORD dbg_handle_exception(const EXCEPTION_RECORD* rec, BOOL first_chance case EXCEPTION_FLT_STACK_CHECK: dbg_printf("floating point stack check"); break; + case CXX_EXCEPTION: + if(rec->NumberParameters == 3 && rec->ExceptionInformation[0] == CXX_FRAME_MAGIC) + dbg_printf("C++ exception(object = 0x%08lx, type = 0x%08lx)", + rec->ExceptionInformation[1], rec->ExceptionInformation[2]); + else + dbg_printf("C++ exception with strange parameter count %d or magic 0x%08lx", + rec->NumberParameters, rec->ExceptionInformation[0]); + break; default: dbg_printf("0x%08x", rec->ExceptionCode); break;