Author Topic: [OT] unofficial MinGW GDB gdb with python released  (Read 254075 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #120 on: August 05, 2011, 08:58:24 am »
Thanks ollydbg for maintaining the unofficial MinGW gdb with python, and also for the translation to English of the "wiki page on how to build gdb". Both are very useful!
You are welcome. Happy sharing!!!
Today, I have also updated the wiki (English version) to the latest build steps, see the first post of this thread.
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 MindVortex

  • Single posting newcomer
  • *
  • Posts: 2
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #121 on: August 09, 2011, 09:16:26 pm »
Hi ollydbg! I specifically registered on this forum to ask you this question :-) Is it possible for you to post a 64-bit version of your python-enabled gdb?..

Offline xunxun

  • Almost regular
  • **
  • Posts: 187
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #122 on: August 09, 2011, 09:35:22 pm »
Hi ollydbg! I specifically registered on this forum to ask you this question :-) Is it possible for you to post a 64-bit version of your python-enabled gdb?..
Ollydbg doesn't have 64bit OS...
Regards,
xunxun

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #123 on: August 10, 2011, 03:26:41 am »
Hi ollydbg! I specifically registered on this forum to ask you this question :-) Is it possible for you to post a 64-bit version of your python-enabled gdb?..
As xunxun said, I do not have a 64bit windows system. so I can't build a native 64bit windows gdb. I guess that you can follow my instructions in the first post and build it yourself. Or I have searched on Google for you and found that you can download on from:
1, read the following posts here: http://lists.qt.nokia.com/pipermail/qt-creator/2011-March/008626.html
2, go to ftp here: ftp://ftp.qt.nokia.com/misc/gdb/7.2/
That's all I can help you.
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: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #124 on: August 10, 2011, 04:19:45 am »
BUMP:
the 2011-08-10 version just has auto-loaded gdb's own python script support for pretty-printer. see
[OT] unofficial MinGW GDB gdb with python released for more details.  :D
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 MindVortex

  • Single posting newcomer
  • *
  • Posts: 2
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #125 on: August 10, 2011, 10:43:48 am »
Thank you anyhow! I'll see what I can do.

Offline nenin

  • Almost regular
  • **
  • Posts: 201
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #126 on: August 17, 2011, 05:34:52 pm »
BUMP:
the 2011-08-10 version just has auto-loaded gdb's own python script support for pretty-printer. see
[OT] unofficial MinGW GDB gdb with python released for more details.  :D

It works ... but I found odd thing: sometimes gdb crashed on start. Looks like it try to prepare non-initialized local variables in main for pretty-printing. At least switch off corresponding option in Setting results in stable (and really fast) further operation.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #127 on: August 18, 2011, 03:16:55 am »
It works ... but I found odd thing: sometimes gdb crashed on start. Looks like it try to prepare non-initialized local variables in main for pretty-printing. At least switch off corresponding option in Setting results in stable (and really fast) further operation.
Did you mean like below:
Code
int main()
{
int a;// set breakpoint here

vector<string> b;

}
Then, you try to use pretty printer to show the variable b?
surely, b is non-initialized local variable, and this will let gdb/python script go to some un-expected behavior, like go infinite loop to show its member.

This is a known bug, I have discussed this bug in this forum before. I also have a workaround patch on GDB to compare the line number between the current PC address and the variable line, then try to filter out the non-initialized local variable. But I do not think this patch will be much reliable.
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 nenin

  • Almost regular
  • **
  • Posts: 201
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #128 on: August 18, 2011, 12:37:31 pm »
Did you mean like below:
Code
int main()
{
int a;// set breakpoint here

vector<string> b;

}
Then, you try to use pretty printer to show the variable b?
surely, b is non-initialized local variable, and this will let gdb/python script go to some un-expected behavior, like go infinite loop to show its member.
I did not. But C::B did it by default, in "Local variables" section of watch.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #129 on: August 18, 2011, 02:57:03 pm »
I did not. But C::B did it by default, in "Local variables" section of watch.
En, that's the same thing I said in my previous post.
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 nenin

  • Almost regular
  • **
  • Posts: 201
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #130 on: August 18, 2011, 05:04:59 pm »
I did not. But C::B did it by default, in "Local variables" section of watch.
En, that's the same thing I said in my previous post.
I suggest to highlight this problem, in header. 

Offline nenin

  • Almost regular
  • **
  • Posts: 201
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #131 on: August 27, 2011, 05:29:02 pm »
I found other issue. This declaration:
Code
const static std::string apms[5]={"&amp;","&lt;","&gt;","&quot;","&apos;"};
kills GDB.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #132 on: August 28, 2011, 03:07:12 am »
I found other issue. This declaration:
Code
const static std::string apms[5]={"&amp;","&lt;","&gt;","&quot;","&apos;"};
kills GDB.
I just test it and works here.(WinXP, MinGW GCC 4.6.1)

see the debug log:
Quote
> p apms
$1 = {"&amp;", "&lt;", "&gt;", "&quot;", "&apos;"}
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 nenin

  • Almost regular
  • **
  • Posts: 201
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #133 on: August 31, 2011, 06:56:18 pm »

see the debug log:
Quote
> p apms
$1 = {"&amp;", "&lt;", "&gt;", "&quot;", "&apos;"}
It works in gdb console. But in C::B watch  dgb fell. I use last TDM - dwarf, 7.3.50.20110810-cvs and CB::B 10.05

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: [OT] unofficial MinGW GDB gdb with python released
« Reply #134 on: September 01, 2011, 04:58:48 am »

see the debug log:
Quote
> p apms
$1 = {"&amp;", "&lt;", "&gt;", "&quot;", "&apos;"}
It works in gdb console. But in C::B watch  dgb fell. I use last TDM - dwarf, 7.3.50.20110810-cvs and CB::B 10.05

It works here.

1. c::b 10.05 is too old, I suggest you should use the latest nightly build debugger branch version.
2. you need to open the "Debugger settings" dialog, then uncheck the "enable watch script" option, if you use python based gdb. (I noticed that if you check this option when using python pretty printer, there will be a crash on gdb).


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.