aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-03-07 15:58:13 +0000
committerTom Tromey <tromey@redhat.com>2011-03-07 15:58:13 +0000
commitaeaec16283729646a2269c53f64c2bc06096906b (patch)
tree12290b6d41234aab200c674bd14f14b2f64a50b8 /gdb/target.c
parent08e1408309952d0890e72ca2b3ac813570127aa0 (diff)
downloadgdb-aeaec16283729646a2269c53f64c2bc06096906b.zip
gdb-aeaec16283729646a2269c53f64c2bc06096906b.tar.gz
gdb-aeaec16283729646a2269c53f64c2bc06096906b.tar.bz2
* target.h (struct target_ops) <to_has_execution>: Add ptid_t
parameter. (target_has_execution_1): Update. (target_has_execution_current): Declare. (target_has_execution): Call target_has_execution_current. (default_child_has_execution): Update. * target.c (default_child_has_execution): Add 'the_ptid' parameter. (target_has_execution_1): Likewise. (target_has_execution_current): New function. (add_target): Update. (init_dummy_target): Update. * remote-m32r-sdi.c (m32r_has_execution): New function. (init_m32r_ops): Use it. * record.c (record_core_has_execution): Now static. Add 'the_ptid' parameter. * inferior.c (have_live_inferiors): Don't save current thread. Use target_has_execution_1.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gdb/target.c b/gdb/target.c
index a4e2ae9..edf7e1c 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -314,11 +314,11 @@ default_child_has_registers (struct target_ops *ops)
}
int
-default_child_has_execution (struct target_ops *ops)
+default_child_has_execution (struct target_ops *ops, ptid_t the_ptid)
{
/* If there's no thread selected, then we can't make it run through
hoops. */
- if (ptid_equal (inferior_ptid, null_ptid))
+ if (ptid_equal (the_ptid, null_ptid))
return 0;
return 1;
@@ -374,17 +374,23 @@ target_has_registers_1 (void)
}
int
-target_has_execution_1 (void)
+target_has_execution_1 (ptid_t the_ptid)
{
struct target_ops *t;
for (t = current_target.beneath; t != NULL; t = t->beneath)
- if (t->to_has_execution (t))
+ if (t->to_has_execution (t, the_ptid))
return 1;
return 0;
}
+int
+target_has_execution_current (void)
+{
+ return target_has_execution_1 (inferior_ptid);
+}
+
/* Add a possible target architecture to the list. */
void
@@ -407,7 +413,7 @@ add_target (struct target_ops *t)
t->to_has_registers = (int (*) (struct target_ops *)) return_zero;
if (t->to_has_execution == NULL)
- t->to_has_execution = (int (*) (struct target_ops *)) return_zero;
+ t->to_has_execution = (int (*) (struct target_ops *, ptid_t)) return_zero;
if (!target_structs)
{
@@ -3218,7 +3224,8 @@ init_dummy_target (void)
dummy_target.to_has_memory = (int (*) (struct target_ops *)) return_zero;
dummy_target.to_has_stack = (int (*) (struct target_ops *)) return_zero;
dummy_target.to_has_registers = (int (*) (struct target_ops *)) return_zero;
- dummy_target.to_has_execution = (int (*) (struct target_ops *)) return_zero;
+ dummy_target.to_has_execution
+ = (int (*) (struct target_ops *, ptid_t)) return_zero;
dummy_target.to_stopped_by_watchpoint = return_zero;
dummy_target.to_stopped_data_address =
(int (*) (struct target_ops *, CORE_ADDR *)) return_zero;