Recent

Author Topic: Bug with wrong breakpoint which works when not needed  (Read 345 times)

Alextp

  • Hero Member
  • *****
  • Posts: 1153
    • UVviewsoft
Bug with wrong breakpoint which works when not needed
« on: August 18, 2020, 12:01:41 pm »
Project: CudaText. is has formmain.pas file.
and another project: ATSynEdit demo. demo with formmain.pas file.
by mistake i placed brkpnt in ATSynEdit demo when CudaText was opened.
result: bad breakpoint which stops running of CudaText.
it shows stop in some random func in formmain.pas where NOT needed.

cudatext.lps file shows bad data. after deleting, bad breakpoint gone.

Code: Pascal  [Select][+][-]
  1.   <Debugging>
  2.     <BreakPoints>
  3.       <Item>
  4.         <Kind Value="bpkSource"/>
  5.         <WatchScope Value="wpsLocal"/>
  6.         <WatchKind Value="wpkWrite"/>
  7.         <Source Value="../../synedit/app/demo_editor/formmain.pas"/>
  8.         <Line Value="1093"/>
  9.       </Item>
  10.     </BreakPoints>
  11.   </Debugging>
  12.  

Laz trunk. fpc 3.2.1.
linux gtk2 x64.
« Last Edit: August 18, 2020, 12:04:31 pm by Alextp »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6711
  • Debugger - SynEdit - and more
    • wiki
Re: Bug with wrong breakpoint which works when not needed
« Reply #1 on: August 18, 2020, 12:37:51 pm »
You mean you have 2 units:
- First: In project CudaText, unit "FormMain.pas", in folder of project CudaText
- Second: In project AtSynEdit, unit "FormMain.pas" (same name, diff folder), in folder of project AtSynEdit

Then you had the project CudaText open.
But you also opened the unit  <folder AtSynEdit>/FormMain.pas  which is not part of the project.

You placed a breakpoint in <folder AtSynEdit>/FormMain.pas



The debugger does ignore the path [1]. So this breakpoint will apply in the file "FormMain.pas" that is in the exe. It does not matter where this file came from.

[1] It tries first with path, but if that fails then without path


Alextp

  • Hero Member
  • *****
  • Posts: 1153
    • UVviewsoft
Re: Bug with wrong breakpoint which works when not needed
« Reply #2 on: August 18, 2020, 02:06:14 pm »
Yes, like this.
Can you make this? if path is found on disk, but file is NOT in project, ignore this breakpnt?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6711
  • Debugger - SynEdit - and more
    • wiki
Re: Bug with wrong breakpoint which works when not needed
« Reply #3 on: August 18, 2020, 03:45:09 pm »
The current behaviour is indented.

Because on some platform, with sym-links there was a problem where fpc and the IDE had a different idea about what the path should be.
So in those scenarios breakpoints would fail, without the current behaviour.

What should happen though is, that if such a breakpoint is reached, the IDE should realize if the file that is shown for the "current debug location" differs from the "location of the breakpoint". In that case some useful info should be made available to the user.

(This should also happen if a user sets a breakpoint on a line with no code (comment, interface section) and the real breakpoint by gdb is 100 lines later / threshold of break-realline > 10 )

Unfortunately, I have no idea when I will be able to do something about this.

Quote
but file is NOT in project,
There are people who include files into their code, without adding them to the project. (from within or outside the project folder, both is possible)

So breakpoints set here, must work.
« Last Edit: August 18, 2020, 03:48:19 pm by Martin_fr »

 

TinyPortal © 2005-2018