diff options
-rw-r--r-- | gdb/expprint.c | 13 | ||||
-rw-r--r-- | gdb/valprint.c | 12 | ||||
-rw-r--r-- | gdbsupport/common-defs.h | 6 |
3 files changed, 31 insertions, 0 deletions
diff --git a/gdb/expprint.c b/gdb/expprint.c index cef6ffb..8534d2a 100644 --- a/gdb/expprint.c +++ b/gdb/expprint.c @@ -65,6 +65,19 @@ dump_prefix_expression (struct expression *exp, struct ui_file *stream) exp->op->dump (stream, 0); } +/* Meant to be used in debug sessions, so don't export it in a header file. */ +extern void ATTRIBUTE_USED debug_exp (struct expression *exp); + +/* Print EXP. */ + +void +ATTRIBUTE_USED +debug_exp (struct expression *exp) +{ + exp->op->dump (gdb_stdlog, 0); + gdb_flush (gdb_stdlog); +} + namespace expr { diff --git a/gdb/valprint.c b/gdb/valprint.c index f873e12..3ad4c0c 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -1190,6 +1190,18 @@ value_print (struct value *val, struct ui_file *stream, current_language->value_print (val, stream, options); } +/* Meant to be used in debug sessions, so don't export it in a header file. */ +extern void ATTRIBUTE_UNUSED debug_val (struct value *val); + +/* Print VAL. */ + +void ATTRIBUTE_UNUSED +debug_val (struct value *val) +{ + value_print (val, gdb_stdlog, &user_print_options); + gdb_flush (gdb_stdlog); +} + static void val_print_type_code_flags (struct type *type, struct value *original_value, int embedded_offset, struct ui_file *stream) diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h index eed364a..e498533 100644 --- a/gdbsupport/common-defs.h +++ b/gdbsupport/common-defs.h @@ -191,6 +191,12 @@ #define ATTRIBUTE_UNUSED_RESULT #endif +#if (GCC_VERSION > 4000) +#define ATTRIBUTE_USED __attribute__ ((__used__)) +#else +#define ATTRIBUTE_USED +#endif + #include "libiberty.h" #include "pathmax.h" #include "gdb/signals.h" |