PDA

View Full Version : Using the evaluate expression leads to a continue !



olivier_m
08-28-2009, 07:09 AM
Hi,

I'm using totalview 8.7.0-0 x86_64 and I observe something strange that was not in the previous release.
I set a breakpoint and when my program stops on it I evaluate some expression using tools->evaluate.
The expression is actually a function call used to dump some information in a file but when I click on the evaluate button the debugger do a continue !

What am I missing ?

Thanks for any help.

Olivier

PeterT-RogueWave
08-28-2009, 01:42 PM
Hello Olivier,

Sounds like a bug. Could you submit this to support@totalviewtech.com with a small example? That would be the best way to check on it.

Regards,

olivier_m
08-31-2009, 12:24 AM
Hello Pete,

I sent the following to the email adress you provided. I put that here to give a better idea of the pb to the other users.

************************************************** ****************
Please find below a very small C example and 3 test scenarios:
put a simple breakpoint on the printf statement that is inside the while loop.

1- run the program, then open tools->evaluate and call foo(). You'll have "foo" printed on the stdout and i doesn't change.
2- put a condition on the breakpoint like if (i >= 100) $stop;
run the program and again call foo through the tools->evaluate tool box. You'll see that the program print foo but also continue... so if you evalute 3 times foo without doing explicitly a continue you'll have:
100 foo
101 foo
102 foo
3- in the same run as "2" remove the conditional statement on the breakpoint and evaluate foo again... the problem remains.

#include <stdio.h>

void foo()
{
printf("foo\n");
}

int main(void)
{
int i;

while (i < 1000)
{
printf("%d ",i);
i++;
}
}

There is of course a small and limited workaround (to put a
breakpoint on the next instruction). It is limited because each time
I'll be doing an evaluate I'll see an evaluate + continue! So the
additional breakpoint is only a "one shot" break point. So it would be
nice to have a better workaround :)