2010-09-16 Phil Muldoon <pmuldoon@redhat.com>

PR mi/11407
	* mi/mi-cmd-stack.c (list_args_or_locals): Catch exceptions from
	read_var_value and common_val_print and print a warning.

2010-09-16  Phil Muldoon  <pmuldoon@redhat.com>
            Jan Kratochvil  <jan.kratochvil@redhat.com>

	PR mi/11407
	* gdb.mi/dw2-ref-missing-frame-func.c: New File.
	* gdb.mi/dw2-ref-missing-frame-main.c New File.
	* gdb.mi/dw2-ref-missing-frame.S New File.
	* gdb.mi/dw2-ref-missing-frame.exp New File.
This commit is contained in:
Phil Muldoon 2010-09-16 13:47:55 +00:00
parent d469f50fd0
commit 875b4ff565
7 changed files with 386 additions and 15 deletions

View file

@ -31,7 +31,7 @@
#include "gdb_string.h"
#include "language.h"
#include "valprint.h"
#include "exceptions.h"
enum what_to_list { locals, arguments, all };
@ -334,27 +334,47 @@ list_args_or_locals (enum what_to_list what, int values, struct frame_info *fi)
&& TYPE_CODE (type) != TYPE_CODE_STRUCT
&& TYPE_CODE (type) != TYPE_CODE_UNION)
{
struct value_print_options opts;
volatile struct gdb_exception except;
TRY_CATCH (except, RETURN_MASK_ERROR)
{
struct value_print_options opts;
val = read_var_value (sym2, fi);
get_raw_print_options (&opts);
opts.deref_ref = 1;
common_val_print
(val, stb->stream, 0, &opts,
language_def (SYMBOL_LANGUAGE (sym2)));
}
if (except.reason < 0)
fprintf_filtered (stb->stream,
_("<error reading variable: %s>"),
except.message);
val = read_var_value (sym2, fi);
get_raw_print_options (&opts);
opts.deref_ref = 1;
common_val_print
(val, stb->stream, 0, &opts,
language_def (SYMBOL_LANGUAGE (sym2)));
ui_out_field_stream (uiout, "value", stb);
}
break;
case PRINT_ALL_VALUES:
{
struct value_print_options opts;
volatile struct gdb_exception except;
TRY_CATCH (except, RETURN_MASK_ERROR)
{
struct value_print_options opts;
val = read_var_value (sym2, fi);
get_raw_print_options (&opts);
opts.deref_ref = 1;
common_val_print
(val, stb->stream, 0, &opts,
language_def (SYMBOL_LANGUAGE (sym2)));
}
if (except.reason < 0)
fprintf_filtered (stb->stream,
_("<error reading variable: %s>"),
except.message);
val = read_var_value (sym2, fi);
get_raw_print_options (&opts);
opts.deref_ref = 1;
common_val_print
(val, stb->stream, 0, &opts,
language_def (SYMBOL_LANGUAGE (sym2)));
ui_out_field_stream (uiout, "value", stb);
}
break;