Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Debugger plugin: GDB MI interface features and issues
ollydbg:
OK, the issue(stated in the previous post) of wxLogMessage was solved.
To avoid the wxLogMessage pullets the GDB-MI logs, you should create
--- Code: ---wxLog::SetActiveTarget(new wxLogStderr(stdout));
--- End code ---
Note, use "stdout", if you leave the parameter empty, it will be "stderr" by default, thus cause the GDB-MI report the annoying message.
See: wxLogStderr
Another patch to fix the build error: (as the compiler interface has changed in rev 8457: * compiler: Major refactor - remove the generator object from the compiler;)
--- Code: --- debbugger_gdbmi/src/plugin.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/debbugger_gdbmi/src/plugin.cpp b/debbugger_gdbmi/src/plugin.cpp
index 4573f2a..1458070 100644
--- a/debbugger_gdbmi/src/plugin.cpp
+++ b/debbugger_gdbmi/src/plugin.cpp
@@ -9,6 +9,7 @@
#include <cbdebugger_interfaces.h>
#include <cbproject.h>
#include <compilerfactory.h>
+#include <compilercommandgenerator.h>
#include <configurationpanel.h>
#include <configmanager.h>
//#include <editbreakpointdlg.h>
@@ -17,6 +18,7 @@
#include <pipedprocess.h>
#include <projectmanager.h>
+
#include "actions.h"
#include "cmd_result_parser.h"
#include "config.h"
@@ -53,7 +55,9 @@ wxString GetLibraryPath(const wxString &oldLibPath, Compiler *compiler, ProjectB
wxString newLibPath;
const wxString libPathSep = platform::windows ? _T(";") : _T(":");
newLibPath << _T(".") << libPathSep;
- newLibPath << GetStringFromArray(compiler->GetLinkerSearchDirs(target), libPathSep);
+ CompilerCommandGenerator *generator = compiler->GetCommandGenerator(target->GetParentProject());
+ newLibPath << GetStringFromArray(generator->GetLinkerSearchDirs(target), libPathSep);
+ delete generator;
if (newLibPath.Mid(newLibPath.Length() - 1, 1) != libPathSep)
newLibPath << libPathSep;
newLibPath << oldLibPath;
--- End code ---
:)
oBFusCATed:
Current state:
1. Many of the features are in state "not implemented", build and inspect the warnings to see them.
2. Watches handling is unstable, I've started to do a test case runner tool but I have not time.
This is high priority and nothing will be done on the plugin until I have this tool.
3. I'm sure there are tons of bugs, because I'm not using it in production, because of 2
p.s. please edit your first post with the link to github, in case someone is interested in testing it.
ollydbg:
--- Quote from: oBFusCATed on May 09, 2013, 08:10:07 am ---Current state:
1. Many of the features are in state "not implemented", build and inspect the warnings to see them.
2. Watches handling is unstable, I've started to do a test case runner tool but I have not time.
This is high priority and nothing will be done on the plugin until I have this tool.
3. I'm sure there are tons of bugs, because I'm not using it in production, because of 2
--- End quote ---
Oh, yes I see there are a log of
--- Code: ---#warning "not implemented"
--- End code ---
in the source code those function should be done.
--- Quote ---p.s. please edit your first post with the link to github, in case someone is interested in testing it.
--- End quote ---
Done.
ollydbg:
This is the patch to fix building and running issue under MinGW
--- Code: --- debbugger_gdbmi.cbp | 11 ++++++-----
src/cmd_queue.h | 22 ++++++++++++----------
2 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/debbugger_gdbmi.cbp b/debbugger_gdbmi.cbp
index 0514778..a37c1ac 100644
--- a/debbugger_gdbmi.cbp
+++ b/debbugger_gdbmi.cbp
@@ -35,8 +35,8 @@
<Option output="debugger_gdbmi" prefix_auto="0" extension_auto="1" />
<Option type="3" />
<Option compiler="gcc" />
- <Option parameters='/ns /nd /na --multiple-instance /nc /d /p "debug"' />
- <Option host_application="C:\dev\cb_dev\debugger1\src\devel\codeblocks.exe" />
+ <Option parameters="--debug-log --no-dde --no-check-associations --multiple-instance --no-splash-screen --verbose --profile=debug" />
+ <Option host_application="$(#cb_sdk)/devel/codeblocks.exe" />
<Option run_host_application_in_terminal="0" />
<Compiler>
<Add option="-Wall" />
@@ -47,15 +47,16 @@
<Add option="-DwxUSE_UNICODE" />
<Add option="-DBUILDING_PLUGIN" />
<Add directory="$(#WX.include)" />
- <Add directory="$(#wx)\contrib\include" />
- <Add directory="$(#WX.lib)\gcc_dll$(WX_CFG)\msw$(WX_SUFFIX)" />
+ <Add directory="$(#wx)/contrib/include" />
+ <Add directory="$(#WX.lib)/gcc_dll$(WX_CFG)/msw$(WX_SUFFIX)" />
</Compiler>
<Linker>
<Add option="-Wl,--enable-auto-image-base" />
<Add option="-Wl,--add-stdcall-alias" />
<Add option="-Wl,--enable-auto-import" />
<Add library="wxmsw28U" />
- <Add directory="$(#WX.lib)\gcc_dll$(WX_CFG)" />
+ <Add directory="$(#WX.lib)/gcc_dll$(WX_CFG)" />
+ <Add directory="$(#cb_sdk)/devel" />
</Linker>
<ExtraCommands>
<Add after="pack.bat $(#cb_sdk)" />
diff --git a/src/cmd_queue.h b/src/cmd_queue.h
index 083fc6e..8579069 100644
--- a/src/cmd_queue.h
+++ b/src/cmd_queue.h
@@ -14,6 +14,8 @@
class PipedProcess;
*/
+#include <stdint.h> //int32_t under MinGW
+
namespace dbg_mi
{
@@ -289,19 +291,19 @@ public:
wxString line;
Type type;
- };
-
- struct Log
- {
- enum Type
- {
- Normal = 0,
- Error
- };
+ };
+
+ struct Log
+ {
+ enum Type
+ {
+ Normal = 0,
+ Error
+ };
};
public:
virtual ~Logger() {}
-
+
virtual void Log(wxString const &line, Log::Type type = Log::Normal) = 0;
virtual void Debug(wxString const &line, Line::Type type = Line::Debug) = 0;
virtual Line const* GetDebugLine(int index) const = 0;
--- End code ---
BTW: there are a lot of CRLF and LF eol mixing in the git source code.
ollydbg:
@obf: what about the patch in my previous post?
Another question:
--- Code: --- virtual void OnCommandOutput(CommandID const &/*id*/, ResultParser const &result)
{
if(result.GetResultClass() == ResultParser::ClassRunning)
{
m_logger.Debug(wxT("RunAction success, the debugger is !stopped!"));
m_logger.Debug(wxT("RunAction::Output - ") + result.MakeDebugString());
m_notification(false);
}
Finish();
}
--- End code ---
"the debugger is !stopped!" means "the debugger is not stopped!" right?
Another build issue fix is that you should add a virtual function like:
--- Code: ---virtual void UpdateWatch(cb::shared_ptr<cbWatch> watch);
...
void Debugger_GDB_MI::UpdateWatch(cb::shared_ptr<cbWatch> watch)
{
}
--- End code ---
I have some issue about creating the patch, because there are some LF and CRLF in plugin.cpp. :(
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version