gdb: fix documentation of gdbarch_displaced_step_copy_insn

Message ID 20200622203558.122305-1-simon.marchi@polymtl.ca
State New
Headers show
Series
  • gdb: fix documentation of gdbarch_displaced_step_copy_insn
Related show

Commit Message

Eli Zaretskii via Gdb-patches June 22, 2020, 8:35 p.m.
I spotted something that looks wrong in the doc of
gdbarch_displaced_step_copy_insn.

It says that if the function returns NULL, it means that it has emulated
the behavior of the instruction and written the result to REGS.
However, it says below that the function may return NULL to indicate
that the instruction can't be single-stepped out-of-line, in which case
the core steps the instruction in-line.  The two are contradictory.

The right one is the latter, if the function returns NULL, the core
falls back to in-line stepping. I checked all the implementations of
this function and they all agree with this.

gdb/ChangeLog:

	* gdbarch.sh (displaced_step_copy_insn): Update doc.

Change-Id: I98163cdd38970cde4c77680e249b10f5d2d5bf9b
---
 gdb/gdbarch.sh | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

-- 
2.27.0

Comments

Eli Zaretskii via Gdb-patches June 29, 2020, 3:37 p.m. | #1
On 2020-06-22 4:35 p.m., Simon Marchi wrote:
> I spotted something that looks wrong in the doc of

> gdbarch_displaced_step_copy_insn.

> 

> It says that if the function returns NULL, it means that it has emulated

> the behavior of the instruction and written the result to REGS.

> However, it says below that the function may return NULL to indicate

> that the instruction can't be single-stepped out-of-line, in which case

> the core steps the instruction in-line.  The two are contradictory.

> 

> The right one is the latter, if the function returns NULL, the core

> falls back to in-line stepping. I checked all the implementations of

> this function and they all agree with this.

> 

> gdb/ChangeLog:

> 

> 	* gdbarch.sh (displaced_step_copy_insn): Update doc.

> 

> Change-Id: I98163cdd38970cde4c77680e249b10f5d2d5bf9b


I pushed this patch.

Simon

Patch

diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index e297b1c56a09..f1762cc926c0 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -767,9 +767,7 @@  V;ULONGEST;max_insn_length;;;0;0
 # not the copy at TO.  The caller should update it to point at TO later.
 #
 # Return a pointer to data of the architecture's choice to be passed
-# to gdbarch_displaced_step_fixup.  Or, return NULL to indicate that
-# the instruction's effects have been completely simulated, with the
-# resulting state written back to REGS.
+# to gdbarch_displaced_step_fixup.
 #
 # For a general explanation of displaced stepping and how GDB uses it,
 # see the comments in infrun.c.