From 3223143295b5bb65ac7179ff1915b4546213dbd0 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 26 May 2011 18:11:33 +0000 Subject: 2011-05-26 Pedro Alves 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) : New field. (target_execution_direction): New macro. * inferior.h (execution_direction): Change type to int. --- gdb/target.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gdb/target.h') diff --git a/gdb/target.h b/gdb/target.h index fd58bd95c98..21e14501eb8 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -641,6 +641,11 @@ struct target_ops /* Can target execute in reverse? */ int (*to_can_execute_reverse) (void); + /* The direction the target is currently executing. Must be + implemented on targets that support reverse execution and async + mode. The default simply returns forward execution. */ + enum exec_direction_kind (*to_execution_direction) (void); + /* Does this target support debugging multiple processes simultaneously? */ int (*to_supports_multi_process) (void); @@ -1271,6 +1276,9 @@ int target_supports_non_stop (void); #define target_async_mask(MASK) \ (current_target.to_async_mask (MASK)) +#define target_execution_direction() \ + (current_target.to_execution_direction ()) + /* Converts a process id to a string. Usually, the string just contains `process xyz', but on some systems it may contain `process xyz thread abc'. */ -- cgit v1.2.1