Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Debugger plugin: GDB MI interface features and issues
MortenMacFly:
--- Quote from: oBFusCATed on April 21, 2012, 01:55:56 pm ---Yes, I will, I think Pecan showed me a patch somewhere about this, but I've not time to apply it.
[...]
Morten: I'm thinking of adding a src/plugin/debuggers/ directory and to put all debugger plugins there.
--- End quote ---
See - in trunk, the community and other devs can help.
Pecan:
--- Quote from: ollydbg on April 21, 2012, 02:19:58 pm ---
Everything works fine here. :)
--- End quote ---
Would you post a debugger log of GDB/MI starting up so I can compare it with mine to see why GDB/MI insists on loading a bazillion DLL's while loading CB and then craps out on about the 40th?
ollydbg:
--- Quote from: Pecan on April 22, 2012, 03:24:57 pm ---
--- Quote from: ollydbg on April 21, 2012, 02:19:58 pm ---
Everything works fine here. :)
--- End quote ---
Would you post a debugger log of GDB/MI starting up so I can compare it with mine to see why GDB/MI insists on loading a bazillion DLL's while loading CB and then craps out on about the 40th?
--- End quote ---
Here it is.
The log file contains something below:
The debugee C::B start up, and load a project, then meet a BP(in a DLL).
EDIT: It looks like some of the log message of debugee is re-directed and show in the debugger_mi's log. That's interesting, you can see many messages like:
--- Code: ---...
[debug]unparsable_output==>WindowsXPLookNFeel: loaded
[debug]unparsable_output==>Abbreviations plugin activated
[debug]unparsable_output==>Source code formatter (AStyle) plugin activated
[debug]unparsable_output==>Autosave plugin activated
[debug]unparsable_output==>Class wizard plugin activated
[debug]unparsable_output==>Code completion plugin activated
[debug]unparsable_output==>Added compiler "GNU GCC Compiler"
[debug]unparsable_output==>Updating class browser...
[debug]unparsable_output==>Class browser updated.
[debug]unparsable_output==>Added compiler "Microsoft Visual C++ Toolkit 2003"
[debug]unparsable_output==>Added compiler "Microsoft Visual C++ 2005/2008"
[debug]unparsable_output==>Added compiler "Microsoft Visual C++ 2010"
[debug]unparsable_output==>Added compiler "Borland C++ Compiler (5.5, 5.82)"
[debug]unparsable_output==>Added compiler "Digital Mars Compiler"
[debug]unparsable_output==>Added compiler "OpenWatcom (W32) Compiler"
[debug]unparsable_output==>Added compiler "GNU GCC Compiler for MSP430"
...
--- End code ---
ollydbg:
--- Quote from: ollydbg on April 23, 2012, 01:49:27 am ---EDIT: It looks like some of the log message of debugee is re-directed and show in the debugger_mi's log. That's interesting, you can see many messages like:
--- End quote ---
I found a bug, the debugee's start-up arguments does not set/send correctly.
It should use some command:
"-exec-arguments"
before
"-exec-run"
EDIT: This is the patch to add args:
--- Code: ------ plugin.cpp Thu Jan 15 17:14:12 1970
+++ plugin.cpp Thu Jan 15 17:14:12 1970
@@ -570,11 +570,12 @@
return 3;
}
// is gdb accessible, i.e. can we find it?
wxString debugger = GetActiveConfigEx().GetDebuggerExecutable();
- wxString debuggee, working_dir;
+ wxString debuggee, working_dir;
+ wxString args = target->GetExecutionParameters();
if (!GetDebuggee(debuggee, working_dir, target))
{
m_hasStartUpError = true;
return 6;
}
@@ -588,11 +589,11 @@
{
wxSetEnv(CB_LIBRARY_ENVVAR, newLibPath);
DebugLog(CB_LIBRARY_ENVVAR _T("=") + newLibPath);
}
- int res = LaunchDebugger(debugger, debuggee, working_dir, 0, console, start_type);
+ int res = LaunchDebugger(debugger, debuggee, args, working_dir, 0, console, start_type);
if (res != 0)
{
m_hasStartUpError = true;
return res;
}
@@ -604,11 +605,11 @@
if (oldLibPath != newLibPath)
wxSetEnv(CB_LIBRARY_ENVVAR, oldLibPath);
return 0;
}
-int Debugger_GDB_MI::LaunchDebugger(wxString const &debugger, wxString const &debuggee,
+int Debugger_GDB_MI::LaunchDebugger(wxString const &debugger, wxString const &debuggee, wxString const &args,
wxString const &working_dir, int pid, bool console,
StartType start_type)
{
m_current_frame.Reset();
if(debugger.IsEmpty())
@@ -642,11 +643,14 @@
return ret;
m_executor.Stopped(true);
// m_executor.Execute(_T("-enable-timings"));
CommitBreakpoints(true);
- CommitWatches();
+ CommitWatches();
+
+ //Set program arguments -exec-arguments
+ m_actions.Add(new dbg_mi::SimpleAction(wxT("-exec-arguments ") + args));
if(console)
{
wxString console_tty;
m_console_pid = RunNixConsole(console_tty);
@@ -1263,12 +1267,12 @@
long number;
if (!pid.ToLong(&number))
return;
- LaunchDebugger(GetActiveConfigEx().GetDebuggerExecutable(), wxEmptyString, wxEmptyString,
- number, false, StartTypeRun);
+ LaunchDebugger(GetActiveConfigEx().GetDebuggerExecutable(), wxEmptyString, wxEmptyString,
+ wxEmptyString, number, false, StartTypeRun);
m_executor.SetAttachedPID(number);
}
void Debugger_GDB_MI::DetachFromProcess()
{
--- plugin.h Thu Jan 15 17:14:12 1970
+++ plugin.h Thu Jan 15 17:14:12 1970
@@ -159,12 +159,12 @@
void OnTimer(wxTimerEvent& event);
void OnIdle(wxIdleEvent& event);
void OnMenuInfoCommandStream(wxCommandEvent& event);
- int LaunchDebugger(wxString const &debugger, wxString const &debuggee, wxString const &working_dir,
- int pid, bool console, StartType start_type);
+ int LaunchDebugger(wxString const &debugger, wxString const &debuggee, wxString const &args,
+ wxString const &working_dir, int pid, bool console, StartType start_type);
private:
void AddStringCommand(wxString const &command);
void DoSendCommand(const wxString& cmd);
void RunQueue();
--- End code ---
PS: I even make a noise in the GDB maillist. :)
http://sourceware.org/ml/gdb/2012-04/msg00180.html
Pecan:
--- Quote from: ollydbg on April 23, 2012, 01:49:27 am ---
Would you post a debugger log of GDB/MI starting up so I can compare it with mine to see why GDB/MI insists on loading a bazillion DLL's while loading CB and then craps out on about the 40th?
--- End quote ---
--- Quote from: ollydbg ---Here it is.
The log file contains something below:
The debugee C::B start up, and load a project, then meet a BP(in a DLL).
--- End quote ---
How much memory does your system have?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version