Tweak in memory_error
authorYao Qi <yao@codesourcery.com>
Mon, 4 Nov 2013 00:51:19 +0000 (08:51 +0800)
committerYao Qi <yao@codesourcery.com>
Fri, 7 Feb 2014 03:19:57 +0000 (11:19 +0800)
This patch adds a local variable exception of type 'enum errors' and
pass it to throw_error, because 'err' is of type
'enum target_xfer_error', and we're abusing it to store an 'enum errors'.

gdb:

2014-02-07  Yao Qi  <yao@codesourcery.com>

* corefile.c (memory_error): Get 'exception' from ERR and pass
'exception' to throw_error.

gdb/ChangeLog
gdb/corefile.c

index 94c3971f71de39ba12fa187e087e3fce37d1c21a..de3c3a60fd1cd1502c3744cf02cf3773dadda7e5 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-07  Yao Qi  <yao@codesourcery.com>
+
+       * corefile.c (memory_error): Get 'exception' from ERR and pass
+       'exception' to throw_error.
+
 2014-02-06  Doug Evans  <xdje42@gmail.com>
 
        * configure.ac (libpython checking): Remove all but python.o from
index 1ed8395c6b893a9f466959be8e773e504460d51d..93f5e04f2e50f2d2f8b01b0ccae6c66a87e6184a 100644 (file)
@@ -221,6 +221,7 @@ void
 memory_error (enum target_xfer_error err, CORE_ADDR memaddr)
 {
   char *str;
+  enum errors exception = GDB_NO_ERROR;
 
   /* Build error string.  */
   str = memory_error_message (err, target_gdbarch (), memaddr);
@@ -230,15 +231,15 @@ memory_error (enum target_xfer_error err, CORE_ADDR memaddr)
   switch (err)
     {
     case TARGET_XFER_E_IO:
-      err = MEMORY_ERROR;
+      exception = MEMORY_ERROR;
       break;
     case TARGET_XFER_E_UNAVAILABLE:
-      err = NOT_AVAILABLE_ERROR;
+      exception = NOT_AVAILABLE_ERROR;
       break;
     }
 
   /* Throw it.  */
-  throw_error (err, ("%s"), str);
+  throw_error (exception, ("%s"), str);
 }
 
 /* Same as target_read_memory, but report an error if can't read.  */
This page took 0.026607 seconds and 4 git commands to generate.