Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Debugger plugin: GDB MI interface features and issues
ollydbg:
--- Quote from: oBFusCATed on May 15, 2012, 10:38:14 am ---Have you tried it?
--- End quote ---
I have tried today, but It looks like there is no new console shown if I use "-gdb-set new-console on".
I have another issue that the gdb-mi plugin does not response when I continually hit the "Next Line" command. (the running-cursor does not jump to the next line after some steps)
The log is below:
--- Code: ---[debug]ActionsMap::Run -> starting action: 02DDAE50 id: 20
[debug]RunAction::OnStart -> -exec-next
[debug]cmd==>200000000000-exec-next
[debug]output==>200000000000^running
[debug]output==>*running,thread-id="all"
[debug]unparsable_output==>(gdb)
[debug]RunAction success, the debugger is !stopped!
[debug]RunAction::Output - type: result
class: running
results:
[debug]Executor started
[debug]notification event recieved!
[debug]output==>*stopped,reason="end-stepping-range",frame={addr="0x0040176c",func="main",args=[],file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="21"},thread-id="1",stopped-threads="all"
[debug]RunAction::destructor
[debug]unparsable_output==>(gdb)
[debug]notification event recieved!
[debug]Executor stopped
[debug]ActionsMap::Run -> starting action: 02D25460 id: 21
[debug]cmd==>210000000000-stack-info-frame
[debug]cmd==>210000000001-stack-list-frames 0 30
[debug]cmd==>210000000002-stack-list-arguments 1 0 30
[debug]ActionsMap::Run -> starting action: 0505E2E0 id: 22
[debug]cmd==>220000000000-thread-info
[debug]ActionsMap::Run -> starting action: 05C98BE0 id: 23
[debug]cmd==>230000000000-var-create - @ "s"
[debug]ActionsMap::Run -> starting action: 05C99DE0 id: 24
[debug]cmd==>240000000000-var-update 1 *
[debug]output==>210000000000^done,frame={level="0",addr="0x0040176c",func="main",file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="21"}
[debug]unparsable_output==>(gdb)
[debug]output==>210000000001^done,stack=[frame={level="0",addr="0x0040176c",func="main",file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="21"}]
[debug]unparsable_output==>(gdb)
[debug]output==>210000000002^done,stack-args=[frame={level="0",args=[]}]
[debug]unparsable_output==>(gdb)
[debug]output==>220000000000^done,threads=[{id="1",target-id="Thread 5516.0x1584",frame={level="0",addr="0x0040176c",func="main",args=[],file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="21"},state="stopped"}],current-thread-id="1"
[debug]unparsable_output==>(gdb)
[debug]output==>230000000000^error,msg="-var-create: unable to create variable object"
[debug]unparsable_output==>(gdb)
[debug]output==>240000000000^done,changelist=[]
[debug]unparsable_output==>(gdb)
[debug]GenerateBacktrace::OnCommandOutput: tuple size 1 stack=[frame={level=0,addr=0x0040176c,func=main,file=E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp,fullname=E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp,line=21}]
[debug]GenerateBacktrace::OnCommandOutput arguments
[debug]WatchCreateAction::OnCommandOutput - processing command 230000000000
[debug]WatchCreateAction::OnCommandOutput - error in command: 230000000000
[debug]updating watches
[debug]WatchUpdateAction::Output - finishing at240000000000
[debug]updating watches
[debug]ActionsMap::Run -> starting action: 02DDADA0 id: 25
[debug]RunAction::OnStart -> -exec-next
[debug]cmd==>250000000000-exec-next
[debug]output==>250000000000^running
[debug]output==>*running,thread-id="all"
[debug]unparsable_output==>(gdb)
[debug]RunAction success, the debugger is !stopped!
[debug]RunAction::Output - type: result
class: running
results:
[debug]Executor started
[debug]notification event recieved!
[debug]output==>*stopped,reason="end-stepping-range",frame={addr="0x00401783",func="main",args=[],file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="22"},thread-id="1",stopped-threads="all"
[debug]RunAction::destructor
[debug]unparsable_output==>(gdb)
[debug]notification event recieved!
[debug]Executor stopped
[debug]ActionsMap::Run -> starting action: 02D25460 id: 26
[debug]cmd==>260000000000-stack-info-frame
[debug]cmd==>260000000001-stack-list-frames 0 30
[debug]cmd==>260000000002-stack-list-arguments 1 0 30
[debug]ActionsMap::Run -> starting action: 0505E2E0 id: 27
[debug]cmd==>270000000000-thread-info
[debug]ActionsMap::Run -> starting action: 05C99DE0 id: 28
[debug]cmd==>280000000000-var-create - @ "s"
[debug]ActionsMap::Run -> starting action: 05C977E0 id: 29
[debug]cmd==>290000000000-var-update 1 *
[debug]output==>260000000000^done,frame={level="0",addr="0x00401783",func="main",file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="22"}
[debug]unparsable_output==>(gdb)
[debug]output==>260000000001^done,stack=[frame={level="0",addr="0x00401783",func="main",file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="22"}]
[debug]unparsable_output==>(gdb)
[debug]output==>260000000002^done,stack-args=[frame={level="0",args=[]}]
[debug]unparsable_output==>(gdb)
[debug]output==>270000000000^done,threads=[{id="1",target-id="Thread 5516.0x1584",frame={level="0",addr="0x00401783",func="main",args=[],file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="22"},state="stopped"}],current-thread-id="1"
[debug]unparsable_output==>(gdb)
[debug]output==>280000000000^error,msg="-var-create: unable to create variable object"
[debug]unparsable_output==>(gdb)
[debug]output==>290000000000^done,changelist=[]
[debug]unparsable_output==>(gdb)
[debug]GenerateBacktrace::OnCommandOutput: tuple size 1 stack=[frame={level=0,addr=0x00401783,func=main,file=E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp,fullname=E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp,line=22}]
[debug]GenerateBacktrace::OnCommandOutput arguments
[debug]WatchCreateAction::OnCommandOutput - processing command 280000000000
[debug]WatchCreateAction::OnCommandOutput - error in command: 280000000000
[debug]updating watches
[debug]WatchUpdateAction::Output - finishing at290000000000
[debug]updating watches
[debug]ActionsMap::Run -> starting action: 02DDAE50 id: 30
[debug]RunAction::OnStart -> -exec-next
[debug]cmd==>300000000000-exec-next
[debug]output==>300000000000^running
[debug]output==>*running,thread-id="all"
[debug]unparsable_output==>(gdb)
[debug]output==>*stopped,reason="end-stepping-range",frame={addr="0x0040178f",func="main",args=[],file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="23"},thread-id="1",stopped-threads="all"
[debug]unparsable_output==>(gdb)
[debug]RunAction success, the debugger is !stopped!
[debug]RunAction::Output - type: result
class: running
results:
[debug]Executor started
[debug]notification event recieved!
[debug]notification event recieved!
[debug]Executor stopped
[debug]RunAction::destructor
[debug]ActionsMap::Run -> starting action: 02D25460 id: 31
[debug]cmd==>310000000000-stack-info-frame
[debug]cmd==>310000000001-stack-list-frames 0 30
[debug]cmd==>310000000002-stack-list-arguments 1 0 30
[debug]ActionsMap::Run -> starting action: 0505E2E0 id: 32
[debug]cmd==>320000000000-thread-info
[debug]ActionsMap::Run -> starting action: 05C977E0 id: 33
[debug]cmd==>330000000000-var-create - @ "s"
[debug]ActionsMap::Run -> starting action: 05C98B60 id: 34
[debug]cmd==>340000000000-var-update 1 *
[debug]output==>310000000000^done,frame={level="0",addr="0x0040178f",func="main",file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="23"}
[debug]unparsable_output==>(gdb)
[debug]output==>310000000001^done,stack=[frame={level="0",addr="0x0040178f",func="main",file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="23"}]
[debug]unparsable_output==>(gdb)
[debug]output==>310000000002^done,stack-args=[frame={level="0",args=[]}]
[debug]unparsable_output==>(gdb)
[debug]output==>320000000000^done,threads=[{id="1",target-id="Thread 5516.0x1584",frame={level="0",addr="0x0040178f",func="main",args=[],file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="23"},state="stopped"}],current-thread-id="1"
[debug]unparsable_output==>(gdb)
[debug]output==>330000000000^error,msg="-var-create: unable to create variable object"
[debug]unparsable_output==>(gdb)
[debug]output==>340000000000^done,changelist=[]
[debug]unparsable_output==>(gdb)
[debug]GenerateBacktrace::OnCommandOutput: tuple size 1 stack=[frame={level=0,addr=0x0040178f,func=main,file=E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp,fullname=E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp,line=23}]
[debug]GenerateBacktrace::OnCommandOutput arguments
[debug]WatchCreateAction::OnCommandOutput - processing command 330000000000
[debug]WatchCreateAction::OnCommandOutput - error in command: 330000000000
[debug]updating watches
[debug]WatchUpdateAction::Output - finishing at340000000000
[debug]updating watches
[debug]ActionsMap::Run -> starting action: 02DDAE50 id: 35
[debug]RunAction::OnStart -> -exec-next
[debug]cmd==>350000000000-exec-next
[debug]output==>350000000000^running
[debug]output==>*running,thread-id="all"
[debug]unparsable_output==>(gdb)
[debug]output==>*stopped,reason="end-stepping-range",frame={addr="0x004017c1",func="main",args=[],file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="24"},thread-id="1",stopped-threads="all"
[debug]unparsable_output==>(gdb)
[debug]RunAction success, the debugger is !stopped!
[debug]RunAction::Output - type: result
class: running
results:
[debug]Executor started
[debug]notification event recieved!
[debug]notification event recieved!
[debug]Executor stopped
[debug]RunAction::destructor
[debug]ActionsMap::Run -> starting action: 02D25460 id: 36
[debug]cmd==>360000000000-stack-info-frame
[debug]cmd==>360000000001-stack-list-frames 0 30
[debug]cmd==>360000000002-stack-list-arguments 1 0 30
[debug]ActionsMap::Run -> starting action: 0505E2E0 id: 37
[debug]cmd==>370000000000-thread-info
[debug]ActionsMap::Run -> starting action: 05C98B60 id: 38
[debug]cmd==>380000000000-var-create - @ "s"
[debug]ActionsMap::Run -> starting action: 05C98A60 id: 39
[debug]cmd==>390000000000-var-update 1 *
[debug]output==>360000000000^done,frame={level="0",addr="0x004017c1",func="main",file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="24"}
[debug]unparsable_output==>(gdb)
[debug]output==>360000000001^done,stack=[frame={level="0",addr="0x004017c1",func="main",file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="24"}]
[debug]unparsable_output==>(gdb)
[debug]output==>360000000002^done,stack-args=[frame={level="0",args=[]}]
[debug]unparsable_output==>(gdb)
[debug]output==>370000000000^done,threads=[{id="1",target-id="Thread 5516.0x1584",frame={level="0",addr="0x004017c1",func="main",args=[],file="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",fullname="E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp",line="24"},state="stopped"}],current-thread-id="1"
[debug]unparsable_output==>(gdb)
[debug]GenerateBacktrace::OnCommandOutput: tuple size 1 stack=[frame={level=0,addr=0x004017c1,func=main,file=E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp,fullname=E:\\code\\cb\\test_code\\gdbpython-demo\\main.cpp,line=24}]
[debug]GenerateBacktrace::OnCommandOutput arguments
[debug]output==>380000000000^error,msg="-var-create: unable to create variable object"
[debug]unparsable_output==>(gdb)
[debug]WatchCreateAction::OnCommandOutput - processing command 380000000000
[debug]WatchCreateAction::OnCommandOutput - error in command: 380000000000
[debug]updating watches
--- End code ---
EDIT: It looks like this is the gdb issue, I can reproduce this in both CLI and MI mode. I'm currently testing a gdb 2012-06-13 build, now, I revert to gdb 2012-06-09 build, and there is not such hang. Sorry for the noise.
ollydbg:
I see a lot of log message like:
--- Code: ---unparsable_output==>(gdb)
or
[debug]unparsable_output==>&"warning: (Internal error: pc 0x112 in read in psymtab, but not in symtab.)\n"
[debug]unparsable_output==>&"\n"
--- End code ---
BTW: when using gdb-mi plugin, I see some messages were show in red color, does this by design?
See the image below:
oBFusCATed:
Yes, this is by design.
ollydbg:
Patch(git) to enable the macro replacement in gdb initial command
--- Code: ---81fe21e1490c3f85e023f310340c2b62e90a3fb2
debbugger_gdbmi/src/config.cpp | 12 ++++++++----
debbugger_gdbmi/src/config.h | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/debbugger_gdbmi/src/config.cpp b/debbugger_gdbmi/src/config.cpp
index 49eeaa8..cf060f8 100644
--- a/debbugger_gdbmi/src/config.cpp
+++ b/debbugger_gdbmi/src/config.cpp
@@ -118,12 +118,16 @@ wxString Configuration::GetDebuggerExecutable(bool expandMacros)
return result;
}
-wxArrayString Configuration::GetInitialCommands()
+wxArrayString Configuration::GetInitialCommands(bool expandMacros)
{
wxArrayString commands;
- wxString const &init = m_config.Read(wxT("init_commands"), wxEmptyString);
- if (!init.empty())
- commands = GetArrayFromString(init, wxT('\n'));
+ wxString init = m_config.Read(wxT("init_commands"), wxEmptyString);
+ if (!init.empty())
+ {
+ if (expandMacros)
+ Manager::Get()->GetMacrosManager()->ReplaceEnvVars(init);
+ commands = GetArrayFromString(init, wxT('\n'));
+ }
return commands;
}
diff --git a/debbugger_gdbmi/src/config.h b/debbugger_gdbmi/src/config.h
index 861fadb..205dc89 100644
--- a/debbugger_gdbmi/src/config.h
+++ b/debbugger_gdbmi/src/config.h
@@ -59,7 +59,7 @@ public:
virtual bool SaveChanges(wxPanel *panel);
public:
wxString GetDebuggerExecutable(bool expandMacros = true);
- wxArrayString GetInitialCommands();
+ wxArrayString GetInitialCommands(bool expandMacros = true);
wxString GetInitialCommandsString();
enum Flags
--- End code ---
Patch(git) to build fix on mingw port:
--- Code: --- debbugger_gdbmi/src/cmd_queue.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/debbugger_gdbmi/src/cmd_queue.h b/debbugger_gdbmi/src/cmd_queue.h
index 083fc6e..c15a800 100644
--- a/debbugger_gdbmi/src/cmd_queue.h
+++ b/debbugger_gdbmi/src/cmd_queue.h
@@ -12,7 +12,8 @@
/*
#include <wx/thread.h>
class PipedProcess;
-*/
+*/
+#include <stdint.h>
namespace dbg_mi
{
--- End code ---
Pecan:
For my education, would someone tell me where m_executor is initialized in this constructor?
--- Code: ---// constructor
Debugger_GDB_MI::Debugger_GDB_MI() :
cbDebuggerPlugin(wxT("GDB/MI"), wxT("gdbmi_debugger")),
m_project(nullptr),
m_execution_logger(this),
m_command_stream_dialog(nullptr),
m_console_pid(-1),
m_pid_attached(0)
{
// Make sure our resources are available.
// In the generated boilerplate code we have no resources but when
// we add some, it will be nice that this code is in place already ;)
if(!Manager::LoadResource(_T("debugger_gdbmi.zip")))
{
NotifyMissingFile(_T("debugger_gdbmi.zip"));
}
m_executor.SetLogger(&m_execution_logger);
}
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version