Hi Ivan,

On Fri, Apr 12, 2013 at 08:32:06PM -0500, jorge ivan poot diaz wrote:
> > Do you want to see the value of this variable inside the debugger (gdb)?
> Yes . How I can do this?

As long as the strings are objects, you need a pretty-printer. You can
use dbg_dump():

(gdb) break SvxColorTabPage::ClickAddHdl_Impl
Breakpoint 1 at 0x7fca09794d8e: file 
/build/aoo/src/trunk/main/cui/source/tabpages/tpcolor.cxx, line 467.
(gdb) c
Continuing.

Breakpoint 1, SvxColorTabPage::ClickAddHdl_Impl (this=0x29ed358) at 
/build/aoo/src/trunk/main/cui/source/tabpages/tpcolor.cxx:467
467             Window *pWindow = this;
(gdb) n

(gdb) 
476             String aDesc( ResId( RID_SVXSTR_DESC_COLOR, rMgr ) );
(gdb) 
477             String aName( aEdtName.GetText() );
(gdb) 
479             long nCount = pColorTab->Count();
(gdb) print aDesc
$1 = {mpData = 0x2a204b0}
(gdb) print aName
$2 = {mpData = 0x2a16610}
(gdb) print dbg_dump(aDesc)
$3 = (const sal_Char *) 0x2968db8 "Please enter a name for the new
color:"
(gdb) print dbg_dump(aName)
$4 = (const sal_Char *) 0x2a3bd68 "Blue 9"


You can also create your gdb pretty-printers, as explained here:
http://sourceware.org/gdb/onlinedocs/gdb/Pretty-Printing.html
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Developer_Guide/debuggingprettyprinters.html
You may find some examples in /usr/share/gdb/auto-load/ if you installed
a debug package.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Attachment: pgpyoKko6upK6.pgp
Description: PGP signature

Reply via email to