News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Splitting debugger in two - specific debugger and common GUI

Started by oBFusCATed, July 26, 2009, 01:27:44 PM

Previous topic - Next topic

oBFusCATed

#435
Pecan: Can you past the debugger's debug log?

p.s. Works here, gentoo linux 64bit, gcc 4.4.5, gdb 7.2
(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!]

Pecan

Quote from: oBFusCATed on February 16, 2011, 03:20:13 PM
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:

oBFusCATed

Does this happen with simple "Hello world" console application?
Or the project is a bit different - native or gui?
(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!]

Pecan

Quote from: oBFusCATed on February 17, 2011, 02:52:56 PM
Does this happen with simple "Hello world" console application?
Or the project is a bit different - native or gui?

It's a simple Hello World created by the wizard.

oBFusCATed

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)
(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!]

dmoore

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.

Thx.

EDIT: Would also help if cbWatch included an easy way to recursively iterate through all children of a watch.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

oBFusCATed

Quote from: dmoore on February 18, 2011, 03:38:33 AM
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)...

Quote from: dmoore on February 18, 2011, 03:38:33 AM
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 :)
(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!]

oBFusCATed

Next patch: http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0019.3.patch

What it does:
1. Removes "Debug-> Edit Watches...", it was unused;
2. Fixed the OnUpdateUI methods: if there was no active debugger all controls were active, now all controls are disabled;
(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!]

Pecan

Quote from: oBFusCATed on February 17, 2011, 08:34:56 PM
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

oBFusCATed

Next patch (it doesn't apply for me, but should show you what should be done): http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0019.4.patch

What it does: it removes the debuggertree.h/cpp from svn and the projects (unix only).

Next patch (main patch for the post): http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0020.0.patch

What it does: Reimplement the settings GUI/API for the debuggers;
This patch is intended as a preview, to show the direction I'm going. Dmoore and Morten please take a look at it.
I'm applying it on my main build of C::B and will test it in the next few days then I'll write the complete commit message...

p.s. tested only on linux, so you should modify the windows project if you want C::B to compile :)
(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!]

dmoore

Quote from: oBFusCATed on February 28, 2011, 08:56:31 AM
Next patch (it doesn't apply for me, but should show you what should be done): http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0019.4.patch
...
Next patch (main patch for the post): http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0020.0.patch
...

I applied both patches, which applied with some weirdness (some of this stuff has been applied previously?). C::B builds fine and I can see the new dialog. Looks good, but I haven't spent much time testing the functionality. So what is the major breakage here? :)
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

oBFusCATed

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...
(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!]

oBFusCATed

Two new patches:
1. http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0019.5.patch
Fixes:
* Step into was not working on windows (the code was different on windows/mac and linux, not it is the same on all platforms)
* Marked on of the reg expressions to use the wxRE_ADVANCED

2. http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0019.6.patch
Fixes:
* Refactored a bit the stack frame parsing code (extracted it in a function)
* Added tests for stack frame parsing
* Another case of stack frame output is parsed correctly ("#11  0x00406810 in main ()")
* Refactored a bit the debuggergdb test project

All development and testing is done on windows, I'll test it on linux later today. Probably patch 20.0 won't apply anymore, I'll fix that, too.

Morten, can I ask you to reject any patches (even made by me), which change a regexp and don't provide a test for 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!]

MortenMacFly

Quote from: oBFusCATed on March 03, 2011, 02:32:58 PM
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?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

dmoore

Quote from: oBFusCATed on March 02, 2011, 12:11:50 AM
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...
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]