bug in cf?

J

Jan Hudecek

Hello everybody,

sorry for the scandalous subject but i cant help it

i have a code that shows up in reflector like this

public int CurrentQuestion(int index, int otherpeopleindex, bool
onrelations)
{
int num = otherpeopleindex + 1;
if (onrelations)
{
for (int i = 0; i < index; i++)
{
if (this.questionOnRelationsField.IsMap)
{
num++;
}
else
{
num += otherpeopleindex;
}
}
return num;
}
return ((index + 1) + this.QuestionOnRelationsCount);
}


but everytime the function executes, the debugger just steps on the
first line and then immediately returns (even though the code below
sometimes gets executed).
Does anyone know whats going on here?
Thanks,
Jan
 
J

Jan Hudecek

It might be actually closer to a bug in debugger... when i set
breakpoint at every line i can step through it
weird
 
S

Simon Hart [MVP]

Is the function returning a value?

What ver of CF and VS are you using?
--
Simon Hart
Visual Developer - Device Application Development MVP
http://www.simonrhart.com

It might be actually closer to a bug in debugger... when i set
breakpoint at every line i can step through it
weird
 
M

mind_the_gap

Is the function returning a value?

What ver of CF and VS are you using?
--
Simon Hart
Visual Developer - Device Application Development MVPhttp://www.simonrhart.com


It might be actually closer to a bug in debugger... when i set
breakpoint at every line i can step through it
weird

Hello everybody,
sorry for the scandalous subject but i cant help it
i have a code that shows up in reflector like this
public int CurrentQuestion(int index, int otherpeopleindex, bool
onrelations)
{
int num = otherpeopleindex + 1;
if (onrelations)
{
for (int i = 0; i < index; i++)
{
if (this.questionOnRelationsField.IsMap)
{
num++;
}
else
{
num += otherpeopleindex;
}
}
return num;
}
return ((index + 1) + this.QuestionOnRelationsCount);

but everytime the function executes, the debugger just steps on the
first line and then immediately returns (even though the code below
sometimes gets executed).
Does anyone know whats going on here?
Thanks,
Jan


Are you using the debugger also in other parts of your application? If
not you might have overseen that you are compiling a release build
instead of using the debug configuration. The consequence is that you
won't be able to debug in a meaningful way, since (normally) in
release mode the optimizer does his job...
At least did I wonder about similar effects, too, some time ago and
the problem was solved by "disabling the optimizer.

bye,
Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top