Code::Blocks Forums

User forums => Nightly builds => Topic started by: killerbot on January 07, 2012, 07:24:37 pm

Title: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: killerbot on January 07, 2012, 07:24:37 pm
Get quick announcements through the RSS feed http://www.codeblocks.org/nightly/CodeBlock_RSS.xml

Before you use a nightly make sure you understand how it works (http://forums.codeblocks.org/index.php/topic,3232.0.html).

A link to the unicode windows wxWidget dll for Code::Blocks : http://prdownload.berlios.de/codeblocks/wxmsw28u_gcc_cb_wx2812_gcc452-TDM.7z

For those who might need this one (when no MingW installed on your system) : the mingw10m.dll : http://prdownload.berlios.de/codeblocks/mingwm10_gcc452-TDM.7z

The 07 January 2012 build is out.
  - Windows :
   http://prdownload.berlios.de/codeblocks/CB_20120107_rev7678_DEBUGGER_BRANCH_win32.7z
  - Linux :
   none

Important changes compared to previous DEBUGGER BRANCH nightly:

* a couple of Mac compatibility fixes

* detect if attaching fails, add some logging when attaching

* detect if any run/continue/start commands fail and stop the debugger (see http://forums.codeblocks.org/index.php/topic,15264.msg103342.html#msg103342)

* do macro expansion for the debugger's executable path

* fixed parsing the output from gdb for watches of type std::map<std::string, std::string>

* Improved the way how the debugging perspective is chosen (the old code was using a hard coded "Debugging" perspective").
Now it is possible to have on perspective for all plugins, one per debugger or one per debugger configuration.
Default is 'one per debugger configuration'.
is one per debugger configuration.
* Use DebuggerManager::GetDebuggerHavingWatch instead of GetActiveDebugger in WatchesDlg::OnExpand and WatchesDlg::OnCollapse;
* Initialized all debugging windows in the main application instead of the debugger gdb plugins
* Refinement of the previous commit (r7630) and now the dialog objects are created explicitly in SetInterfaceFactory;
* Fixed a regression in CDB handling caused by the breakpoint redesign;
* Fixed a bug in the step out implementation of the cdb_driver - if was stepping to the line after the call because an explicit step was done
* Improve the WatchesDlg::RenameWatch function:
* The renamed watch is removed from the plugin it belongs to and it is added to the active debugger;
* UpdateWatch is called, so the children of the old watch are removed
* Added API to test what features a plugin supports. Used the API to implement some features.
* Check if the plugin supports breakpoints and do the appropriate thing in the editor (no toggle breakpoint and no menu entries for breakpoints);
* Call RegisterValueTooltip automatically if the plugin supports value tooltips, made it private;
* Added EnableWindow methods to ExamineMemoryDlg, CPURegistersDlg, BacktraceDlg, ThreadsDlg and DisassemblyDlg;
* Added DebuggerManager::RefreshUI, so all windows can be updated with on call, used it where it was appropriate;
* Added some missing macros to properly implement WatchProperty;
* Added code to test if the plugin support watches and then do the appropriate thing (no adding new watches, no watch properties, etc);
* Added WatchesDlg::RefreshUI, which disables watches from the inactive plugins and enables the watches for the active plugin;
* Added context menu entries only if they are supported by the active plugin (add watch, add data breakpoint, toggle breakpoint, run to cursor, set next statement);
* Enable or disable the menu items used to show/hide debugger windows by checking what is supported by the active plugin
* wx29 fixes;
* fix for update-scripts of some contrib-plugins
* more (better) fixes for wx 2.9.x compatibility, branch compiles now just fine using the wx 2.9 project file
* fixed compiler error with wxPGIdIsOk after setting wxPG_COMPATIBILITY_1_2_0 to 0
* Added API for adding menu items for debugger windows in the menu Debug->Debugging windows;
* Used the new API for adding the current windows;
* Removed old menu items from the xrc file;
* Changed the API for showing the tools menu, now it just fills the menu. This new API is used to fill the Debug->Information;
* Removed all the code related to the tools menu, because all the code should be in the plugins;
* Fixed the crash in batch build mode (do not assume that LoadPanel will succeed);
* Added a way to control the number of elements or the size of char string printed in the watches (uses "set print elements" gdb command);
* debugger_plugin: Added a way to enable or disable the breakpoint, when an exception is thrown, during debugging. Previously a restart of the debugging session was required;
* Fixed a bug with the autosizing of the columns in the tooltip for variables like "std::string s1("a");". The bug is that the type column is too short and the reason is that the margin was not taken into account. I've added a new method for
returning the width of the margin to wxPropGrid
* Combined the normal log and the debug log in the same window. Changed the API to reflect the change. Hopefully there will be less confusion in the forums in the future;
* Removed the cgDebugger settings filter, because it is not needed;
* all updates that occurred on trunk


Note: Watch parsing prints an error message in the watches window if the parsing fails. If you see this string please report it as a bug.

THIS IS A SPECIAL TEST BUILD OF REFACTORINGS CARRIED OUT ON THE DEBUGGER BRANCH IN OUR SVN.
FOCUS IS ON ENHANCED DEBUGGING USABILITY.

Give your feedback on this version only in this thread, don't mix it with the regular nightly please. If you feel it is however not
related to the debugger functionality itself, then it might be better to report it the corresponding regular nightly build thread.

Once we don't have any blockers on this version,we will merge the changes into trunk and it will be part of the regular nightlies.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 08, 2012, 12:30:25 am
Thank you Killerbot :)
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: Jenna on January 08, 2012, 12:49:09 am
Debian packages (binaries and sources) for 32-bit and 64-bit systems can be found in my repo.

If you want to use apt (or dselect, synaptic or whatever) you need to add the following entries to /etc/apt/sources.list :
Code
deb http://apt.jenslody.de/ any dbg
deb-src http://apt.jenslody.de/ any dbg
and remove entries for the normal nightlies.

Alternatively you can download the deb's directly from http://apt.jenslody.de/pool/dbg/c/codeblocks/ (http://apt.jenslody.de/pool/dbg/c/codeblocks/) .
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 08, 2012, 02:34:51 am
Great job jens and killerbot!!! Too many improvement since last nightly build.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 11, 2012, 08:36:25 am
When debugging, I right click on the Call-stack's one entry, and try to select "Switch on double click"  mode(The default value is "Jump on double click").

After click the "Switch..." menu entry, the "Jump ..." is still marked (with a black small dot).

This maybe a bug.

Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: Jenna on January 11, 2012, 09:04:34 am
When debugging, I right click on the Call-stack's one entry, and try to select "Switch on double click"  mode(The default value is "Jump on double click").

After click the "Switch..." menu entry, the "Jump ..." is still marked (with a black small dot).

This maybe a bug.


For me the default was "Switch ..." and I was able to set it to "Jump ...".
But setting it back to the"Switch"-option seems not to work.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 11, 2012, 09:33:52 am
Show be fixed in svn. Thanks for the report.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 11, 2012, 10:05:05 am
Show be fixed in svn. Thanks for the report.
:) Thanks for the quick fix!!!
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: Max on January 11, 2012, 10:07:58 am
OBFusCATed...

Are you aware that the shipped script for GDB that permits watching a wxString is no longer working for ap project using (linking) wxWidgets 2.9.3? I moved from 2.8.12 to 2.9.3 and the watch window is now unable to show th contents of a wxString.

Regards

Max
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 11, 2012, 10:22:48 am
Yes, in 2.9.3 you have python pretty printers please enable them, because they are the way forward.
The gdb scripts are something from the past and I have no intentions to support them.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: AlexN on January 11, 2012, 08:18:52 pm
The 70 January 2012 build is out.

Thank you!

But which calender do you use? ;)
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: killerbot on January 11, 2012, 10:44:04 pm
The 70 January 2012 build is out.

Thank you!

But which calender do you use? ;)

fixed :-)
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: Folco on January 13, 2012, 08:21:44 pm
Thanks for this nightly, happy new year and coding ! :)
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: renega_666 on January 26, 2012, 03:22:15 pm
Codeblocks r7678
Windows Xp 32 bits | Windows7 32 bits | Windows7 64bits
TDM GCC 4.6.1

Hi!

Since I moved to the latest nightly I have a lot of problems with the debugger's watches.
Every time I want to watch a variable, the following message appears:
"Parsing GDB output failed for ..."
I have created a little sample code that demonstrates the problem:
Code
#include <iostream>
#include <string>
using namespace std;
typedef std::string String;
class Foo
{
public:
  Foo(std::string name) :mName(name),mBar(0){}
  ~Foo(){}
  void print(){std::cout << mBar << std::endl;}
private:
  std::string mName;
  int mBar;
};
int main()
{
  Foo foo("MyFoo");
  foo.print();
  cout << "Hello world!" << endl;
  String str = "My string";
  cout << str << endl;
  return 0;
}

Put a breakpoint on
Code
cout << str << endl;
and try to watch str and foo won't work (parsing output failed)

http://imageshack.us/photo/my-images/822/cbscreen.png/ (http://imageshack.us/photo/my-images/822/cbscreen.png/)

If you remove the string typedef, the str var is properly shown but not the foo one.

I also tried to enable the debugger's debug log but no log windows appears in the log pane. I only have the regular debug log:
Code
Building to ensure sources are up-to-date
Selecting target:
Debug-Win32
Adding source dir: D:\Projects\Codeblocks\test\
Adding source dir: D:\Projects\Codeblocks\test\
Adding file: D:\Projects\Codeblocks\test\bin\Debug\test.exe
Changing directory to: D:/Projects/Codeblocks/test/.

[debug]PATH=.;C:\MinGW32\bin;C:\Python27\;C:\Python27\Scripts;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\swig;C:\Program Files\doxygen\bin;C:\Program Files\Graphic Remedy\gDEBugger\;C:\Program Files\Microsoft Platform SDK\Bin\.;C:\Program Files\Microsoft Platform SDK\Bin\WinNT\.;C:\Program Files\Autodesk\Backburner\;C:\Program Files\Fichiers communs\Autodesk Shared\;C:\Program Files\TortoiseSVN\bin;c:\swig
[debug]Command-line: C:\MinGW32\bin\gdb.exe -nx -fullname  -quiet -args D:/Projects/Codeblocks/test/bin/Debug/test.exe
[debug]Working dir : D:\Projects\Codeblocks\test

Starting debugger: C:\MinGW32\bin\gdb.exe -nx -fullname  -quiet -args D:/Projects/Codeblocks/test/bin/Debug/test.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from d:\projects\codeblocks\test\bin\debug\test.exe...done.
[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:\Codeblocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> set print static-members off
show print static-members off

[debug]>>>>>>cb_gdb:Printing of C++ static members is off.
[debug]> directory D:/Projects/Codeblocks/test/
[debug]>>>>>>cb_gdb:Printing of C++ static members is off.
[debug]> break "D:/Projects/Codeblocks/test/main.cpp:21"
[debug]>>>>>>cb_gdb:



[debug]> run
[debug]>>>>>>cb_gdb:Breakpoint 2 at 0x401452: file D:\Projects\Codeblocks\test\main.cpp, line 21.
[debug]>>>>>>cb_gdb:
[debug]gdb: windows_init_thread_list

Child process PID: 3104

[debug][New Thread 3104.0xbb8]
[debug]Breakpoint 2, main () at D:\Projects\Codeblocks\test\main.cpp:21
[debug]d:\projects\codeblocks\test\main.cpp:21:388:beg:0x401452
[debug]>>>>>>cb_gdb:

At d:\projects\codeblocks\test\main.cpp:21

[debug]> whatis str
[debug]type = String
[debug]>>>>>>cb_gdb:
[debug]> output str
[debug]{
[debug]  _M_dataplus = {
[debug]    <std::allocator<char>> = {
[debug]      <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
[debug]    members of std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider:
[debug]    _M_p = 0x3e3d44 "My string"
[debug]  }
[debug]}>>>>>>cb_gdb:
[debug]> whatis foo
[debug]type = Foo
[debug]>>>>>>cb_gdb:
[debug]> output foo
[debug]{
[debug]  mName = {
[debug]    _M_dataplus = {
[debug]      <std::allocator<char>> = {
[debug]        <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
[debug]      members of std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider:
[debug]      _M_p = 0x3e3d14 "MyFoo"
[debug]    }
[debug]  },
[debug]  mBar = 0
[debug]}>>>>>>cb_gdb:


Everything was working fine with the previous nightly (7550).

Codeblocks is now unusable for debugging for me so I'm going to switch back to the previous nightly...
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 26, 2012, 04:04:43 pm
@renega_666 (http://forums.codeblocks.org/index.php?action=profile;u=30856)
Your test code works OK under a gdb.exe (which has python script enabled), you should also load the pretty-printer for stl when debugger started (see: GDB Pretty printer introduction and setup (http://code.google.com/p/qp-gcc/wiki/GDB)).

You can have to try MinGW's official gdb 7.3 (gdb-python27.exe) or mybuild ([OT] unofficial MinGW GDB gdb with python released (http://forums.codeblocks.org/index.php/topic,11301.msg77000.html#msg77000))
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 26, 2012, 04:34:04 pm
renega_666: Thanks for the report, I've added it to my todo and I'll see what is wrong with it later today (hopefully).
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: Jenna on January 26, 2012, 05:37:10 pm
I found two minor issues:
if I add the same variable twice, it's also shown twice in the watches list.
The expected behaviour would be to select it in the watches window, or just do nothing.

And dragging a variable into the watches window without pressing control deletes it in the editor.
If I remember correctly this was fxed some time ago, but I'm not sure absolutely about that.
I can look into the second issue this evening.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 26, 2012, 05:46:46 pm
I found two minor issues:
if I add the same variable twice, it's also shown twice in the watches list.
The expected behaviour would be to select it in the watches window, or just do nothing.
Are you sure this is needed? I'm not, because sometimes you may want to have to watches with different options.

And dragging a variable into the watches window without pressing control deletes it in the editor.
If I remember correctly this was fxed some time ago, but I'm not sure absolutely about that.
I can look into the second issue this evening.
No, it has never been fixed, last time I've reported this, you said it was working correctly for you.
I'll be happy if you're able to fix it.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: MortenMacFly on January 26, 2012, 08:13:19 pm
Are you sure this is needed? I'm not, because sometimes you may want to have to watches with different options.
Indeed. For example, if you watch array (matrices) or vectors. Often you want to see only a certain elements / rows / columns. I do this regularly.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 26, 2012, 09:46:03 pm
Can someone running windows and non-python enabled gdb confirm the parser problems reported by renega_666?
I've tried to reproduce the problem with the latest version of the branch and it works as expected.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: Jenna on January 27, 2012, 08:37:18 am
I found two minor issues:
if I add the same variable twice, it's also shown twice in the watches list.
The expected behaviour would be to select it in the watches window, or just do nothing.
Are you sure this is needed? I'm not, because sometimes you may want to have to watches with different options.

Agreed !

And dragging a variable into the watches window without pressing control deletes it in the editor.
If I remember correctly this was fxed some time ago, but I'm not sure absolutely about that.
I can look into the second issue this evening.
No, it has never been fixed, last time I've reported this, you said it was working correctly for you.
I'll be happy if you're able to fix it.

Fixed in svn r7718 .
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 27, 2012, 09:12:19 am
Fixed in svn r7718 .
Thank you :)
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: renega_666 on January 28, 2012, 04:53:21 pm
Hi!

Some news about the issue I reported two days ago:

1. I now have tested and reproduced the bug on my house computers (win7 32bits and 64 bits). The parser error is still here.
2. I've also tried to remove my configuration files from app data and start with a clean default config but unfortunately the bug still appears. (tried on win7 32/64 and winXp 32)
3. Then, I've followed ollydbg instructions to enable gdb python and the parser error still occurs (I've used the ollydbg build and followed the setup instructions on the wiki page) (only tried on win7 32bits)

Is there anything else I could try?

Btw I 'm still not able to view the debugger's debug log (the check box is checked but the log window doesn't appear, it does in the previous nightly).

Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 28, 2012, 07:16:37 pm
Btw I 'm still not able to view the debugger's debug log (the check box is checked but the log window doesn't appear, it does in the previous nightly).
The debug log was removed, because many users had trouble finding it.
Now the debug log messages are printed in the normal log, but they have the prefix [debug].

I'll change the naming of the option, so it is less confusing.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 28, 2012, 07:23:39 pm
Can I ask someone on windows to test the renega_666 examples and confirm, that there is a bug?
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: MortenMacFly on January 28, 2012, 08:05:51 pm
Can I ask someone on windows to test the renega_666 examples and confirm, that there is a bug?
Windows XP here, debugger branch, even path with spaces - the bug does not occur.
Maybe it is a modified debugger script?
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 28, 2012, 08:34:26 pm
Morten: Can you disable the 'watch scripts' and try again? Also make sure you have no python-enabled-gdb.

renega_666: Can you post the full build log and can you try the previous nightly, to verify it is still working?
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: renega_666 on January 29, 2012, 02:18:24 am
Tested with the sample code provided in my firts post.

Results with r7550

- the bug doesn't occur

- Screenshot:

http://imageshack.us/photo/my-images/692/screenshot7550.png/ (http://imageshack.us/photo/my-images/692/screenshot7550.png/)

- log:

Quote
PATH=.;C:\MinGW32\bin;D:\Perl\site\bin;D:\Perl\bin;C:\Python27\;C:\Python27\Scripts;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program Files\Autodesk\Backburner\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\doxygen\bin;C:\swig;C:\Program Files\TortoiseSVN\bin;D:\Program Files\doxygen\bin;D:\Program Files\CMake 2.8\bin;D:\QtSDK\Qt\4.8.0\bin;%APPDATA%\Python\Scripts;C:\MinGW32\bin
Command-line: C:\MinGW32\bin\gdb.exe -nx -fullname  -quiet -args D:/Projects/Codeblocks/TestBugGDBParser/bin/Debug/TestBugGDBParser.exe
Working dir : D:\Projects\Codeblocks\TestBugGDBParser
> set prompt >>>>>>cb_gdb:
Reading symbols from D:\Projects\Codeblocks\TestBugGDBParser\bin\Debug\TestBugGDBParser.exe...done.
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.4.50.20120119-cvs
Copyright (C) 2012 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:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source D:\Codeblocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> source C:\MinGW32\bin\stl.gdb
source C:\MinGW32\bin\wx.gdb
>>>>>>cb_gdb:>>>>>>cb_gdb:
> directory D:/Projects/Codeblocks/TestBugGDBParser/
>>>>>>cb_gdb:
> break "D:/Projects/Codeblocks/TestBugGDBParser/main.cpp:21"
Breakpoint 2 at 0x401452: file D:\Projects\Codeblocks\TestBugGDBParser\main.cpp, line 21.
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 6948.0xaec]
Breakpoint 2, main () at D:\Projects\Codeblocks\TestBugGDBParser\main.cpp:21
D:\Projects\Codeblocks\TestBugGDBParser\main.cpp:21:388:beg:0x401452
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> bt 30
#0  main () at D:\Projects\Codeblocks\TestBugGDBParser\main.cpp:21
>>>>>>cb_gdb:
> whatis foo
type = Foo
>>>>>>cb_gdb:
> output foo
{
  mName = {
    static npos = <optimized out>,
    _M_dataplus = {
      <std::allocator<char>> = {
        <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
      members of std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider:
      _M_p = 0x252b84 "MyFoo"
    }
  },
  mBar = 0
}>>>>>>cb_gdb:
> whatis str
type = String
>>>>>>cb_gdb:
> output str
{
  static npos = <optimized out>,
  _M_dataplus = {
    <std::allocator<char>> = {
      <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
    members of std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider:
    _M_p = 0x252bb4 "My string"
  }
}>>>>>>cb_gdb:

Results with r7678

- the bug does occur.

- Screenshot:

http://imageshack.us/photo/my-images/407/screenshot7678.png/

- log:

Quote
Building to ensure sources are up-to-date
Selecting target:
Debug-Win32
Adding source dir: D:\Projects\Codeblocks\TestBugGDBParser\
Adding source dir: D:\Projects\Codeblocks\TestBugGDBParser\
Adding file: D:\Projects\Codeblocks\TestBugGDBParser\bin\Debug\TestBugGDBParser.exe
Changing directory to: D:/Projects/Codeblocks/TestBugGDBParser/.

[debug]PATH=.;C:\MinGW32\bin;D:\Perl\site\bin;D:\Perl\bin;C:\Python27\;C:\Python27\Scripts;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program Files\Autodesk\Backburner\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\doxygen\bin;C:\swig;C:\Program Files\TortoiseSVN\bin;D:\Program Files\doxygen\bin;D:\Program Files\CMake 2.8\bin;D:\QtSDK\Qt\4.8.0\bin;%APPDATA%\Python\Scripts;C:\MinGW32\bin
[debug]Command-line: C:\MinGW32\bin\gdb.exe -nx -fullname  -quiet -args D:/Projects/Codeblocks/TestBugGDBParser/bin/Debug/TestBugGDBParser.exe
[debug]Working dir : D:\Projects\Codeblocks\TestBugGDBParser

Starting debugger: C:\MinGW32\bin\gdb.exe -nx -fullname  -quiet -args D:/Projects/Codeblocks/TestBugGDBParser/bin/Debug/TestBugGDBParser.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from D:\Projects\Codeblocks\TestBugGDBParser\bin\Debug\TestBugGDBParser.exe...
[debug]done.
[debug](gdb)
[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.4.50.20120119-cvs
[debug]Copyright (C) 2012 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.4.50.20120119-cvs

[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 D:\Codeblocks_New\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> source C:\MinGW32\bin\stl.gdb
source C:\MinGW32\bin\wx.gdb
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> directory D:/Projects/Codeblocks/TestBugGDBParser/
[debug]>>>>>>cb_gdb:
[debug]> break "D:/Projects/Codeblocks/TestBugGDBParser/main.cpp:21"
[debug]Breakpoint 2 at 0x401452: file D:\Projects\Codeblocks\TestBugGDBParser\main.cpp, line 21.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]gdb: windows_init_thread_list

Child process PID: 9116

[debug][New Thread 9116.0x14cc]
[debug]Breakpoint 2, main () at D:\Projects\Codeblocks\TestBugGDBParser\main.cpp:21
[debug]D:\Projects\Codeblocks\TestBugGDBParser\main.cpp:21:388:beg:0x401452
[debug]>>>>>>cb_gdb:

At D:\Projects\Codeblocks\TestBugGDBParser\main.cpp:21

[debug]> set debugevents off
[debug]>>>>>>cb_gdb:
[debug]> whatis str
[debug]type = String
[debug]>>>>>>cb_gdb:
[debug]> output str
[debug]{
[debug]  static npos = <optimized out>,
[debug]  _M_dataplus = {
[debug]    <std::allocator<char>> = {
[debug]      <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
[debug]    members of std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider:
[debug]    _M_p = 0x642bb4 "My string"
[debug]  }
[debug]}>>>>>>cb_gdb:
[debug]> whatis foo
[debug]type = Foo
[debug]>>>>>>cb_gdb:
[debug]> output foo
[debug]{
[debug]  mName = {
[debug]    static npos = <optimized out>,
[debug]    _M_dataplus = {
[debug]      <std::allocator<char>> = {
[debug]        <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
[debug]      members of std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider:
[debug]      _M_p = 0x642b84 "MyFoo"
[debug]    }
[debug]  },
[debug]  mBar = 0
[debug]}>>>>>>cb_gdb:
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 29, 2012, 02:51:08 am
I've diffed the logs and there is not big differences in them.

The only suspicious thing in them is this:
Code
>>>>>>cb_gdb:
> source D:\Codeblocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> source C:\MinGW32\bin\stl.gdb
source C:\MinGW32\bin\wx.gdb
>>>>>>cb_gdb:>>>>>>cb_gdb:

Code
>>>>>>cb_gdb:
> source D:\Codeblocks_New\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> source C:\MinGW32\bin\stl.gdb
>>>>>>cb_gdb:>>>>>>cb_gdb:

I guess you've put this source commands in the initial commands.
Can you remove them and try again? Why are they different in the two versions?
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: renega_666 on January 29, 2012, 01:56:59 pm
Do you speak about stl-views-1.0.3.gdb ? or  C:\MinGW32\bin\stl.gdb?

I think I didn't do anything about the first source command, the second one is the one I added when following the ollydbg instructions to enable python gdb.

Here is a screenshot of my debugger settings: http://imageshack.us/photo/my-images/407/capturejnl.png/ (http://imageshack.us/photo/my-images/407/capturejnl.png/)

Please tell me the name of the files/commands you want I to remove, I'm a little lost here...
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 29, 2012, 02:05:44 pm
The one you've added manually, for stl-views you can't do anything :)

Also if you want to use the python printers you should disable the 'Enable watch scripts' option.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: renega_666 on January 29, 2012, 02:23:29 pm
Quote
The one you've added manually, for stl-views you can't do anything Smiley

Also if you want to use the python printers you should disable the 'Enable watch scripts' option.

That's it! Pasing error disappear if I uncheck the 'Enable watch script'! :) But why did it work with the previous nightly (without the check box unchecked)?

Do you still want I to remove those commands? (I guess I would have to check the 'Enable watch script' then?)
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 29, 2012, 02:36:40 pm
Yes, remove the scripts and enable the option for watch scripts.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: renega_666 on January 29, 2012, 02:49:12 pm
So I removed the script commands and checked the 'Enable wtach scripts' and the bug appears again

Here is the log:

Quote
Building to ensure sources are up-to-date
Selecting target:
Debug-Win32
Adding source dir: D:\Projects\Codeblocks\TestBugGDBParser\
Adding source dir: D:\Projects\Codeblocks\TestBugGDBParser\
Adding file: D:\Projects\Codeblocks\TestBugGDBParser\bin\Debug\TestBugGDBParser.exe
Changing directory to: D:/Projects/Codeblocks/TestBugGDBParser/.

[debug]PATH=.;C:\MinGW32\bin;D:\Perl\site\bin;D:\Perl\bin;C:\Python27\;C:\Python27\Scripts;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program Files\Autodesk\Backburner\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\doxygen\bin;C:\swig;C:\Program Files\TortoiseSVN\bin;D:\Program Files\doxygen\bin;D:\Program Files\CMake 2.8\bin;D:\QtSDK\Qt\4.8.0\bin;%APPDATA%\Python\Scripts;C:\MinGW32\bin
[debug]Command-line: C:\MinGW32\bin\gdb.exe -nx -fullname  -quiet -args D:/Projects/Codeblocks/TestBugGDBParser/bin/Debug/TestBugGDBParser.exe
[debug]Working dir : D:\Projects\Codeblocks\TestBugGDBParser

Starting debugger: C:\MinGW32\bin\gdb.exe -nx -fullname  -quiet -args D:/Projects/Codeblocks/TestBugGDBParser/bin/Debug/TestBugGDBParser.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from D:\Projects\Codeblocks\TestBugGDBParser\bin\Debug\TestBugGDBParser.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.4.50.20120119-cvs
[debug]Copyright (C) 2012 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.4.50.20120119-cvs

[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 D:\Codeblocks_New\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory D:/Projects/Codeblocks/TestBugGDBParser/
[debug]>>>>>>cb_gdb:
[debug]> break "D:/Projects/Codeblocks/TestBugGDBParser/main.cpp:21"
[debug]Breakpoint 2 at 0x401452: file D:\Projects\Codeblocks\TestBugGDBParser\main.cpp, line 21.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]gdb: windows_init_thread_list

Child process PID: 7652

[debug][New Thread 7652.0x267c]
[debug]Breakpoint 2, main () at D:\Projects\Codeblocks\TestBugGDBParser\main.cpp:21
[debug]D:\Projects\Codeblocks\TestBugGDBParser\main.cpp:21:388:beg:0x401452
[debug]>>>>>>cb_gdb:

At D:\Projects\Codeblocks\TestBugGDBParser\main.cpp:21

[debug]> set debugevents off
[debug]>>>>>>cb_gdb:
[debug]> whatis str
[debug]type = String
[debug]>>>>>>cb_gdb:
[debug]> output str
[debug]{
[debug]  static npos = <optimized out>,
[debug]  _M_dataplus = {
[debug]    <std::allocator<char>> = {
[debug]      <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
[debug]    members of std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider:
[debug]    _M_p = 0x892ccc "My string"
[debug]  }
[debug]}>>>>>>cb_gdb:
[debug]> whatis foo
[debug]type = Foo
[debug]>>>>>>cb_gdb:
[debug]> output foo
[debug]{
[debug]  mName = {
[debug]    static npos = <optimized out>,
[debug]    _M_dataplus = {
[debug]      <std::allocator<char>> = {
[debug]        <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
[debug]      members of std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider:
[debug]      _M_p = 0x892c9c "MyFoo"
[debug]    }
[debug]  },
[debug]  mBar = 0
[debug]}>>>>>>cb_gdb:
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 29, 2012, 03:37:41 pm
Hi, renega_666 (http://forums.codeblocks.org/index.php?action=profile;u=30856), I just read all your posts on the thread.

There are currently two method of show a std::string value under C::B.

1,
Use a python enabled gdb.
Disable the script (Uncheck the "Enable watch scripts") in the debugger setting dialog.
Adding some custom scripts to load python pretty printers when gdb started.
(I use: "source $(TARGET_COMPILER_DIR)bin\stl.gdb" for c++ stl library and "source $(TARGET_COMPILER_DIR)bin\wx.gdb" for wxWidgts library).
Note: You should have pretty printer scripts folders under your MinGw/bin folder.

2,
Use a normal gdb (whether it was python enabled or not).
Enable the script (Check the "Enable watch scripts") in the debugger setting dialog.
Do not add any custom loading python scripts.

I just test the method 1, and it works OK.
When I test method 2, the watch window shows that: Parsing GDB output failed for 'str'!
I'm using this debugger branch nighty build, and windows XP, the gdb was my personal build version: GNU gdb (GDB) 7.4.50.20120128-cvs
The related failed log:
Code
[debug]>>>>>>cb_gdb:
[debug]> whatis str
[debug]type = String
[debug]>>>>>>cb_gdb:
[debug]> output str
[debug]{
[debug]  static npos = 4294967295
[debug],
[debug]  _M_dataplus = {
[debug]    <std::allocator<char>> = {
[debug]      <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
[debug]    members of std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider:
[debug]    _M_p = 0x3f3d5c "My string"
[debug]  }
[debug]}>>>>>>cb_gdb:
[debug]> whatis foo
[debug]type = Foo
[debug]>>>>>>cb_gdb:
[debug]> output foo
[debug]{
[debug]  mName = {
[debug]    static npos = 4294967295,
[debug]    _M_dataplus = {
[debug]      <std::allocator<char>> = {
[debug]        <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
[debug]      members of std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider:
[debug]      _M_p = 0x3f3d2c "MyFoo"
[debug]    }
[debug]  },
[debug]  mBar = 0
[debug]}>>>>>>cb_gdb:

So, either the new gdb has different output string than some old gdb version(like the official gdb7.3.1) Or there are some parsing errors.

To me, I suggest you use the method 1, because it is much better and powerful.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: renega_666 on January 29, 2012, 04:35:36 pm
Quote
To me, I suggest you use the method 1, because it is much better and powerful.
Yeah I'm using it right now and it works reallly well! Thanks for the tip!  ;)
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: renega_666 on January 29, 2012, 04:40:30 pm
Quote
So, either the new gdb has different output string than some old gdb version(like the official gdb7.3.1)

I don't know if this might help but at work I was using the old gdb 7.3 (that comes with the TDM 4.6.1 distibution) when I first saw the parsing error (see my first post).
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 29, 2012, 05:17:37 pm
Hm, maybe I'll have to switch to windows for some debugging after all :(
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 30, 2012, 02:51:27 pm
I just find an issue that
1, pause the app
2, manually run the gdb command "delete" to delete all the breakpoints
3, click to add two breakpoints.

But see the index value? why it is -1???

See the screen shot below: (I'm using windows XP, gdb cvs build by myself, this nightly)
(http://i683.photobucket.com/albums/vv194/ollydbg_cb/2012-01-30215051.png)
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 30, 2012, 03:07:00 pm
Why do you expect this is going to work?
If you set a breakpoint in the gui and the delete it manually with a gdb command, you'll have problems, don't do it!
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 30, 2012, 03:28:58 pm
Why do you expect this is going to work?
If you set a breakpoint in the gui and the delete it manually with a gdb command, you'll have problems, don't do it!

Even I do not manually run the "delete" gdb command, I only click on the gui to set breakpoints, I still get a lot of index=-1 showing in the breakpoint window.

1, I set some bps when the debugger is in-active, all the setting bp have the -1 index.
2, when the debugger started, those bps are not re-indexed and updated.
3, When one of the bp(index=-1) was hit line 209, I can add more bps (line 215)through gui click, and they have all the positive index like index=3.
4, I click on the bp(index=-1) trying to remove one bp in line 210 , it looks like it's done(the bed circle has gone).
5, I continue to run the debugee, I will see the old place line 210 (the bp I try to remove in step 4) still hit by showing a yellow triangle there.

Here is the simple debug log:
Code
Debugger name and version: GNU gdb (GDB) 7.4.50.20120128-cvs

[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 disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\stl.gdb
source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\wx.gdb
set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> directory E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:Source directories searched: E:/code/cb/cb_trunk/src/plugins/codecompletion/parser;$cdir;$cwd
[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:209"
[debug]>>>>>>cb_gdb:



[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:210"
[debug]Breakpoint 2 at 0x4345b4: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 209.
[debug]>>>>>>cb_gdb:Breakpoint 3 at 0x4345c2: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 210.
[debug]> run
[debug]>>>>>>cb_gdb:
[debug]Starting program: E:\code\cb\cb_trunk\src\devel\parsertest.exe
[debug]gdb: windows_init_thread_list

Child process PID: 5416

[debug][New Thread 5416.0x15a0]
[debug]Breakpoint 2, Frame::Start (this=0x15f5b40) at E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209
[debug]E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209:10793:beg:0x4345b4
[debug]>>>>>>cb_gdb:

At E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209

[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:215"
[debug]Breakpoint 4 at 0x43466e: E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:215. (2 locations)
[debug]>>>>>>cb_gdb:
[debug]> delete breakpoints 2
[debug]>>>>>>cb_gdb:

Continuing...

[debug]> cont
[debug]Continuing.
[debug]Breakpoint 3, Frame::Start (this=0x15f5b40) at E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:210
[debug]E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:210:10842:beg:0x4345c2
[debug]>>>>>>cb_gdb:

At E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:210


Edit

I add line number of bp in the steps.

Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 30, 2012, 08:44:35 pm
Code
[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:209"
[debug]>>>>>>cb_gdb:



[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:210"
[debug]Breakpoint 2 at 0x4345b4: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 209.
[debug]>>>>>>cb_gdb:Breakpoint 3 at 0x4345c2: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 210.
I don't know why this has happened, but the log is broken. Notice how the second command is executed before the output of the first is parsed.
Please try with a default configuration and with a official mingw gdb install.

Can you reproduce this problem with a simple test code sample?
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 31, 2012, 01:57:05 am
Code
[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:209"
[debug]>>>>>>cb_gdb:



[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:210"
[debug]Breakpoint 2 at 0x4345b4: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 209.
[debug]>>>>>>cb_gdb:Breakpoint 3 at 0x4345c2: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 210.
Question: why there are many empty lines after the second debug log line?


I just test the official mingw gdb 7.3.1, it works Ok. see the log:
Code
Debugger name and version: GNU gdb (GDB) 7.3.1

[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 disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\stl.gdb
source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\wx.gdb
set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> directory E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:209"
[debug]Breakpoint 2 at 0x4345b4: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 209.
[debug]>>>>>>cb_gdb:
[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:210"
[debug]Breakpoint 3 at 0x4345c2: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 210.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]gdb: windows_init_thread_list

Child process PID: 2196

[debug][New Thread 2196.0x200]
[debug]Breakpoint 2, Frame::Start (this=0x15f5b40) at E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209
[debug]e:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209:10793:beg:0x4345b4
[debug]>>>>>>cb_gdb:

At e:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209

[debug]> set debugevents off
[debug]>>>>>>cb_gdb:
[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:215"
[debug]Breakpoint 4 at 0x43466e: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 215.
[debug]>>>>>>cb_gdb:
[debug]> delete breakpoints 3
[debug]>>>>>>cb_gdb:

Continuing...

[debug]> cont
[debug]Breakpoint 4, Frame::Start (this=0x15f5b40) at E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:215
[debug]e:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:215:11050:beg:0x43466e
[debug]>>>>>>cb_gdb:

At e:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:215


I'm not sure why the latest cvs gdb was broken, as you said
Quote
Notice how the second command is executed before the output of the first is parsed.

Note that both the bps in line 209 and 210 is set before I start the debugger.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 31, 2012, 02:53:31 am
I just add two line in the custom gdb's initial commands like:
Code
source $(TARGET_COMPILER_DIR)bin\stl.gdb
source $(TARGET_COMPILER_DIR)bin\wx.gdb
break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:209"
break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:211"
Also, I try to check the "Do no run the debugee" option in the dialog. When I start the debugger, I see this in the log:
Code
Debugger name and version: GNU gdb (GDB) 7.4.50.20120128-cvs

[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 disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\stl.gdb
source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\wx.gdb
break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:209"
break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:211"

[debug]>>>>>>cb_gdb:
[debug]> directory E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/
[debug]>>>>>>cb_gdb:
[debug]Breakpoint 2 at 0x4345b4: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 209.
[debug]>>>>>>cb_gdb:Breakpoint 3 at 0x4345d0: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 211.
[debug]>>>>>>cb_gdb:Note: breakpoint 3 also set at pc 0x4345d0.
[debug]Breakpoint 4 at 0x4345d0: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 211.
[debug]>>>>>>cb_gdb:Source directories searched: E:/code/cb/cb_trunk/src/plugins/codecompletion/parser;$cdir;$cwd
[debug]>>>>>>cb_gdb:


You see: It looks like gdb now give some information:
Code
[debug]>>>>>>cb_gdb:Note: breakpoint 3 also set at pc 0x4345d0.
[debug]Breakpoint 4 at 0x4345d0: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 211.
[debug]>>>>>>cb_gdb:Source directories searched: E:/code/cb/cb_trunk/src/plugins/codecompletion/parser;$cdir;$cwd
[debug]>>>>>>cb_gdb:
Question: what does the line beginning with
Code
[debug]>>>>>>cb_gdb
[debug]>
[debug]
Even some empty line in the log?
I'm confused with those debug log prefix, can you give a explanation? Thanks.

Here is the same log with official mingw gdb 7.3.1.
Code
Debugger name and version: GNU gdb (GDB) 7.3.1

[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 disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\stl.gdb
source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\wx.gdb
break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:209"
break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:211"

[debug]>>>>>>cb_gdb:
[debug]> directory E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/
[debug]>>>>>>cb_gdb:
[debug]Breakpoint 2 at 0x4345b4: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 209.
[debug]>>>>>>cb_gdb:Breakpoint 3 at 0x4345d0: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 211.
[debug]>>>>>>cb_gdb:Breakpoint 4 at 0x4345d0: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 211.
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:



PS:( I think the recent release gdb 7.4 will maybe have the same issue with my gdb cvs, because gdb just do a branch on the cvs trunk before it release a new release)
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 31, 2012, 04:07:41 am
Here is the log I uncomment the line 838 in gdb_driver.cpp, so that I can see what it actually handle the output string
Code
DebugLog(wxString::Format(_T("Command parsing output (cmd: %s): %s"), cmd->m_Cmd.c_str(), buffer.Left(idx).c_str()));


The log is below, when enter the first breakpoint, I just click on the second bp(line 210), but continue run the debugee, I still paused in the line 210.

Code
Debugger name and version: GNU gdb (GDB) 7.4.50.20120128-cvs

[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: set confirm off): >>>>>>
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: set width 0): >>>>>>
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: set height 0): >>>>>>
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: set breakpoint pending on): >>>>>>
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: set print asm-demangle on): >>>>>>
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: set unwindonsignal on): >>>>>>
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: set print elements 0): >>>>>>
[debug]> set debugevents on
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: set debugevents on): >>>>>>
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: set disassembly-flavor att): >>>>>>
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: catch throw): Catchpoint 1 (throw)
>>>>>>
[debug]> source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\stl.gdb
source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\wx.gdb
set print elements 200
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\stl.gdb
source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\wx.gdb
set print elements 200): >>>>>>
[debug]> directory E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:Source directories searched: E:/code/cb/cb_trunk/src/plugins/codecompletion/parser;$cdir;$cwd
[debug]Command parsing output (cmd: directory E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/): >>>>>>
[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:209"
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:209"): >>>>>>



[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:210"
[debug]Breakpoint 2 at 0x4345b4: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 209.
[debug]>>>>>>cb_gdb:Breakpoint 3 at 0x4345c2: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 210.
[debug]Command parsing output (cmd: break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:210"): Breakpoint 2 at 0x4345b4: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 209.
>>>>>>
[debug]> run
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: run): >>>>>>
[debug]Starting program: E:\code\cb\cb_trunk\src\devel\parsertest.exe
[debug]gdb: windows_init_thread_list

Child process PID: 3384

[debug][New Thread 3384.0xbc0]
[debug]d=bc0 code=LOAD_DLL_DEBUG_EVENT)
[debug]Breakpoint 2, Frame::Start (this=0x15f5c48) at E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209
[debug]E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209:10793:beg:0x4345b4
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: set debugevents off): Starting program: E:\code\cb\cb_trunk\src\devel\parsertest.exe
gdb: windows_init_thread_list
[New Thread 3384.0xbc0]
d=bc0 code=LOAD_DLL_DEBUG_EVENT)
Breakpoint 2, Frame::Start (this=0x15f5c48) at E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209
E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209:10793:beg:0x4345b4
>>>>>>

At E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209

[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:214"
[debug]Breakpoint 4 at 0x4345de: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 214.
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:214"): Breakpoint 4 at 0x4345de: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 214.
>>>>>>
[debug]> delete breakpoints 2
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: delete breakpoints 2): >>>>>>

Continuing...

[debug]> cont
[debug]Continuing.
[debug]Breakpoint 3, Frame::Start (this=0x15f5c48) at E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:210
[debug]E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:210:10842:beg:0x4345c2
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: cont): Continuing.
Breakpoint 3, Frame::Start (this=0x15f5c48) at E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:210
E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:210:10842:beg:0x4345c2
>>>>>>

At E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:210

Here is the mingw gdb official output
Code
Debugger name and version: GNU gdb (GDB) 7.3.1
......
set print elements 200
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\stl.gdb
source E:\code\cb\gcc\mingw-static-4.4.5-all\bin\wx.gdb
set print elements 200): >>>>>>
[debug]> directory E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:>>>>>>cb_gdb:
[debug]Command parsing output (cmd: directory E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/): >>>>>>
[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:209"
[debug]Breakpoint 2 at 0x4345b4: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 209.
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:209"): Breakpoint 2 at 0x4345b4: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 209.
>>>>>>
[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:210"
[debug]Breakpoint 3 at 0x4345c2: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 210.
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:210"): Breakpoint 3 at 0x4345c2: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 210.
>>>>>>
[debug]> run
[debug]gdb: windows_init_thread_list

Child process PID: 1744

[debug][New Thread 1744.0xb54]
[debug]Breakpoint 2, Frame::Start (this=0x15f5c48) at E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209
[debug]e:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209:10793:beg:0x4345b4
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: run): gdb: windows_init_thread_list
[New Thread 1744.0xb54]
Breakpoint 2, Frame::Start (this=0x15f5c48) at E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209
e:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209:10793:beg:0x4345b4
>>>>>>

At e:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:209

[debug]> set debugevents off
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: set debugevents off): >>>>>>
[debug]> break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:214"
[debug]Breakpoint 4 at 0x4345de: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 214.
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: break "E:/code/cb/cb_trunk/src/plugins/codecompletion/parser/frame.cpp:214"): Breakpoint 4 at 0x4345de: file E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp, line 214.
>>>>>>
[debug]> delete breakpoints 3
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: delete breakpoints 3): >>>>>>

Continuing...

[debug]> cont
[debug]Breakpoint 4, Frame::Start (this=0x15f5c48) at E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:214
[debug]e:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:214:10979:beg:0x4345de
[debug]>>>>>>cb_gdb:
[debug]Command parsing output (cmd: cont): Breakpoint 4, Frame::Start (this=0x15f5c48) at E:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:214
e:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:214:10979:beg:0x4345de
>>>>>>

At e:\code\cb\cb_trunk\src\plugins\codecompletion\parser\frame.cpp:214


Can you see the difference? when you delete the same line, the debugger plugin send different index command.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 31, 2012, 07:22:02 am
Ok, I just find that I may find the reason of this issue:

GDB will return a ">>>>>>cb_gdb:" (we call it FULL_GDB_PROMPT or GDB_PROMPT string, this is the customized gdb prompt by codeblocks) to indicate the previous command is executed correctly.

But it looks like every gdb command should return a GDB_PROMPT.

But when I have many custom script in the debugger setting dialog, such as: I put three command here.
Code
source $(TARGET_COMPILER_DIR)bin\stl.gdb
source $(TARGET_COMPILER_DIR)bin\wx.gdb
set print elements 200
Those three command will return three GDB_PROMPT.

Also, the command like setting the directory command will also return a GDB_PROMPT.

After that, we are sending setting break point command, then wait to receive the bp index from gdb. This is a handshake, gdb will return the correct bp index.
Now, if we do not eat/clear the previous GDB_PROMPT, they will be buffered, and serves as the response string from gdb, so we get a bp index mismatch.

So, the solution should be simple:
We should clear/wait the GDB_PROMPT after the custom gdb command, this will not later confuse the normal breakpoint command handshake.

Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: MortenMacFly on January 31, 2012, 07:24:07 am
Can you see the difference? when you delete the same line, the debugger plugin send different index command.
Mmmhh... that is weird, indeed. Looks like the output parsing queue is somehow corrupted, too. There should not be two ">>>>>>cb_gdb:" in one line...?! Is the GBD 7.4 debugger threaded?! Is the MinGW official the TDM-GCC one?
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 31, 2012, 07:32:38 am
Can you see the difference? when you delete the same line, the debugger plugin send different index command.
Mmmhh... that is weird, indeed. Looks like the output parsing queue is somehow corrupted, too. There should not be two ">>>>>>cb_gdb:" in one line...?!
Yes, I have debugged some hours, and find the reason in my previous posts.
Quote
Is the GBD 7.4 debugger threaded?! Is the MinGW official the TDM-GCC one?
Threat? dangerous? No, both should works quite well.
The gdb 7.4 was branched from the main trunk cvs about one or two months ago, and there are not many bug fixes targets to MinGW.
But the gdb cvs recently has many things changed targets to mingw, at least the "relocated feature", maybe other things. (you may see some discussions in gdb patches mail lists)

So, currently, I'm still use gdb cvs build myself. :)
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: MortenMacFly on January 31, 2012, 07:38:47 am
Threat? dangerous? No, both should works quite well.
LOL, no - I meant it may use threads to speed up things and then the output can come mixed. But this really should not be the case.

We should clear/wait the GDB_PROMPT after the custom gdb command, this will not later confuse the normal breakpoint command handshake.
Still weird that this does not happen with earlier versions of GDB.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 31, 2012, 07:50:57 am
Threat? dangerous? No, both should works quite well.
LOL, no - I meant it may use threads to speed up things and then the output can come mixed. But this really should not be the case.
I do not know whether gdb internally handle command by thread or not.

Quote
We should clear/wait the GDB_PROMPT after the custom gdb command, this will not later confuse the normal breakpoint command handshake.
Still weird that this does not happen with earlier versions of GDB.
That's because the later gdb, namely the gdb cvs I tested runs faster.
I have a compare test case:
1, the same test project
2, the same setting breakpoint before debugger started.
3, the same gdb cvs version and same gdb custom command.
The only difference is:
CaseA: I have a debug log code in the line 837 of gdb_dirver.cpp: (which log out a full send command and received text)
Code
DebugLog(wxString::Format(_T("###Handshake: %s #### %s #####"), cmd->m_Cmd.c_str(), buffer.c_str()));
CaseB: I just comment out the above debug log code.

The result is:
CaseA works Ok, no bp index mismatch.
CaseB works badly.

So, you see, The DebugLog code generally does not cause anything, but only a time delay, but this hide the issue.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 31, 2012, 08:49:48 am
I have a feeling that the output of gdb 7.4 has changed.
But I have very little intentions to fix it, sorry.
I'm switching all my energy to the gdb/mi plugin as I've said, before.

Edit: Probably you have to change the RunQueue and ParseOutput to wait for the prompt.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on January 31, 2012, 08:58:09 am
I have a feeling that the output of gdb 7.4 has changed.
But I have very little intentions to fix it, sorry.
I'm switching all my energy to the gdb/mi plugin as I've said, before.
Ok, gdb/mi is better to do the handshake with an IDE.  :)
Quote
Edit: Probably you have to change the RunQueue and ParseOutput to wait for the prompt.
I will try that if I have time, BTW: do you have a simple direction on which part/code snippet should be changed to wait the prompt?
Thanks.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on January 31, 2012, 09:11:36 am
The runqueue should not be called, before the next prompt has arrived, probably.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on February 01, 2012, 02:16:46 am
I have tried to fix this, but finally failed. So I decided to find a workaround. :)

Finally I find one workaround. That is: group all the custom gdb command in one *.gdb file.

Before:
Code
source $(TARGET_COMPILER_DIR)bin\stl.gdb
source $(TARGET_COMPILER_DIR)bin\wx.gdb
set print elements 200

After:
Code
source $(TARGET_COMPILER_DIR)bin\custom.gdb

Note: custom.gdb contains all the contents of the previous three command. Now, it works OK.
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: oBFusCATed on February 01, 2012, 09:34:57 am
ollydbg: you can remove the "set print elements 200", we have an option now.
Click the button in the debugger toolbar next to the button for the debug windows :)
Title: Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
Post by: ollydbg on February 01, 2012, 03:09:34 pm
ollydbg: you can remove the "set print elements 200", we have an option now.
Click the button in the debugger toolbar next to the button for the debug windows :)
Thanks for the hint, your suggest way works Ok.
There is a minor issue that the print element number value is not persistent. (When I close C::B, and restart it again, it was reset to 0 again). Then puting it in a gdb script file is surely persistent. ;)