diff options
author | Daniel Jacobowitz <drow@false.org> | 2006-05-15 16:53:38 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2006-05-15 16:53:38 +0000 |
commit | 19ca80ba578d7849bc921f80339f757f91eb4eae (patch) | |
tree | 9ff503a38756f3401cecdb19d4cd63ab434a3990 /gdb/valprint.c | |
parent | 245c7f487f624e96be56ead109684a7684160eca (diff) | |
download | gdb-19ca80ba578d7849bc921f80339f757f91eb4eae.zip gdb-19ca80ba578d7849bc921f80339f757f91eb4eae.tar.gz gdb-19ca80ba578d7849bc921f80339f757f91eb4eae.tar.bz2 |
* valprint.c: Include "exceptions.h".
(val_print): If something goes wrong while printing, supply an
error message.
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r-- | gdb/valprint.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c index b3a411a..d730917 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -34,6 +34,7 @@ #include "valprint.h" #include "floatformat.h" #include "doublest.h" +#include "exceptions.h" #include <errno.h> @@ -205,6 +206,9 @@ val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int format, int deref_ref, int recurse, enum val_prettyprint pretty) { + volatile struct gdb_exception except; + int ret = 0; + struct type *real_type = check_typedef (type); if (pretty == Val_pretty_default) { @@ -224,8 +228,15 @@ val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, return (0); } - return (LA_VAL_PRINT (type, valaddr, embedded_offset, address, - stream, format, deref_ref, recurse, pretty)); + TRY_CATCH (except, RETURN_MASK_ERROR) + { + ret = LA_VAL_PRINT (type, valaddr, embedded_offset, address, + stream, format, deref_ref, recurse, pretty); + } + if (except.reason < 0) + fprintf_filtered (stream, _("<error reading variable>")); + + return ret; } /* Check whether the value VAL is printable. Return 1 if it is; |