This is the mail archive of the gdb-cvs@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]

[binutils-gdb] guile disassembly hardcode TARGET_XFER_E_IO


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9a4073e20b2f1da74cb3b46707e4f6fc4e700950

commit 9a4073e20b2f1da74cb3b46707e4f6fc4e700950
Author: Pedro Alves <palves@redhat.com>
Date:   Tue Nov 17 13:31:28 2015 +0000

    guile disassembly hardcode TARGET_XFER_E_IO
    
    Instead of adding a cast at the memory_error call, as needed for C++,
    and have the reader understand the indirection, make it simple and
    hardcode the generic memory error at the memory_error call site.
    
    gdb/ChangeLog:
    2015-11-17  Pedro Alves  <palves@redhat.com>
    
    	* guile/scm-disasm.c (gdbscm_disasm_read_memory): Return -1 on
    	error instead of TARGET_XFER_E_IO.
    	(gdbscm_disasm_memory_error): Always pass TARGET_XFER_E_IO to
    	memory_error.

Diff:
---
 gdb/ChangeLog          | 7 +++++++
 gdb/guile/scm-disasm.c | 7 +++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 20a62c2..43be20e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2015-11-17  Pedro Alves  <palves@redhat.com>
+
+	* guile/scm-disasm.c (gdbscm_disasm_read_memory): Return -1 on
+	error instead of TARGET_XFER_E_IO.
+	(gdbscm_disasm_memory_error): Always pass TARGET_XFER_E_IO to
+	memory_error.
+
 2015-11-17  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
 	* hppa-tdep.c (hppa_sign_extend, hppa_low_hppa_sign_extend)
diff --git a/gdb/guile/scm-disasm.c b/gdb/guile/scm-disasm.c
index 78b38df..c9e940d 100644
--- a/gdb/guile/scm-disasm.c
+++ b/gdb/guile/scm-disasm.c
@@ -119,9 +119,8 @@ gdbscm_disasm_read_memory (bfd_vma memaddr, bfd_byte *myaddr,
   status = gdbscm_with_guile (gdbscm_disasm_read_memory_worker, &data);
 
   /* TODO: IWBN to distinguish problems reading target memory versus problems
-     with the port (e.g., EOF).
-     We return TARGET_XFER_E_IO here as that's what memory_error looks for.  */
-  return status != NULL ? TARGET_XFER_E_IO : 0;
+     with the port (e.g., EOF).  */
+  return status != NULL ? -1 : 0;
 }
 
 /* disassemble_info.memory_error_func for gdbscm_print_insn_from_port.
@@ -133,7 +132,7 @@ static void
 gdbscm_disasm_memory_error (int status, bfd_vma memaddr,
 			    struct disassemble_info *info)
 {
-  memory_error (status, memaddr);
+  memory_error (TARGET_XFER_E_IO, memaddr);
 }
 
 /* disassemble_info.print_address_func for gdbscm_print_insn_from_port.


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