diff options
author | Yao Qi <yao@codesourcery.com> | 2013-11-04 08:51:19 +0800 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2014-02-07 11:19:57 +0800 |
commit | 8635b3bf5980d6968d277ed83442c96544830a1b (patch) | |
tree | efc33ad51aedcf2cb85e7e3fdc4e0ab255231a49 /gdb | |
parent | 1f25b93bc6e10b314ccdc5c42583f77db1b33e2e (diff) | |
download | gdb-8635b3bf5980d6968d277ed83442c96544830a1b.zip gdb-8635b3bf5980d6968d277ed83442c96544830a1b.tar.gz gdb-8635b3bf5980d6968d277ed83442c96544830a1b.tar.bz2 |
Tweak in memory_error
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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/corefile.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 94c3971..de3c3a6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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 diff --git a/gdb/corefile.c b/gdb/corefile.c index 1ed8395..93f5e04 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -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. */ |