• Re: DebugBreak() in Ada

    From Niklas Holsti@21:1/5 to Petter on Tue Apr 25 15:11:57 2023
    On 2023-04-25 14:18, Petter wrote:
    I used some way to cause a DebugBreak() (programmatically causeng a
    break command in gdb) some 10 years ago. Now I can't find it. Perhaps
    one could raise int3? But I can't find how to either. Regards,
    Petter


    What do you mean by "causing a break command in gdb"? Do you intend to
    run the program under gdb, and want to be able to insert something --
    perhaps a call DebugBreak -- in the Ada source to always cause a break
    into gdb control at the point of that call, without having to set gdb breakpoints at every call?

    It is not a fully automatic method, but you could write a null Ada
    procedure DebugBreak and set a breakpoint in that procedure, manually
    from gdb, before starting the program. Then every call to DebugBreak
    will break, and you can look one level down in the call chain to see the
    state at the point of call.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Petter@21:1/5 to All on Tue Apr 25 04:18:51 2023
    I used some way to cause a DebugBreak() (programmatically causeng a break command in gdb) some 10 years ago. Now I can't find it. Perhaps one could raise int3? But I can't find how to either.
    Regards,
    Petter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Petter@21:1/5 to All on Tue Apr 25 08:21:22 2023
    tisdag 25 april 2023 kl. 14:12:02 UTC+2 skrev Niklas Holsti:
    On 2023-04-25 14:18, Petter wrote:
    I used some way to cause a DebugBreak() (programmatically causeng a
    break command in gdb) some 10 years ago. Now I can't find it. Perhaps
    one could raise int3? But I can't find how to either. Regards,
    Petter
    What do you mean by "causing a break command in gdb"? Do you intend to
    run the program under gdb, and want to be able to insert something --
    perhaps a call DebugBreak -- in the Ada source to always cause a break
    into gdb control at the point of that call, without having to set gdb breakpoints at every call?

    It is not a fully automatic method, but you could write a null Ada
    procedure DebugBreak and set a breakpoint in that procedure, manually
    from gdb, before starting the program. Then every call to DebugBreak
    will break, and you can look one level down in the call chain to see the state at the point of call.

    Sorry, I thougth DebugBreak() was familiar. If you in other languages not used by me call DebugBreak() i cuases the debugger to stop a running execution. I'm thought we had a similar for Ada. But I can be mistaken

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Wright@21:1/5 to Niklas Holsti on Tue Apr 25 18:22:35 2023
    Niklas Holsti <niklas.holsti@tidorum.invalid> writes:

    It is not a fully automatic method, but you could write a null Ada
    procedure DebugBreak and set a breakpoint in that procedure, manually
    from gdb, before starting the program. Then every call to DebugBreak
    will break, and you can look one level down in the call chain to see
    the state at the point of call.

    Great idea!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Wright@21:1/5 to Petter on Tue Apr 25 18:20:20 2023
    Petter <petter_fryklund@hotmail.com> writes:

    I used some way to cause a DebugBreak() (programmatically causeng a
    break command in gdb) some 10 years ago. Now I can't find it. Perhaps
    one could raise int3? But I can't find how to either.

    I just googled debugbreak and the third hit was this:
    https://github.com/scottt/debugbreak

    It'd need some work, but at least on macOS/x86_64 GCC & clang[++] both
    give a SIGTRAP.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)