Eric Pouech : winedbg: Slightly change the option setting syntax ( allows also to get the current state back).
Alexandre Julliard
julliard at winehq.org
Tue Nov 11 08:35:37 CST 2008
Module: wine
Branch: master
Commit: 508414313e2736b991c8a0bde4476cb11d3975e0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=508414313e2736b991c8a0bde4476cb11d3975e0
Author: Eric Pouech <eric.pouech at orange.fr>
Date: Mon Nov 10 15:03:02 2008 +0100
winedbg: Slightly change the option setting syntax (allows also to get the current state back).
---
programs/winedbg/dbg.y | 4 ++--
programs/winedbg/debugger.h | 2 +-
programs/winedbg/winedbg.c | 15 +++++++++++----
3 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y
index c88d3e8..33ca896 100644
--- a/programs/winedbg/dbg.y
+++ b/programs/winedbg/dbg.y
@@ -210,8 +210,8 @@ set_command:
| tSET '-' tIDENTIFIER { info_wine_dbg_channel(FALSE, NULL, $3); }
| tSET tIDENTIFIER '+' tIDENTIFIER { info_wine_dbg_channel(TRUE, $2, $4); }
| tSET tIDENTIFIER '-' tIDENTIFIER { info_wine_dbg_channel(FALSE, $2, $4); }
- | tSET '!' tIDENTIFIER '+' { dbg_set_option($3, TRUE); }
- | tSET '!' tIDENTIFIER '-' { dbg_set_option($3, FALSE); }
+ | tSET '!' tIDENTIFIER tIDENTIFIER { dbg_set_option($3, $4); }
+ | tSET '!' tIDENTIFIER { dbg_set_option($3, NULL); }
;
x_command:
diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h
index 6c7cde3..12ab719 100644
--- a/programs/winedbg/debugger.h
+++ b/programs/winedbg/debugger.h
@@ -456,7 +456,7 @@ extern void dbg_del_thread(struct dbg_thread* t);
extern BOOL dbg_init(HANDLE hProc, const WCHAR* in, BOOL invade);
extern BOOL dbg_load_module(HANDLE hProc, HANDLE hFile, const WCHAR* name, DWORD base, DWORD size);
extern BOOL dbg_get_debuggee_info(HANDLE hProcess, IMAGEHLP_MODULE* imh_mod);
-extern void dbg_set_option(const char*, BOOL);
+extern void dbg_set_option(const char*, const char*);
/* gdbproxy.c */
extern int gdb_main(int argc, char* argv[]);
diff --git a/programs/winedbg/winedbg.c b/programs/winedbg/winedbg.c
index ab66148..3fefd4c 100644
--- a/programs/winedbg/winedbg.c
+++ b/programs/winedbg/winedbg.c
@@ -501,13 +501,20 @@ void dbg_del_thread(struct dbg_thread* t)
HeapFree(GetProcessHeap(), 0, t);
}
-void dbg_set_option(const char* option, BOOL enable)
+void dbg_set_option(const char* option, const char* val)
{
- if (!strcmp(option, "module"))
+ if (!strcasecmp(option, "module_load_mismatched"))
{
DWORD opt = SymGetOptions();
- if (enable) opt |= SYMOPT_LOAD_ANYTHING;
- else opt &= ~SYMOPT_LOAD_ANYTHING;
+ if (!val)
+ dbg_printf("Option: module_load_mismatched %s\n", opt & SYMOPT_LOAD_ANYTHING ? "true" : "false");
+ else if (!strcasecmp(val, "true")) opt |= SYMOPT_LOAD_ANYTHING;
+ else if (!strcasecmp(val, "false")) opt &= ~SYMOPT_LOAD_ANYTHING;
+ else
+ {
+ dbg_printf("Syntax: module_load_mismatched [true|false]\n");
+ return;
+ }
SymSetOptions(opt);
}
else dbg_printf("Unknown option '%s'\n", option);
More information about the wine-cvs
mailing list