From 8ecfe8b2183338613e7fdbc01e9e3e6b0996ce6d Mon Sep 17 00:00:00 2001 From: "elias.bachaalany" Date: Fri, 4 Jun 2010 15:01:51 +0000 Subject: [PATCH] dbghooks / dbg_request_error was broken --- examples/debughook.py | 5 +++++ swig/dbg.i | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/examples/debughook.py b/examples/debughook.py index 7765a0b..8ee74e8 100644 --- a/examples/debughook.py +++ b/examples/debughook.py @@ -24,6 +24,11 @@ class MyDbgHook(DBG_Hooks): def dbg_bpt(self, tid, ea): print "Break point at 0x%x pid=%d" % (ea, tid) + # return values: + # -1 - to display a breakpoint warning dialog + # if the process is suspended. + # 0 - to never display a breakpoint warning dialog. + # 1 - to always display a breakpoint warning dialog. return 0 def dbg_trace(self, tid, ea): diff --git a/swig/dbg.i b/swig/dbg.i index 3824f73..72fb517 100644 --- a/swig/dbg.i +++ b/swig/dbg.i @@ -100,8 +100,8 @@ public: virtual void dbg_suspend_process(void) { }; virtual int dbg_bpt(thid_t tid, ea_t breakpoint_ea) { return 0; }; virtual int dbg_trace(thid_t tid, ea_t ip) { return 0; }; - virtual void dbg_request_error(ui_notification_t failed_command, - dbg_notification_t failed_dbg_notification) { }; + virtual void dbg_request_error(int failed_command, + int failed_dbg_notification) { }; virtual void dbg_step_into(void) { }; virtual void dbg_step_over(void) { }; virtual void dbg_run_to(thid_t tid) { }; @@ -116,8 +116,6 @@ int idaapi DBG_Callback(void *ud, int notification_code, va_list va) thid_t tid; int *warn; ea_t ip; - ui_notification_t failed_command; - dbg_notification_t failed_dbg_notification; ea_t breakpoint_ea; try { @@ -227,11 +225,12 @@ int idaapi DBG_Callback(void *ud, int notification_code, va_list va) return proxy->dbg_bpt(tid, ip); case dbg_request_error: - failed_command = (ui_notification_t)va_arg(va, int); - failed_dbg_notification = (dbg_notification_t)va_arg(va, int); + { + int failed_command = (int)va_arg(va, ui_notification_t); + int failed_dbg_notification = (int)va_arg(va, dbg_notification_t); proxy->dbg_request_error(failed_command, failed_dbg_notification); return 0; - + } case dbg_step_into: proxy->dbg_step_into(); return 0;