aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.h
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2014-08-05 11:42:21 +0100
committerGary Benson <gbenson@redhat.com>2014-08-29 10:11:59 +0100
commit2437fd32f17cb11338949cff1fd0741e14ce1681 (patch)
tree2bcf8bd5e476b038acf8db7cad7772fc949f298d /gdb/utils.h
parent4805fc5533c158766d04f58af62bea884d624421 (diff)
downloadgdb-2437fd32f17cb11338949cff1fd0741e14ce1681.zip
gdb-2437fd32f17cb11338949cff1fd0741e14ce1681.tar.gz
gdb-2437fd32f17cb11338949cff1fd0741e14ce1681.tar.bz2
Make internal_vproblem always work
internal_vproblem can be called (via malloc_failure) from almost the first line of captured_main, but it will crash if called before the first call to set_width. This commit makes internal_vproblem work at any time. There are two parts to this. If called before gdb_stderr is set up, internal_vproblem will fall back to printing the message on regular stderr and aborting. If called after gdb_stderr is set up but before filtered printing is set up, internal_vproblem will operate as usual except that it can not query whether to quit and/or dump core so it defaults to doing both. gdb/ChangeLog: * utils.h (filtered_printing_initialized): New declaration. * utils.c (abort_with_message): New function. (internal_vproblem): Use abort_with_message for first level recursive internal problems, and if gdb_stderr is not set up. Protect calls to target_terminal_ours, begin_line and query.
Diffstat (limited to 'gdb/utils.h')
-rw-r--r--gdb/utils.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/utils.h b/gdb/utils.h
index 57a1c0f..62888a7 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -244,6 +244,9 @@ extern void fputstrn_filtered (const char *str, int n, int quotr,
extern void fputstrn_unfiltered (const char *str, int n, int quotr,
struct ui_file * stream);
+/* Return nonzero if filtered printing is initialized. */
+extern int filtered_printing_initialized (void);
+
/* Display the host ADDR on STREAM formatted as ``0x%x''. */
extern void gdb_print_host_address (const void *addr, struct ui_file *stream);