Author Topic: A bug of "Call stack" view....  (Read 7728 times)

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
A bug of "Call stack" view....
« on: September 03, 2009, 10:30:10 am »
0, I have the code, that : main call L1, L1 call L2, ...., like:

main ()
{
     L1();
}

L1()
{
    L2();
}

L2()
{
    L3();
}

L3()
{
    int a;
    int b = a;   
}

/////////////
1. now I debug (step) those code, ....and I step into L3, the cursor now at the line : "int a;"
2. I open the "Call stack" (debug -> debugging windows -> call stack) .... !!! now the cursor position wil MOVE TO the L2.
3. I press the F7, the position move to "int b = a;", AND ! as soon as, it come back to "L2()"...

sorry for my pool English!
who can help me ? thanks!

//////////////////
windows xp;
gdb 5.2.1
g++ 3.4.5
« Last Edit: September 03, 2009, 10:34:47 am by nanyu »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5519
Re: A bug of "Call stack" view....
« Reply #1 on: September 03, 2009, 12:27:10 pm »
Hi,

Though I have not tried out your example, things I can say are :
* your GDB is very old, and more or less no longer supported by CB
* your GCC is also rather old.

I will run your test case on my more 'modern' ;-) installation and past my results.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5519
Re: A bug of "Call stack" view....
« Reply #2 on: September 03, 2009, 12:39:46 pm »
Code
void L3()
{
    int a;
    int b = a;
}

void L2()
{
    L3();
}

void L1()
{
    L2();
}

int main ()
{
     L1();
}

* first of all when I step into L3, the cursor is on int b=a, which is normal because the line int a; does not contain any executable statements
* then I ask the call stack : which says I am in L3, and the cursor also stays on the line int b = a;
* then I step : I end up at the closing brace of L3, and the callstack still says I am in L3
* then I step : I end up at the closing brace of L2, and the callstack still says I am in L2
* ....

so works correctly.

I am using : GDB 6.8, GCC : 4.3.1 , CB : latest revision from svn, all on linux