GNU Binutils with patches for OS216
Revision | 49133c575cfbdfb34fc55d26b323229ced906a39 (tree) |
---|---|
Time | 2008-12-28 05:28:12 |
Author | Michael Snyder <msnyder@vmwa...> |
Commiter | Michael Snyder |
2008-12-26 Michael Snyder <msnyder@vmware.com>
* record.h: Don't export record_not_record.
* infrun.c (proceed): Don't call record_not_record_set.
* record.h (record_not_record): Rename to in_record_wait.
(record_not_record_set): Rename to in_record_wait_set.
(record_not_record_cleanup): Rename to in_record_wait_cleanup.
(record_store_registers): Check in_record_wait flag.
(record_xfer_partial): Ditto.
@@ -1,5 +1,15 @@ | ||
1 | 1 | 2008-12-26 Michael Snyder <msnyder@vmware.com> |
2 | 2 | |
3 | + * record.h: Don't export record_not_record. | |
4 | + * infrun.c (proceed): Don't call record_not_record_set. | |
5 | + * record.h (record_not_record): Rename to in_record_wait. | |
6 | + (record_not_record_set): Rename to in_record_wait_set. | |
7 | + (record_not_record_cleanup): Rename to in_record_wait_cleanup. | |
8 | + (record_store_registers): Check in_record_wait flag. | |
9 | + (record_xfer_partial): Ditto. | |
10 | + | |
11 | +2008-12-26 Michael Snyder <msnyder@vmware.com> | |
12 | + | |
3 | 13 | * Marker: adding teawater patches to branch. |
4 | 14 | |
5 | 15 | 2008-12-26 Sandra Loosemore <sandra@codesourcery.com> |
@@ -1312,12 +1312,6 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) | ||
1312 | 1312 | if (step < 0) |
1313 | 1313 | stop_after_trap = 1; |
1314 | 1314 | |
1315 | - /* When GDB resume the inferior, process record target doesn't need to | |
1316 | - record the memory and register store operation of GDB. So set | |
1317 | - record_not_record to 1. */ | |
1318 | - if (RECORD_IS_USED) | |
1319 | - record_not_record_set (); | |
1320 | - | |
1321 | 1315 | if (addr == (CORE_ADDR) -1) |
1322 | 1316 | { |
1323 | 1317 | if (pc == stop_pc && breakpoint_here_p (pc) |
@@ -47,7 +47,7 @@ static int record_resume_step = 0; | ||
47 | 47 | static enum target_signal record_resume_siggnal; |
48 | 48 | static int record_get_sig = 0; |
49 | 49 | static sigset_t record_maskall; |
50 | -static int record_not_record = 0; | |
50 | +static int in_record_wait = 0; | |
51 | 51 | int record_will_store_registers = 0; |
52 | 52 | |
53 | 53 | extern struct bp_location *bp_location_chain; |
@@ -364,19 +364,19 @@ record_message (struct gdbarch *gdbarch) | ||
364 | 364 | } |
365 | 365 | } |
366 | 366 | |
367 | -/* Things to clean up if we QUIT out of function that set | |
368 | - record_not_record. */ | |
367 | +/* Things to clean up if we error or QUIT out of function that set | |
368 | + in_record_wait (ie. command that called 'proceed'). */ | |
369 | 369 | static void |
370 | -record_not_record_cleanups (void *ignore) | |
370 | +in_record_wait_cleanups (void *ignore) | |
371 | 371 | { |
372 | - record_not_record = 0; | |
372 | + in_record_wait = 0; | |
373 | 373 | } |
374 | 374 | |
375 | 375 | void |
376 | -record_not_record_set (void) | |
376 | +in_record_wait_set (void) | |
377 | 377 | { |
378 | - struct cleanup *old_cleanups = make_cleanup (record_not_record_cleanups, 0); | |
379 | - record_not_record = 1; | |
378 | + struct cleanup *old_cleanups = make_cleanup (in_record_wait_cleanups, 0); | |
379 | + in_record_wait = 1; | |
380 | 380 | } |
381 | 381 | |
382 | 382 | static void |
@@ -483,6 +483,7 @@ record_wait_cleanups (void *ignore) | ||
483 | 483 | static ptid_t |
484 | 484 | record_wait (ptid_t ptid, struct target_waitstatus *status) |
485 | 485 | { |
486 | + in_record_wait_set (); | |
486 | 487 | if (record_debug) |
487 | 488 | { |
488 | 489 | fprintf_unfiltered (gdb_stdlog, |
@@ -696,10 +697,14 @@ record_wait (ptid_t ptid, struct target_waitstatus *status) | ||
696 | 697 | paddr_nz ((CORE_ADDR)record_list), |
697 | 698 | record_list->u.reg.num); |
698 | 699 | } |
700 | + /* MVS: This step fetches the reg from the target. */ | |
699 | 701 | regcache_cooked_read (regcache, record_list->u.reg.num, reg); |
702 | + /* MVS: This step writes the execution log reg to the target. */ | |
700 | 703 | regcache_cooked_write (regcache, record_list->u.reg.num, |
701 | 704 | record_list->u.reg.val); |
705 | + /* MVS: And this step saves the target reg in the exec log. */ | |
702 | 706 | memcpy (record_list->u.reg.val, reg, MAX_REGISTER_SIZE); |
707 | + /* MVS: Net result -- swap. */ | |
703 | 708 | } |
704 | 709 | else if (record_list->type == record_mem) |
705 | 710 | { |
@@ -713,6 +718,8 @@ record_wait (ptid_t ptid, struct target_waitstatus *status) | ||
713 | 718 | paddr_nz (record_list->u.mem.addr), |
714 | 719 | record_list->u.mem.len); |
715 | 720 | } |
721 | + | |
722 | + /* MVS: This step fetches 'mem' from the target. */ | |
716 | 723 | if (target_read_memory |
717 | 724 | (record_list->u.mem.addr, mem, record_list->u.mem.len)) |
718 | 725 | { |
@@ -720,6 +727,8 @@ record_wait (ptid_t ptid, struct target_waitstatus *status) | ||
720 | 727 | paddr_nz (record_list->u.mem.addr), |
721 | 728 | record_list->u.mem.len); |
722 | 729 | } |
730 | + | |
731 | + /* MVS: This step writes from the exec log to the target. */ | |
723 | 732 | if (target_write_memory |
724 | 733 | (record_list->u.mem.addr, record_list->u.mem.val, |
725 | 734 | record_list->u.mem.len)) |
@@ -729,7 +738,9 @@ record_wait (ptid_t ptid, struct target_waitstatus *status) | ||
729 | 738 | paddr_nz (record_list->u.mem.addr), |
730 | 739 | record_list->u.mem.len); |
731 | 740 | } |
741 | + /* MVS: And this step writes target 'mem' to the exec log. */ | |
732 | 742 | memcpy (record_list->u.mem.val, mem, record_list->u.mem.len); |
743 | + /* MVS: Net result: swap. */ | |
733 | 744 | } |
734 | 745 | else |
735 | 746 | { |
@@ -937,7 +948,7 @@ record_registers_change (struct regcache *regcache, int regnum) | ||
937 | 948 | static void |
938 | 949 | record_store_registers (struct regcache *regcache, int regno) |
939 | 950 | { |
940 | - if (!record_not_record) | |
951 | + if (!in_record_wait) | |
941 | 952 | { |
942 | 953 | if (RECORD_IS_REPLAY) |
943 | 954 | { |
@@ -1000,7 +1011,7 @@ record_xfer_partial (struct target_ops *ops, enum target_object object, | ||
1000 | 1011 | const char *annex, gdb_byte * readbuf, |
1001 | 1012 | const gdb_byte * writebuf, ULONGEST offset, LONGEST len) |
1002 | 1013 | { |
1003 | - if (!record_not_record | |
1014 | + if (!in_record_wait | |
1004 | 1015 | && (object == TARGET_OBJECT_MEMORY |
1005 | 1016 | || object == TARGET_OBJECT_RAW_MEMORY) && writebuf) |
1006 | 1017 | { |
@@ -1058,7 +1069,6 @@ record_xfer_partial (struct target_ops *ops, enum target_object object, | ||
1058 | 1069 | record_insn_num++; |
1059 | 1070 | } |
1060 | 1071 | } |
1061 | - | |
1062 | 1072 | return record_beneath_to_xfer_partial (ops, object, annex, readbuf, |
1063 | 1073 | writebuf, offset, len); |
1064 | 1074 | } |
@@ -1071,7 +1081,7 @@ record_xfer_partial (struct target_ops *ops, enum target_object object, | ||
1071 | 1081 | static int |
1072 | 1082 | record_insert_breakpoint (struct bp_target_info *bp_tgt) |
1073 | 1083 | { |
1074 | - if (!RECORD_IS_REPLAY) | |
1084 | + if (!RECORD_IS_USED) | |
1075 | 1085 | { |
1076 | 1086 | return record_beneath_to_insert_breakpoint (bp_tgt); |
1077 | 1087 | } |
@@ -1082,7 +1092,7 @@ record_insert_breakpoint (struct bp_target_info *bp_tgt) | ||
1082 | 1092 | static int |
1083 | 1093 | record_remove_breakpoint (struct bp_target_info *bp_tgt) |
1084 | 1094 | { |
1085 | - if (!RECORD_IS_REPLAY) | |
1095 | + if (!RECORD_IS_USED) | |
1086 | 1096 | { |
1087 | 1097 | return record_beneath_to_remove_breakpoint (bp_tgt); |
1088 | 1098 | } |
@@ -80,7 +80,6 @@ extern int record_arch_list_add_reg (int num); | ||
80 | 80 | extern int record_arch_list_add_mem (CORE_ADDR addr, int len); |
81 | 81 | extern int record_arch_list_add_end (int need_dasm); |
82 | 82 | extern void record_message (struct gdbarch *gdbarch); |
83 | -extern void record_not_record_set (void); | |
84 | 83 | |
85 | 84 | extern void (*record_beneath_to_resume) (ptid_t, int, enum target_signal); |
86 | 85 | extern ptid_t (*record_beneath_to_wait) (ptid_t, struct target_waitstatus *); |