[PATCH] arc: Add support for Linux coredump files

Shahab Vahedi shahab.vahedi@gmail.com
Tue Sep 29 15:42:20 GMT 2020


Hi Simon,

First, thank you a lot for such explanatory answer.

On Tue, Sep 29, 2020 at 10:22:18AM -0400, Simon Marchi wrote:
> target_read_memory calls read_inferior_memory, which calls the target's
> read_memory method, and then puts back in place the instructions
> shadowed by breakpoints and fast tracepoint jumps inserted by GDBserver
> in place.  This is so that the memory returned to the caller (and
> possibly to GDB) contains the contents it expects to see.

I repeat the code snippet here:
----
bool
arc_target::low_breakpoint_at (CORE_ADDR where)
{
  uint16_t insn;
  uint16_t breakpoint = ntohs (TRAP_S_1_OPCODE);

  target_read_memory (where, (gdb_byte *) &insn, TRAP_S_1_SIZE);
  return (insn == breakpoint);
}
----

Because this memory access is indeed to check for a "breakpoint",
then I should NOT be using breakpoint-undoing edition.  Therefore,
I will use "this->read_memory (...)".


Cheers,
Shahab


More information about the Gdb-patches mailing list