This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH V2 2/2] Prologue: Add selftests to x64/x32 architecture.


On 16-12-16 14:58:36, Bernhard Heckel wrote:
> +
> +class code_reader : public abstract_code_reader
> +{
> +public:
> +  code_reader (void)
> +  {
> +    target_memory = 1;
> +  }
> +
> +  void read (CORE_ADDR memaddr, gdb_byte *buffer, ssize_t len)
> +  {
> +    read_code (memaddr, buffer, len);

Can we use target_read_code here?  It doesn't throw an error if it
can't read.  Method 'read' becomes

int read (CORE_ADDR memaddr, gdb_byte *buffer, ssize_t len)

so that we may even share more code with disassembly.  See Pedro's
POC patch.

-- 
Yao (齐尧)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]