Re: How to determine whether GDB is single-stepping within sim_engine_run() ?
Andrew Burgess <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
* William Tambe via Gdb <[email protected]> [2020-08-09 14:41:34 -0500]: > Within the sim function sim_engine_run(), is there a way to determine > whether GDB is single-stepping (ie: when using commands next step > nexti stepi) ? > > I would like to use that capability to have the simulator disable > interrupts while single-stepping. GDB drives the simulator through the sim_resume function, of which there are a couple depending on what type of simulator is implemented. The sim_resume method takes a flag to indicate if the simulator should single step or not, and this flag is used to set state within the simulator object. I would suggest figuring out which sim_resume method your simulator uses, see how the single step flag is used, and then make use of this same state within your sim_engine_run. Hope that helps, Andrew