winedbg: Allow user to specify length of stack info output.

This commit is contained in:
Andrew Eikum 2010-05-24 17:48:36 -05:00 committed by Alexandre Julliard
parent 084d5f1f6c
commit d3f80c1e9f
6 changed files with 14 additions and 10 deletions

View File

@ -274,7 +274,8 @@ info_command:
| tINFO tALLREGS { be_cpu->print_context(dbg_curr_thread->handle, &dbg_context, 1); } | tINFO tALLREGS { be_cpu->print_context(dbg_curr_thread->handle, &dbg_context, 1); }
| tINFO tSEGMENTS expr_rvalue { info_win32_segments($3 >> 3, 1); } | tINFO tSEGMENTS expr_rvalue { info_win32_segments($3 >> 3, 1); }
| tINFO tSEGMENTS { info_win32_segments(0, -1); } | tINFO tSEGMENTS { info_win32_segments(0, -1); }
| tINFO tSTACK { stack_info(); } | tINFO tSTACK tNUM { stack_info($3); }
| tINFO tSTACK { stack_info(-1); }
| tINFO tSYMBOL tSTRING { symbol_info($3); } | tINFO tSYMBOL tSTRING { symbol_info($3); }
| tINFO tLOCAL { symbol_info_locals(); } | tINFO tLOCAL { symbol_info_locals(); }
| tINFO tDISPLAY { display_info(); } | tINFO tDISPLAY { display_info(); }

View File

@ -384,7 +384,7 @@ extern void source_nuke_path(struct dbg_process* p);
extern void source_free_files(struct dbg_process* p); extern void source_free_files(struct dbg_process* p);
/* stack.c */ /* stack.c */
extern void stack_info(void); extern void stack_info(int len);
extern void stack_backtrace(DWORD threadID); extern void stack_backtrace(DWORD threadID);
extern BOOL stack_set_frame(int newframe); extern BOOL stack_set_frame(int newframe);
extern BOOL stack_get_current_frame(IMAGEHLP_STACK_FRAME* ihsf); extern BOOL stack_get_current_frame(IMAGEHLP_STACK_FRAME* ihsf);

View File

@ -106,7 +106,7 @@ void info_help(void)
" info segments <pid> Displays information about all known segments", " info segments <pid> Displays information about all known segments",
" info share Displays all loaded modules", " info share Displays all loaded modules",
" info share <addr> Displays internal module state", " info share <addr> Displays internal module state",
" info stack Dumps information about top of stack", " info stack [<len>] Dumps information about top of stack, up to len words",
" info symbol <sym> Displays information about a given symbol", " info symbol <sym> Displays information about a given symbol",
" info thread Shows all running threads", " info thread Shows all running threads",
" info wnd <handle> Displays internal window state", " info wnd <handle> Displays internal window state",

View File

@ -33,12 +33,15 @@
/*********************************************************************** /***********************************************************************
* stack_info * stack_info
* *
* Dump the top of the stack * Dump the top of the stack. If len <= 0, a default length is used.
*/ */
void stack_info(void) void stack_info(int len)
{ {
struct dbg_lvalue lvalue; struct dbg_lvalue lvalue;
if(len <= 0)
len = 24;
lvalue.cookie = 0; lvalue.cookie = 0;
lvalue.type.id = dbg_itype_segptr; lvalue.type.id = dbg_itype_segptr;
lvalue.type.module = 0; lvalue.type.module = 0;
@ -51,14 +54,14 @@ void stack_info(void)
switch (lvalue.addr.Mode) switch (lvalue.addr.Mode)
{ {
case AddrModeFlat: /* 32-bit or 64-bit mode */ case AddrModeFlat: /* 32-bit or 64-bit mode */
memory_examine(&lvalue, 24, 'a'); memory_examine(&lvalue, len, 'a');
break; break;
case AddrMode1632: /* 32-bit mode */ case AddrMode1632: /* 32-bit mode */
memory_examine(&lvalue, 24, 'x'); memory_examine(&lvalue, len, 'x');
break; break;
case AddrModeReal: /* 16-bit mode */ case AddrModeReal: /* 16-bit mode */
case AddrMode1616: case AddrMode1616:
memory_examine(&lvalue, 24, 'w'); memory_examine(&lvalue, len, 'w');
break; break;
} }
} }

View File

@ -182,7 +182,7 @@ static unsigned dbg_exception_prolog(BOOL is_debug, BOOL first_chance, const EXC
{ {
/* This is a real crash, dump some info */ /* This is a real crash, dump some info */
be_cpu->print_context(dbg_curr_thread->handle, &dbg_context, 0); be_cpu->print_context(dbg_curr_thread->handle, &dbg_context, 0);
stack_info(); stack_info(-1);
be_cpu->print_segment_info(dbg_curr_thread->handle, &dbg_context); be_cpu->print_segment_info(dbg_curr_thread->handle, &dbg_context);
stack_backtrace(dbg_curr_tid); stack_backtrace(dbg_curr_tid);
} }

View File

@ -389,7 +389,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data)
memory_get_current_pc(&addr); memory_get_current_pc(&addr);
stack_fetch_frames(&dbg_context); stack_fetch_frames(&dbg_context);
be_cpu->print_context(dbg_curr_thread->handle, &dbg_context, 0); be_cpu->print_context(dbg_curr_thread->handle, &dbg_context, 0);
stack_info(); stack_info(-1);
be_cpu->print_segment_info(dbg_curr_thread->handle, &dbg_context); be_cpu->print_segment_info(dbg_curr_thread->handle, &dbg_context);
stack_backtrace(mes->ThreadId); stack_backtrace(mes->ThreadId);
source_list_from_addr(&addr, 0); source_list_from_addr(&addr, 0);