Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Debugger plugin: GDB MI interface features and issues

<< < (7/10) > >>

oBFusCATed:
Default constructor?

Pecan:

--- Quote from: oBFusCATed on June 27, 2012, 11:39:04 pm ---Default constructor?

--- End quote ---

It's your code bro. I'm really asking you.
Is it because namespace dbg_mi has to be initialized first?
Because class "GDBExecutor : public CommandExecutor" is a member of namespace dbg_mi?

oBFusCATed:

--- Quote from: Pecan on June 27, 2012, 11:49:35 pm ---Is it because namespace dbg_mi has to be initialized first?

--- End quote ---
What initialization?
C++ namespaces are used only for separating symbols and to prevent polluting the global namespace.
As far as I know there is no initialization.

And yes there is a default c-tor in the GDBExecutor, which is called implicitly by the c-tor of the plugin.

Pecan:

--- Quote from: oBFusCATed on June 27, 2012, 11:59:21 pm ---
--- Quote from: Pecan on June 27, 2012, 11:49:35 pm ---Is it because namespace dbg_mi has to be initialized first?

--- End quote ---
What initialization?
C++ namespaces are used only for separating symbols and to prevent polluting the global namespace.
As far as I know there is no initialization.

And yes there is a default c-tor in the GDBExecutor, which is called implicitly by the c-tor of the plugin.

--- End quote ---

Of course, thanks.  :-[

ollydbg:
This is a detailed test on how the log message goes with gdb-mi.

Create a simple wxWidgets application, by default, it was a GUI application, so no console window will show when the app runs.
Put the code in the app's init stage

--- Code: ---wxLog::SetActiveTarget(new wxLogStderr());
--- End code ---
Put the code in one event handler of the wxFrame:

--- Code: ---wxLogMessage(wxT("HI from wxLogMessage"));
wxPuts(wxT("HI from wxPuts"));
--- End code ---

Here are the test and result:
Set the project as a "GUI" project, build, run app under Codeblocks
Case one:
Run: no console was created, no "HI" messages.
Case two:
Run under gdb-mi debugger plugin: no console was created, and the "HI from wxLogMessage" will shown in the gdb-mi console, the log looks like:

--- Quote ---[debug]unparsable_output==>&"warning: 16:47:44: HI from wxLogMessage\r\n"
[debug]unparsable_output==>&"\n"

--- End quote ---

Set the project as a "console" project, build, run app under Codeblocks
Case three:
Run: console window was show, and both messages were shown in the console like below:

--- Quote ---16:58:42: HI from wxLogMessage
HI from wxPuts
--- End quote ---
Case four:
Run under gdb-mi plugin: The same as Case three, besides that, the gdb-mi also receive the wxLogMessage like case Two.

Set the project as a "console" project, build, run app under Windows Shell gdb command line.
Case five:
Start the gdb like:

--- Quote ---E:\code\cb\test_code\wxLogMessageVswxPuts\bin\Debug>gdb.exe --interpreter=mi wxLogMessageVswxPuts.exe
--- End quote ---
Then hit "r" command, there will be three message show in the gdb's console

--- Quote ---17:05:10: HI from wxLogMessage
&"warning: 17:05:10: HI from wxLogMessage\r\n"
&"\n"
HI from wxPuts
--- End quote ---

Case six:
Start the gdb like:

--- Quote ---E:\code\cb\test_code\wxLogMessageVswxPuts\bin\Debug>gdb.exe --interpreter=mi wxLogMessageVswxPuts.exe
--- End quote ---
Then enter "-gdb-set new-console on", then "r" command

The result is:

--- Quote ---17:11:32: HI from wxLogMessage
HI from wxPuts
--- End quote ---
the above message will go to the new-console, and the gdb-mi console will still receive an ugly message:

--- Quote ---&"warning: 17:11:32: HI from wxLogMessage\r\n"
&"\n
--- End quote ---


So, as a conclusion:
1, I prefer use wxPuts if I would like to debug under gdb-mi, otherwise, those "warnings" are annoying.
2, I use "-gdb-set new-console on", this is currently the only way to create a new console under gdb-mi.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version