Bug 21755 - No "step" event
Summary: No "step" event
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: python (show other bugs)
Version: 7.0
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-12 07:28 UTC by adi.raghava3
Modified: 2024-06-21 12:17 UTC (History)
4 users (show)

See Also:
Host: Mac OSX
Target: KL46Z (arm cortex m0+)
Build:
Last reconfirmed: 2017-08-07 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description adi.raghava3 2017-07-12 07:28:49 UTC
I am trying to save the value of a register at every execution.
I am not sure if record would be the correct fit. I was hoping there is a space to call a hook for every step, or next command.
Comment 1 Phil Muldoon 2017-08-07 07:54:42 UTC
Inferior control is not yet implemented in GDB Python unfortunately.  Hopefully, that will change in the future.
Comment 2 Phil Muldoon 2017-08-07 10:49:01 UTC
Oops I do apologize, this was about stepping events, not actual stepping. We do have both "stop" and "continue" events. There is indeed no concrete step event. But I suspect a step would just emit a "continue" then "stop" event anyway?

https://www.sourceware.org/gdb/onlinedocs/gdb.html#Events-In-Python
Comment 3 Tom Tromey 2023-11-15 18:55:53 UTC
One way to do this is attach to stop events.
There's a patch pending to add a reason to these,
so you can detect "step" stops if you need that for some reason.

There's no way to force gdb to single-step on a 'continue'
or anything like that though.
Comment 4 Hannes Domani 2024-06-21 12:17:50 UTC
In the upcoming gdb-15 release the gdb.StopEvent no has a "details" attribute which contains the reason, which you can access with:

event.details['reason']

Which would be 'end-stepping-range' for step events.

See docu for more info:
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Events-In-Python.html#index-StopEvent_002edetails

Is this enough to close this issue?