diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-12-04 16:43:54 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-12-04 16:43:54 -0500 |
commit | bab37966cfd192a12d5d1d259c7009a02cefe8b3 (patch) | |
tree | cd931b82c874bb51a037e25c5a887282f34fff4f /gdb/continuations.h | |
parent | 7def77a1cf6bfd9d3640701dc3414feb0034a858 (diff) | |
download | gdb-bab37966cfd192a12d5d1d259c7009a02cefe8b3.zip gdb-bab37966cfd192a12d5d1d259c7009a02cefe8b3.tar.gz gdb-bab37966cfd192a12d5d1d259c7009a02cefe8b3.tar.bz2 |
gdb: introduce status enum for displaced step prepare/finish
This is a preparatory patch to reduce the size of the diff of the
upcoming main patch. It introduces enum types for the return values of
displaced step "prepare" and "finish" operations. I find that this
expresses better the intention of the code, rather than returning
arbitrary integer values (-1, 0 and 1) which are difficult to remember.
That makes the code easier to read.
I put the new enum types in a new displaced-stepping.h file, because I
introduce that file in a later patch anyway. Putting it there avoids
having to move it later.
There is one change in behavior for displaced_step_finish: it currently
returns 0 if the thread wasn't doing a displaced step and 1 if the
thread was doing a displaced step which was executed successfully. It
turns out that this distinction is not needed by any caller, so I've
merged these two cases into "_OK", rather than adding an extra
enumerator.
gdb/ChangeLog:
* infrun.c (displaced_step_prepare_throw): Change return type to
displaced_step_prepare_status.
(displaced_step_prepare): Likewise.
(displaced_step_finish): Change return type to
displaced_step_finish_status.
(resume_1): Adjust.
(stop_all_threads): Adjust.
* displaced-stepping.h: New file.
Change-Id: I5c8fe07212cd398d5b486b5936d9d0807acd3788
Diffstat (limited to 'gdb/continuations.h')
0 files changed, 0 insertions, 0 deletions