Debugger

Leon Pollak leonp at plris.com
Wed Mar 28 14:31:59 BST 2007


On Wednesday 28 March 2007, Andreas Pakulat wrote:
> > Just for example:
> > 1. Breakpoints setting/removing does not work properly and this is so
> > obvious, that can not be not seen while debugging the kdevelop.
> Can you elaborate a bit? What does happen, what do you expect.
When I have two breakpoints in the same file, say 1 and 2, and I delete 1, 
then delete 2. What happens is that first 1 is deleted, but when I delete 2, 
the first is restored back!
Below is the gdb "show all" printout:
<font color="blue">(gdb) -break-delete 3</font>
^done
<font 
color="blue">(gdb) -break-insert /Development/Common/Common/hd.cpp:218</font>
^done,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x00026964",func="cRecordTmr::TSR(void*)",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="218",times="0"}
<font color="blue">(gdb) -break-delete 4</font>
^done
<font color="blue">(gdb) -break-condition 5 </font>
^done
<font color="blue">(gdb) -break-after 5 0</font>
^done
<font color="blue">(gdb) -break-enable 5</font>
^done

The lines after "break-delete 4" appeared at the moment of the second BP 
deletion.
Deletion of breakpoints via the "bp tab" does not help - they are restored 
somehow and appear as a gray circles... And sometimes bp is set but not 
displayed...

> > 2. Source pages very frequently do not follow the breakpoints fired.
> So kdevelop doesn't switch to the source file where the next BP is? We
> have a problem with the breakpointtable that manifests like this,
> however nobody ever could reproduce this problem more than 1 time.
I have this happenning many many times. i should say that correct behavior is 
much more seldom then incorrect.


> > 3. Green cursor indicating current position almost do not work in C++.
> Works for me all the time.
For me works only in one file till now. I can not say what is special in this 
file against others.

> > 4. The same about breakpoints indication - almost all are gray in C++.
> Same here
What do you mean? You too have them all gray? Or vise verse?


> > All this makes me think that I have some environmental problem. Can
> > somebody comment this?
> Which version of gdb are you using? Anything below 6.4 will fail, 6.6 is
> recommended. If thats already the version you have then please
> right-click the gdb tab after a debugger session and choose "show all
> commands", then copy everything and attach it to your next post.
Yes, I have 6.6. 
Below is the session printout. Hope it will help...

<font color="blue">(gdb) quit</font>
quit
The program is running.  Exit anyway? (y or n) [answered Y; input not from 
terminal]
<font color="blue">(gdb) Process exited</font>
/opt/rtems/bin/powerpc-gdb-6.6 /Development/Projects/DDR_10242/debug/./src/DDR_10242 --interpreter=mi2 -quiet<font 
color="blue">(gdb) set print static-members on</font>
set print static-members on
^done
<font color="blue">(gdb) set width 0</font>
set width 0
^done
<font color="blue">(gdb) set height 0</font>
set height 0
^done
<font color="blue">(gdb) set stop-on-solib-events 1</font>
set stop-on-solib-events 1
^done
<font color="blue">(gdb) handle SIG32 pass nostop noprint</font>
handle SIG32 pass nostop noprint
Signal        Stop	Print	Pass to program	Description
SIG32         No	No	Yes		Real-time event 32
^done
<font color="blue">(gdb) handle SIG41 pass nostop noprint</font>
handle SIG41 pass nostop noprint
Signal        Stop	Print	Pass to program	Description
SIG41         No	No	Yes		Real-time event 41
^done
<font color="blue">(gdb) handle SIG42 pass nostop noprint</font>
handle SIG42 pass nostop noprint
Signal        Stop	Print	Pass to program	Description
SIG42         No	No	Yes		Real-time event 42
^done
<font color="blue">(gdb) handle SIG43 pass nostop noprint</font>
handle SIG43 pass nostop noprint
Signal        Stop	Print	Pass to program	Description
SIG43         No	No	Yes		Real-time event 43
^done
<font color="blue">(gdb) set print asm-demangle on</font>
set print asm-demangle on
^done
<font color="blue">(gdb) set output-radix 10</font>
set output-radix 10
Output radix now set to decimal 10, hex a, octal 12.
^done
<font color="blue">(gdb) cd /Development/Projects/DDR_10242/debug/./src</font>
cd /Development/Projects/DDR_10242/debug/./src
Working directory /Development/Projects/DDR_10242/debug/src.
^done
<font 
color="blue">(gdb) -break-insert /Development/Common/Common/utils.cpp:14</font>
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00038798",func="CauseResetHW()",file="/Development/Projects/DDR_10242/common/utils.cpp",fullname="/Development/Projects/DDR_10242/common/utils.cpp",line="14",times="0"}
<font 
color="blue">(gdb) -break-insert /opt/rtems-4.7/rtems-src-4.7brunch/c/src/lib/libbsp/powerpc/FDR_8247/vectors/vectors_init.c:79</font>
^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0004a32c",func="C_exception_handler",file="/opt/rtems/rtems-src/c/src/lib/libbsp/powerpc/FDR_8247/vectors/vectors_init.c",fullname="/opt/rtems-4.7/rtems-src-4.7brunch/c/src/lib/libbsp/powerpc/FDR_8247/vectors/vectors_init.c",line="79",times="0"}
<font 
color="blue">(gdb) -break-insert /Development/Common/Common/hd.cpp:218</font>
^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x00026964",func="cRecordTmr::TSR(void*)",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="218",times="0"}
<font 
color="blue">(gdb) -break-insert /Development/Common/Common/hd.cpp:214</font>
^done,bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x000268f4",func="cRecordTmr::TSR(void*)",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="214",times="0"}
<font color="blue">(gdb) tty /dev/pts/11</font>
tty /dev/pts/11
^done
<font color="blue">(gdb) 
source /Development/Projects/DDR_10242/src/.gdbinit</font>
source /Development/Projects/DDR_10242/src/.gdbinit
Redefine command "o0"? (y or n) [answered Y; input not from terminal]
Redefine command "pci"? (y or n) [answered Y; input not from terminal]
The target endianness is set automatically (currently big endian)
The target may not be able to correctly handle a memory-write-packet-size
of 1024 bytes. Change the packet size? (y or n) [answered Y; input not from 
terminal]
warning: shared library handler failed to enable breakpoint
0xfe002b90 in ?? ()
Sleeping for 1 seconds.
done.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xfe00370c in ?? ()
Loading section .text, size 0x7ce9c lma 0x10000
Loading section .gcc_except_table, size 0x638 lma 0x8ce9c
Loading section .got, size 0x10 lma 0x8d4d4
Loading section .got2, size 0x620 lma 0x8d4e4
Loading section .fixup, size 0x7c0 lma 0x8db04
Loading section .data, size 0x1d8c lma 0x9b24c
Start address 0x10000, load size 524368
Transfer rate: 167416 bits/sec, 978 bytes/write.
^done
<font color="blue">(gdb) -break-condition 1 </font>
^done
<font color="blue">(gdb) -break-after 1 0</font>
^done
<font color="blue">(gdb) -break-enable 1</font>
^done
<font color="blue">(gdb) -break-condition 2 </font>
^done
<font color="blue">(gdb) -break-after 2 0</font>
^done
<font color="blue">(gdb) -break-enable 2</font>
^done
<font color="blue">(gdb) -break-condition 3 </font>
^done
<font color="blue">(gdb) -break-after 3 0</font>
^done
<font color="blue">(gdb) -break-enable 3</font>
^done
<font color="blue">(gdb) -break-condition 4 </font>
^done
<font color="blue">(gdb) -break-after 4 0</font>
^done
<font color="blue">(gdb) -break-enable 4</font>
^done
<font color="blue">(gdb) -exec-continue</font>
^running
Current language:  auto; currently c++
*stopped,reason="breakpoint-hit",bkptno="4",thread-id="0",frame={addr="0x000268f4",func="cRecordTmr::TSR",args=[{name="this",value="0x918d8"},
{name="UsDat",value="0x0"}],file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="214"}
<font color="blue">(gdb) -file-list-exec-source-file</font>
^done,line="214",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp"
<font color="blue">(gdb) -break-list</font>
^done,BreakpointTable={nr_rows="4",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00038798",func="CauseResetHW()",file="/Development/Projects/DDR_10242/common/utils.cpp",fullname="/Development/Projects/DDR_10242/common/utils.cpp",line="14",times="0"},bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0004a32c",func="C_exception_handler",file="/opt/rtems/rtems-src/c/src/lib/libbsp/powerpc/FDR_8247/vectors/vectors_init.c",fullname="/opt/rtems-4.7/rtems-src-4.7brunch/c/src/lib/libbsp/powerpc/FDR_8247/vectors/vectors_init.c",line="79",times="0"},bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x00026964",func="cRecordTmr::TSR(void*)",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="218",times="0"},bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x000268f4",func="cRecordTmr::TSR(void*)",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="214",times="1"}]}
<font color="blue">(gdb) -stack-list-arguments 0 0 0</font>
^done,stack-args=[frame={level="0",args=[name="this",name="UsDat"]}]
<font color="blue">(gdb) -stack-list-locals 0</font>
^done,locals=[name="l",name="UsedPercent",name="str",name="Point"]
<font color="blue">(gdb) -thread-list-ids</font>
warning: RMT ERROR : failed to get remote thread list.
^done,thread-ids={},number-of-threads="0"
<font color="blue">(gdb) info frame</font>
info frame
Stack level 0, frame at 0x4af9e0:
 pc = 0x268f4 in cRecordTmr::TSR(void*) 
(/Development/Projects/DDR_10242/common/hd.cpp:214); saved pc 0x27300
 called by frame at 0x4afa08
 source language c++.
 Arglist at 0x4af930, args: this=0x918d8, UsDat=0x0
 Locals at 0x4af930, Previous frame's sp is 0x4af9e0
 Saved registers:
  r29 at 0x4af9d4, r30 at 0x4af9d8, r31 at 0x4af9dc, pc at 0x4af9e4, lr at 
0x4af9e4
^done
<font color="blue">(gdb) -stack-info-depth 6</font>
^done,depth="6"
<font color="blue">(gdb) -stack-list-frames 0 5</font>
^done,stack=[frame={level="0",addr="0x000268f4",func="cRecordTmr::TSR",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="214"},frame={level="1",addr="0x00027300",func="cHDTask::State2Record",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="124"},frame={level="2",addr="0x00027b68",func="cHDTask::Body",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="69"},frame={level="3",addr="0x000266a0",func="cTask::Dummy",file="/Development/Projects/DDR_10242/common/rtems++.h",fullname="/Development/Projects/DDR_10242/common/rtems++.h",line="57"},frame={level="4",addr="0x0006cff0",func="_Thread_Handler",file="/opt/rtems/rtems-src/c/src/../../cpukit/score/src/threadhandler.c",fullname="/opt/rtems-4.7/rtems-src-4.7brunch/cpukit/score/src/threadhandler.c",line="127"},frame={level="5",addr="0x0006cf24",func="rtems_is_status_successful",file="../../cpukit/../../../FDR_8247/lib/include/rtems/rtems/status.inl",fullname="/opt/rtems-4.7/build/powerpc-rtems/FDR_8247/lib/include/rtems/rtems/status.inl",line="37"}]
<font color="blue">(gdb) print /x &this</font>
print /x &this
$1 = 0x4af9c8
^done
<font color="blue">(gdb) -var-create KDEV164 * "this"</font>
^done,name="KDEV164",numchild="1",type="cRecordTmr * const"
<font color="blue">(gdb) print /x &UsDat</font>
print /x &UsDat
$2 = 0x4af9cc
^done
<font color="blue">(gdb) -var-create KDEV165 * "UsDat"</font>
^done,name="KDEV165",numchild="0",type="void *"
<font color="blue">(gdb) print /x &l</font>
print /x &l
$3 = 0x4af93c
^done
<font color="blue">(gdb) -var-create KDEV166 * "l"</font>
^done,name="KDEV166",numchild="0",type="uint"
<font color="blue">(gdb) print /x &UsedPercent</font>
print /x &UsedPercent
$4 = 0x4af938
^done
<font color="blue">(gdb) -var-create KDEV167 * "UsedPercent"</font>
^done,name="KDEV167",numchild="0",type="uint"
<font color="blue">(gdb) print /x &str</font>
print /x &str
$5 = 0x918e8
^done
<font color="blue">(gdb) -var-create KDEV168 * "str"</font>
^done,name="KDEV168",numchild="10",type="char [10]"
<font color="blue">(gdb) print /x &Point</font>
print /x &Point
$6 = 0x986c8
^done
<font color="blue">(gdb) -var-create KDEV169 * "Point"</font>
^done,name="KDEV169",numchild="0",type="bool"
<font color="blue">(gdb) print /x &this</font>
print /x &this
$7 = 0x4af9c8
^done
<font color="blue">(gdb) whatis this</font>
whatis this
type = cRecordTmr * const
^done
<font color="blue">(gdb) print /x &UsDat</font>
print /x &UsDat
$8 = 0x4af9cc
^done
<font color="blue">(gdb) whatis UsDat</font>
whatis UsDat
type = void *
^done
<font color="blue">(gdb) print /x &l</font>
print /x &l
$9 = 0x4af93c
^done
<font color="blue">(gdb) whatis l</font>
whatis l
type = uint
^done
<font color="blue">(gdb) print /x &UsedPercent</font>
print /x &UsedPercent
$10 = 0x4af938
^done
<font color="blue">(gdb) whatis UsedPercent</font>
whatis UsedPercent
type = uint
^done
<font color="blue">(gdb) print /x &str</font>
print /x &str
$11 = 0x918e8
^done
<font color="blue">(gdb) whatis str</font>
whatis str
type = char [10]
^done
<font color="blue">(gdb) print /x &Point</font>
print /x &Point
$12 = 0x986c8
^done
<font color="blue">(gdb) whatis Point</font>
whatis Point
type = bool
^done
<font color="blue">(gdb) -var-update *</font>
^done,changelist=[]
<font color="blue">(gdb) -var-evaluate-expression "KDEV164"</font>
^done,value="0x918d8"
<font color="blue">(gdb) -var-evaluate-expression "KDEV165"</font>
^done,value="0x0"
<font color="blue">(gdb) -var-evaluate-expression "KDEV166"</font>
^done,value="640"
<font color="blue">(gdb) -var-evaluate-expression "KDEV167"</font>
^done,value="0"
<font color="blue">(gdb) -var-evaluate-expression "KDEV168"</font>
^done,value="[10]"
<font color="blue">(gdb) -var-evaluate-expression "KDEV169"</font>
^done,value="false"
<font color="blue">(gdb) -exec-continue</font>
^running
*stopped,reason="breakpoint-hit",bkptno="3",thread-id="0",frame={addr="0x00026964",func="cRecordTmr::TSR",args=[{name="this",value="0x918d8"},
{name="UsDat",value="0x0"}],file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="218"}
<font color="blue">(gdb) -file-list-exec-source-file</font>
^done,line="218",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp"
<font color="blue">(gdb) -break-list</font>
^done,BreakpointTable={nr_rows="4",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00038798",func="CauseResetHW()",file="/Development/Projects/DDR_10242/common/utils.cpp",fullname="/Development/Projects/DDR_10242/common/utils.cpp",line="14",times="0"},bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0004a32c",func="C_exception_handler",file="/opt/rtems/rtems-src/c/src/lib/libbsp/powerpc/FDR_8247/vectors/vectors_init.c",fullname="/opt/rtems-4.7/rtems-src-4.7brunch/c/src/lib/libbsp/powerpc/FDR_8247/vectors/vectors_init.c",line="79",times="0"},bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x00026964",func="cRecordTmr::TSR(void*)",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="218",times="1"},bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x000268f4",func="cRecordTmr::TSR(void*)",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="214",times="1"}]}
<font color="blue">(gdb) -stack-list-arguments 0 0 0</font>
^done,stack-args=[frame={level="0",args=[name="this",name="UsDat"]}]
<font color="blue">(gdb) -stack-list-locals 0</font>
^done,locals=[name="l",name="UsedPercent",name="str",name="Point"]
<font color="blue">(gdb) -thread-list-ids</font>
warning: RMT ERROR : failed to get remote thread list.
^done,thread-ids={},number-of-threads="0"
<font color="blue">(gdb) info frame</font>
info frame
Stack level 0, frame at 0x4af9e0:
 pc = 0x26964 in cRecordTmr::TSR(void*) 
(/Development/Projects/DDR_10242/common/hd.cpp:218); saved pc 0x27300
 called by frame at 0x4afa08
 source language c++.
 Arglist at 0x4af930, args: this=0x918d8, UsDat=0x0
 Locals at 0x4af930, Previous frame's sp is 0x4af9e0
 Saved registers:
  r29 at 0x4af9d4, r30 at 0x4af9d8, r31 at 0x4af9dc, pc at 0x4af9e4, lr at 
0x4af9e4
^done
<font color="blue">(gdb) -stack-info-depth 6</font>
^done,depth="6"
<font color="blue">(gdb) -stack-list-frames 0 5</font>
^done,stack=[frame={level="0",addr="0x00026964",func="cRecordTmr::TSR",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="218"},frame={level="1",addr="0x00027300",func="cHDTask::State2Record",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="124"},frame={level="2",addr="0x00027b68",func="cHDTask::Body",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="69"},frame={level="3",addr="0x000266a0",func="cTask::Dummy",file="/Development/Projects/DDR_10242/common/rtems++.h",fullname="/Development/Projects/DDR_10242/common/rtems++.h",line="57"},frame={level="4",addr="0x0006cff0",func="_Thread_Handler",file="/opt/rtems/rtems-src/c/src/../../cpukit/score/src/threadhandler.c",fullname="/opt/rtems-4.7/rtems-src-4.7brunch/cpukit/score/src/threadhandler.c",line="127"},frame={level="5",addr="0x0006cf24",func="rtems_is_status_successful",file="../../cpukit/../../../FDR_8247/lib/include/rtems/rtems/status.inl",fullname="/opt/rtems-4.7/build/powerpc-rtems/FDR_8247/lib/include/rtems/rtems/status.inl",line="37"}]
<font color="blue">(gdb) print /x &this</font>
print /x &this
$13 = 0x4af9c8
^done
<font color="blue">(gdb) whatis this</font>
whatis this
type = cRecordTmr * const
^done
<font color="blue">(gdb) print /x &UsDat</font>
print /x &UsDat
$14 = 0x4af9cc
^done
<font color="blue">(gdb) whatis UsDat</font>
whatis UsDat
type = void *
^done
<font color="blue">(gdb) print /x &l</font>
print /x &l
$15 = 0x4af93c
^done
<font color="blue">(gdb) whatis l</font>
whatis l
type = uint
^done
<font color="blue">(gdb) print /x &UsedPercent</font>
print /x &UsedPercent
$16 = 0x4af938
^done
<font color="blue">(gdb) whatis UsedPercent</font>
whatis UsedPercent
type = uint
^done
<font color="blue">(gdb) print /x &str</font>
print /x &str
$17 = 0x918e8
^done
<font color="blue">(gdb) whatis str</font>
whatis str
type = char [10]
^done
<font color="blue">(gdb) print /x &Point</font>
print /x &Point
$18 = 0x986c8
^done
<font color="blue">(gdb) whatis Point</font>
whatis Point
type = bool
^done
<font color="blue">(gdb) -var-update *</font>
^done,changelist=[{name="KDEV169",in_scope="true",type_changed="false"}]
<font color="blue">(gdb) -var-evaluate-expression "KDEV169"</font>
^done,value="true"
<font color="blue">(gdb) -exec-continue</font>
^running
*stopped,reason="breakpoint-hit",bkptno="4",thread-id="0",frame={addr="0x000268f4",func="cRecordTmr::TSR",args=[{name="this",value="0x918d8"},
{name="UsDat",value="0x0"}],file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="214"}
<font color="blue">(gdb) -file-list-exec-source-file</font>
^done,line="214",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp"
<font color="blue">(gdb) -break-list</font>
^done,BreakpointTable={nr_rows="4",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00038798",func="CauseResetHW()",file="/Development/Projects/DDR_10242/common/utils.cpp",fullname="/Development/Projects/DDR_10242/common/utils.cpp",line="14",times="0"},bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0004a32c",func="C_exception_handler",file="/opt/rtems/rtems-src/c/src/lib/libbsp/powerpc/FDR_8247/vectors/vectors_init.c",fullname="/opt/rtems-4.7/rtems-src-4.7brunch/c/src/lib/libbsp/powerpc/FDR_8247/vectors/vectors_init.c",line="79",times="0"},bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x00026964",func="cRecordTmr::TSR(void*)",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="218",times="1"},bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x000268f4",func="cRecordTmr::TSR(void*)",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="214",times="2"}]}
<font color="blue">(gdb) -stack-list-arguments 0 0 0</font>
^done,stack-args=[frame={level="0",args=[name="this",name="UsDat"]}]
<font color="blue">(gdb) -stack-list-locals 0</font>
^done,locals=[name="l",name="UsedPercent",name="str",name="Point"]
<font color="blue">(gdb) -thread-list-ids</font>
warning: RMT ERROR : failed to get remote thread list.
^done,thread-ids={},number-of-threads="0"
<font color="blue">(gdb) info frame</font>
info frame
Stack level 0, frame at 0x9f190:
 pc = 0x268f4 in cRecordTmr::TSR(void*) 
(/Development/Projects/DDR_10242/common/hd.cpp:214); saved pc 0x2a474
 called by frame at 0x9f1a8
 source language c++.
 Arglist at 0x9f0e0, args: this=0x918d8, UsDat=0x0
 Locals at 0x9f0e0, Previous frame's sp is 0x9f190
 Saved registers:
  r29 at 0x9f184, r30 at 0x9f188, r31 at 0x9f18c, pc at 0x9f194, lr at 0x9f194
^done
<font color="blue">(gdb) -stack-info-depth 6</font>
^done,depth="6"
<font color="blue">(gdb) -stack-list-frames 0 5</font>
^done,stack=[frame={level="0",addr="0x000268f4",func="cRecordTmr::TSR",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="214"},frame={level="1",addr="0x0002a474",func="cTimer<(TimerTypes)
0>::Dummy",file="/Development/Projects/DDR_10242/common/rtems++.h",fullname="/Development/Projects/DDR_10242/common/rtems++.h",line="137"},frame={level="2",addr="0x00066118",func="_Watchdog_Tickle",file="/opt/rtems/rtems-src/c/src/../../cpukit/score/src/watchdogtickle.c",fullname="/opt/rtems-4.7/rtems-src-4.7brunch/cpukit/score/src/watchdogtickle.c",line="95"},frame={level="3",addr="0x0004e2ac",func="_Watchdog_Tickle_ticks",file="../../cpukit/../../../FDR_8247/lib/include/rtems/score/watchdog.inl",fullname="/opt/rtems-4.7/build/powerpc-rtems/FDR_8247/lib/include/rtems/score/watchdog.inl",line="96"},frame={level="4",addr="0x0004e1f8",func="rtems_clock_tick",file="/opt/rtems/rtems-src/c/src/../../cpukit/rtems/src/clocktick.c",fullname="/opt/rtems-4.7/rtems-src-4.7brunch/cpukit/rtems/src/clocktick.c",line="46"},frame={level="5",addr="0x00047cf0",func="Clock_isr",file="/opt/rtems/rtems-src/c/src/lib/libcpu/powerpc/mpc8260/clock/clock.c",fullname="/opt/rtems-4.7/rtems-src-4.7brunch/c/src/lib/libcpu/powerpc/mpc8260/clock/clock.c",line="79"}]
<font color="blue">(gdb) -var-delete "KDEV164"</font>
^done,ndeleted="1"
<font color="blue">(gdb) -var-delete "KDEV165"</font>
^done,ndeleted="1"
<font color="blue">(gdb) -var-delete "KDEV166"</font>
^done,ndeleted="1"
<font color="blue">(gdb) -var-delete "KDEV167"</font>
^done,ndeleted="1"
<font color="blue">(gdb) -var-delete "KDEV168"</font>
^done,ndeleted="1"
<font color="blue">(gdb) -var-delete "KDEV169"</font>
^done,ndeleted="1"
<font color="blue">(gdb) print /x &this</font>
print /x &this
$19 = 0x9f178
^done
<font color="blue">(gdb) -var-create KDEV170 * "this"</font>
^done,name="KDEV170",numchild="1",type="cRecordTmr * const"
<font color="blue">(gdb) print /x &UsDat</font>
print /x &UsDat
$20 = 0x9f17c
^done
<font color="blue">(gdb) -var-create KDEV171 * "UsDat"</font>
^done,name="KDEV171",numchild="0",type="void *"
<font color="blue">(gdb) print /x &l</font>
print /x &l
$21 = 0x9f0ec
^done
<font color="blue">(gdb) -var-create KDEV172 * "l"</font>
^done,name="KDEV172",numchild="0",type="uint"
<font color="blue">(gdb) print /x &UsedPercent</font>
print /x &UsedPercent
$22 = 0x9f0e8
^done
<font color="blue">(gdb) -var-create KDEV173 * "UsedPercent"</font>
^done,name="KDEV173",numchild="0",type="uint"
<font color="blue">(gdb) print /x &str</font>
print /x &str
$23 = 0x918e8
^done
<font color="blue">(gdb) -var-create KDEV174 * "str"</font>
^done,name="KDEV174",numchild="10",type="char [10]"
<font color="blue">(gdb) print /x &Point</font>
print /x &Point
$24 = 0x986c8
^done
<font color="blue">(gdb) -var-create KDEV175 * "Point"</font>
^done,name="KDEV175",numchild="0",type="bool"
<font color="blue">(gdb) print /x &this</font>
print /x &this
$25 = 0x9f178
^done
<font color="blue">(gdb) whatis this</font>
whatis this
type = cRecordTmr * const
^done
<font color="blue">(gdb) print /x &UsDat</font>
print /x &UsDat
$26 = 0x9f17c
^done
<font color="blue">(gdb) whatis UsDat</font>
whatis UsDat
type = void *
^done
<font color="blue">(gdb) print /x &l</font>
print /x &l
$27 = 0x9f0ec
^done
<font color="blue">(gdb) whatis l</font>
whatis l
type = uint
^done
<font color="blue">(gdb) print /x &UsedPercent</font>
print /x &UsedPercent
$28 = 0x9f0e8
^done
<font color="blue">(gdb) whatis UsedPercent</font>
whatis UsedPercent
type = uint
^done
<font color="blue">(gdb) print /x &str</font>
print /x &str
$29 = 0x918e8
^done
<font color="blue">(gdb) whatis str</font>
whatis str
type = char [10]
^done
<font color="blue">(gdb) print /x &Point</font>
print /x &Point
$30 = 0x986c8
^done
<font color="blue">(gdb) whatis Point</font>
whatis Point
type = bool
^done
<font color="blue">(gdb) -var-update *</font>
^done,changelist=[]
<font color="blue">(gdb) -var-evaluate-expression "KDEV170"</font>
^done,value="0x918d8"
<font color="blue">(gdb) -var-evaluate-expression "KDEV171"</font>
^done,value="0x0"
<font color="blue">(gdb) -var-evaluate-expression "KDEV172"</font>
^done,value="640"
<font color="blue">(gdb) -var-evaluate-expression "KDEV173"</font>
^done,value="0"
<font color="blue">(gdb) -var-evaluate-expression "KDEV174"</font>
^done,value="[10]"
<font color="blue">(gdb) -var-evaluate-expression "KDEV175"</font>
^done,value="true"
<font color="blue">(gdb) -exec-step</font>
^running
Current language:  auto; currently c
*stopped,reason="end-stepping-range",thread-id="0",frame={addr="0x0006f32c",func="sprintf",args=[{name="str",value="0x918e8 
\"RCRD  0%\""},{name="fmt",value="0x84ffc 
\"RCRD %2d%%\""}],file="../../../../../../../gcc-4.1.1/newlib/libc/stdio/sprintf.c",line="380"}
<font color="blue">(gdb) -file-list-exec-source-file</font>
^done,line="380",file="../../../../../../../gcc-4.1.1/newlib/libc/stdio/sprintf.c"
<font color="blue">(gdb) -break-list</font>
^done,BreakpointTable={nr_rows="4",nr_cols="6",hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00038798",func="CauseResetHW()",file="/Development/Projects/DDR_10242/common/utils.cpp",fullname="/Development/Projects/DDR_10242/common/utils.cpp",line="14",times="0"},bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0004a32c",func="C_exception_handler",file="/opt/rtems/rtems-src/c/src/lib/libbsp/powerpc/FDR_8247/vectors/vectors_init.c",fullname="/opt/rtems-4.7/rtems-src-4.7brunch/c/src/lib/libbsp/powerpc/FDR_8247/vectors/vectors_init.c",line="79",times="0"},bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x00026964",func="cRecordTmr::TSR(void*)",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="218",times="1"},bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x000268f4",func="cRecordTmr::TSR(void*)",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="214",times="2"}]}
<font color="blue">(gdb) -stack-list-arguments 0 0 0</font>
^done,stack-args=[frame={level="0",args=[name="str",name="fmt"]}]
<font color="blue">(gdb) -stack-list-locals 0</font>
^done,locals=[name="ap",name="f"]
<font color="blue">(gdb) -thread-list-ids</font>
warning: RMT ERROR : failed to get remote thread list.
^done,thread-ids={},number-of-threads="0"
<font color="blue">(gdb) info frame</font>
info frame
Stack level 0, frame at 0x9f0e0:
 pc = 0x6f32c in sprintf 
(../../../../../../../gcc-4.1.1/newlib/libc/stdio/sprintf.c:380); saved pc 
0x26910
 called by frame at 0x9f190
 source language c.
 Arglist at 0x9f000, args: str=0x918e8 "RCRD  0%", fmt=0x84ffc "RCRD %2d%%"
 Locals at 0x9f000, Previous frame's sp is 0x9f0e0
 Saved registers:
  r30 at 0x9f0d8, r31 at 0x9f0dc, pc at 0x9f0e4, lr at 0x9f0e4
^done
<font color="blue">(gdb) -stack-info-depth 6</font>
^done,depth="6"
<font color="blue">(gdb) -stack-list-frames 0 5</font>
^done,stack=[frame={level="0",addr="0x0006f32c",func="sprintf",file="../../../../../../../gcc-4.1.1/newlib/libc/stdio/sprintf.c",line="380"},frame={level="1",addr="0x00026910",func="cRecordTmr::TSR",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="214"},frame={level="2",addr="0x0002a474",func="cTimer<(TimerTypes)
0>::Dummy",file="/Development/Projects/DDR_10242/common/rtems++.h",fullname="/Development/Projects/DDR_10242/common/rtems++.h",line="137"},frame={level="3",addr="0x00066118",func="_Watchdog_Tickle",file="/opt/rtems/rtems-src/c/src/../../cpukit/score/src/watchdogtickle.c",fullname="/opt/rtems-4.7/rtems-src-4.7brunch/cpukit/score/src/watchdogtickle.c",line="95"},frame={level="4",addr="0x0004e2ac",func="_Watchdog_Tickle_ticks",file="../../cpukit/../../../FDR_8247/lib/include/rtems/score/watchdog.inl",fullname="/opt/rtems-4.7/build/powerpc-rtems/FDR_8247/lib/include/rtems/score/watchdog.inl",line="96"},frame={level="5",addr="0x0004e1f8",func="rtems_clock_tick",file="/opt/rtems/rtems-src/c/src/../../cpukit/rtems/src/clocktick.c",fullname="/opt/rtems-4.7/rtems-src-4.7brunch/cpukit/rtems/src/clocktick.c",line="46"}]
<font color="blue">(gdb) -var-delete "KDEV170"</font>
^done,ndeleted="1"
<font color="blue">(gdb) -var-delete "KDEV171"</font>
^done,ndeleted="1"
<font color="blue">(gdb) -var-delete "KDEV172"</font>
^done,ndeleted="1"
<font color="blue">(gdb) -var-delete "KDEV173"</font>
^done,ndeleted="1"
<font color="blue">(gdb) -var-delete "KDEV174"</font>
^done,ndeleted="1"
<font color="blue">(gdb) -var-delete "KDEV175"</font>
^done,ndeleted="1"
<font color="blue">(gdb) print /x &str</font>
print /x &str
Address requested for identifier "str" which is in register $r3
^error,msg="Address requested for identifier \"str\" which is in register $r3"
<font color="blue">(gdb) -var-create KDEV176 * "str"</font>
^done,name="KDEV176",numchild="1",type="char *"
<font color="blue">(gdb) print /x &fmt</font>
print /x &fmt
Address requested for identifier "fmt" which is in register $r4
^error,msg="Address requested for identifier \"fmt\" which is in register $r4"
<font color="blue">(gdb) -var-create KDEV177 * "fmt"</font>
^done,name="KDEV177",numchild="1",type="const char *"
<font color="blue">(gdb) print /x &ap</font>
print /x &ap
$31 = 0x9f008
^done
<font color="blue">(gdb) -var-create KDEV178 * "ap"</font>
^done,name="KDEV178",numchild="1",type="va_list"
<font color="blue">(gdb) print /x &f</font>
print /x &f
$32 = 0x9f014
^done
<font color="blue">(gdb) -var-create KDEV179 * "f"</font>
^done,name="KDEV179",numchild="22",type="FILE"
<font color="blue">(gdb) print /x &str</font>
print /x &str
Address requested for identifier "str" which is in register $r3
^error,msg="Address requested for identifier \"str\" which is in register $r3"
<font color="blue">(gdb) whatis str</font>
whatis str
type = char *
^done
<font color="blue">(gdb) print /x &fmt</font>
print /x &fmt
Address requested for identifier "fmt" which is in register $r4
^error,msg="Address requested for identifier \"fmt\" which is in register $r4"
<font color="blue">(gdb) whatis fmt</font>
whatis fmt
type = const char *
^done
<font color="blue">(gdb) print /x &ap</font>
print /x &ap
$33 = 0x9f008
^done
<font color="blue">(gdb) whatis ap</font>
whatis ap
type = va_list
^done
<font color="blue">(gdb) print /x &f</font>
print /x &f
$34 = 0x9f014
^done
<font color="blue">(gdb) whatis f</font>
whatis f
type = FILE
^done
<font color="blue">(gdb) -var-update *</font>
^done,changelist=[]
<font color="blue">(gdb) -var-evaluate-expression "KDEV176"</font>
^done,value="0x918e8 \"RCRD  0%\""
<font color="blue">(gdb) -var-evaluate-expression "KDEV177"</font>
^done,value="0x84ffc \"RCRD %2d%%\""
<font color="blue">(gdb) -var-evaluate-expression "KDEV178"</font>
^done,value="[1]"
<font color="blue">(gdb) -var-evaluate-expression "KDEV179"</font>
^done,value="{...}"
<font color="blue">(gdb) -break-delete 3</font>
^done
<font 
color="blue">(gdb) -break-insert /Development/Common/Common/hd.cpp:218</font>
^done,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x00026964",func="cRecordTmr::TSR(void*)",file="/Development/Projects/DDR_10242/common/hd.cpp",fullname="/Development/Projects/DDR_10242/common/hd.cpp",line="218",times="0"}
<font color="blue">(gdb) -break-delete 4</font>
^done
<font color="blue">(gdb) -break-condition 5 </font>
^done
<font color="blue">(gdb) -break-after 5 0</font>
^done
<font color="blue">(gdb) -break-enable 5</font>
^done
-----------
Leon




More information about the KDevelop mailing list