Recent

Author Topic: fpDebug not goto error line in source code  (Read 1171 times)

tsknv

  • New member
  • *
  • Posts: 9
fpDebug not goto error line in source code
« on: May 26, 2022, 04:21:06 am »
Hello.
Project for example  attached.
Click to Button1 occur  exception "Operation not allowed, dataset ... is not in an edit or insert state."
If use GDB - Lazarus goto to error line in project source code (43: BufDataset.FieldByName('fld1').Value := '!!!';)
If use fpDebug - Lazarus show assembler window and not show error in pascal source code.
DWARF(-gw3) is enabled in project options
What am I doing wrong?

Lazarus 2.2.2

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: fpDebug not goto error line in source code
« Reply #1 on: May 26, 2022, 08:47:43 am »
Did you enable lineinfo?
Specialize a type, not a var.

tsknv

  • New member
  • *
  • Posts: 9
Re: fpDebug not goto error line in source code
« Reply #2 on: May 26, 2022, 08:58:07 am »
option -gl is enabled

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: fpDebug not goto error line in source code
« Reply #3 on: May 26, 2022, 01:07:19 pm »
What does the stack window show?

Also what is the address in the asm window?
And, are there any name in the address window?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: fpDebug not goto error line in source code
« Reply #4 on: May 26, 2022, 01:29:22 pm »
I had a quick look. Yes there is an issue. Actually I recall, I had noted that before, its buried somewhere on my todo.
Unfortunately it will take some time to fix...

The stack window should show some info, and you can locate your code in there.

tsknv

  • New member
  • *
  • Posts: 9
Re: fpDebug not goto error line in source code
« Reply #5 on: May 26, 2022, 01:41:12 pm »
Screenshot stack and asm the windows attached this message

tsknv

  • New member
  • *
  • Posts: 9
Re: fpDebug not goto error line in source code
« Reply #6 on: May 26, 2022, 01:58:54 pm »
...
Unfortunately it will take some time to fix...
The stack window should show some info, and you can locate your code in there.

Understood. Thanks you.

korba812

  • Sr. Member
  • ****
  • Posts: 391
Re: fpDebug not goto error line in source code
« Reply #7 on: May 26, 2022, 02:13:14 pm »
It looks like you have fpc packages compiled without debug information. You need to compile packages (fcl-db in this case) with debug information enabled.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: fpDebug not goto error line in source code
« Reply #8 on: May 26, 2022, 03:18:34 pm »
It looks like you have fpc packages compiled without debug information. You need to compile packages (fcl-db in this case) with debug information enabled.
No, he doesn't need. (unless he wants to see the line in fcl-db)

If there is no debug info in fcl-db, then the debugger is supposed to find the first line that has debug info.
In this case his ButtonClick.


tsknv

  • New member
  • *
  • Posts: 9
Re: fpDebug not goto error line in source code
« Reply #9 on: May 26, 2022, 03:44:38 pm »
It looks like you have fpc packages compiled without debug information. You need to compile packages (fcl-db in this case) with debug information enabled.
In this example I debug only my project, I don't want to debug packages.

I change only debuger in Lazarus options and no change any other options - GDB shows the line in the my project (not in the package, packages compiled without debug infomation) that caused the exception, fpDebug does not.


korba812

  • Sr. Member
  • ****
  • Posts: 391
Re: fpDebug not goto error line in source code
« Reply #10 on: May 26, 2022, 04:02:56 pm »
No, he doesn't need. (unless he wants to see the line in fcl-db)

If there is no debug info in fcl-db, then the debugger is supposed to find the first line that has debug info.
In this case his ButtonClick.
Ah, ok. Sorry for noise.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: fpDebug not goto error line in source code
« Reply #11 on: May 26, 2022, 04:03:39 pm »
The problem is that GDB blocks the IDE while it gets stack info.
FpDebug doesn't block the IDE.

But the code (for finding the source line of an exception) does currently not take that into account. It doesn't wait, for the info. And so it does nothing when using FpDebug.

 

TinyPortal © 2005-2018