This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: View registers from stack frames


>>> I'm using a self built gdb-6.1.1 for PPC-targets and cygwin. The
>>> communication with the target is over a stub-server to a PPC-board.
>>
>>For PPC, try 6.2 instead.
>>
>>As Andrew already explained, this is what is supposed to happen.  It
>>did not used to work but was fixed by the new frame architecture.
>
>Ok, I will try 6.2 then.

Hmm, that didn't seem to work better... I should say different.

(gdb) thread 21
[Switching to thread 21 (Thread 1578452)]#0  CMyWorkerTask::Test (
    this=0x1815d4, str=@0x18d734)
    at N:\Temp\SAMCLASS\Applicat\Src\Test1.cpp:476
476                             while (uTest2 < 3000001){
(gdb) bt
#0  CMyWorkerTask::Test (this=0x1815d4, str=@0x18d734)
    at N:\Temp\SAMCLASS\Applicat\Src\Test1.cpp:476
#1  0x00060564 in CMyWorkerTask::Test (this=0x1815d4, str=@0x18d734)
    at N:\Temp\SAMCLASS\Applicat\Src\Test1.cpp:469
#2  0x00060564 in CMyWorkerTask::Test (this=0x1815d4, str=@0x210)
    at N:\Temp\SAMCLASS\Applicat\Src\Test1.cpp:469
#3  0x00060564 in CMyWorkerTask::Test (this=0x1815d4, str=@0x0)
    at N:\Temp\SAMCLASS\Applicat\Src\Test1.cpp:469
#4  0x00060564 in CMyWorkerTask::Test (this=0x1815d4, str=@0x64646464)
    at N:\Temp\SAMCLASS\Applicat\Src\Test1.cpp:469
#5  0x00060564 in CMyWorkerTask::Test (this=0x1815d4, str=@0x32414000)
    at N:\Temp\SAMCLASS\Applicat\Src\Test1.cpp:469
Previous frame inner to this frame (corrupt stack?)

(gdb) info frame
Stack level 0, frame at 0x18d6b4:
 pc = 0x6056c in CMyWorkerTask::Test(CINOSString &)
    (N:\Temp\SAMCLASS\Applicat\Src\Test1.cpp:476); saved pc 0x60564
 called by frame at 0x18d6fc
 source language c++.
 Arglist at 0x18d66c, args: this=0x1815d4, str=@0x18d734
 Locals at 0x18d66c, Previous frame's sp is 0x18d6b4

(gdb) p/x $pc
$1 = 0x6056c
(gdb) p/x $lr
$2 = 0x60564

(gdb) frame 1
#1  0x00060564 in CMyWorkerTask::Test (this=0x1815d4, str=@0x18d734)
    at N:\Temp\SAMCLASS\Applicat\Src\Test1.cpp:469
469                             Test(str);
(gdb) info frame
Stack level 1, frame at 0x18d6fc:
 pc = 0x60564 in CMyWorkerTask::Test(CINOSString &)
    (N:\Temp\SAMCLASS\Applicat\Src\Test1.cpp:469); saved pc 0x60564
 called by frame at 0x18d7d4, caller of frame at 0x18d6b4
 source language c++.
 Arglist at 0x18d6b4, args: this=0x1815d4, str=@0x18d734
 Locals at 0x18d6b4, Previous frame's sp is 0x18d6fc

(gdb) p/x $pc
$3 = 0x60564
(gdb) p/x $lr
$4 = 0x60564

(gdb) frame 2
#2  0x00060564 in CMyWorkerTask::Test (this=0x1815d4, str=@0x210)
    at N:\Temp\SAMCLASS\Applicat\Src\Test1.cpp:469
469                             Test(str);
(gdb) info frame
Stack level 2, frame at 0x18d7d4:
 pc = 0x60564 in CMyWorkerTask::Test(CINOSString &)
    (N:\Temp\SAMCLASS\Applicat\Src\Test1.cpp:469); saved pc 0x60564
 called by frame at 0x18d9b4, caller of frame at 0x18d6fc
 source language c++.
 Arglist at 0x18d6fc, args: this=0x1815d4, str=@0x210
 Locals at 0x18d6fc, Previous frame's sp is 0x18d7d4

(gdb) p/x $pc
$5 = 0x60564
(gdb) p/x $lr
$6 = 0x60564


It is better in so far as the pc did change from frame 0 to frame 1.
But now reading the whole call stack is messed up. Funny though
that only the pc stays the same, other values do change.

That was with exactly the same setup as before. But maybe gdb-6.2
needs different values from the stub...? If I go back to gdb-6.1.1
it works again.

Should I try an even newer gdb then?

Thanks

bye  Fabi



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]