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 5/6] Disassembly unit test: memory error


On 17-01-17 08:37:48, Luis Machado wrote:
> >+
> >+    static int read_memory (bfd_vma memaddr, gdb_byte *myaddr,
> >+			    unsigned int len,
> >+			    struct disassemble_info *info)
> >+    {
> >+      /* Always get an error.  */
> 
> /* Always return an error.  */
> 
> Also, should we return an explicit error like TARGET_XFER_E_IO or
> MEMORY_ERROR?

-1 is what target_read_code returned on error, and -1 is expected by
disassembler in opcodes.  We need to define the error number in
include/dis-asm.h.  I'll do it later.

> 
> >+      return -1;
> >+    }
> >+  };
> >+

-- 
Yao (齐尧)


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