Author Topic: Splitting debugger in two - specific debugger and common GUI  (Read 429078 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #45 on: September 09, 2009, 09:01:24 pm »
After removing the png's at the end with a text-editor (on linux), I was able to apply the patch against clean svn r5755 on windows with TortoiseSVN.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #46 on: September 09, 2009, 09:18:29 pm »
What do you use to apply the patch?
When I used "tortoisesvn->apply patch", it told me that there are binary files but it skipped them and the rest was applied correctly (I think)

Here is the full source: http://smrt.is-a-geek.org/codeblocks/dbg_refactor/cb_dbg_refactor.zip
I prefer to send it all so it will be easier for you to do a full tree diff (I've used winmerge on windows to do it).
The source is base on r5755.

You can try this patch: http://smrt.is-a-geek.org/codeblocks/dbg_refactor/dbg_refactor0003_win_svn_no_png.patch
I've removed the pngs, don't know why they are there :(

I've tried to apply the patch with the patch command line tool on linux, but it doesn't recognised the moved files as such and keeps telling me that the patch is reversed :(

Sorry for the annoyance and the problems with the applying. :(
p.s. I've created the patch  (svn_win) with "tortoisesvn -> create patch", might that cause the problems? I can recreate it with "svn diff"
p.s.s. jens have done the same as my no_png file :)

p.s.s.s. Just to remind that you need wxPropGrid from svn in order to compile it
« Last Edit: September 09, 2009, 09:21:58 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #47 on: September 10, 2009, 08:09:56 am »
p.s. I've created the patch  (svn_win) with "tortoisesvn -> create patch", might that cause the problems? I can recreate it with "svn diff"
SVN diff is always the way to prefer as this will work reliable. Actually TortoiseSVN should do the same... but it seems not.

p.s.s.s. Just to remind that you need wxPropGrid from svn in order to compile it
Ooops - just realised exactly that need.

P.s.: Instead of P.s.s.s I guess it should have read P.p.p.s ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #48 on: September 10, 2009, 09:37:37 am »
Ok... merging is (sowmehow) done. I am starting to compile now. Something I have noticed:
You also have moved resource files (XRC's) to the SDK resources but left them in the debugger, too. Doesn't this result in a conflict? Should I better remove the duplicate resources from the debugger folder (in plugins), too?

Oh - and how did you compile the propgrid from SVN? Do you use wx29 already after all? (propgrid is not part of the wx 2.8.10 sources AFAIK...)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #49 on: September 10, 2009, 11:03:06 am »
SVN diff is always the way to prefer as this will work reliable. Actually TortoiseSVN should do the same... but it seems not.

p.s.s.s. Just to remind that you need wxPropGrid from svn in order to compile it
Ooops - just realised exactly that need.

Ok... merging is (sowmehow) done. I am starting to compile now. Something I have noticed:
You also have moved resource files (XRC's) to the SDK resources but left them in the debugger, too. Doesn't this result in a conflict? Should I better remove the duplicate resources from the debugger folder (in plugins), too?
I've move the files, so the one that are in both sdk and the debugger, should be removed from the debugger.

Oh - and how did you compile the propgrid from SVN? Do you use wx29 already after all? (propgrid is not part of the wx 2.8.10 sources AFAIK...)
I'm using wx2.8.10 + self-compiled wxpropgrid by a self-made C::B project :)
Here it is http://smrt.is-a-geek.org/codeblocks/dbg_refactor/wxpropgrid-svn.zip


P.s.: Instead of P.s.s.s I guess it should have read P.p.p.s ;-)
Thanks :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #50 on: September 10, 2009, 12:21:27 pm »
Hmmmm...:
Code
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...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #51 on: September 10, 2009, 02:44:35 pm »
Hmmmm...:
Nah - forget about it. Still duplicate files in the debugger plugin folder that moved to SDK. It has compiled successfully!!! :D

Now let's give it a try... 8)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #52 on: September 10, 2009, 05:17:47 pm »
Now let's give it a try... 8)
Ok - first impression:
- it works partially :)
- it does not stop at a BP
- if I enabled "evaluation expression under cursor" C::B crashes
...digging into it. (Compiler: 4.4.0 TDM, Debugger 6.8-3.)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #53 on: September 10, 2009, 05:58:35 pm »
What are you debugging?
Is it something complex or a simple test project you can provide, so I can test too?
I've not tested it thoroughly on windows. :(
I've done a simple test and it stopped on the breakpoint (I think).
Do you see the breakpoint in the breakpoints dialog and do you see the break commands in the "debugger log (debug)" window?
Does "run to cursor" work.
"Evaluate expression" doesn't crash here, if you provide an example project I'll see what's doing on.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #54 on: September 10, 2009, 06:07:40 pm »
What are you debugging?
I am debugging a hello world app ;-)

Do you see the breakpoint in the breakpoints dialog and do you see the break commands in the "debugger log (debug)" window?
No. I don't come that far.

"Evaluate expression" doesn't crash here, if you provide an example project I'll see what's doing on.
It was not that one but enabling the debugger's debug log (in the debuggers options).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #55 on: September 10, 2009, 06:36:29 pm »
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:

Code
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;
 }
« Last Edit: September 10, 2009, 06:50:37 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #56 on: September 10, 2009, 08:38:31 pm »
With the patch above, I get this error on linux:
Code
/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
« Last Edit: September 10, 2009, 08:41:50 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #57 on: September 10, 2009, 09:03:25 pm »
Which is the best way I can fix it?
I've attached a modified logmanager.h which I will check-in later. Please use that instead of cbAssert in that case. Cause otherwise badly written plugins will terminate C::B.

[attachment deleted by admin]
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #58 on: September 10, 2009, 09:27:58 pm »
Morten are you sure?
I think that cbAssert does nothing in release builds?
If we have a definition of release builds :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #59 on: September 10, 2009, 09:52:38 pm »
I think that cbAssert does nothing in release builds?
That's true. However - as we rarely doing true debug builds we would not see it anyways...

BTW: Your error: You'll need to include cbexcepton.h in logmanager.h.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ