Make internal_vproblem always work
authorGary Benson <gbenson@redhat.com>
Tue, 5 Aug 2014 10:42:21 +0000 (11:42 +0100)
committerGary Benson <gbenson@redhat.com>
Fri, 29 Aug 2014 09:11:59 +0000 (10:11 +0100)
commit2437fd32f17cb11338949cff1fd0741e14ce1681
tree2bcf8bd5e476b038acf8db7cad7772fc949f298d
parent4805fc5533c158766d04f58af62bea884d624421
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.
gdb/ChangeLog
gdb/utils.c
gdb/utils.h
This page took 0.026278 seconds and 4 git commands to generate.