PC Review


Reply
 
 
Jan Hudecek
Guest
Posts: n/a
 
      14th Feb 2009
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[i].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
 
Reply With Quote
 
 
 
 
Jan Hudecek
Guest
Posts: n/a
 
      14th Feb 2009
It might be actually closer to a bug in debugger... when i set
breakpoint at every line i can step through it
weird

On 14 Ún, 11:39, Jan Hudecek <hudecek...@gmail.com> wrote:
> 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[i].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


 
Reply With Quote
 
Simon Hart [MVP]
Guest
Posts: n/a
 
      15th Feb 2009
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

"Jan Hudecek" <(E-Mail Removed)> wrote in message
news:b3f53c8c-974b-41c9-a984-(E-Mail Removed)...
It might be actually closer to a bug in debugger... when i set
breakpoint at every line i can step through it
weird

On 14 Ún, 11:39, Jan Hudecek <hudecek...@gmail.com> wrote:
> 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[i].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


 
Reply With Quote
 
mind_the_gap
Guest
Posts: n/a
 
      16th Feb 2009
On Feb 15, 8:43*am, "Simon Hart [MVP]" <srhart...@yahoo.com> wrote:
> 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
>
> "Jan Hudecek" <hudecek...@gmail.com> wrote in message
>
> news:b3f53c8c-974b-41c9-a984-(E-Mail Removed)...
> It might be actually closer to a bug in debugger... when i set
> breakpoint at every line i can step through it
> weird
>
> On 14 Ún, 11:39, Jan Hudecek <hudecek...@gmail.com> wrote:
>
>
>
> > 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[i].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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:45 PM.