Author Topic: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.  (Read 71212 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #30 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.
(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 renega_666

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #31 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?)
« Last Edit: January 29, 2012, 02:25:13 pm by renega_666 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #32 on: January 29, 2012, 02:36:40 pm »
Yes, remove the scripts and enable the option for watch scripts.
(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 renega_666

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #33 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:

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #34 on: January 29, 2012, 03:37:41 pm »
Hi, renega_666, 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.
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 renega_666

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #35 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!  ;)

Offline renega_666

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #36 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).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #37 on: January 29, 2012, 05:17:37 pm »
Hm, maybe I'll have to switch to windows for some debugging after all :(
(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: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #38 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)
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: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #39 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!
(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: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #40 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.

« Last Edit: January 30, 2012, 03:35:19 pm by ollydbg »
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: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #41 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?
(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: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #42 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.
« Last Edit: January 31, 2012, 03:08:04 am by ollydbg »
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #43 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)
« Last Edit: January 31, 2012, 03:06:34 am by ollydbg »
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: The 07 January 2012 build (7678) DEBUGGER BRANCH version is out.
« Reply #44 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.
« Last Edit: January 31, 2012, 04:19:57 am by ollydbg »
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.