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

Yao Qi qiyaoltc@gmail.com
Tue Dec 20 09:20:00 GMT 2016


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 (齐尧)



More information about the Gdb-patches mailing list