Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Wrong frame level info from CDT.

Mikhail,

	I could not get to the rock bottom of the problem as this problem is
not reproducible all the times. 
But we have been getting No frame with frame # or frame address from time to
time. 
Some times, the frame # is -1 & sometimes, the frame # is 3 or 4 (where just
frames does not exist at all)

There could be something the following code is messing up with[Thread.java:
278]
// Need the GDB/MI view of level which is the reverse, i.e. the highest
level is 0
// See comment in StackFrame constructor.
	int miLevel = getStackFrameCount() - frameLevel;

I have just listed the MI annotatations for one such scenario.


[1,133,878,523,970] 18118-exec-step 1
[1,133,878,523,970] 18118^running
[1,133,878,523,970] (gdb) 
[1,133,878,524,110]
18118*stopped,reason="end-stepping-range",thread-id="1",frame={addr="0x00000
0000\
4205be2",func="vim_strsave",args=[{name="string"}],file="/home/balask/thread
s/Vim/vim62/src/misc2.c"\
,line="915"}
[1,133,878,524,110] (gdb) 
[1,133,878,524,110] 18119 info threads
[1,133,878,524,126] &"info threads\n"
[1,133,878,524,313] ~"*   1 system thread 1729469 Priority:178  "
[1,133,878,524,313]
18119^done,frame={func="vim_strsave",args=[{name="string"}],file="/home/bala
sk/t\
hreads/Vim/vim62/src/misc2.c",line="915"}
[1,133,878,524,313] (gdb) 
[1,133,878,524,313] 18120-stack-info-depth
[1,133,878,524,329] 18120^done,depth="3"
[1,133,878,524,329] (gdb) 
[1,133,878,524,329] 18121-stack-list-frames 0 3
[1,133,878,524,345] 18121^done,stack=[frame={level="0
",addr="0x0000000004205be2",func="vim_strsave"\
,file="/home/balask/threads/Vim/vim62/src/misc2.c",line="915"},frame={level=
"1 ",addr="0x00000000043\
bad70",func="netbeans_setRunDir",file="/home/balask/threads/Vim/vim62/src/ne
tbeans.c",line="2057"},f\
rame={level="2
",addr="0x00000000041a1310",func="main",file="/home/balask/threads/Vim/vim62
/src/main\
.c",line="323"}]
[1,133,878,525,251] (gdb) 
getStackFrameCount()=3::::::frameLevel= 3::::::getStackFrameCount
-frameLevel= 0
[1,133,878,531,611] 18126-stack-select-frame 0
[1,133,878,531,829] 18126^done
[1,133,878,531,829] 18127 whatis p
[1,133,878,531,829] (gdb) 
[1,133,878,531,845] &"whatis p\n"
[1,133,878,532,032] ~"type = unsigned char *\n"
[1,133,878,532,032] 18127^done
[1,133,878,532,032] (gdb) 
getStackFrameCount()= 3::::::frameLevel= 0::::::getStackFrameCount -
frameLevel= 3
[1,133,878,536,298] 18128-stack-select-frame 3
[1,133,878,536,298] &"No frame with frame# or frame_address 3\n"
[1,133,878,536,486] 18128^error,msg="No frame with frame# or frame_address
3"
[1,133,878,536,486] (gdb) 
[1,133,878,536,486] 18129 whatis p
[1,133,878,536,486] &"whatis p\n"
[1,133,878,536,689] ~"type = unsigned char *\n"
[1,133,878,536,689] 18129^done




Thanks,
Bala  

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On
Behalf Of Mikhail Khodjaiants
Sent: Friday, December 02, 2005 9:50 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] Wrong frame level info from CDT.

Anita,

> Therefore pressing F5 at the return statement of this function gives 
> following input to MI GDB: [ (FrameCount - FrameLevel) = (2-3) = -1 ]
>
>                mi stack-select-frame -1 output returned will be 'No 
> frame with frame# or frame_address -1" from GDB.

The "stack-select-frame" command is not get called in your scenario. When I
follow it I don't get this error.
"stack-select-frame" is called only if the selection of stack frame in the
Debug view is changed.

Mikhail

----- Original Message -----
From: "Birje, Anita (STSD)" <anita.birje@xxxxxx>
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Sent: Friday, December 02, 2005 7:17 AM
Subject: RE: [cdt-dev] Wrong frame level info from CDT.


> Hi Mikhail,
>
> I am working on the latest version of CDT (3.0),  OS being Windows XP.
>
> Simple scenario
> ------------------------ 
> Assume the stack frame level is currently 2 & frame count is 2. (Frame
> level is the current stack frame and frame count is the total number of
> stack frames)
>
> After a function call (Step Into / F5), suppose the frame level becomes
> 3 & total number of stack frames is 3.(Frames here are 3 nested function
> calls, each function defined in separate '*.c' file). On return from
> this particular function the frame count gets reduced by 1 (FrameCount
> is now 2) whereas the levels of frame (FrameLevel in StackFrame) still
> displays 3.
>
> Therefore pressing F5 at the return statement of this function gives
> following input to MI GDB: [ (FrameCount - FrameLevel) = (2-3) = -1 ]
>
>                mi stack-select-frame -1
> output returned will be 'No frame with frame# or frame_address -1" from
> GDB.
>
> Thanks,
> Anita
>
> -----Original Message----- 
> From: cdt-dev-bounces@xxxxxxxxxxx [
> <mailto:cdt-dev-bounces@xxxxxxxxxxx> mailto:cdt-dev-bounces@xxxxxxxxxxx]
> On Behalf Of Mikhail Khodjaiants
> Sent: Tuesday, November 29, 2005 9:56 PM
> To: CDT General developers list.
> Subject: Re: [cdt-dev] Wrong frame level info from CDT.
>
> Anita,
>
> You must be doing something else except stepping - the
> "stack-select-frame"
> command is not get called if I just step through the code.
> I tried to follow your instructions but I haven't been able to reproduce
> the problem.
> BTW, which version of CDT you rae using and what is your platfom?
>
> Thanks,
> Mikhail
> ----- Original Message ----- 
> From: "Birje, Anita (STSD)" <anita.birje@xxxxxx>
> To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
> Sent: Tuesday, November 29, 2005 8:18 AM
> Subject: RE: [cdt-dev] Wrong frame level info from CDT.
>
>
>> Hi,
>>
>> This happens in a nested function call ( when frame level >= 3 ),
>> whenever there is a return from the function (frame level > 3).
> Instead
>> of doing a Step Over (F6), do a Step Into (F5) and the error could be
>> reproduced.
>>
>> As mentioned in the previous mail, sometimes the frameLevel or the
>> frameCount issues a wrong mi frame level command, resulting in 'No
> frame
>> with frame# or frame_address -1" from GDB.
>>
>> Hope the information would be enough to reproduce this error. Please
> let
>> me know if any further indepth information would be required for
>> reproducing this.
>>
>> Thanks & Regards,
>> Anita Birje
>>
>>
>>
>> -----Original Message----- 
>> From: cdt-dev-bounces@xxxxxxxxxxx [
> <mailto:cdt-dev-bounces@xxxxxxxxxxx> mailto:cdt-dev-bounces@xxxxxxxxxxx]
>
>> On Behalf Of Mikhail Khodjaiants
>> Sent: Tuesday, November 29, 2005 3:24 AM
>> To: CDT General developers list.
>> Subject: Re: [cdt-dev] Wrong frame level info from CDT.
>>
>> Do you have a test case? I can't reproduce it.
>>
>> ----- Original Message ----- 
>> From: "Birje, Anita (STSD)" <anita.birje@xxxxxx>
>> To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
>> Sent: Friday, November 25, 2005 7:56 AM
>> Subject: [cdt-dev] Wrong frame level info from CDT.
>>
>>
>>> Hi,
>>>
>>> While trying to debug a program, I get wrong frame level info from
>> CDT,
>>> therefore passing a command to MI GDB as follows
>>> mi stack-select-frame -1
>>> results in a 'No frame with frame# or frame_address -1" from GDB.
>>>
>>> After going through the code, realized , 'Thread.java' returns '-1'
> at
>>> line 277 :
>>> int miLevel = getStackFrameCount()- frameLevel;
>>>
>>> The 'frameLevel' estimated is incorrect which is done in
> 'Thread.java'
>>> at line 256:
>>> frameLevel = stackframe.getLevel();
>>> This is probably due to the wrong level set at line 124 in
>> 'Thread.java'
>>> :
>>> currentFrames.add(new StackFrame(this, miFrames[i], depth -
>>> miFrames[i].getLevel()));
>>>
>>> Did anyone encounter this problem or knows the solution, please help.
>
>>>
>>> Regards,
>>> Anita
>>
>
> 

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev





Back to the top