User forums > Using Code::Blocks

Why C::B over write gdb's set print element value?

(1/3) > >>

ollydbg:
I see when start gdb, it is:

--- Code: ---set print elements -1

--- End code ---
This cause some problems, such as when a large String is put as a function argument(maybe, the wxString was loaded from a txt file), this will show all the contents of the String in the debugger log.

So, I think we can leave it as gdb default value is 200.
See:
Print Settings - Debugging with GDB

Jenna:
You should say, that it is only for the debugger-branch, not for trunk.

What I don't understand is, what the value of -1 means, because a value of 0 means unlimited.

ollydbg:

--- Quote from: jens on December 03, 2011, 02:30:21 pm ---You should say, that it is only for the debugger-branch, not for trunk.

--- End quote ---
Oh, sorry, I use only debugger branch these days.

--- Quote ---What I don't understand is, what the value of -1 means, because a value of 0 means unlimited.

--- End quote ---
Yes, as the gdb document said, it should be 0 (not -1).

oBFusCATed:
This is the reason:
http://svn.berlios.de/wsvn/codeblocks/branches/wxpropgrid_debugger/src/plugins/debuggergdb/gdb_driver.cpp?op=revision&rev=6393&peg=7585

ollydbg: can you give an example code?

ollydbg:

--- Quote from: oBFusCATed on December 04, 2011, 04:11:14 pm ---ollydbg: can you give an example code?

--- End quote ---
The sample code below:

--- Quote ---int main()
{
    char * p = new char[4000];
    p[1]=4;//set breakpoint here
    return 0;
}

--- End quote ---

You can just "print p" at the breakpoint, then gdb will show many trash.

Also, if the pointer p is passed to a function call. then when you run a "backtrace", the trash will be shown too.

Navigation

[0] Message Index

[#] Next page

Go to full version