summaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2011-05-26 18:11:32 +0000
committerPedro Alves <pedro@codesourcery.com>2011-05-26 18:11:32 +0000
commit44b67f6b464ec456793182183b3b47175d7d602e (patch)
treea83450c5481246d87d5b3c66b907111e1eb677ad /gdb/target.c
parentd28e5067bf1fde683dfe7b3d5c3e97d24bd426f3 (diff)
downloadgdb-44b67f6b464ec456793182183b3b47175d7d602e.tar.gz
2011-05-26 Pedro Alves <pedro@codesourcery.com>
gdb/ * record.c: Include event-loop.h, inf-loop.h. (record_beneath_to_async): New global. (tmp_to_async): New global. (record_async_inferior_event_token): New global. (record_open_1): Don't error out if async is enabled. (record_open): Handle to_async. Create an async event source in the event loop. (record_close): Delete the async event source. (record_resumed): New global. (record_execution_dir): New global. (record_resume, record_core_resume): Set them. Register the target on the event loop. (record_wait): Rename to ... (record_wait_1): ... this. Add more debug output. Handle TARGET_WNOHANG, and the target beneath returning TARGET_WAITKIND_IGNORE. (record_wait): Reimplement on top of record_wait_1. (record_async_mask_value): New global. (record_async, record_async_mask, record_can_async_p) (record_is_async_p, record_execution_direction): New functions. (init_record_ops, init_record_core_ops): Install new methods. * infrun.c (fetch_inferior_event): Temporarily switch the global execution direction to the direction the target was going. (execution_direction): Change type to int. * target.c (default_execution_direction): New function. (update_current_target): Inherit and de_fault to_execution_direction. * target.h (struct target_ops) <to_execution_direction>: New field. (target_execution_direction): New macro. * inferior.h (execution_direction): Change type to int.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index ed2da34744c..0b7e61e04c8 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -544,6 +544,18 @@ default_get_ada_task_ptid (long lwp, long tid)
return ptid_build (ptid_get_pid (inferior_ptid), lwp, tid);
}
+static enum exec_direction_kind
+default_execution_direction (void)
+{
+ if (!target_can_execute_reverse)
+ return EXEC_FORWARD;
+ else if (!target_can_async_p ())
+ return EXEC_FORWARD;
+ else
+ gdb_assert_not_reached ("\
+to_execution_direction must be implemented for reverse async");
+}
+
/* Go through the target stack from top to bottom, copying over zero
entries in current_target, then filling in still empty entries. In
effect, we are doing class inheritance through the pushed target
@@ -654,6 +666,7 @@ update_current_target (void)
INHERIT (to_goto_bookmark, t);
/* Do not inherit to_get_thread_local_address. */
INHERIT (to_can_execute_reverse, t);
+ INHERIT (to_execution_direction, t);
INHERIT (to_thread_architecture, t);
/* Do not inherit to_read_description. */
INHERIT (to_get_ada_task_ptid, t);
@@ -897,6 +910,8 @@ update_current_target (void)
de_fault (to_traceframe_info,
(struct traceframe_info * (*) (void))
tcomplain);
+ de_fault (to_execution_direction, default_execution_direction);
+
#undef de_fault
/* Finally, position the target-stack beneath the squashed