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

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #225 on: August 06, 2010, 05:26:08 am »
a silly question:

If the new debugger plugin use the "MI" interface, can we still enter some command in “CLI” mode as the current implementation?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #226 on: August 06, 2010, 09:32:41 am »
If the new debugger plugin use the "MI" interface, can we still enter some command in “CLI” mode as the current implementation?
Yes you can, look at the gdb docs for details.
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #227 on: August 06, 2010, 01:43:50 pm »
Yes you can
Ok, this is an enough good answer. :D thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #228 on: August 15, 2010, 01:51:59 pm »
Next patch: http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0015.2.patch

1. fixes formatting
2. improves the parsing of watch variables

Unittest project for the debugger plugin: http://smrt.is-a-geek.org/codeblocks/patches/dbg/test_dbg.zip

1. extract the zip file in the src/ directory
2. add the test project in a workspace with the codeblock-unix.cbp
3. make codeblocks to depend on the test project

The provided project is linux only and requires unittest++ to compile.

Any feedback is welcome
(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 #229 on: August 22, 2010, 09:39:28 pm »
OK, Next patch: http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0016.0.patch

What it does:
1. Adds another command step into instruction.
1.1. Added toolbar button (please add the proper icons from the nightly thread)
1.2. Added menu item
2. Rearranges the icons on the toolbar a bit
(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 #230 on: August 23, 2010, 12:12:27 am »
And another one: http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0016.1.patch

Fixed this bug:



At first no window was ticked. I clicked on "Watches" (which was already visible), and it go its tick. Disassembly window was not shown. I clicked on it, I got it, and the tick was also there. CPU Registers was shown from the beginning, never clicked it, never got the tick.
(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 cbexaminr

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #231 on: September 02, 2010, 05:03:43 pm »
FWIW -

In svn branch wxpropgrid_debugger, file plugins\debuggergdb\gdb_commands.h, "class GdbCmd_TooltipEvaluation", routine "void ParseOutput(const wxString& output)", toward the end of the routiine, I think there is a problem with the variable s_pWin.

It appears some code was added (relative to current trunk) to avoid invoking the tipwindow if the mouse has moved.  As a result of that addition, it seems s_pWin can be left with a value of an item that was "Close()"ed in a previous iteration, such that subsequent attempts to "Close()" that old item could occur, which might be a bad thing.

Didn't see anywhere else where s_pWin was being cleared to avoid this potential problem, but I may be overlooking something - and I don't know for sure that the "Close()" will render the item invalid, but...

it looks suspicious to me.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #232 on: September 02, 2010, 05:07:39 pm »
Will look at it...
(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 #233 on: September 03, 2010, 02:33:41 am »
Next patch: http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0016.3.1.patch

1. Added s_pWin = NULL in GdbCmd_TooltipEvaluation::ParseOutput
2. Added the check if the terminal opening has finished in a loop. The terminal should open faster. Also it should be detected correctly if it is started on a slower computer.
3. Fixed parsing of std::string = "test,test" in the watches window
4. Fixed "Catch exception" on windows
5. Fixed some "Do not run debuggee bugs"
5.1. "tbreak" command was emitted, when the debug/continue button was hit
5.2. "run" command was emitted, when in remote debugging mode, now emits the correct "cont"
5.3. "start" command was emitted, now the correct "run" is emitted

Test please :)
(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 #234 on: September 05, 2010, 03:40:37 pm »
Next patch: http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0016.4.patch

1. Combined "Debug -> Start" and "Debug -> Continue" in one menu item
2. Moved "Debug -> Run to Cursor" below "Stop debugger"
3. Implemented interrupting the debugger while remote debugging (see this thread for details http://forums.codeblocks.org/index.php/topic,12412.0.html )
4. Fixed a warning

Test again please...
(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 #235 on: September 09, 2010, 07:45:45 pm »
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 #236 on: September 09, 2010, 08:16:29 pm »
No, it is not available in gentoo, for some reason :(
(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 #237 on: September 11, 2010, 10:54:06 pm »
Next patch: http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0016.5.patch

1. Fixed some bugs related to the auto switch mode
1.1. Switch to the valid frame even when the backtrace windows is closed
1.2. If we're doing to update the backtrace, don't sync the editor. This prevents a popup to show when it is not needed.
2. Autosize the File column in the backtrace window

Morten, please merge trunk to debuggers branch, so I can test the fix for the loggers...
(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 #238 on: September 12, 2010, 01:16:33 am »
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:
Code
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)
     {
(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 #239 on: September 12, 2010, 10:56:05 am »
Morten: can you revert the change in MainFrame::ScanForPlugins() in r5795?
Done.

BTW: In fact I was always curious about that change and never applied it in my local copy. But I forgot to discuss this with you. Glad it's solved now. :-)
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