* * *

Author Topic: Breakpoint skipped but stops at next instruction (solved)  (Read 644 times)

PStechPaul

  • Jr. Member
  • **
  • Posts: 72
    • P S Technology, Inc.
Breakpoint skipped but stops at next instruction (solved)
« on: April 28, 2017, 07:42:32 pm »
I am trying to debug a project and I put a breakpoint on a conditional statement that should not be true, but execution stops at the next executable statement. A screenshot is attached. I notice that the little blue dot does not appear on these statements. Could that mean that the compiler has removed these statements?

[edit] Never mind - I had not rebuilt the project yet. Now the breakpoints work normally.
« Last Edit: April 28, 2017, 07:49:53 pm by PStechPaul »

molly

  • Hero Member
  • *****
  • Posts: 1787
Re: Breakpoint skipped but stops at next instruction
« Reply #1 on: April 28, 2017, 07:47:32 pm »
I am not 100% sure but it could be the fact that you have the end statement 'breaked' as well.

E.g. that means the statement you have set 'on break' never gets reached and instead the code directly on the end statement is being 'executed' but, it is a rather 'mute' statement.

Unset the breakpoints, properly format your code and try again. Set breakpoint at begin statement or directly underneath (e.g. the first actual statement).

btw:
exit will exit before the RecvData value is actually set (not that it matters much for your example, just an observation);
« Last Edit: April 28, 2017, 07:50:42 pm by molly »

PStechPaul

  • Jr. Member
  • **
  • Posts: 72
    • P S Technology, Inc.
Re: Breakpoint skipped but stops at next instruction (solved)
« Reply #2 on: April 28, 2017, 07:58:57 pm »
Actually it was because I had not yet rebuilt the project.  ::) I swapped the break statement to the end of the code block. The assignment of RecvData was only to add another line where I could place a breakpoint. Thanks for the advice.  8)

molly

  • Hero Member
  • *****
  • Posts: 1787
Re: Breakpoint skipped but stops at next instruction (solved)
« Reply #3 on: April 28, 2017, 08:01:21 pm »
ah ok. no problem. Thanks for reporting back.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus