Recent

Author Topic: An instruction to pause the debugger. [SOLVED]  (Read 2126 times)

BrunoK

  • Hero Member
  • *****
  • Posts: 563
  • Retired programmer
Re: An instruction to pause the debugger. [SOLVED]
« Reply #15 on: July 01, 2024, 04:49:57 pm »
Code: Pascal  [Select][+][-]
  1. asm
  2.   nop
  3. end;
and set a breakpoint there.
The initial use case is Coco/R parser generated pascal code that analyze a .txt file containing measurement results in text form. In some languages (french) the .txt file has a grammar is not LL(1) and needs quite a bit of debbugging and tweaking of the coco EBNF file description / normalization to be able to inject info in my database.
 
I don't know where the point I want to BreakPoint will end up in the unit after the generating step, so it is more practical to have a instruction that suspends the execution at the desired point rather than laboriously deleting / re adding break points in the debugger.
The inlining pops'up the stack trace at the line of the call of my local BreakPoint instruction call and one F7 places me on the instruction following the call, what is not to like.

BrunoK

  • Hero Member
  • *****
  • Posts: 563
  • Retired programmer
Re: An instruction to pause the debugger. [SOLVED]
« Reply #16 on: July 01, 2024, 04:56:49 pm »
...
IOW, it takes _zero_ bytes.  Basically, you can have your cake and eat it too whenever convenient.

HTH.
Taking a few bytes / tens of bytes is none of my problem.

440bx

  • Hero Member
  • *****
  • Posts: 4478
Re: An instruction to pause the debugger. [SOLVED]
« Reply #17 on: July 01, 2024, 05:18:28 pm »
Taking a few bytes / tens of bytes is none of my problem.
I can relate to that.  On today's multi-gigabyte machine it isn't a priority to squeeze a few bytes out (except in genuinely rare cases.)

Still, I thought I'd mention it for completeness and just in case you might have been interested.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018