X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fprintcmd.c;h=05c68a0d20dbcf37ae19e5c5e61993511ff00359;hb=32b40af94e919e235c21486110311647cbeecf2e;hp=3e8e6a879c53bb5dfd5700d4281e3c3b61a7af22;hpb=dccbb60975cdbcd6a906a79d0c4308b040fdac1b;p=deliverable%2Fbinutils-gdb.git
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 3e8e6a879c..05c68a0d20 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1,6 +1,6 @@
/* Print values for GNU debugger GDB.
- Copyright (C) 1986-2014 Free Software Foundation, Inc.
+ Copyright (C) 1986-2015 Free Software Foundation, Inc.
This file is part of GDB.
@@ -18,7 +18,6 @@
along with this program. If not, see . */
#include "defs.h"
-#include
#include "frame.h"
#include "symtab.h"
#include "gdbtypes.h"
@@ -40,7 +39,6 @@
#include "block.h"
#include "disasm.h"
#include "dfp.h"
-#include "exceptions.h"
#include "observer.h"
#include "solist.h"
#include "parser-defs.h"
@@ -1253,8 +1251,11 @@ address_info (char *exp, int from_tty)
current_language->la_language, DMGL_ANSI);
printf_filtered ("\" is ");
val = SYMBOL_VALUE (sym);
- section = SYMBOL_OBJ_SECTION (SYMBOL_OBJFILE (sym), sym);
- gdbarch = get_objfile_arch (SYMBOL_SYMTAB (sym)->objfile);
+ if (SYMBOL_OBJFILE_OWNED (sym))
+ section = SYMBOL_OBJ_SECTION (symbol_objfile (sym), sym);
+ else
+ section = NULL;
+ gdbarch = symbol_arch (sym);
if (SYMBOL_COMPUTED_OPS (sym) != NULL)
{
@@ -1495,7 +1496,7 @@ display_command (char *arg, int from_tty)
{
struct format_data fmt;
struct expression *expr;
- struct display *new;
+ struct display *newobj;
int display_it = 1;
const char *exp = arg;
@@ -1534,20 +1535,20 @@ display_command (char *arg, int from_tty)
innermost_block = NULL;
expr = parse_expression (exp);
- new = (struct display *) xmalloc (sizeof (struct display));
+ newobj = (struct display *) xmalloc (sizeof (struct display));
- new->exp_string = xstrdup (exp);
- new->exp = expr;
- new->block = innermost_block;
- new->pspace = current_program_space;
- new->next = display_chain;
- new->number = ++display_number;
- new->format = fmt;
- new->enabled_p = 1;
- display_chain = new;
+ newobj->exp_string = xstrdup (exp);
+ newobj->exp = expr;
+ newobj->block = innermost_block;
+ newobj->pspace = current_program_space;
+ newobj->next = display_chain;
+ newobj->number = ++display_number;
+ newobj->format = fmt;
+ newobj->enabled_p = 1;
+ display_chain = newobj;
if (from_tty)
- do_one_display (new);
+ do_one_display (newobj);
dont_repeat ();
}
@@ -1691,15 +1692,14 @@ do_one_display (struct display *d)
if (d->exp == NULL)
{
- volatile struct gdb_exception ex;
- TRY_CATCH (ex, RETURN_MASK_ALL)
+ TRY
{
innermost_block = NULL;
d->exp = parse_expression (d->exp_string);
d->block = innermost_block;
}
- if (ex.reason < 0)
+ CATCH (ex, RETURN_MASK_ALL)
{
/* Can't re-parse the expression. Disable this display item. */
d->enabled_p = 0;
@@ -1707,6 +1707,7 @@ do_one_display (struct display *d)
d->exp_string, ex.message);
return;
}
+ END_CATCH
}
if (d->block)
@@ -1730,7 +1731,6 @@ do_one_display (struct display *d)
printf_filtered (": ");
if (d->format.size)
{
- volatile struct gdb_exception ex;
annotate_display_format ();
@@ -1754,7 +1754,7 @@ do_one_display (struct display *d)
annotate_display_value ();
- TRY_CATCH (ex, RETURN_MASK_ERROR)
+ TRY
{
struct value *val;
CORE_ADDR addr;
@@ -1765,13 +1765,15 @@ do_one_display (struct display *d)
addr = gdbarch_addr_bits_remove (d->exp->gdbarch, addr);
do_examine (d->format, d->exp->gdbarch, addr);
}
- if (ex.reason < 0)
- fprintf_filtered (gdb_stdout, _("\n"), ex.message);
+ CATCH (ex, RETURN_MASK_ERROR)
+ {
+ fprintf_filtered (gdb_stdout, _("\n"), ex.message);
+ }
+ END_CATCH
}
else
{
struct value_print_options opts;
- volatile struct gdb_exception ex;
annotate_display_format ();
@@ -1790,15 +1792,19 @@ do_one_display (struct display *d)
get_formatted_print_options (&opts, d->format.format);
opts.raw = d->format.raw;
- TRY_CATCH (ex, RETURN_MASK_ERROR)
+ TRY
{
struct value *val;
val = evaluate_expression (d->exp);
print_formatted (val, d->format.size, &opts, gdb_stdout);
}
- if (ex.reason < 0)
- fprintf_filtered (gdb_stdout, _(""), ex.message);
+ CATCH (ex, RETURN_MASK_ERROR)
+ {
+ fprintf_filtered (gdb_stdout, _(""), ex.message);
+ }
+ END_CATCH
+
printf_filtered ("\n");
}
@@ -1974,13 +1980,12 @@ print_variable_and_value (const char *name, struct symbol *var,
struct frame_info *frame,
struct ui_file *stream, int indent)
{
- volatile struct gdb_exception except;
if (!name)
name = SYMBOL_PRINT_NAME (var);
fprintf_filtered (stream, "%s%s = ", n_spaces (2 * indent), name);
- TRY_CATCH (except, RETURN_MASK_ERROR)
+ TRY
{
struct value *val;
struct value_print_options opts;
@@ -1994,9 +1999,13 @@ print_variable_and_value (const char *name, struct symbol *var,
function. */
frame = NULL;
}
- if (except.reason < 0)
- fprintf_filtered(stream, "", name,
- except.message);
+ CATCH (except, RETURN_MASK_ERROR)
+ {
+ fprintf_filtered(stream, "", name,
+ except.message);
+ }
+ END_CATCH
+
fprintf_filtered (stream, "\n");
}