aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/target.c20
-rw-r--r--gdb/target.h5
-rw-r--r--gdb/utils.c2
4 files changed, 34 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ffecd79..f29d399 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,6 +1,15 @@
2014-07-18 Tom Tromey <tromey@redhat.com>
PR gdb/17130:
+ * utils.c (quit): Use target_supports_terminal_ours.
+ * target.h (target_supports_terminal_ours): Declare.
+ * target.c (target_supports_delete_record): Don't check
+ to_delete_record against NULL.
+ (target_supports_terminal_ours): New function.
+
+2014-07-18 Tom Tromey <tromey@redhat.com>
+
+ PR gdb/17130:
* spu-multiarch.c (spu_region_ok_for_hw_watchpoint)
(spu_fetch_registers, spu_store_registers, spu_xfer_partial)
(spu_search_memory, spu_mourn_inferior): Simplify delegation.
diff --git a/gdb/target.c b/gdb/target.c
index 07d029a..d77542a 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -499,6 +499,23 @@ target_terminal_inferior (void)
(*current_target.to_terminal_inferior) (&current_target);
}
+/* See target.h. */
+
+int
+target_supports_terminal_ours (void)
+{
+ struct target_ops *t;
+
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ {
+ if (t->to_terminal_ours != delegate_terminal_ours
+ && t->to_terminal_ours != tdefault_terminal_ours)
+ return 1;
+ }
+
+ return 0;
+}
+
static void
tcomplain (void)
{
@@ -3457,7 +3474,8 @@ target_supports_delete_record (void)
struct target_ops *t;
for (t = current_target.beneath; t != NULL; t = t->beneath)
- if (t->to_delete_record != NULL)
+ if (t->to_delete_record != delegate_delete_record
+ && t->to_delete_record != tdefault_delete_record)
return 1;
return 0;
diff --git a/gdb/target.h b/gdb/target.h
index 8c8ce00..35a7d7d 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1397,6 +1397,11 @@ extern void target_terminal_inferior (void);
#define target_terminal_ours() \
(*current_target.to_terminal_ours) (&current_target)
+/* Return true if the target stack has a non-default
+ "to_terminal_ours" method. */
+
+extern int target_supports_terminal_ours (void);
+
/* Save our terminal settings.
This is called from TUI after entering or leaving the curses
mode. Since curses modifies our terminal this call is here
diff --git a/gdb/utils.c b/gdb/utils.c
index d324227..a9e8196 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1095,7 +1095,7 @@ quit (void)
if (job_control
/* If there is no terminal switching for this target, then we can't
possibly get screwed by the lack of job control. */
- || current_target.to_terminal_ours == NULL)
+ || !target_supports_terminal_ours ())
fatal ("Quit");
else
fatal ("Quit (expect signal SIGINT when the program is resumed)");