Morten how could I (in the GDB/mi plugin) derive from classes in GDB plugin? Or I have understood you incorrectly?
I don't think CDB is a concern because the current implementation works for both (only the drivers are different).
The hardest thing to abstract in the debugger part of CB is the watch window, the others would be straight forward.
For example the call stack window usage could look like this:
void MyDBG::OnUpdateCallStack()
{
cbCallStackWindow *window = Manager::Get()->GetDebuggerUI(CB_DBG_UI_CALL_STACK);
if(!window || !window->IsVisible())
return;
window->StartUpdating();
foreach(frame in m_call_stack_frames)
{
window->AddFrame(cbCallStackFrame(frame.path, frame.addr, frame.symbol));
}
window->FinishUpdating();
}
Morten how could I (in the GDB/mi plugin) derive from classes in GDB plugin?
Erm... just like
class Gdb
{
public:
void GdbFunction(){ // gdb code }
};
class NewGdb : public Gdb
{
public:
void GdbFunction(){ // new_gdb code }
void NewGdbFunction(){}
};
void new_gdb_plugin()
{
NewGdb new_gdb;
}
etc... But probably I have misunderstood?
My first question is:
It seems there are files to be added to "sdk"(mainly header files), such as:
@@ -508,6 +522,9 @@
<Unit filename="include/editarraystringdlg.h">
<Option target="sdk" />
</Unit>
+ <Unit filename="include/editbreakpointdlg.h">
+ <Option target="sdk" />
+ </Unit>
<Unit filename="include/editkeywordsdlg.h">
<Option target="sdk" />
</Unit>
and some files were added to "debugger"( mainly cpp files)
@@ -1467,12 +1484,6 @@
<Unit filename="plugins/debuggergdb/backtracedlg.h">
<Option target="Debugger" />
</Unit>
- <Unit filename="plugins/debuggergdb/breakpointsdlg.cpp">
- <Option target="Debugger" />
- </Unit>
- <Unit filename="plugins/debuggergdb/breakpointsdlg.h">
- <Option target="Debugger" />
- </Unit>
<Unit filename="plugins/debuggergdb/cdb_commands.h">
<Option target="Debugger" />
</Unit>
So, my question is: Why not let them all stay in target "Debugger"?
Maybe, it is this function:
bool PluginManager::DetachPlugin(cbPlugin* plugin)
{
if (!plugin)
return false;
if (!plugin->IsAttached())
return true;
Manager::Get()->RemoveAllEventSinksFor(plugin);
plugin->Release(Manager::IsAppShuttingDown());
return true;
}
Then plugin->Release will do the whole job.
Thanks Jens, that was it.
Do someone knows why the code for recreating the menu is something like this:
SetMenuBar(0L);
mbar = new wxMenuBar;
FillTheMenuBar(mbar);
SetMenuBar(mbar);
I'm asking because I'm using Manager::Get()->GetAppWindow()->GetMenuBar() to create the debug menu, not the wxMenuBar supplied to the BuildMenu method.
And I get a crash because the menubar is NULL while menu recreation.
Edit:
Another issue I have is that I can't create the debugger toolbar from the sdk.
At the moment every plugin should implement the BuildToolbar method, which fill pre-supplied toolbar with some content. This means that every plugin has one toolbar that is unique.
I want to have only one debugger toolbar, that is shared by all debugger plugins.
What I've tried so far:
void DebuggerToolbarHandler::LoadToolbar()
{
if(m_toolbar)
return;
m_toolbar = Manager::Get()->CreateEmptyToolbar();
wxString my_16x16 = Manager::isToolBar16x16(m_toolbar) ? _T("_16x16") : _T("");
Manager::AddonToolBar(m_toolbar, wxString(_T("debugger_toolbar")) + my_16x16);
// m_toolbar->Realize();
m_toolbar->SetInitialSize();
// m_toolbar->Show();
wxAuiManager* layout = Manager::Get()->GetAppMainFrame()->GetLayoutManager();
layout->AddPane(m_toolbar, wxAuiPaneInfo().
Name(_T("Debugger Toolbar")).Caption(_("Debugger Toolbar")).
ToolbarPane().Top().Row(1));
Manager::Get()->GetAppMainFrame()->DoUpdateLayout();
}
/// Manager::Get()->GetAppMainFrame() returns:
class IMainFrame
{
public:
virtual wxAuiManager* GetLayoutManager() = 0;
virtual void DoUpdateLayout() = 0;
};
// that is implemented by the MainFrame class in main.cpp
The toolbar is created but it is not shown. I know that because I was calling layout->Update instead of DoUpdateLayout and some strange window have been shown while CB was starting, then disappears.
Hmmmm...:
mingw32-g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -Iinclude -Iinclude\scripting\include -Iinclude\scripting\sqplus -IC:\Devel\wxWidgets\include -IC:\Devel\wxWidgets\lib\gcc_dll\mswu -Iinclude\wxscintilla\include -Iinclude\tinyxml -IC:\Devel\GCC4TDM\include -c C:\Devel\CodeBlocks\src\plugins\debuggergdb\debugger_defs.cpp -o .objs\plugins\debuggergdb\debugger_defs.o
In file included from C:\Devel\CodeBlocks\src\plugins\debuggergdb\cdb_driver.cpp:12:
C:\Devel\CodeBlocks\src\plugins\debuggergdb\cdb_commands.h: In member function 'virtual void CdbCmd_Backtrace::ParseOutput(const wxString&)':
C:\Devel\CodeBlocks\src\plugins\debuggergdb\cdb_commands.h:432: error: invalid use of incomplete type 'struct cbBacktraceDlg'
C:\Devel\CodeBlocks\src\include\debuggermanager.h:17: error: forward declaration of 'struct cbBacktraceDlg'
C:\Devel\CodeBlocks\src\plugins\debuggergdb\cdb_commands.h: In member function 'virtual void CdbCmd_InfoRegisters::ParseOutput(const wxString&)':
C:\Devel\CodeBlocks\src\plugins\debuggergdb\cdb_commands.h:470: error: invalid use of incomplete type 'struct cbCPURegistersDlg'
C:\Devel\CodeBlocks\src\include\debuggermanager.h:19: error: forward declaration of 'struct cbCPURegistersDlg'
C:\Devel\CodeBlocks\src\plugins\debuggergdb\cdb_commands.h: In member function 'virtual void CdbCmd_Disassembly::ParseOutput(const wxString&)':
C:\Devel\CodeBlocks\src\plugins\debuggergdb\cdb_commands.h:504: error: invalid use of incomplete type 'struct cbDisassemblyDlg'
C:\Devel\CodeBlocks\src\include\debuggermanager.h:21: error: forward declaration of 'struct cbDisassemblyDlg'
C:\Devel\CodeBlocks\src\plugins\debuggergdb\cdb_commands.h: In member function 'virtual void CdbCmd_DisassemblyInit::ParseOutput(const wxString&)':
C:\Devel\CodeBlocks\src\plugins\debuggergdb\cdb_commands.h:554: error: invalid use of incomplete type 'struct cbDisassemblyDlg'
C:\Devel\CodeBlocks\src\include\debuggermanager.h:21: error: forward declaration of 'struct cbDisassemblyDlg'
C:\Devel\CodeBlocks\src\plugins\debuggergdb\cdb_commands.h:567: error: invalid use of incomplete type 'struct cbDisassemblyDlg'
C:\Devel\CodeBlocks\src\include\debuggermanager.h:21: error: forward declaration of 'struct cbDisassemblyDlg'
Process terminated with status 1 (0 minutes, 25 seconds)
10 errors, 1 warnings
Not sure why that is... the includes and everything looks just fine to me...?!
It was not that one but enabling the debugger's debug log (in the debuggers options).
Crashed it too, will debug in a minute
Update: THE PATCH:
diff U3 include/logmanager.h include/logmanager.h
--- include/logmanager.h Thu Jan 15 11:14:12 1970
+++ include/logmanager.h Thu Jan 15 11:14:12 1970
@@ -100,7 +100,7 @@
* Plugins should call Panic() with the plugin's name as the component argument.
*/
- void Log(const wxString& msg, int i = app_log, Logger::level lv = Logger::info) { slot[i].log->Append(msg, lv); };
+ void Log(const wxString& msg, int i = app_log, Logger::level lv = Logger::info) { cbAssert(i >= 0 && i <= max_logs); slot[i].log->Append(msg, lv); };
void LogWarning(const wxString& msg, int i = app_log) { Log(msg, i, Logger::warning); };
void LogError(const wxString& msg, int i = app_log) { Log(msg, i, Logger::error); };
diff U3 plugins/debuggergdb/debuggergdb.cpp plugins/debuggergdb/debuggergdb.cpp
--- plugins/debuggergdb/debuggergdb.cpp Thu Jan 15 11:14:12 1970
+++ plugins/debuggergdb/debuggergdb.cpp Thu Jan 15 11:14:12 1970
@@ -340,11 +340,11 @@
if (!log_visible && m_HasDebugLog)
{
Manager::Get()->GetDebuggerManager()->HideLogger(true);
+ m_DbgPageIndex = -1;
}
else if (log_visible && !m_HasDebugLog)
{
- int index;
- Manager::Get()->GetDebuggerManager()->GetLogger(true, index);
+ Manager::Get()->GetDebuggerManager()->GetLogger(true, m_DbgPageIndex);
}
m_HasDebugLog = log_visible;
}
With the patch above, I get this error on linux:
/home/obfuscated/projects/codeblocks/git/src/include/logmanager.h:103: warning: comparison between signed and unsigned integer expressions
/home/obfuscated/projects/codeblocks/git/src/include/logmanager.h:103: error: ‘cbAssert’ was not declared in this scope
Which is the best way I can fix it?
Update: the error is in my plugin which is outside of the CB tree
Patch 1 - RunToCursor goes to the correct line
index e6a1e9a..475ae23 100644
--- a/src/sdk/debuggermenu.cpp
+++ b/src/sdk/debuggermenu.cpp
@@ -233,7 +233,7 @@ void DebuggerMenuHandler::OnRunToCursor(wxCommandEvent& event)
if (!ed)
return;
const wxString &line_text = ed->GetControl()->GetLine(ed->GetControl()->GetCurrentLine());
- m_activeDebugger->RunToCursor(ed->GetFilename(), ed->GetControl()->GetCurrentLine(), line_text);
+ m_activeDebugger->RunToCursor(ed->GetFilename(), ed->GetControl()->GetCurrentLine() + 1, line_text);
}
void DebuggerMenuHandler::OnToggleBreakpoint(wxCommandEvent& event)
Patch 2 - make writing debugger plugins easier
diff --git a/src/include/cbplugin.h b/src/include/cbplugin.h
index 6f234ea..7237c07 100644
--- a/src/include/cbplugin.h
+++ b/src/include/cbplugin.h
@@ -498,6 +498,7 @@ class PLUGIN_EXPORT cbDebuggerPlugin: public cbPlugin
virtual wxString GetEditorWordAtCaret();
protected:
void RemoveBreakpointFromEditor(const wxString& filename, int line);
+ void ClearActiveMarkFromAllEditors();
private:
wxToolBar *m_toolbar;
};
diff --git a/src/plugins/debuggergdb/debuggergdb.cpp b/src/plugins/debuggergdb/debuggergdb.cpp
index 9b8c36d..9e34854 100644
--- a/src/plugins/debuggergdb/debuggergdb.cpp
+++ b/src/plugins/debuggergdb/debuggergdb.cpp
@@ -1774,20 +1774,6 @@ void DebuggerGDB::BringAppToFront()
app->Raise();
}
-void DebuggerGDB::ClearActiveMarkFromAllEditors()
-{
- EditorManager* edMan = Manager::Get()->GetEditorManager();
-// Plugins are destroyed prior to EditorManager, so this is guaranteed to be valid at all times
-// if (!edMan)
-// return;
- for (int i = 0; i < edMan->GetEditorsCount(); ++i)
- {
- cbEditor* ed = edMan->GetBuiltinEditor(i);
- if (ed)
- ed->SetDebugLine(-1);
- }
-}
-
void DebuggerGDB::SyncEditor(const wxString& filename, int line, bool setMarker)
{
DebuggerManager::SyncEditorResult result;
diff --git a/src/plugins/debuggergdb/debuggergdb.h b/src/plugins/debuggergdb/debuggergdb.h
index 72703a9..ea9fa3f 100644
--- a/src/plugins/debuggergdb/debuggergdb.h
+++ b/src/plugins/debuggergdb/debuggergdb.h
@@ -116,7 +116,6 @@ class DebuggerGDB : public cbDebuggerPlugin
void DoSwitchToDebuggingLayout();
void DoSwitchToPreviousLayout();
void ParseOutput(const wxString& output);
- void ClearActiveMarkFromAllEditors();
void DoWatches();
wxString FindDebuggerExecutable(Compiler* compiler);
int LaunchProcess(const wxString& cmd, const wxString& cwd);
diff --git a/src/sdk/cbplugin.cpp b/src/sdk/cbplugin.cpp
index 4f6a2e1..0650ea5 100644
--- a/src/sdk/cbplugin.cpp
+++ b/src/sdk/cbplugin.cpp
@@ -166,6 +166,20 @@ void cbDebuggerPlugin::RemoveBreakpointFromEditor(const wxString& filename, int
ed->RemoveBreakpoint(line, false);
}
+void cbDebuggerPlugin::ClearActiveMarkFromAllEditors()
+{
+ EditorManager* edMan = Manager::Get()->GetEditorManager();
+// Plugins are destroyed prior to EditorManager, so this is guaranteed to be valid at all times
+// if (!edMan)
+// return;
+ for (int i = 0; i < edMan->GetEditorsCount(); ++i)
+ {
+ cbEditor* ed = edMan->GetBuiltinEditor(i);
+ if (ed)
+ ed->SetDebugLine(-1);
+ }
+}
+
/////
///// cbToolPlugin
/////
Patch 3 - the stop button behaviour has been broken :roll:
--- a/src/sdk/debuggermenu.cpp
+++ b/src/sdk/debuggermenu.cpp
@@ -190,7 +190,10 @@ void DebuggerMenuHandler::OnStart(wxCommandEvent& event)
void DebuggerMenuHandler::OnStop(wxCommandEvent& event)
{
cbAssert(m_activeDebugger);
- m_activeDebugger->Stop();
+ if(m_activeDebugger->IsStopped())
+ m_activeDebugger->Stop();
+ else
+ m_activeDebugger->Break();
}
void DebuggerMenuHandler::OnContinue(wxCommandEvent& event)
What are you changes?
Hi Martin,
I am trying to build the debugger branch, but I get the following error:
src\plugins\debuggergdb\debugger_defs.h:12:22: tr1/memory: No such file or directory
Edit: What is not clear to me: Why are the BP's handled one time in m_State and another time in m_breakpoints?! There is a funny mixture of what is being used inside debuggergdb. It's not clear to me when which version is right...?!
I didn't want to mess with the plugin code too much. So I settled for some code duplication.
Here is the fix, but maybe I should extract this and the other notifications, so all plugins implement it by default :)
Index: src/plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- src/plugins/debuggergdb/debuggergdb.cpp (revision 5809)
+++ src/plugins/debuggergdb/debuggergdb.cpp (working copy)
@@ -2008,7 +2008,7 @@
bpFileName.Normalize();
edFileName.Normalize();
if (bpFileName.GetFullPath().Matches(edFileName.GetFullPath()))
- ed->ToggleBreakpoint(bp->line, false);
+ ed->ToggleBreakpoint(bp->line - 1, false);
}
// Now check and highlight the active line under debugging
if (m_State.HasDriver())
Here is a patch that fixes the parsing the GDB output, generated by "output var", when "var" is a reference.
Index: src/plugins/debuggergdb/parsewatchvalue.cpp
===================================================================
--- src/plugins/debuggergdb/parsewatchvalue.cpp (revision 5826)
+++ src/plugins/debuggergdb/parsewatchvalue.cpp (working copy)
@@ -314,12 +314,20 @@
return true;
}
- if(value[0] == wxT('{') && value[value.length() - 1] == wxT('}'))
+ // Try to find the first brace.
+ // If the watch is for a reference the brace is not at position = 0
+ wxString::size_type start = value.find(wxT('{'));
+
+ if(start != wxString::npos && value[value.length() - 1] == wxT('}'))
{
- int start = 1;
- bool result = ParseGDBWatchValue(watch, value, start, value.length() - 2);
+ int t_start = start + 1;
+ bool result = ParseGDBWatchValue(watch, value, t_start, value.length() - 2);
if(result)
+ {
+ if(start > 0)
+ watch.SetValue(value.substr(0, start));
watch.RemoveChildren(true);
+ }
return result;
}
else
-------------- Build: Debugger in Code::Blocks ---------------
mingw32-g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -DWXMAKINGDLL_PROPGRID -DwxPG_USE_WXMODULE=0 -IC:\wxWidgets-2.8.10\include -IC:\wxWidgets-2.8.10\contrib\include -IC:\wxWidgets-2.8.10\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude -Iinclude\scripting\include -Iinclude\scripting\sqplus -c C:\cb_debugger_branch\src\plugins\debuggergdb\cdb_driver.cpp -o .objs\plugins\debuggergdb\cdb_driver.o
mingw32-g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -DWXMAKINGDLL_PROPGRID -DwxPG_USE_WXMODULE=0 -IC:\wxWidgets-2.8.10\include -IC:\wxWidgets-2.8.10\contrib\include -IC:\wxWidgets-2.8.10\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude -Iinclude\scripting\include -Iinclude\scripting\sqplus -c C:\cb_debugger_branch\src\plugins\debuggergdb\databreakpointdlg.cpp -o .objs\plugins\debuggergdb\databreakpointdlg.o
mingw32-g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -DWXMAKINGDLL_PROPGRID -DwxPG_USE_WXMODULE=0 -IC:\wxWidgets-2.8.10\include -IC:\wxWidgets-2.8.10\contrib\include -IC:\wxWidgets-2.8.10\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude -Iinclude\scripting\include -Iinclude\scripting\sqplus -c C:\cb_debugger_branch\src\plugins\debuggergdb\debugger_defs.cpp -o .objs\plugins\debuggergdb\debugger_defs.o
mingw32-g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -DWXMAKINGDLL_PROPGRID -DwxPG_USE_WXMODULE=0 -IC:\wxWidgets-2.8.10\include -IC:\wxWidgets-2.8.10\contrib\include -IC:\wxWidgets-2.8.10\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude -Iinclude\scripting\include -Iinclude\scripting\sqplus -c C:\cb_debugger_branch\src\plugins\debuggergdb\debuggerdriver.cpp -o .objs\plugins\debuggergdb\debuggerdriver.o
mingw32-g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -DWXMAKINGDLL_PROPGRID -DwxPG_USE_WXMODULE=0 -IC:\wxWidgets-2.8.10\include -IC:\wxWidgets-2.8.10\contrib\include -IC:\wxWidgets-2.8.10\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude -Iinclude\scripting\include -Iinclude\scripting\sqplus -c C:\cb_debugger_branch\src\plugins\debuggergdb\debuggergdb.cpp -o .objs\plugins\debuggergdb\debuggergdb.o
C:\cb_debugger_branch\src\plugins\debuggergdb\debuggergdb.cpp:1748:1: error: unterminated #ifndef
C:\cb_debugger_branch\src\plugins\debuggergdb\debuggergdb.cpp: In member function 'virtual void DebuggerGDB::Break()':
C:\cb_debugger_branch\src\plugins\debuggergdb\debuggergdb.cpp:1747: warning: unused variable 'pid'
C:\cb_debugger_branch\src\plugins\debuggergdb\debuggergdb.cpp:1747: error: expected '}' at end of input
C:\cb_debugger_branch\src\plugins\debuggergdb\debuggergdb.cpp:1747: error: expected '}' at end of input
Process terminated with status 1 (12 minutes, 40 seconds)
3 errors, 9 warnings
build failed in the latest debugger branch under TDM mingw.
Hi, oBF, thanks!!!!! :D
I just apply this patch, and find a small bug.
The test code is the attachment of this message
http://forums.codeblocks.org/index.php/topic,11301.msg77123.html#msg77123
In debugger branch, I can set breakpoint in the function body.
void __declspec(dllexport) MyFunction(const LPCSTR sometext)
{
/** SET BREAK POINT HERE VVVVVVVVVVV **/
MessageBoxA(0, sometext, "DLL Message", MB_OK | MB_ICONINFORMATION); *************breakpoint set here.
/** SET BREAK POINT HERE ^^^^^^^^^^^^ **/
}
when the debugger hit the bp, cursor jumped to the wrong place,
if ( NULL != ProcAdd )
{
fRunTimeLinkSuccess = TRUE;
( ProcAdd ) ( TEXT( "Message via DLL function\n" ) ); *********when bp hit, the cursor always jump here.
}
I think this is wrong behavior.
It works fine in the trunk version.
My environment: TDM-MinGW GCC 4.4.1 and GDB 7.02
and with patch from jens:
http://forums.codeblocks.org/index.php/topic,11301.msg77156.html#msg77156
thanks.
Edit
I just found that if the Call stack window was not opened during debugging, the cursor can jump to the right place. :D, so, this is an issue of interpreting the backtrack output.
Uau, you are quite fast :)
Can you provide a platform independent test case? (probably not because I'm sure it breaks because of the "__declspec(dllexport)" )
Can you paste here the output in the debugger log window after the "bt 30" command..
Unfortunately the output of that command is made for users not parsers and so it is quite unreliable :(
Thanks for the feadback
Ok, but I can only supply a windows test case, because I only have windows. I haven't tried linux till now. :(
Log with no call stack window:
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.0
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Function "__cxa_throw" not defined.
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source F:\debugger_branch\src\output\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory D:/codeblocks_opencv/call_DLL_wxDebugTest/
>>>>>>cb_gdb:
> break "D:/codeblocks_opencv/call_DLL_wxDebugTest/TestApp/main.cpp:63"
Breakpoint 2 at 0x401438: file D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp, line 63.
>>>>>>cb_gdb:
> break "D:/codeblocks_opencv/call_DLL_wxDebugTest/TestDLL/dllmain.cpp:10"
No source file named D:/codeblocks_opencv/call_DLL_wxDebugTest/TestDLL/dllmain.cpp.
Breakpoint 3 ("D:/codeblocks_opencv/call_DLL_wxDebugTest/TestDLL/dllmain.cpp:10) pending.
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 1844.0x260]
[New Thread 1844.0x2c8]
Breakpoint 2, WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63
D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63:2773:beg:0x401438
Current language: auto
The current source language is "auto; currently c++".
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> whatis szClassName
type = char [21]
>>>>>>cb_gdb:
> output &szClassName
(char (*)[21]) 0x402000>>>>>>cb_gdb:
> output szClassName
"CodeBlocksWindowsApp">>>>>>cb_gdb:
> cont
Breakpoint 3, MyFunction (sometext=0x40305d "Message via DLL function\n") at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10
D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10:192:beg:0x684c11de
>>>>>>cb_gdb:
> cont
warning: Temporarily disabling breakpoints for unloaded shared library "D:\codeblocks_opencv\call_DLL_wxDebugTest\bin\TestDLL.dll"
Program exited normally.
>>>>>>cb_gdb:
> quit
Log with call stack window opened.
> bt 30
#0 WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63
#1 0x00401a86 in main ()
>>>>>>cb_gdb:
> break "D:/codeblocks_opencv/call_DLL_wxDebugTest/TestApp/main.cpp:65"
Breakpoint 4 at 0x40143d: file D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp, line 65.
>>>>>>cb_gdb:
> cont
Breakpoint 3, MyFunction (sometext=0x40305d "Message via DLL function\n") at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10
D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10:192:beg:0x684c11de
>>>>>>cb_gdb:
> bt 30
#0 MyFunction (sometext=0x40305d "Message via DLL function\n") at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10
#1 0x0040156b in LoadDllPlugin () at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127
#2 0x0040143d in WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63
#3 0x00401a86 in main ()
>>>>>>cb_gdb:
> frame 1
#1 0x0040156b in LoadDllPlugin () at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127
D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127:4719:beg:0x40156b
>>>>>>cb_gdb:
> bt 30
#0 MyFunction (sometext=0x40305d "Message via DLL function\n") at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10
#1 0x0040156b in LoadDllPlugin () at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127
#2 0x0040143d in WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63
#3 0x00401a86 in main ()
>>>>>>cb_gdb:
> frame 1
#1 0x0040156b in LoadDllPlugin () at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127
D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127:4719:beg:0x40156b
>>>>>>cb_gdb:
> cont
warning: Temporarily disabling breakpoints for unloaded shared library "D:\codeblocks_opencv\call_DLL_wxDebugTest\bin\TestDLL.dll"
Breakpoint 4, WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:65
D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:65:2799:beg:0x40143d
>>>>>>cb_gdb:
> bt 30
#0 WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:65
#1 0x00401a86 in main ()
>>>>>>cb_gdb:
> cont
Program exited normally.
>>>>>>cb_gdb:
> quit
Log with call stack window opened.
> bt 30
#0 WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63
#1 0x00401a86 in main ()
> bt 30
#0 MyFunction (sometext=0x40305d "Message via DLL function\n") at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10
#1 0x0040156b in LoadDllPlugin () at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127
#2 0x0040143d in WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63
#3 0x00401a86 in main ()
> bt 30
#0 MyFunction (sometext=0x40305d "Message via DLL function\n") at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestDLL\dllmain.cpp:10
#1 0x0040156b in LoadDllPlugin () at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:127
#2 0x0040143d in WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:63
#3 0x00401a86 in main ()
> bt 30
#0 WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x251f1a "", nCmdShow=10) at D:\codeblocks_opencv\call_DLL_wxDebugTest\TestApp\main.cpp:65
#1 0x00401a86 in main ()
That is the relevant output, I'll fix it tonight, when I get home.
Update:
Here is the fixed patch http://smrt.is-a-geek.org/codeblocks/dbg_refactor/dbg_refactor0006.patch
And the diff of the two patches
--- dbg_refactor0005.patch 2009-10-19 01:26:10.000000000 +0300
+++ dbg_refactor0006.patch 2009-10-19 19:52:09.000000000 +0300
@@ -406,7 +406,7 @@
//#31 0x004076ca in main () at C:/Devel/wxWidgets-2.6.1/include/wx/intl.h:555
//#50 0x00410c8c in one::~one() (this=0x3d24c8) at main.cpp:14
-static wxRegEx reBT0(_T("#([0-9]+)[ \t]+([^(]+)[ \t]+(\\([^)]*\\))")); // case #0
-+static wxRegEx reBT0(_T("#([0-9]+)[ \t]+([a-zA-Z:\\(\\)0-9 ,=_@]+)[ \t]at[ \t](.+):([0-9]+)")); // case #0
++static wxRegEx reBT0(_T("#([0-9]+)[ \t]+(.+)[ \t]at[ \t](.+):([0-9]+)")); // case #0
static wxRegEx reBT1(_T("#([0-9]+)[ \t]+0x([A-Fa-f0-9]+)[ \t]+in[ \t]+(.+)[ \t]+(\\([^)]*\\))[ \t]")); // all other cases (gdb 6.3)
static wxRegEx reBTX(_T("#([0-9]+)[ \t]+0x([A-Fa-f0-9]+)[ \t]+in[ \t]+([^(]+)[ \t]*(\\([^)]*\\)[ \t]*\\([^)]*\\))")); // all other cases (gdb 5.2)
static wxRegEx reBT2(_T("\\)[ \t]+[atfrom]+[ \t]+(.*):([0-9]+)"));
UPDATE: Olly have you tried the new patch?
Patch needed on branch wxpropgrid_debugger under windows without Precompiled Headers enabled.
Tim S.
SDK folder only patch
Index: src/sdk/examinememorydlg.cpp
===================================================================
--- src/sdk/examinememorydlg.cpp (revision 5882)
+++ src/sdk/examinememorydlg.cpp (working copy)
@@ -7,7 +7,11 @@
* $HeadURL$
*/
-#include <sdk.h>
+#include "sdk_precomp.h"
+#ifndef CB_PRECOMP
+ #include "cbplugin.h"
+#endif
+
#include "examinememorydlg.h"
#include <wx/intl.h>
#include <wx/xrc/xmlres.h>
Index: src/sdk/debuggermanager.cpp
===================================================================
--- src/sdk/debuggermanager.cpp (revision 5882)
+++ src/sdk/debuggermanager.cpp (working copy)
@@ -8,7 +8,26 @@
*/
#include "sdk_precomp.h"
+#ifndef CB_PRECOMP
+ #include <wx/artprov.h>
+ #include <wx/bmpbuttn.h>
+ #include <wx/combobox.h>
+ #include <wx/filedlg.h>
+ #include <wx/frame.h>
+ #include <wx/menu.h>
+ #include <wx/sizer.h>
+ #include <wx/stattext.h>
+ #include "cbeditor.h"
+ #include "cbexception.h"
+ #include "cbplugin.h"
+ #include "cbproject.h"
+ #include "configmanager.h"
+ #include "editormanager.h"
+ #include "logmanager.h"
+ #include "projectmanager.h"
+#endif
+
#include <algorithm>
#include <wx/toolbar.h>
Index: src/sdk/cbplugin.cpp
===================================================================
--- src/sdk/cbplugin.cpp (revision 5882)
+++ src/sdk/cbplugin.cpp (working copy)
@@ -19,6 +19,9 @@
#include "projectbuildtarget.h"
#include "cbproject.h"
#include "logmanager.h"
+ #include "editormanager.h"
+ #include "cbeditor.h"
+ #include "projectmanager.h"
#endif
#include <wx/toolbar.h>
Index: src/sdk/backtracedlg.cpp
===================================================================
--- src/sdk/backtracedlg.cpp (revision 5882)
+++ src/sdk/backtracedlg.cpp (working copy)
@@ -7,13 +7,23 @@
* $HeadURL$
*/
#include "sdk_precomp.h"
+#ifndef CB_PRECOMP
+ #include <wx/filedlg.h>
+ #include <wx/listctrl.h>
+ #include <wx/menu.h>
+ #include <wx/sizer.h>
+ #include <wx/txtstrm.h>
+ #include <wx/wfstream.h>
-#include "backtracedlg.h"
+ #include "cbplugin.h"
+ #include "configmanager.h"
+#endif
#include <wx/clipbrd.h>
-#include <wx/listctrl.h>
#include "filefilters.h"
+#include "backtracedlg.h"
+
namespace
{
const int idList = wxNewId();
Index: src/sdk/editbreakpointdlg.cpp
===================================================================
--- src/sdk/editbreakpointdlg.cpp (revision 5882)
+++ src/sdk/editbreakpointdlg.cpp (working copy)
@@ -8,7 +8,12 @@
*/
#include "sdk_precomp.h"
+#ifndef CB_PRECOMP
+ #include <wx/xrc/xmlres.h>
+ #include "debuggermanager.h"
+#endif
+
#include "editbreakpointdlg.h"
#include <wx/intl.h>
#include <wx/xrc/xmlres.h>
Index: src/sdk/breakpointsdlg.cpp
===================================================================
--- src/sdk/breakpointsdlg.cpp (revision 5882)
+++ src/sdk/breakpointsdlg.cpp (working copy)
@@ -7,15 +7,18 @@
* $HeadURL$
*/
+#include <set>
+
#include "sdk_precomp.h"
-#include "breakpointsdlg.h"
-
#ifndef CB_PRECOMP
# include "globals.h"
# include "manager.h"
# include "editormanager.h"
# include "cbeditor.h"
+# include "cbplugin.h"
+# include "debuggermanager.h"
+
# include <wx/button.h>
# include <wx/checkbox.h>
# include <wx/intl.h>
@@ -24,10 +27,13 @@
# include <wx/menu.h>
# include <wx/textctrl.h>
# include <wx/spinctrl.h>
+# include <wx/sizer.h>
#endif
#include "editbreakpointdlg.h"
+#include "breakpointsdlg.h"
+
namespace
{
const int idList = wxNewId();
Index: src/sdk/debuggermenu.cpp
===================================================================
--- src/sdk/debuggermenu.cpp (revision 5882)
+++ src/sdk/debuggermenu.cpp (working copy)
@@ -7,7 +7,15 @@
* $HeadURL$
*/
#include "sdk_precomp.h"
+#ifndef CB_PRECOMP
+ #include <wx/xrc/xmlres.h>
+ #include "cbeditor.h"
+ #include "cbproject.h"
+ #include "editormanager.h"
+ #include "projectmanager.h"
+#endif
+
#include "debuggermenu.h"
#include <algorithm>
Index: src/sdk/threadsdlg.cpp
===================================================================
--- src/sdk/threadsdlg.cpp (revision 5882)
+++ src/sdk/threadsdlg.cpp (working copy)
@@ -7,16 +7,17 @@
* $HeadURL$
*/
-#include "threadsdlg.h"
+#include "sdk_precomp.h"
+#ifndef CB_PRECOMP
+ #include <wx/listctrl.h>
+ #include <wx/menu.h>
+ #include <wx/sizer.h>
-#include "sdk.h"
+ #include "cbplugin.h"
+#endif
-#include <wx/listctrl.h>
-#include <wx/menu.h>
-#include <wx/sizer.h>
+#include "threadsdlg.h"
-
-
namespace
{
const int idList = wxNewId();
Index: src/sdk/watchesdlg.cpp
===================================================================
--- src/sdk/watchesdlg.cpp (revision 5882)
+++ src/sdk/watchesdlg.cpp (working copy)
@@ -7,11 +7,20 @@
* $HeadURL$
*/
-#include <sdk.h>
-#include "watchesdlg.h"
+#include "sdk_precomp.h"
+#ifndef CB_PRECOMP
+ #include <wx/menu.h>
+ #include <wx/sizer.h>
+ #include "cbplugin.h"
+ #include "logmanager.h"
+ #include "scrollingdialog.h"
+#endif
+
#include <wx/propgrid/propgrid.h>
+#include "watchesdlg.h"
+
namespace
{
const int idGrid = wxNewId();
Index: src/include/debuggermenu.h
===================================================================
--- src/include/debuggermenu.h (revision 5882)
+++ src/include/debuggermenu.h (working copy)
@@ -6,7 +6,10 @@
#ifndef X_DEBUGGER_MENU_H
#define X_DEBUGGER_MENU_H
+#include <wx/event.h>
+
class cbDebuggerPlugin;
+class wxToolBar;
class DebuggerMenuHandler : public wxEvtHandler
{
Index: src/include/breakpointsdlg.h
===================================================================
--- src/include/breakpointsdlg.h (revision 5882)
+++ src/include/breakpointsdlg.h (working copy)
@@ -6,8 +6,13 @@
#ifndef BREAKPOINTSDLG_H
#define BREAKPOINTSDLG_H
+#include <vector>
+
#include <wx/panel.h>
+class cbBreakpoint;
+class CodeBlocksEvent;
+class cbDebuggerPlugin;
class wxCommandEvent;
class wxListCtrl;
class wxListEvent;
Patch for src and debug plugin headers needed for NON precompiled under Windows XP.
Note: I redid the headers alot in debuggergdb.cpp in order to precompilied header sdk.h better.
Tim S.
Index: src/plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- src/plugins/debuggergdb/debuggergdb.cpp (revision 5883)
+++ src/plugins/debuggergdb/debuggergdb.cpp (working copy)
@@ -7,57 +7,59 @@
* $HeadURL$
*/
+
#include <sdk.h>
-#include <wx/txtstrm.h>
-#include <wx/regex.h>
-#include "scrollingdialog.h"
-#include <wx/msgdlg.h>
-#include <wx/tokenzr.h>
+#include <algorithm> // std::remove_if
+#ifndef CB_PRECOMP
+ #include <wx/frame.h> // GetMenuBar
+ #include <wx/msgdlg.h>
+ #include <wx/regex.h>
+ #include <wx/txtstrm.h>
-#include <manager.h>
-#include <configmanager.h>
-#include <logmanager.h>
-#include <projectmanager.h>
-#include <pluginmanager.h>
-#include <editormanager.h>
-#include <macrosmanager.h>
-#include <cbeditor.h>
-#include <projectbuildtarget.h>
-#include <sdk_events.h>
-#include <editarraystringdlg.h>
-#include <compilerfactory.h>
-#include <projectloader_hooks.h>
-#include <xtra_res.h>
+ #include <cbeditor.h>
+ #include <cbproject.h>
+ #include <compilerfactory.h>
+ #include <configmanager.h>
+ #include <editormanager.h>
+ #include <globals.h>
+ #include <logmanager.h>
+ #include <macrosmanager.h>
+ #include <manager.h>
+ #include <pluginmanager.h>
+ #include <projectbuildtarget.h>
+ #include <projectmanager.h>
+ #include <scrollingdialog.h>
+ #include <sdk_events.h>
+ #include <xtra_res.h>
+#endif
+#ifdef __WXMSW__
+ #include <winbase.h>
+#else
+ int GetShortPathName(const void*, void*, int){/* bogus */ return 0; };
+#endif
+
#include <annoyingdialog.h>
#include <backtracedlg.h>
#include <breakpointsdlg.h>
+#include <cbstyledtextctrl.h>
#include <disassemblydlg.h>
+#include <editarraystringdlg.h>
#include <editbreakpointdlg.h>
#include <examinememorydlg.h>
+#include <projectloader_hooks.h>
#include <threadsdlg.h>
#include <watchesdlg.h>
-#include "cbstyledtextctrl.h"
#include "databreakpointdlg.h"
#include "debuggerdriver.h"
-#include "debuggergdb.h"
#include "debuggeroptionsdlg.h"
#include "debuggeroptionsprjdlg.h"
#include "editwatchesdlg.h"
#include "editwatchdlg.h"
-#include "globals.h"
-#ifdef __WXMSW__
- #include <winbase.h>
-#else
- int GetShortPathName(const void*, void*, int){/* bogus */ return 0; };
-#endif
+#include "debuggergdb.h"
-#ifndef CB_PRECOMP
- #include <wx/frame.h> // GetMenuBar
- #include "cbproject.h"
-#endif
#if defined(__APPLE__) && defined(__MACH__)
#define LIBRARY_ENVVAR _T("DYLD_LIBRARY_PATH")
Index: src/plugins/debuggergdb/gdb_commands.h
===================================================================
--- src/plugins/debuggergdb/gdb_commands.h (revision 5883)
+++ src/plugins/debuggergdb/gdb_commands.h (working copy)
@@ -25,6 +25,7 @@
#include <scriptingmanager.h>
#include <sqplus.h>
#include <infowindow.h>
+#include "logmanager.h"
// FIXME (obfuscated#): remove this include
#include "debuggertree.h"
Index: src/plugins/debuggergdb/debugger_defs.h
===================================================================
--- src/plugins/debuggergdb/debugger_defs.h (revision 5883)
+++ src/plugins/debuggergdb/debugger_defs.h (working copy)
@@ -11,6 +11,8 @@
#include <vector>
#include <tr1/memory>
+#include "debuggermanager.h"
+
class DebuggerDriver;
class DebuggerTree;
Index: src/src/main.h
===================================================================
--- src/src/main.h (revision 5883)
+++ src/src/main.h (working copy)
@@ -19,6 +19,7 @@
#include "cbplugin.h"
#include "sdk_events.h"
#include "scripting/bindings/sc_base_types.h"
+#include "scrollingdialog.h"
WX_DECLARE_HASH_MAP(int, wxString, wxIntegerHash, wxIntegerEqual, PluginIDsMap);
WX_DECLARE_HASH_MAP(cbPlugin*, wxToolBar*, wxPointerHash, wxPointerEqual, PluginToolbarsMap);
The autotools build system seems broken in the debugger branch.
Can someone confirm this?
Here is the build log
obfuscated@xlad ~/projects/codeblocks/brances/debugger_clean $ ./bootstrap
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: You should add the contents of the following files to `aclocal.m4':
libtoolize: `/usr/share/aclocal/libtool.m4'
libtoolize: `/usr/share/aclocal/ltoptions.m4'
libtoolize: `/usr/share/aclocal/ltversion.m4'
libtoolize: `/usr/share/aclocal/ltsugar.m4'
libtoolize: `/usr/share/aclocal/lt~obsolete.m4'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
configure.in: installing `./install-sh'
configure.in: installing `./missing'
src/base/tinyxml/Makefile.am: installing `./depcomp'
src/plugins/contrib/Makefile.am:101: BUILD_CCCC does not appear in AM_CONDITIONAL
src/plugins/contrib/Makefile.am:105: BUILD_CPPCHECK does not appear in AM_CONDITIONAL
configure.in:7: installing `./config.guess'
configure.in:7: installing `./config.sub'
And after the ./bootstrap there is no configure script :(
System gentoo amd64 + gcc 4.4.2/glibc 2.9
It is fixed.
But your patch for the notebook problems breaks the BrowseTracker plugin
/wxscintilla/include -Ulinux -Uunix -g -DDEBUG -DCB_AUTOCONF -march=core2 -O2 -fweb -frename-registers -pipe -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -c Version.cpp -fPIC -DPIC -o .libs/Version.o
BrowseTracker.cpp: In member function ‘bool BrowseTracker::IsEditorBaseOpen(EditorBase*)’:
BrowseTracker.cpp:2777: error: cannot convert ‘cbAuiNotebook*’ to ‘wxAuiNotebook*’ in initialization
make[4]: *** [BrowseTracker.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/plugins/contrib/BrowseTracker'
Patch for cppcheck in the debugger branch
Index: src/plugins/contrib/CppCheck/CppCheck-unix.cbp
===================================================================
--- src/plugins/contrib/CppCheck/CppCheck-unix.cbp (revision 5956)
+++ src/plugins/contrib/CppCheck/CppCheck-unix.cbp (working copy)
@@ -32,7 +32,7 @@
<Add option="-DCB_PRECOMP" />
<Add option="-DcbDEBUG" />
<Add directory="../../../include" />
- <Add directory="../../../include/wxscintilla/include" />
+ <Add directory="../../../sdk/wxscintilla/include" />
</Compiler>
<Linker>
<Add option="`wx-config --libs`" />
The same fix seems to be needed in the autotools system.
Also does ./configure --with-contrib-plugins="all,-CppCheck" should work (build all plugins except the CppCheck)?
My test doesn't seem to work :(
* debugger branch: update to wxpropgrid hopefully fixing the visualisation issue with +/- on Windows
Bug is fixed, Thanks Morten.
Seems the auto-fu is broken...
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: You should add the contents of the following files to `aclocal.m4':
libtoolize: `/usr/share/aclocal/libtool.m4'
libtoolize: `/usr/share/aclocal/ltoptions.m4'
libtoolize: `/usr/share/aclocal/ltversion.m4'
libtoolize: `/usr/share/aclocal/ltsugar.m4'
libtoolize: `/usr/share/aclocal/lt~obsolete.m4'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
configure.in: installing `./install-sh'
configure.in: installing `./missing'
src/base/tinyxml/Makefile.am: installing `./depcomp'
configure.in:7: installing `./config.guess'
configure.in:7: installing `./config.sub'
configure.in:209: required file `src/plugins/scriptedwizard/resources/sharedlib/files/Makefile.in' not found
Also you have not fully applied the previous patch... here is what's left: http://smrt.is-a-geek.org/codeblocks/dbg_refactor0010.patch
Thank you Morten....
But the build using the autofu system seems to be broken:
.libs/cbexception.o: In function `cbException':
/usr/include/wx-2.8/wx/thread.h:554: multiple definition of `cbException::cbException(wxString const&, wxString const&, int)'
.libs/cbexception.o:/usr/include/wx-2.8/wx/thread.h:554: first defined here
.libs/cbexception.o: In function `cbException':
/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/cbexception.cpp:24: multiple definition of `cbException::cbException(wxString const&, wxString const&, int)'
.libs/cbexception.o:/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/cbexception.cpp:24: first defined here
.libs/cbexception.o: In function `cbException::ShowErrorMessage(bool)':
/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/cbexception.cpp:32: multiple definition of `cbException::ShowErrorMessage(bool)'
.libs/cbexception.o:/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/cbexception.cpp:32: first defined here
.libs/cbexception.o: In function `~cbException':
/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/cbexception.cpp:27: multiple definition of `cbException::~cbException()'
.libs/cbexception.o:/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/cbexception.cpp:27: first defined here
.libs/cbexception.o: In function `~cbException':
/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/cbexception.cpp:27: multiple definition of `cbException::~cbException()'
.libs/cbexception.o:/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/cbexception.cpp:27: first defined here
.libs/cbexception.o: In function `~cbException':
/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/cbexception.cpp:27: multiple definition of `cbException::~cbException()'
.libs/cbexception.o:/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/cbexception.cpp:27: first defined here
.libs/editor_hooks.o: In function `EditorHooks::HasRegisteredHooks()':
/usr/include/wx-2.8/wx/thread.h:554: multiple definition of `EditorHooks::HasRegisteredHooks()'
.libs/editor_hooks.o:/usr/include/wx-2.8/wx/thread.h:554: first defined here
.libs/editor_hooks.o: In function `EditorHooks::CallHooks(cbEditor*, wxScintillaEvent&)':
/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/editor_hooks.cpp:55: multiple definition of `EditorHooks::CallHooks(cbEditor*, wxScintillaEvent&)'
.libs/editor_hooks.o:/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/editor_hooks.cpp:55: first defined here
.libs/editor_hooks.o: In function `EditorHooks::UnregisterHook(int, bool)':
/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/editor_hooks.cpp:33: multiple definition of `EditorHooks::UnregisterHook(int, bool)'
.libs/editor_hooks.o:/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/editor_hooks.cpp:33: first defined here
.libs/editor_hooks.o: In function `EditorHooks::RegisterHook(EditorHooks::HookFunctorBase*)':
/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/editor_hooks.cpp:22: multiple definition of `EditorHooks::RegisterHook(EditorHooks::HookFunctorBase*)'
.libs/editor_hooks.o:/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk/editor_hooks.cpp:22: first defined here
.libs/nullptr.o:(.bss+0x0): multiple definition of `nullptr'
.libs/nullptr.o:(.bss+0x0): first defined here
collect2: ld returned 1 exit status
make[3]: *** [libcodeblocks.la] Error 1
make[3]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src/sdk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/dev-util/codeblocks-9999-r20/work/codeblocks-9999/src'
Building from C::B seems to work
HEHE: post 555, go go subaru rally team from the 90's
Thanks.
No, I don't have it in my latest patchset (no posted here, but will when I have more to show).
But I was having it before the latest changes in the wxPropertyGrid.
The way to fix it:
m_grid->SetColumnProportions(0, 50);
m_grid->SetColumnProportions(1, 50);
// I may have misspelled the method name!
I've just found a problem in the shutdown procedure of C::B
void MainFrame::OnApplicationClose(wxCloseEvent& event)
{
.......
if (!Manager::IsBatchBuild())
{
m_pInfoPane->Destroy();
m_pInfoPane = 0L;
}
Manager::Shutdown(); // Shutdown() is not Free(), Manager is automatically destroyed at exit
And the problem is: the log & info notebook is destroyed (all child logger controls too) before all plugins are destroyed/unloaded.
The result is that the logger system has pointers to destroyed objects => we get a crash every time such a pointer is used (for example in TextCtrlLogger::Append).
How should this problem be fixed?
1. Move the notebook's destruction below the Manager::Shutdown(); call
2. Add a method to the LogManager -> MarkAsDestroyed, which does "control = NULL"
3. Something else
One more change I have in my working copy is this:
===================================================================
--- sdk/globals.cpp (revision 6372)
+++ sdk/globals.cpp (working copy)
@@ -210,6 +210,9 @@
{
wxString ext = filename.AfterLast(_T('.')).Lower();
+ if (ext.find(wxT('/')) != wxString::npos)
+ return ftHeader;
+
if (ext.IsSameAs(FileFilters::ASM_EXT) ||
ext.IsSameAs(FileFilters::C_EXT) ||
ext.IsSameAs(FileFilters::CC_EXT) ||
Index: sdk/cbplugin.cpp
===================================================================
--- sdk/cbplugin.cpp (revision 6372)
+++ sdk/cbplugin.cpp (working copy)
@@ -254,7 +254,7 @@
}
}
FileType ft = FileTypeOf(filename);
- if (ft != ftSource && ft != ftHeader && ft != ftResource)
+ if ((ft != ftSource && ft != ftHeader && ft != ftResource) || line < 0)
{
if(log_index != -1)
{
I've added it in order to enabled switching to frames inside headers from the C++'s standard library (vector, string, exception, etc).
I know this is not the right solution, but I'm not sure it if can be done without hacks.
Any suggestions are welcome and desired!
The branch is broken :(
Index: src/plugins/debuggergdb/cdb_driver.cpp
===================================================================
--- src/plugins/debuggergdb/cdb_driver.cpp (revision 6402)
+++ src/plugins/debuggergdb/cdb_driver.cpp (working copy)
@@ -191,7 +191,7 @@
QueueCommand(new CdbCmd_InfoRegisters(this));
}
-void CDB_driver::SwitchToFrame(size_t /*number*/)
+void CDB_driver::SwitchToFrame(size_t number)
{
ResetCursor();
QueueCommand(new CdbCmd_SwitchFrame(this, number));
Morten: can you revert the change in MainFrame::ScanForPlugins() in r5795?
I've accidentally removed the code that searches for plugins in the user's directory, bad me, bad :(
The change should be something like this:
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (revision 6571)
+++ src/src/main.cpp (working copy)
@@ -1010,11 +1010,16 @@
PluginManager* m_PluginManager = Manager::Get()->GetPluginManager();
- // global paths
- wxString path = ConfigManager::GetPluginsFolder(true);
+ // user paths first
+ wxString path = ConfigManager::GetPluginsFolder(false);
Manager::Get()->GetLogManager()->Log(_("Scanning for plugins in ") + path);
int count = m_PluginManager->ScanForPlugins(path);
+ // global paths
+ path = ConfigManager::GetPluginsFolder(true);
+ Manager::Get()->GetLogManager()->Log(_("Scanning for plugins in ") + path);
+ count += m_PluginManager->ScanForPlugins(path);
+
// actually load plugins
if (count > 0)
{
The problem seems to happen only when you have a plugin in the ~/.codeblocks directory.
When I've removed the plugin, CB could find the core plugins.
Probably a chdir is executed somewhere and the relative path to the global plugins is not correct any more.
Works also, even if I have a plugin in ~/.codeblocks:
[...]
Scanning for plugins in /home/jens/.codeblocks/share/codeblocks/plugins
Loaded 1 plugins
Scanning for plugins in /home/jens/codeblocks-build/codeblocks.dbg/src/output/share/codeblocks/plugins
Loaded 11 plugins
[...]
debugger-branch without contrib-plugins.
Morten:
this change is wrong, please revert it:
obfuscated@xlad ~/projects/codeblocks/brances/wxpropgrid_debugger $ svn diff -r PREV:HEAD src/sdk/loggers.cpp
Index: src/sdk/loggers.cpp
===================================================================
--- src/sdk/loggers.cpp (revision 6605)
+++ src/sdk/loggers.cpp (revision 6608)
@@ -103,7 +104,6 @@
style[success].SetTextColour(BlendTextColour(*wxBLUE));
- style[warning].SetTextColour(BlendTextColour(*wxBLUE));
style[warning].SetFont(italic_font);
style[error].SetFont(bold_font);
no pch patch:
Index: src/sdk/cbplugin.cpp
===================================================================
--- src/sdk/cbplugin.cpp (revision 6634)
+++ src/sdk/cbplugin.cpp (working copy)
@@ -22,6 +22,9 @@
#include "editormanager.h"
#include "cbeditor.h"
#include "projectmanager.h"
+ #include "infowindow.h"
+ #include "macrosmanager.h"
+ #include "configmanager.h"
#endif
#include <wx/toolbar.h>
Index: src/sdk/watchesdlg.cpp
===================================================================
--- src/sdk/watchesdlg.cpp (revision 6634)
+++ src/sdk/watchesdlg.cpp (working copy)
@@ -9,9 +9,11 @@
#include "sdk_precomp.h"
#ifndef CB_PRECOMP
+ #include <wx/dnd.h>
#include <wx/menu.h>
#include <wx/sizer.h>
+ #include "cbexception.h"
#include "cbplugin.h"
#include "logmanager.h"
#include "scrollingdialog.h"
Index: src/plugins/debuggergdb/cdb_driver.cpp
===================================================================
--- src/plugins/debuggergdb/cdb_driver.cpp (revision 6634)
+++ src/plugins/debuggergdb/cdb_driver.cpp (working copy)
@@ -8,6 +8,11 @@
*/
#include <sdk.h>
+
+#ifndef CB_PRECOMP
+ #include "logmanager.h"
+#endif
+
#include "cdb_driver.h"
#include "cdb_commands.h"
Yes, I'll tonight (but I don't use disassembly much(at all in fact))... If I don't answer soon please remind me.
Btw this one looks bad
@@ -117,33 +120,83 @@
wxString fmt;
fmt.Printf(_T("%p\t%s\n"), (void*)addr, line.c_str());
if (!fmt.StartsWith(wxT("0x")))
- fmt = wxT("0x") + fmt;
+ fmt.insert(size_t(0), &wxT("0x")[0], wxString::npos) ; //n == npos, insert all of sz
Why it is needed? what it does?
cbexaminr: some comments on the patch:
GdbCmd_Disassembly(DebuggerDriver* driver)
: DebuggerCmd(driver)
{
+ //TBD: Should this be 'fixed' to a position, something like
+ //"disassemble $pc" ? I think a user messing with the debug console and disassemble
+ //could foul up the result, with that missing, but not certain...
+ cbDisassemblyDlg *dialog = Manager::Get()->GetDebuggerManager()->GetDisassemblyDialog();
m_Cmd << _T("disassemble");
+ if(dialog->MixedMode())
+ //gdb's ordering of instructions with /m can be pretty confusing...
+ m_Cmd << _T(" /m") ;
}
1. Progably dialog->MixedMode(), should be moved to DebuggerManager::GetMixedMode()/IsMixedMode();
2. Change the constructor from GdbCmd_Disassembly(DebuggerDriver* driver) to GdbCmd_Disassembly(DebuggerDriver* driver, bool mixedMode) and do "if(dialog->MixedMode())" only once;
3. I think the user can't fool the disassembly, because he can't enter commands while the output is processed (If it can please show how)
4. use "svn diff -x '-u -b'" to generate the patch because you've messed the formatting of src/sdk/resources/disassembly.xrc
5. else and if should be on one line, and there is a space between if and (
6. why don't you use a proper container for m_LineTypes (std::vector<LineTypeEnum>, wxArray something... (vector<bool> is not proper container in c++ < 0x) )?
I've not done any testing, but will do tomorrow ...
I'm working on gdb/mi plugin, it can be found here:
URL: svn://smrt.is-a-geek.org/cb_gdb_mi/debbugger_gdbmi
Repository Root: svn://smrt.is-a-geek.org/cb_gdb_mi
But at the moment requires, special patch in order to compile and work, will post it later...
p.s. at the moment gdb/mi plugin has the most basic actions/commands working (stepping/breakpoints/callstack/threads/watches), no disassembly, memory windows, no remote debugging
There is a build problem:
/home/obfuscated/projects/codeblocks/brances/wxpropgrid_debugger/src/sdk/nullptr.cpp:16: error: ‘null_pointer_t’ does not name a type
It seems that the nullptr.cpp is not added to the trunk's Codeblocks-unix.cbp
...I got another 2 issues:
1.) I am not sure if this is related: But after applying the patch C::B does not startup anymore and I receive an error that the wxScintilla window could not be created in the constructor, in this line:
m_pCode = new wxScintilla(this, wxID_ANY);
...which goes back into the disassembly window (which was modified). I am still investigating though as in parallel I modified scintilla, too... unfortunately.
2.) From the logs I see a lot NULL pointer issues. meaning crash candidates, e.g.:
m_MixedModeCB = (wxCheckBox*)FindWindow(XRCID("chkMode"));
m_MixedModeCB->SetValue(Manager::Get()->GetDebuggerManager()->IsDisassemblyMixedMode());
...or here:
DebuggerManager &manager = *Manager::Get()->GetDebuggerManager();
bool newMode = !manager.IsDisassemblyMixedMode();
Please always make sure you verify pointers. The only exception might be singleton classes, but even then you must be careful if the app shuts down. The latter is strange anyways, why don't you operate with pointers here? This is the only place I know where a singleton class is used by reference. IMHO this is dangerous and violates somehow the concept of a singleton.
Concenring functionality: Well... I'll try to get it up and running... :lol:
Hi,
I wanted to try your version of debugger, but I was not successful in applying the posted patch (dbg_refactor0018.1.patch). From it's code I thought it has to be applied to the svn version 6872.
$ patch -p0 < dbg_refactor0018.1.patch
(Stripping trailing CRs from patch.)
patching file src/plugins/debuggergdb/debuggergdb.cpp
Hunk #1 FAILED at 1640.
1 out of 1 hunk FAILED -- saving rejects to file src/plugins/debuggergdb/debuggergdb.cpp.rej
(Stripping trailing CRs from patch.)
patching file src/plugins/debuggergdb/gdb_driver.h
Hunk #1 succeeded at 115 (offset -10 lines).
(Stripping trailing CRs from patch.)
patching file src/plugins/debuggergdb/gdb_driver.cpp
Hunk #1 succeeded at 69 (offset -5 lines).
Hunk #2 succeeded at 83 (offset -5 lines).
Hunk #3 succeeded at 483 (offset -19 lines).
Hunk #4 succeeded at 540 with fuzz 1 (offset -21 lines).
Hunk #5 succeeded at 552 with fuzz 2 (offset -28 lines).
Hunk #6 FAILED at 768.
patch unexpectedly ends in middle of line
Hunk #7 succeeded at 761 with fuzz 1 (offset -35 lines).
1 out of 7 hunks FAILED -- saving rejects to file src/plugins/debuggergdb/gdb_driver.cpp.rej
I hope that I'm not missing something obvious...
regards
Jan
OK, I'll try some things and if they don't work, the workaround will stay.
breakpoints:
The executable is build with /Zi /Od (or /0d) /MDd and it stops on the next line.
Here is the version of the debugger "Microsoft (R) Windows Debugger Version 6.11.0001.404 X86".
I'm using the latest nightly, without your changes.
Command-line: c:\Program Files\Debugging Tools for Windows (x86)\cdb.exe -G -lines -y C:/dev/projects/tests/cdb_test/; -srcpath C:/dev/projects/tests/cdb_test/; bin/debug/cdb_test.exe
Working dir : C:\dev\projects\tests\cdb_test\
> bc *
Microsoft (R) Windows Debugger Version 6.11.0001.404 X86
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: bin/debug/cdb_test.exe
Symbol search path is: C:/dev/projects/tests/cdb_test/
Executable search path is:
ModLoad: 00400000 0040f000 cdb_test.exe
ModLoad: 7c900000 7c9b2000 ntdll.dll
ModLoad: 7c800000 7c8f6000 C:\WINDOWS\system32\kernel32.dll
ModLoad: 10480000 10557000 C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\MSVCP90D.dll
ModLoad: 10200000 10323000 C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\MSVCR90D.dll
(300.115c): Break instruction exception - code 80000003 (first chance)
eax=00251eb4 ebx=7ffdb000 ecx=00000003 edx=00000008 esi=00251f48 edi=00251eb4
eip=7c90120e esp=0012fb20 ebp=0012fc94 iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000202
*** ERROR: Symbol file could not be found. Defaulted to export symbols for ntdll.dll -
ntdll!DbgBreakPoint:
7c90120e cc int 3
0:000> 0:000>
> bu1 `C:/dev/projects/tests/cdb_test/main.cpp:40`
*** WARNING: Unable to verify checksum for cdb_test.exe
0:000>
> l+t
Source options are 1:
1/t - Step/trace by source line
0:000>
> l+s
Source options are 5:
1/t - Step/trace by source line
4/s - List source code at prompt
0:000>
> l+o
Source options are d:
1/t - Step/trace by source line
4/s - List source code at prompt
8/o - Only show source code at prompt
0:000>
> g
Breakpoint 1 hit
> 40: printf("curr dir: %s\n", curr_dir);
0:000>
> k n
# ChildEBP RetAddr
00 0012ff68 00405058 cdb_test!main+0x45 [c:\dev\projects\tests\cdb_test\main.cpp @ 40]
01 0012ffb8 00404e9f cdb_test!__tmainCRTStartup+0x1a8 [f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 586]
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\WINDOWS\system32\kernel32.dll -
02 0012ffc0 7c817077 cdb_test!mainCRTStartup+0xf [f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 403]
WARNING: Stack unwind information not available. Following frames may be wrong.
03 0012fff0 00000000 kernel32!RegisterWaitForInputIdle+0x49
0:000>
> q
quit:
As you can see the debugger returned the correct line, but in C::B it is +1.
Breakpoint 1 hit
> 40: printf("curr dir: %s\n", curr_dir);
+1 for Jens' suggestion
-1 to Morten's, because OnAttach is declared in cbPlugin, so I can't change its name.
Another options is
MyPlugins::OnAttach(...)
{
cbDebugger::OnAttach(...);
....
}
But I don't like it too much.
Does any interest (apart from myself) remain in the experimental scrolling 'quickwatch' tooltip variable view?
Sounds interesting to me.
Obfuscated: I put together a stub Debugger plugin, but having a hard time figuring out how to get my plugin to show up in Debug->ActiveDebuggers menu. I have put this in my plugins OnAtttachReal:
DebuggerManager &dbg_manager = *Manager::Get()->GetDebuggerManager();
dbg_manager.RegisterDebugger(this, _T("testplugin"));
Most of the virtual method implementations are empty stubs at this point. What else to I need to add before the plugin shows up in the ActiveDebuggers submenu?
I made a little progress tonight on the Python Debugger. For anyone interested in following along, the code is here
svn checkout svn://svn.berlios.de/cbilplugin/trunk/PythonDebugger
It's still a mess and has quite a few bugs. But you can sort of step through a python program and add/remove breakpoints.
2. I noticed the the GDB_MI plugin was using some sort of smart pointer to store the breakpoint class instances (with the breakpoint class itself defined in the SDK). I would have thought the framework would provide the container classes...
Most of the time the plugin is the owner of the data and then the GUI classes query the debugger for this data, so they can display it in some way.
Probably this is not the best design, but I wanted to change as little as possible and also to minimize the copying of data.
Seems like a simple container defined in DebuggerManager.h (or wherever cbBreakpoint is defined) could take care of this:
class BreakpointList
{
cbBreakpoint *operator[](...); //array style access
int GetCount(); //returns number of breakpoints
cbBreakpoint *Add(file, line); //returns NULL if request invalid
bool Remove(cbBreakpoint *); //returns true if successful
int Find(cbBreakpoint *); //find index of breakpoint
void RemoveAll();
}
This way, implementation details like smartpointers can be hidden away from the user. Potentially useful features, such as sorting of breakpoints could also be implemented in this class. (Users with advanced needs can obviously still roll their own).
dmoore: probably it could be done this way, write it down in you nodes file and go on, later we can modify it, if you still think it is good thing. By the way smart pointer usage is a bit broken,
because AddBreakpoint should return the smart pointer, not the pointee...I've added a TODO to look at it.
I thought that there might have been an issue with shared_pointer usage but wasn't familiar enough to be sure. I wonder whether you really need them at all. Is there really that much of a cost to copy the breakpoint data?
If sharepointers are your preferred solution then I guess you should be doing something like:
struct cbBreakpointInternal
{
enum Type
{
Code,
Data
};
wxString m_filename;
wxString m_condition;
int m_line;
int m_ignoreCount;
Type m_type;
bool m_enabled;
bool m_useIgnoreCount;
bool m_useCondition;
wxString m_dataExpression;
bool m_breakOnRead;
bool m_breakOnWrite;
};
class cbBreakpoint
{
public:
cbBreakpoint();
cbBreakpoint(const wxString &filename, int line);
cbBreakpoint(const wxString &dataExpression, bool breakOnRead, bool breakOnWrite);
void SetLine(int line);
void SetCondition(wxString const &condition);
void SetIgnoreCount(int count);
void SetEnabled(bool flag);
void SetUseIgnoreCount(bool flag);
void SetUseCondition(bool flag);
const wxString & GetFilename() const;
const wxString & GetCondition() const;
int GetLine() const;
int GetIgnoreCount() const;
Type GetType() const;
bool IsEnabled() const;
bool UseIgnoreCount() const;
bool UseCondition() const;
const wxString& GetDataExpression() const;
bool GetBreakOnRead() const;
bool GetBreakOnWrite() const;
private:
shared_pointer<cbBreakpointInternal> ptr;
}
class BreakpointList
{
cbBreakpoint operator[](...); //array style access
int GetCount(); //returns number of breakpoints
cbBreakpoint Add(file, line); //returns NULL if request invalid
bool Remove(cbBreakpoint); //returns true if successful
int Find(cbBreakpoint); //find index of breakpoint
void RemoveAll();
}
then the framework would work with copies of cbBreakpoint rather than (cbBreakpoint *)
Pecan: Can you past the debugger's debug log?
p.s. Works here, gentoo linux 64bit, gcc 4.4.5, gdb 7.2
svn build rev 6973 (2011-02-07 13:39:14) gcc 4.3.1 Windows/unicode - 32 bit
// ---------------------------------------------------------------------
Step Into log
// ---------------------------------------------------------------------
PATH=.;C:\Usr\mingw431\bin;C:\WINDOWS\system32;C:\WINDOWS;.;c:\usr\bin;c:\usr\bin\subversion\
Command-line: C:\Usr\mingw431\bin\gdb.exe -nx -fullname -quiet -args ./debug/codetest.exe
Working dir : C:\temp\test\
> set prompt >>>>>>cb_gdb:
Reading symbols from C:\temp\test/./debug/codetest.exe...done.
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.0
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set print elements -1
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> source C:\Usr\Proj\cbDebug\trunk\src\output\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory C:/temp/test/
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 1120.0x454]
Error: dll starting at 0x77210000 not found.
Error: dll starting at 0x757e0000 not found.
Error: dll starting at 0x77210000 not found.
Error: dll starting at 0x77330000 not found.
Program exited normally.
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> quit
// ---------------------------------------------------------------------
Run to Cursor Log
// ---------------------------------------------------------------------
PATH=.;C:\Usr\mingw431\bin;C:\WINDOWS\system32;C:\WINDOWS;.;c:\usr\bin;c:\usr\bin\subversion\
Command-line: C:\Usr\mingw431\bin\gdb.exe -nx -fullname -quiet -args ./debug/codetest.exe
Working dir : C:\temp\test\
> set prompt >>>>>>cb_gdb:
Reading symbols from C:\temp\test/./debug/codetest.exe...done.
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.0
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set print elements -1
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> source C:\Usr\Proj\cbDebug\trunk\src\output\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory C:/temp/test/
>>>>>>cb_gdb:
> tbreak "C:/temp/test/main.cpp:5"
Temporary breakpoint 1 at 0x401366: file C:\temp\test\main.cpp, line 5.
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 4132.0x1200]
Error: dll starting at 0x77210000 not found.
Error: dll starting at 0x757e0000 not found.
Error: dll starting at 0x77210000 not found.
Error: dll starting at 0x77330000 not found.
Temporary breakpoint 1, main () at C:\temp\test\main.cpp:7
C:\temp\test\main.cpp:7:62:beg:0x401366
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
I need some help with the watches interface. How do I specify that a watch object is expandable without adding children? In python, everything is an object, so it should be possible to expand and see the child members of the object, but I don't want to actually add any children until the user expands the item.
Implement:
virtual void ExpandWatch(cbWatch *watch) = 0;
virtual void CollapseWatch(cbWatch *watch) = 0;
These are called when the user expands and collapses specific watch, see how it is done in the gdb/mi.
I think you should add dummy initial children (updating in progress for example)...
EDIT: Would also help if cbWatch included an easy way to recursively iterate through all children of a watch.
Patches welcome or please specify the requirement better :)
Pecan: I should try it on windows... can you try the latest debugger's branch nightly?
Also next patch is here: http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0019.2.patch
What it does:
1. Don't show the breakpoints for the inactive debuggers in the editor's margin. It is refreshed, when the active debugger changes;
2. Extract, some code from CompilerFinished, so it is simpler to implement and less error prone;
3. Document CompilerFinished;
4. Add some logging, when we try to interrupt the debugger;
5. Reorder the source files in the test project file (C::B wants to do it)
RE: "Step Into" does not break the program as a means to start the debugging session.
I tried the latest nightly *and* the latest debugger branch with the same results. I.e., using Step Into to start the pgm and break on the first statement does not do so. It acts like "run" instead.
This is a simple console "Hello World" generated by the wizard.
svn build rev 7017 (2011-02-19 13:44:32) gcc 4.5.1 Windows/unicode - 32 bit
I should also mention that the same problem occurs for me in the regular SVN branch. (windows)
If starting the debugging session with "Step Into" was never intended to work, it should be disabled.
Debugger Log:
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\temp\test\
Adding source dir: C:\temp\test\
Adding file: .\debug\StepIntoTest.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.0
Child process PID: 5116
Program exited normally.
Debugger finished with status 0
Debuggers Debug Log:
PATH=.;C:\Usr\mingw431\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Dell\Dell Wireless WLAN Card;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\usr\bin;C:\Program Files (x86)\CollabNet Subversion;C:\Program Files (x86)\TortoiseSVN\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Common Files\Adobe\AGL
Command-line: C:\Usr\mingw431\bin\gdb.exe -nx -fullname -quiet -args ./debug/StepIntoTest.exe
Working dir : C:\temp\test\
> set prompt >>>>>>cb_gdb:
Reading symbols from C:\temp\test/./debug/StepIntoTest.exe...done.
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.0
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set print elements -1
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> source c:\temp\Nightly\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory C:/temp/test/
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 5116.0xca8]
Error: dll starting at 0x77440000 not found.
Error: dll starting at 0x75ff0000 not found.
Error: dll starting at 0x77440000 not found.
Error: dll starting at 0x77560000 not found.
Program exited normally.
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> quit
1. http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0019.5.patch
Concerning this one: Hopefully you noticed that you've removed a work-around for windows, namely stated in this comment:
// under windows, 'start' segfaults with wx projects...
So either this is fixed in recent GDB's (did you try that functionality on all platforms?), or you might have overseen. Any comment on that?
0019.4 seems applied by Morten.
The main breakage will probably be related to the new "Debug -> Active debuggers -> Target's default" feature.
Also most of the exotic embedded targets won't have correct default settings for the debugger...
Is that because of the various instances of this:
- m_Programs.DBG = _T("ppc-insight.exe");
+ m_Programs.DBGconfig = wxEmptyString; // _T("ppc-insight.exe");
not sure why you are setting them to empty strings...
Patch for the unix test project
Index: src/plugins/debuggergdb/debuggergdb_test-unix.cbp
===================================================================
--- src/plugins/debuggergdb/debuggergdb_test-unix.cbp (revision 7038)
+++ src/plugins/debuggergdb/debuggergdb_test-unix.cbp (working copy)
@@ -31,7 +31,8 @@
<Add directory="$(#unittest_pp)/src" />
<Add directory="." />
<Add directory="../../include" />
- <Add directory="../../devel" />
+ <Add directory="../../include/scripting/include" />
+ <Add directory="../../include/scripting/sqplus" />
</Compiler>
<Linker>
<Add option="`wx-config --libs`" />
@@ -46,6 +47,8 @@
</ExtraCommands>
<Unit filename="debugger_defs.cpp" />
<Unit filename="debugger_defs.h" />
+ <Unit filename="debuggergdb_test_backtrace.cpp" />
+ <Unit filename="debuggergdb_test_common.h" />
<Unit filename="debuggergdb_test_main.cpp" />
<Unit filename="debuggergdb_test_parser.cpp" />
<Unit filename="debuggeroptionsprjdlg.h" />
Edit: also a patch to disable the compilation of the resource file:
Index: src/CodeBlocks-unix.cbp
===================================================================
--- src/CodeBlocks-unix.cbp (revision 7038)
+++ src/CodeBlocks-unix.cbp (working copy)
@@ -3286,6 +3304,8 @@
</Unit>
<Unit filename="src/resources/resources.rc">
<Option compilerVar="WINDRES" />
+ <Option compile="0" />
+ <Option link="0" />
<Option target="src" />
</Unit>
<Unit filename="src/resources/scripting_settings.xrc">
(There is a chance it won't apply)
Edit2: Here is the fixed 20.0.patch: http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0020.1.patch
This screenshot of yours looks very promising. What a nice work! 8)
Thanks :)
tO oBFusCATed:
Only these two are still broken. If I find any others I post them here.
{0x4080d8 "1st", 0x4080dc "2rd", '.' <repeats 48 times>, 0x408110 "3th"}
{0x4080d8 "1st", 0x4080dc '.' <repeats 14 times>, "#", '&' <repeats 16 times>, 0x4080fc "3th"}
Thanks for fixes, but after new commits I get SIGSEGV when I close Code::Blocks. It breaks in debuggermenu.cpp on line 199. Here is my debug log.Building to ensure sources are up-to-date
Selecting target:
src
Adding source dir: C:\proj1\clean_cb\src\
Adding source dir: C:\proj1\clean_cb\src\
Adding file: C:\proj1\clean_cb\src\devel\codeblocks.exe
Changing directory to: C:/proj1/clean_cb/src/devel
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.8
Child process PID: 992
At C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199
Continuing...
At C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199
Continuing...
At C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199
Program received signal SIGSEGV, Segmentation fault.
In wxMenuItem::Check () (C:\unix\wxWidgets-2.8.11\lib\gcc_dll\wxmsw28u_gcc_custom.dll)
#1 0x00cf4e9d in DebuggerMenuHandler::RebuildActiveDebuggersMenu (this=0x48401e0) at C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199
C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199:8979:beg:0xcf4e9d
At C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199
#1 0x00cf4e9d in DebuggerMenuHandler::RebuildActiveDebuggersMenu (this=0x48401e0) at C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199
C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199:8979:beg:0xcf4e9d
Continuing...
Program received signal SIGSEGV, Segmentation fault.
In wxMenuItem::Check () (C:\unix\wxWidgets-2.8.11\lib\gcc_dll\wxmsw28u_gcc_custom.dll)
#1 0x00cf4e9d in DebuggerMenuHandler::RebuildActiveDebuggersMenu (this=0x48401e0) at C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199
C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199:8979:beg:0xcf4e9d
At C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199
#1 0x00cf4e9d in DebuggerMenuHandler::RebuildActiveDebuggersMenu (this=0x48401e0) at C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199
C:\proj1\clean_cb\src\sdk\debuggermenu.cpp:199:8979:beg:0xcf4e9d
Continuing...
Program exited with code 030000000005.
Debugger finished with status 0
The patch is only partially applied in the debugger branch.
I just update to rev 7362, but found that it's hard to apply the patch. So, I revert back to rev 7342, and apply the patch. :D
@obF:
cbEVT_EDITOR_TOOLTIP is sent from cbEditor to notify all the plugins, and which is cause by receiving the DWellStart event from scintilla control.
Connect( m_ID, -1, wxEVT_SCI_DWELLSTART,
(wxObjectEventFunction) (wxEventFunction) (wxScintillaEventFunction)
&cbEditor::OnEditorDwellStart );
and
void cbEditor::OnEditorDwellStart(wxScintillaEvent& event)
{
if (!wxTheApp->IsActive())
return;
cbStyledTextCtrl* control = GetControl();
if (!control)
return;
wxRect screenRect = control->GetScreenRect();
wxPoint ptEvent(event.GetX(), event.GetY());
ptEvent = control->ClientToScreen(ptEvent);
wxPoint ptScreen = wxGetMousePosition();
wxPoint ptClient = control->ScreenToClient(ptScreen);
double distance = sqrt( (ptScreen.x - ptEvent.x) * (ptScreen.x - ptEvent.x)
+ (ptScreen.y - ptEvent.y) * (ptScreen.y - ptEvent.y) );
if (!screenRect.Contains(ptScreen) || distance > 10)
return;
int pos = control->PositionFromPoint(ptClient);
int style = control->GetStyleAt(pos);
NotifyPlugins(cbEVT_EDITOR_TOOLTIP, style, wxEmptyString, ptClient.x, ptClient.y);
wxScintillaEvent newEvent(event);
newEvent.SetX(ptClient.x);
newEvent.SetY(ptClient.y);
OnScintillaEvent(event);
}
and
void wxScintilla::NotifyParent (SCNotification* _scn)
{
SCNotification& scn = *_scn;
wxScintillaEvent evt (0, GetId());
evt.SetEventObject(this);
evt.SetPosition(scn.position);
evt.SetKey(scn.ch);
evt.SetModifiers(scn.modifiers);
switch (scn.nmhdr.code) {
case SCN_STYLENEEDED:
evt.SetEventType (wxEVT_SCI_STYLENEEDED);
break;
.......
.......
case SCN_DWELLSTART:
evt.SetEventType (wxEVT_SCI_DWELLSTART);
evt.SetX(scn.x);
evt.SetY(scn.y);
break;
the logic of sending SCN_DWELLSTART is much simple. in scintilla control, there is a timer, when the control received the MouseMove event, it will always restart the timer, if for about 500ms there is not MouseMove event happens, then the timer event handler will be fired, and send a SCN_DWELLSTART event.
Any MouseMove or keypress will let restart the timer and send a SCN_DWELLEND event.
Applying your patch, I see that both codecompletion plugin and debugger plugin will have a handler to response the cbEVT_EDITOR_TOOLTIP event from SDK, I found such code in debugger's handler:
void cbDebuggerPlugin::ProcessValueTooltip(CodeBlocksEvent& event)
{
event.Skip();
if (cbDebuggerCommonConfig::GetFlag(cbDebuggerCommonConfig::RequireCtrlForTooltips))
{
if (!wxGetKeyState(WXK_CONTROL))
return;
}
if (!ShowValueTooltip(event.GetInt()))
return;
EditorBase* base = event.GetEditor();
cbEditor* ed = base && base->IsBuiltinEditor() ? static_cast<cbEditor*>(base) : 0;
if (!ed)
return;
if (ed->IsContextMenuOpened())
return;
// get rid of other calltips (if any) [for example the code completion one, at this time we
// want the debugger value call/tool-tip to win and be shown]
if (ed->GetControl()->CallTipActive())
ed->GetControl()->CallTipCancel();
wxPoint pt;
pt.x = event.GetX();
pt.y = event.GetY();
const wxString &token = GetEditorWordAtCaret(&pt);
if (!token.empty())
{
pt = ed->GetControl()->ClientToScreen(pt);
OnValueTooltip(token, wxRect(pt.x - 5, pt.y, 10, 10));
}
}
This has the assumption that CC's handler is running before the debugger's handler. In-fact, there is no grantee which tip handler will run before other one. if CC's handler runs later, it will destroy the debugger's tip. This is a race condition. :D we have discussed before.
also, this code:
if (cbDebuggerCommonConfig::GetFlag(cbDebuggerCommonConfig::RequireCtrlForTooltips))
{
if (!wxGetKeyState(WXK_CONTROL))
return;
}
Does not works under Windows for sure. I have exam this condition before. Under windows, if you hold the control key, then the timer in scintilla control will notice that your have press a key, and do a restart always, and the time handler never fired. (I'm not sure how the scintilla control was implemented under Linux), even though the SCN_DWELLSTART is already send, when detecting the ctrl key, it will quickly send a SCN_DWELLEND event to destroy the tip.
The other issue is related in my post:
DWELL Windows Question (https://groups.google.com/d/topic/scintilla-interest/fRCdbpxqGPU/discussion)
I can filter the ctrl key, so the sci control send SCN_DWELLSTART event does not consider the ctrl condition. the client has the duty to check whether show or disable the tip depend on the ctrl key condition. After your tip window is shown, if you still hold on the ctrl key. the tip window will received the key press event, and destroy the tip. at this condition, you need to filter the ctrl key event in the tip window too.
One change in the scintilla editor should be like below:
Index: E:/code/cb/cb_debugger_branch/src/sdk/wxscintilla/src/scintilla/src/Editor.cxx
===================================================================
--- E:/code/cb/cb_debugger_branch/src/sdk/wxscintilla/src/scintilla/src/Editor.cxx (revision 7366)
+++ E:/code/cb/cb_debugger_branch/src/sdk/wxscintilla/src/scintilla/src/Editor.cxx (working copy)
@@ -5580,7 +5580,9 @@
}
int Editor::KeyDownWithModifiers(int key, int modifiers, bool *consumed) {
- DwellEnd(false);
+ //any key other than ctrl will cause the dwell end
+ if(modifiers!=SCI_CTRL)
+ DwellEnd(false);
int msg = kmap.Find(key, modifiers);
if (msg) {
if (consumed)
Compare with my last patch: my last patch (http://forums.codeblocks.org/index.php/topic,13875.msg93580.html#msg93580)
it seem you did not use "GDBTipWindowView" or "GDBTipWindow" to show the tip?
as you said:
- Added implementation of the tooltip using wxPropertyGrid
, does this tip only used for watch dialog?
I just exam the code:
void cbDebuggerPlugin::ProcessValueTooltip(CodeBlocksEvent& event)
{
event.Skip();
if (cbDebuggerCommonConfig::GetFlag(cbDebuggerCommonConfig::RequireCtrlForTooltips))
{
if (!wxGetKeyState(WXK_CONTROL))
return;
}
if (!ShowValueTooltip(event.GetInt()))
return;
EditorBase* base = event.GetEditor();
cbEditor* ed = base && base->IsBuiltinEditor() ? static_cast<cbEditor*>(base) : 0;
if (!ed)
return;
if (ed->IsContextMenuOpened())
return;
// get rid of other calltips (if any) [for example the code completion one, at this time we
// want the debugger value call/tool-tip to win and be shown]
if (ed->GetControl()->CallTipActive())
ed->GetControl()->CallTipCancel();
wxPoint pt;
pt.x = event.GetX();
pt.y = event.GetY();
const wxString &token = GetEditorWordAtCaret(&pt);
if (!token.empty())
{
pt = ed->GetControl()->ClientToScreen(pt);
OnValueTooltip(token, wxRect(pt.x - 5, pt.y, 10, 10));
}
}
So, where did you actually show the debugger's tip window? In the function
OnValueTooltip(token, wxRect(pt.x - 5, pt.y, 10, 10));
??
I can't see any code snippet to show the tip window. :D
Compare with my last patch: my last patch (http://forums.codeblocks.org/index.php/topic,13875.msg93580.html#msg93580)
it seem you did not use "GDBTipWindowView" or "GDBTipWindow" to show the tip?
No, I don't :)
See the ValueTooltip class.
Thanks, I found it, it was in parsing the gdb command output, here:
/**
* Command to display a tooltip about a variables value.
*/
class GdbCmd_TooltipEvaluation : public DebuggerCmd
{
wxRect m_WinRect;
wxString m_What;
wxString m_Type;
wxString m_Address;
wxString m_ParseFunc;
public:
/** @param what The variable to evaluate.
@param win A pointer to the tip window pointer.
@param tiprect The tip window's rect.
*/
GdbCmd_TooltipEvaluation(DebuggerDriver* driver, const wxString& what, const wxRect& tiprect, const wxString& w_type = wxEmptyString, const wxString& address = wxEmptyString)
: DebuggerCmd(driver),
m_WinRect(tiprect),
m_What(what),
m_Type(w_type),
m_Address(address)
{
m_Type.Trim(true);
m_Type.Trim(false);
m_Cmd = static_cast<GDB_driver*>(m_pDriver)->GetScriptedTypeCommand(w_type, m_ParseFunc);
if (m_Cmd.IsEmpty())
{
// if it's a pointer, automatically dereference it
if (w_type.Length() > 2 && // at least 2 chars
w_type.Last() == _T('*') && // last is *
w_type.GetChar(w_type.Length() - 2) != _T('*') && // second last is not * (i.e. doesn't end with **)
!w_type.Contains(_T("char "))) // not char* (special case)
{
m_What = wxT("*") + m_What;
}
m_Cmd << wxT("output ");
m_Cmd << m_What;
}
else
{
try
{
SqPlus::SquirrelFunction<wxString&> f(cbU2C(m_Cmd));
m_Cmd = f(w_type, what, 0, 0);
}
catch (SquirrelError e)
{
m_Cmd = cbC2U(e.desc);
m_pDriver->DebugLog(_T("Script exception: ") + m_Cmd);
}
}
}
void ParseOutput(const wxString& output)
{
wxString contents;
if (output.StartsWith(_T("No symbol ")) || output.StartsWith(_T("Attempt to ")))
contents = output;
else
{
if (!m_ParseFunc.IsEmpty())
{
try
{
SqPlus::SquirrelFunction<wxString&> f(cbU2C(m_ParseFunc));
contents << f(output, 0);
}
catch (SquirrelError e)
{
contents << cbC2U(e.desc);
m_pDriver->DebugLog(_T("Script exception: ") + contents);
}
}
else
{
contents << output;
// the following breaks the text when it *is* a hex number
// if (reGenericHexAddress.Matches(output))
// {
// contents.Replace(reGenericHexAddress.GetMatch(output, 1), _T(""));
// contents.Trim(false);
// }
}
}
contents.Trim(true);
contents.Trim(false);
GDBWatch::Pointer watch(new GDBWatch(m_What));
watch->SetType(m_Type);
ParseGDBWatchValue(*watch, contents);
if (Manager::Get()->GetDebuggerManager()->ShowValueTooltip(watch, m_WinRect))
{
watch->SetForTooltip(true);
m_pDriver->GetDebugger()->AddWatchNoUpdate(watch);
}
}
};
I know, I have it in the to-do.
This http://smrt.is-a-geek.org/codeblocks/TODO is the full to-do if someone is interested :)
too many todos.
about the python pretty printer, the latest cvs version of GDB has supply some command like:
"info pretty-printer" to show the installed pretty printers.
"enable/disable pretty-printer" to enable/disable this feature.
These feature can be added when you have some gdb's own pretty-printer utilities scripts in share/gdb folder (I only tested under MinGW).
Hm, OK, I'll give it a try, but I'm mostly on windows.
Please, be very careful with that one. It changes a very sensitive core component of C::B. Basically all elements using PipedProcess will be affected and change it's behaviour.
Also, I don't understand why this:
if (EatEOL(c)) {
wxString line;
line.swap(m_line);
return line;
}
...is needed instead of this:
if (EatEOL(c))
return m_line;
...and why in the end instead of this:
...not this is used:
(...which would read better...)
Also, what is a test case to reproduce the actual issue? Because I never had such and I don't know anybody else suffering from this implementation.
Please, be very careful with that one. It changes a very sensitive core component of C::B. Basically all elements using PipedProcess will be affected and change it's behaviour.
Yes, I know, I've tried to modify this part already, as you know I've failed miserably :(
Also, I don't understand why this:
if (EatEOL(c)) {
wxString line;
line.swap(m_line);
return line;
}
...
This is the same as:
wxString s=m_line;
m_line.clear();
return s;
But it is faster, it is pretty standard c++ trick :)
Also, what is a test case to reproduce the actual issue? Because I never had such and I don't know anybody else suffering from this implementation.
+1
svn wxpropgrid_debugger branch R7550 fails to build:
SqPlus::SQClassDef<wxArrayString>("wxArrayString").
emptyCtor().
func(&wxArrayString::Add, "Add").
func(&wxArrayString::Clear, "Clear").
// func(&wxArrayString::Index, "Index").
staticFuncVarArgs(&wxArrayString_Index, "Index", "*").
func(&wxArrayString::GetCount, "GetCount").
func(&wxArrayString::Item, "Item");
C:\dev\codeblocks\svn_dbgbranch_on20111101\src\sdk\scripting\bindings\sc_wxtypes.cpp:251: error: no matching function for call to 'SqPlus::SQClassDef<wxArrayString>::func(<unresolved overloaded function type>, const char [5])'
Same problem exists in trunk R7550 retrieved shortly before debugger branch.
Additionally, debugger branch also seems to be missing parenthesis when build attempted with wx 2.9(.2)
sdk\cbplugin.cpp:640-644
#if wxCHECK_VERSION(2, 9, 0)
Manager::Get()->GetLogManager()->DebugLog(F(_("Switching layout to \"%s\""), name.wx_str())); <<<==== I added final paren here
#else
Manager::Get()->GetLogManager()->DebugLog(F(_("Switching layout to \"%s\""), name.c_str()));
#endif
svn build rev 7587 (2011-11-12 18:16:49) gcc 4.3.1 Windows/unicode - 32 bit
At compileroptionsdlg.cpp statement 2293
// compiler set buttons
if (!m_pProject)
{
en = !data; // global options selected
m_pProject is always 0x0. If I place the following before 2293
if (!m_pProject) asm("int3"); /*trap*/
the trap never occurs whether there's a project loaded or not.
The old code used to read:
// compiler set buttons
if (XRCCTRL(*this, "btnAddCompiler", wxButton)) // only if exist
{
en = !data; // global options selected
Something is strange here...
http://dl.dropbox.com/u/46870262/ScreenShot00749.jpg
To reproduce, try to run a batch build like this:
Here comes a backtrace:
sdk/wxscintilla/src/wxscintilla.cpp:247
sdk/wxscintilla/src/wxscintilla.cpp:1721
src/disassemblydlg.cpp:55
src/debugger_interface_creator.cpp:111
sdk/debuggermanager.cpp:990
src/main.cpp:787
src/main.cpp:702
src/main.cpp:567
src/app.cpp:407
src/app.cpp:641
The pointers to the wxscintilla.cpp and main.cpp source files might not be meaningful, as they differ from the once of the debugger branch.
I've happened on a situation where the debugger cannot be paused or stopped.
SVN 7631 debugger branch
Here are the steps
1) Load the debugger branch BrowseTracker.cbp
2) Place a trap at stmt 443
// ----------------------------------------------------------------------------
void JumpTracker::OnMenuJumpBack(wxCommandEvent &/*event*/)
// ----------------------------------------------------------------------------
{asm("int3"); /*trap*/
#if defined(LOGGING)
LOGIT( _T("JT [%s]"), _T("OnMenuJumpBack"));
#endif
3) compile without -g and with -s
4) run the debugger with BrowseTracker loaded.
5) load codeblocks.cbp into the debugee
6) click anywhere in a source file, page down two pages and click again
7) click on menu, view, jump, jump back ;the debugee CB will trap.
8) click on debug toolbar "next line"
All but the pause and stop buttons will then disable, but the debugger will forever be "Trying to pause the run in progress"
Debugger log
----------------
Active debugger config: GDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
default
Adding source dir: C:\Usr\Proj\cbDebug\trunk\src\plugins\contrib\BrowseTracker\
Adding source dir: C:\Usr\Proj\cbDebug\trunk\src\plugins\contrib\BrowseTracker\
Adding file: ..\..\..\devel\codeblocks.exe
Changing directory to: C:/Usr/Proj/cbDebug/trunk/src/plugins/contrib/BrowseTracker/.
Starting debugger: gdb.exe -nx -fullname -quiet -args ../../../devel/codeblocks.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.0
Child process PID: 3472
Program received signal SIGTRAP, Trace/breakpoint trap.
In ?? () (C:\Usr\Proj\cbDebug\trunk\src\devel\share\codeblocks\plugins\BrowseTracker.dll)
Debugger(debug) log
-------------------
PATH=.;C:\Usr\Proj\cbDebug\trunk\src\devel;C:\Usr\Proj\wxWidgets2810\lib\gcc_dll;C:\Usr\mingw431\bin;C:\Usr\Proj\ImageCraft\ImageCraft_AVR\trunk\src\output;C:\WINDOWS\system32;C:\WINDOWS;.;c:\usr\bin;c:\usr\bin\subversion\
Command-line: gdb.exe -nx -fullname -quiet -args ../../../devel/codeblocks.exe
Working dir : C:\Usr\Proj\cbDebug\trunk\src\plugins\contrib\BrowseTracker
> set prompt >>>>>>cb_gdb:
Reading symbols from C:\Usr\Proj\cbDebug\trunk\src\plugins\contrib\BrowseTracker/../../../devel/codeblocks.exe...done.
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.0
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set print elements -1
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source c:\Usr\Proj\cbDebug\trunk\src\output\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory C:/Usr/Proj/cbDebug/trunk/src/plugins/contrib/BrowseTracker/
>>>>>>cb_gdb:
> set args --debug-log --multiple-instance -na -ns -nd
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 3472.0xb54]
a70000.
[New Thread 3472.0xa04]
[New Thread 3472.0x9fc]
[New Thread 3472.0xf84]
[New Thread 3472.0x10f8]
[New Thread 3472.0x458]
[New Thread 3472.0xe58]
[New Thread 3472.0x284]
[New Thread 3472.0x4f0]
[New Thread 3472.0xbac]
[New Thread 3472.0xb7c]
[New Thread 3472.0x15c]
[New Thread 3472.0x137c]
Error: dll starting at 0x76e90000 not found.
Error: dll starting at 0x751c0000 not found.
Error: dll starting at 0x76e90000 not found.
Error: dll starting at 0x76d90000 not found.
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
(... lots of these...)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
Program received signal SIGTRAP, Trace/breakpoint trap.
0x04c37a8a in ?? () from C:\Usr\Proj\cbDebug\trunk\src\devel\share\codeblocks\plugins\BrowseTracker.dll
Current language: auto
The current source language is "auto; currently c++".
>>>>>>cb_gdb:
> set debugevents off
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
>>>>>>cb_gdb:
> bt 30
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x28f8a3 in read in psymtab, but not in symtab.)
(...lots and lots of these...)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
#0 0x04c37a8a in ?? () from C:\Usr\Proj\cbDebug\trunk\src\devel\share\codeblocks\plugins\BrowseTracker.dll
#1 0x0028f8a4 in ?? ()
#2 0x0028f8a4 in ?? ()
#3 0x0028f440 in ?? ()
#4 0x101a398b in wxMenuBase::UpdateUI(wxEvtHandler*) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#5 0x10095099 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#6 0x100951bb in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#7 0x100977e6 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#8 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#9 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#10 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#11 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#12 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#13 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#14 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#15 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#16 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#17 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#18 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#19 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#20 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#21 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#22 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#23 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#24 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#25 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#26 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#27 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#28 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#29 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
>>>>>>cb_gdb:
Here's the "stopping event"
Active debugger config: GDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
default
Adding source dir: C:\Usr\Proj\cbDebug\trunk\src\plugins\contrib\BrowseTracker\
Adding source dir: C:\Usr\Proj\cbDebug\trunk\src\plugins\contrib\BrowseTracker\
Adding file: ..\..\..\devel\codeblocks.exe
Changing directory to: C:/Usr/Proj/cbDebug/trunk/src/plugins/contrib/BrowseTracker/.
Starting debugger: gdb.exe -nx -fullname -quiet -args ../../../devel/codeblocks.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.0
Child process PID: 3528
Program received signal SIGTRAP, Trace/breakpoint trap.
In ?? () (C:\Usr\Proj\cbDebug\trunk\src\devel\share\codeblocks\plugins\BrowseTracker.dll)
Trying to pause the running process...
Trying to pause the running process...
Trying to pause the running process...
PATH=.;C:\Usr\Proj\cbDebug\trunk\src\devel;C:\Usr\Proj\wxWidgets2810\lib\gcc_dll;C:\Usr\mingw431\bin;C:\Usr\Proj\ImageCraft\ImageCraft_AVR\trunk\src\output;C:\WINDOWS\system32;C:\WINDOWS;.;c:\usr\bin;c:\usr\bin\subversion\
Command-line: gdb.exe -nx -fullname -quiet -args ../../../devel/codeblocks.exe
Working dir : C:\Usr\Proj\cbDebug\trunk\src\plugins\contrib\BrowseTracker
> set prompt >>>>>>cb_gdb:
Reading symbols from C:\Usr\Proj\cbDebug\trunk\src\plugins\contrib\BrowseTracker/../../../devel/codeblocks.exe...done.
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.0
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set print elements -1
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source c:\Usr\Proj\cbDebug\trunk\src\output\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory C:/Usr/Proj/cbDebug/trunk/src/plugins/contrib/BrowseTracker/
>>>>>>cb_gdb:
> set args --debug-log --multiple-instance -na -ns -nd
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 3528.0x258]
d=600, DBG_CONTINUE);
[New Thread 3528.0xcd0]
[New Thread 3528.0x11d8]
[New Thread 3528.0xe14]
[New Thread 3528.0xaf8]
[New Thread 3528.0x1220]
[New Thread 3528.0xb5c]
[New Thread 3528.0x5bc]
[New Thread 3528.0xe58]
[New Thread 3528.0xeb4]
[New Thread 3528.0xc7c]
[New Thread 3528.0x204]
[New Thread 3528.0x12f4]
Error: dll starting at 0x76e90000 not found.
Error: dll starting at 0x751c0000 not found.
Error: dll starting at 0x76e90000 not found.
Error: dll starting at 0x76d90000 not found.
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
[New Thread 3528.0x10bc]
Program received signal SIGTRAP, Trace/breakpoint trap.
0x04c37a8a in ?? () from C:\Usr\Proj\cbDebug\trunk\src\devel\share\codeblocks\plugins\BrowseTracker.dll
Current language: auto
The current source language is "auto; currently c++".
>>>>>>cb_gdb:
> set debugevents off
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
>>>>>>cb_gdb:
> bt 30
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
(... many duplicate lines removed...)
warning: (Internal error: pc 0x100977a6 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
#0 0x04c37a8a in ?? () from C:\Usr\Proj\cbDebug\trunk\src\devel\share\codeblocks\plugins\BrowseTracker.dll
#1 0x0028f8a4 in ?? ()
#2 0x0028f8a4 in ?? ()
#3 0x0028f440 in ?? ()
#4 0x101a398b in wxMenuBase::UpdateUI(wxEvtHandler*) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#5 0x10095099 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#6 0x100951bb in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#7 0x100977e6 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#8 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#9 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#10 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#11 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#12 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#13 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#14 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#15 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#16 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#17 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#18 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#19 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#20 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#21 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#22 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#23 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#24 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#25 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#26 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#27 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#28 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
#29 0x100977a7 in wxEvtHandler::ProcessEvent(wxEvent&) () from C:\Usr\Proj\cbDebug\trunk\src\devel\wxmsw28u_gcc_custom.dll
>>>>>>cb_gdb:
> next
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x4c37a8a in read in psymtab, but not in symtab.)
Cannot find bounds of current function
>>>>>>cb_gdb:
With simple "Hello World" the program steps once and runs to end.
Does it happen for you, too?
Yes, it does.
Here is a patch that fixes it. Is it OK to commit it?
Explanation:
Before my commit it was working, because CreateToolbars() was called before creating the debugger related windows. Now it is called after that.
And for some strange reason CreateToolbars is loading the resources for the second time.
Index: src/src/app.cpp
===================================================================
--- src/src/app.cpp (revision 7634)
+++ src/src/app.cpp (working copy)
@@ -525,12 +525,15 @@
// set safe-mode appropriately
PluginManager::SetSafeMode(m_SafeMode);
- if(!m_Batch && m_Script.IsEmpty() && !InitXRCStuff())
+ if(!m_Batch && m_Script.IsEmpty())
{
// wsSafeShowMessage(_T("Fatal error"), _T("Initialisation of resources failed."));
return false;
}
+ if (!InitXRCStuff())
+ return false;
+
InitLocale();
if(m_DDE && !m_Batch && Manager::Get()->GetConfigManager(_T("app"))->ReadBool(_T("/environment/use_ipc"), true))
Argh, you're right.
What about this version then:
Index: C:/dev/cb_dev/debugger1/src/src/app.cpp
===================================================================
--- C:/dev/cb_dev/debugger1/src/src/app.cpp (revision 7633)
+++ C:/dev/cb_dev/debugger1/src/src/app.cpp (working copy)
@@ -524,8 +524,7 @@
// set safe-mode appropriately
PluginManager::SetSafeMode(m_SafeMode);
-
- if(!m_Batch && m_Script.IsEmpty() && !InitXRCStuff())
+ if(!InitXRCStuff() && !m_Batch && m_Script.IsEmpty())
{
// wsSafeShowMessage(_T("Fatal error"), _T("Initialisation of resources failed."));
return false;
I've search the svn history and it seems that the check was added on purpose by Thomas in r2706.
Thomas any comments on this?
I had the following issue several times now:
While debugging, I pressed "Next" several times to debug step-by-step and suddenly all debugger buttons are greyed out, except the "Pause " and "Stop". But hitting these does nothing. I have to kill the debugger (notice that killing the debugger's debuggee does nothing, too) to get C::B back to work.
In the debuggers debug log I see:
[debug]> next
[debug]Cannot find bounds of current function
[debug]>>>>>>cb_gdb:
Trying to pause the running process...
And that's basically it. Even if hitting the "Stop" button several times.
What's causing this? Anybody here experiencing the same?
I didn't find one yet... let me further investigate.
Got one!
- Create a hello world project
- Set a BP in the first line in "main".
- Step though the code using F7
- After a few steps I come to that point.
Here is the log:
[debug]>>>>>>cb_gdb:
At c:\users\morten\desktop\mycon\main.cpp:7
[debug]> set debugevents off
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]c:\users\morten\desktop\mycon\main.cpp:8:99:beg:0x401342
[debug]>>>>>>cb_gdb:
At c:\users\morten\desktop\mycon\main.cpp:8
[debug]> next
[debug]c:\users\morten\desktop\mycon\main.cpp:9:114:beg:0x401347
[debug]>>>>>>cb_gdb:
At c:\users\morten\desktop\mycon\main.cpp:9
[debug]> next
[debug]250 ../mingw/crt1.c: No such file or directory.
[debug]__mingw_CRTStartup () at ../mingw/crt1.c:250
[debug] in ../mingw/crt1.c
[debug]>>>>>>cb_gdb:
Trying to pause the running process...
Trying to pause the running process...
Trying to pause the running process...
Note that "Trying to pause the running process..." comes from trying to press pause or stop. And also notice that I hit far more on "Step" than shown in the log...
Can you try this patch and then tell me if it works:
Index: src/plugins/debuggergdb/gdb_commands.h
===================================================================
--- src/plugins/debuggergdb/gdb_commands.h (revision 7700)
+++ src/plugins/debuggergdb/gdb_commands.h (working copy)
@@ -681,9 +681,9 @@
const wxArrayString &lines = GetArrayFromString(output, _T('\n'));
for (size_t ii = 0; ii < lines.GetCount(); ++ii)
{
- if (lines[ii].StartsWith(wxT("No symbol table loaded."))
- || lines[ii].StartsWith(wxT("No executable file specified."))
- || lines[ii].StartsWith(wxT("No executable specified.")))
+ if (lines[ii].StartsWith(wxT("No symbol table loaded"))
+ || lines[ii].StartsWith(wxT("No executable file specified"))
+ || lines[ii].StartsWith(wxT("No executable specified")))
{
// log this and quit debugging
m_pDriver->Log(_("Starting the debuggee failed: ")+lines[ii]);
About the Chinese characters: I don't see any on linux, but I guess something is not initialized correctly, can you try to debug it?
PS, you can not set a breakpoint in a file with spaces under gdb(Windows).
This works very well for me if you have set the "GDB workaround in the advanced compiler options.
I have already have this option checked.
See my log (with spaces)
Debugger name and version: GNU gdb (GDB) 7.4.50.20120117-cvs
...
[debug]>>>>>>cb_gdb:
[debug]> directory E:/code/cb/TEST_C~1/SPACEF~1/hi/
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> break "E:/code/cb/test_code/space folder/hi/main.cpp:8"
[debug]Breakpoint 2 at 0x401402: file E:\code\cb\test_code\space folder\hi\main.cpp, line 8.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]gdb: windows_init_thread_list
Child process PID: 4164
[debug][New Thread 4164.0x1cc]
[debug]Error in re-setting breakpoint 2: Function "E:/code/cb/test_code/space folder/hi/main.cpp:8" not defined.
[debug][Inferior 1 (process 4164) exited normally]
[debug]>>>>>>cb_gdb:
Error in re-setting breakpoint 2: Function "E:/code/cb/test_code/space folder/hi/main.cpp:8" not defined.
[Inferior 1 (process 4164) exited normally]
[debug]> set debugevents off
[debug]>>>>>>cb_gdb:
[debug]> quit
Debugger finished with status 0
Below is path with no space:
Debugger name and version: GNU gdb (GDB) 7.4.50.20120117-cvs
...
[debug]>>>>>>cb_gdb:
[debug]> directory E:/code/cb/test_code/nospace/hi/
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> break "E:/code/cb/test_code/space folder/hi/main.cpp:8"
[debug]No source file named E:/code/cb/test_code/space folder/hi/main.cpp.
[debug]Breakpoint 2 ("E:/code/cb/test_code/space folder/hi/main.cpp:8) pending.
[debug]>>>>>>cb_gdb:
[debug]> break "E:/code/cb/test_code/nospace/hi/main.cpp:7"
[debug]Breakpoint 3 at 0x4013de: file E:\code\cb\test_code\nospace\hi\main.cpp, line 7.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]gdb: windows_init_thread_list
Child process PID: 6040
[debug][New Thread 6040.0xa34]
[debug]Breakpoint 3, main () at E:\code\cb\test_code\nospace\hi\main.cpp:7
[debug]E:\code\cb\test_code\nospace\hi\main.cpp:7:62:beg:0x4013de
[debug]>>>>>>cb_gdb:
At E:\code\cb\test_code\nospace\hi\main.cpp:7
[debug]> set debugevents off
[debug]>>>>>>cb_gdb:
Hey, I found a potential issue. :)
I have two project opened.(one have space in path, the other does not), both have main.cpp and I set one breakpoint per file.
I'm debugging the project with no space(active project), but the log shows that the BP in file with space (non active project) are still sent.
You see the second log:
[debug]> break "E:/code/cb/test_code/space folder/hi/main.cpp:8"
[debug]No source file named E:/code/cb/test_code/space folder/hi/main.cpp.
[debug]Breakpoint 2 ("E:/code/cb/test_code/space folder/hi/main.cpp:8) pending.
[debug]>>>>>>cb_gdb:
[debug]> break "E:/code/cb/test_code/nospace/hi/main.cpp:7"
[debug]Breakpoint 3 at 0x4013de: file E:\code\cb\test_code\nospace\hi\main.cpp, line 7.
Maybe, we should give a message or warning on this cases?
Take a look here: http://docs.wxwidgets.org/2.9.3/overview_debugging.html
You can try to set wxDEBUG_LEVEL==0 or provide a null assert handler.
If this doesn't help, you can try to skip the warning line in the GDB_driver::ParseOutput
Put something like this
if (line[i].StartsWith(wxT("warning:"))
{
m_pDBG->Log(wxT("skipped:")+lines[i]);
}
before the "else if (lines.StartsWith(_T("Error ")) ||" line
I've not tried the code, so it might cause problems.
since last weeks changes (debugger plugin // cc plugin) : failing to build :
[even did make clean up to .configure]
make[4]: *** No rule to make target `ccdebuginfo.cpp', needed by `ccdebuginfo.lo'.
...so you see that due to the fact that some messages are strangely interrupted (WHY btw - I think this is a bug!!!) it does not really help. I get less messages, but still too much and still the debugger freezes after some time. Maybe a low-level filtering as suggested will help...
Does this code
static wxString buffer;
buffer << output << _T('\n');
m_pDBG->DebugLog(output);
In the function void GDB_driver::ParseOutput(const wxString& output) cause this issue?
Ok - here comes another issue... ;-)
- consider this code:
#include <iostream>
void funca()
{
std::cout << "Hello!" << std::endl;
}
int main()
{
funca();
return 0;
}
- place a BP at the line "funca();"
- continue to step through it with Next (F7)
- after a few times, everything comes to a halt.
You cannot stop/pause/continue/whats-over the debugger or C::B. You have to kill the debugger (not the debugee - that's impossible!) using the task manager.
Here is the debuggers debug log:
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.3
[debug]Copyright (C) 2011 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law. Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.3
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set debugevents on
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source C:\Devel\CodeBlocks\src\devel29\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory C:/Users/morten/Desktop/MyCon/
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/morten/Desktop/MyCon/main.cpp:10"
[debug]Breakpoint 2 at 0x401347: file C:\Users\morten\Desktop\MyCon\main.cpp, line 10.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]gdb: windows_init_thread_list
Child process PID: 7980
[debug][New Thread 7980.0x18c]
[debug]Breakpoint 2, main () at C:\Users\morten\Desktop\MyCon\main.cpp:10
[debug]c:\users\morten\desktop\mycon\main.cpp:10:101:beg:0x401347
[debug]>>>>>>cb_gdb:
At c:\users\morten\desktop\mycon\main.cpp:10
[debug]> set debugevents off
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]c:\users\morten\desktop\mycon\main.cpp:11:115:beg:0x40134c
[debug]>>>>>>cb_gdb:
At c:\users\morten\desktop\mycon\main.cpp:11
[debug]> next
[debug]c:\users\morten\desktop\mycon\main.cpp:12:130:beg:0x401351
[debug]>>>>>>cb_gdb:
At c:\users\morten\desktop\mycon\main.cpp:12
[debug]> next
[debug]250 ../mingw/crt1.c: No such file or directory.
[debug]__mingw_CRTStartup () at ../mingw/crt1.c:250
[debug] in ../mingw/crt1.c
[debug]>>>>>>cb_gdb:
Ok - here comes another issue... ;-)
- consider this code:
#include <iostream>
void funca()
{
std::cout << "Hello!" << std::endl;
}
int main()
{
funca();
return 0;
}
- place a BP at the line "funca();"
- continue to step through it with Next (F7)
- after a few times, everything comes to a halt.
It works fine here xunxun's gcc 4.6.3 and gdb cvs build my self.
[debug]>>>>>>cb_gdb:
[debug]> break "E:/code/cb/test_code/mortenr2012-01-15/main.cpp:10"
[debug]Breakpoint 2 at 0x401697: file E:\code\cb\test_code\mortenr2012-01-15\main.cpp, line 10.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: E:\code\cb\test_code\mortenr2012-01-15\bin\Debug\mortenr2012-01-15.exe
[debug]gdb: windows_init_thread_list
Child process PID: 5332
[debug][New Thread 5332.0x1178]
[debug]Breakpoint 2, main () at E:\code\cb\test_code\mortenr2012-01-15\main.cpp:10
[debug]E:\code\cb\test_code\mortenr2012-01-15\main.cpp:10:101:beg:0x401697
[debug]>>>>>>cb_gdb:
At E:\code\cb\test_code\mortenr2012-01-15\main.cpp:10
[debug]> set debugevents off
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]E:\code\cb\test_code\mortenr2012-01-15\main.cpp:11:115:beg:0x40169c
[debug]>>>>>>cb_gdb:
At E:\code\cb\test_code\mortenr2012-01-15\main.cpp:11
[debug]> next
[debug]E:\code\cb\test_code\mortenr2012-01-15\main.cpp:12:130:beg:0x4016a1
[debug]>>>>>>cb_gdb:
At E:\code\cb\test_code\mortenr2012-01-15\main.cpp:12
[debug]> next
[debug]0x0040146d in __tmainCRTStartup ()
[debug]>>>>>>cb_gdb:
In __tmainCRTStartup () ()
[debug]> bt 30
[debug]#0 0x0040146d in __tmainCRTStartup ()
[debug]#1 0x7c817077 in RegisterWaitForInputIdle () from C:\WINDOWS\system32\kernel32.dll
[debug]#2 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:
[debug]> next
[debug]Single stepping until exit from function __tmainCRTStartup,
[debug]which has no line number information.
[debug][Inferior 1 (process 5332) exited normally]
[debug]>>>>>>cb_gdb:
[Inferior 1 (process 5332) exited normally]
[debug]> quit
Debugger finished with status 0