aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2014-08-05 10:20:05 +0100
committerGary Benson <gbenson@redhat.com>2014-08-19 09:44:16 +0100
commit196a707b15ab32c29ba021b4f5b9ea202c109fe1 (patch)
treee0f3538a5567ec07596b6d4c10fd0244af82a636 /gdb/utils.c
parent774891604bce270965bd356b8fc81fd51680050c (diff)
downloadgdb-196a707b15ab32c29ba021b4f5b9ea202c109fe1.zip
gdb-196a707b15ab32c29ba021b4f5b9ea202c109fe1.tar.gz
gdb-196a707b15ab32c29ba021b4f5b9ea202c109fe1.tar.bz2
Ensure internal_vproblem always prints the message
While working on internal_vproblem I noticed that the error/warning message is suppressed if problem->should_quit is internal_problem_yes or internal_problem_no. This behaviour seems wrong. This commit modifies internal_vproblem to emit the message regardless of the user's settings. gdb/ 2014-08-19 Gary Benson <gbenson@redhat.com> * utils.c (internal_vproblem): Always print the message.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 34b842e..61f0abc 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -733,18 +733,17 @@ internal_vproblem (struct internal_problem *problem,
make_cleanup (xfree, reason);
}
+ /* Emit the message unless query will emit it below. */
+ if (problem->should_quit != internal_problem_ask || !confirm)
+ fprintf_unfiltered (gdb_stderr, "%s\n", reason);
+
if (problem->should_quit == internal_problem_ask)
{
/* Default (yes/batch case) is to quit GDB. When in batch mode
this lessens the likelihood of GDB going into an infinite
loop. */
if (!confirm)
- {
- /* Emit the message and quit. */
- fputs_unfiltered (reason, gdb_stderr);
- fputs_unfiltered ("\n", gdb_stderr);
- quit_p = 1;
- }
+ quit_p = 1;
else
quit_p = query (_("%s\nQuit this debugging session? "), reason);
}