diff options
author | Hui Zhu <teawater@gmail.com> | 2008-09-18 17:17:42 +0000 |
---|---|---|
committer | Hui Zhu <teawater@gmail.com> | 2008-09-18 17:17:42 +0000 |
commit | 116c7eedcb636aa9c911df7f823b29632472a901 (patch) | |
tree | 5b8704b69afc21c51b406a029cdb7089e15f3f09 | |
parent | d2fd7e5e8ba666edd23abb748f590eb20eaf9b4f (diff) | |
download | binutils-gdb-116c7eedcb636aa9c911df7f823b29632472a901.tar.gz |
2008-09-19 Hui Zhu <teawater@gmail.com>
* record.c (record_wait): Fix the bug of forware step after
reverse step.
Make debug message more clean.
Remove variable record_list_status.
* i386-tdep.c (i386_record): Fix the bug of "0x80 ... 0x83".
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/i386-tdep.c | 6 | ||||
-rw-r--r-- | gdb/record.c | 75 |
3 files changed, 44 insertions, 46 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9dd4d9118ec..e3cb35f464b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2008-09-19 Hui Zhu <teawater@gmail.com> + + * record.c (record_wait): Fix the bug of forware step after + reverse step. + Make debug message more clean. + Remove variable record_list_status. + + * i386-tdep.c (i386_record): Fix the bug of "0x80 ... 0x83". + 2008-09-15 Michael Snyder <msnyder@vmware.com> * infrun.c (proceed): No need to singlestep over a breakpoint diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index b391e5d0fd1..95f271df9f5 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -3037,11 +3037,7 @@ reswitch: } else { - if (ot == OT_BYTE) - { - reg &= 0x3; - } - if (record_arch_list_add_reg (reg)) + if (record_arch_list_add_reg (rm)) { return (-1); } diff --git a/gdb/record.c b/gdb/record.c index 449fc5720ef..54b600a554f 100644 --- a/gdb/record.c +++ b/gdb/record.c @@ -33,7 +33,6 @@ int record_debug = 0; record_t record_first; record_t *record_list = &record_first; -int record_list_status = 1; /* 0 normal 1 to the begin 2 to the end */ record_t *record_arch_list_head = NULL; record_t *record_arch_list_tail = NULL; struct regcache *record_regcache = NULL; @@ -446,7 +445,6 @@ record_open (char *name, int from_tty) /* Reset */ record_insn_num = 0; - record_list_status = 1; record_execdir = EXEC_FORWARD; record_list = &record_first; record_list->next = NULL; @@ -546,30 +544,31 @@ record_wait (ptid_t ptid, struct target_waitstatus *status) Then set it to terminal_ours to make GDB get the signal. */ target_terminal_ours (); - /* Loop over the record log, looking for the next place to stop. */ + /* In EXEC_FORWARD mode,, record_list point to the tail of prev + instruction. */ + if (record_execdir == EXEC_FORWARD && record_list->next) + { + record_list = record_list->next; + } + + /* Loop over the record_list, looking for the next place to stop. */ do { /* check state */ - if ((record_execdir == EXEC_REVERSE && !record_list->prev - && record_list_status == 1) - || (record_execdir != EXEC_REVERSE - && !record_list->next - && record_list_status == 2)) + if (record_execdir == EXEC_REVERSE && record_list == &record_first) { - if (record_list_status == 2) - { - fprintf_unfiltered (gdb_stdlog, - "Record: running to the end of record list.\n"); - } - else if (record_list_status == 1) - { - fprintf_unfiltered (gdb_stdlog, - "Record: running to the begin of record list.\n"); - } + fprintf_unfiltered (gdb_stdlog, + "Record: running to the begin of record list.\n"); + stop_soon = STOP_QUIETLY; + break; + } + if (record_execdir != EXEC_REVERSE && !record_list->next) + { + fprintf_unfiltered (gdb_stdlog, + "Record: running to the end of record list.\n"); stop_soon = STOP_QUIETLY; break; } - record_list_status = 0; /* set ptid, register and memory according to record_list */ if (record_list->type == record_reg) @@ -579,7 +578,8 @@ record_wait (ptid_t ptid, struct target_waitstatus *status) if (record_debug > 1) { fprintf_unfiltered (gdb_stdlog, - "Record: record_reg to inferior num = %d.\n", + "Record: record_reg 0x%s to inferior num = %d.\n", + paddr_nz ((CORE_ADDR)record_list), record_list->u.reg.num); } regcache_cooked_read (regcache, record_list->u.reg.num, reg); @@ -594,7 +594,8 @@ record_wait (ptid_t ptid, struct target_waitstatus *status) if (record_debug > 1) { fprintf_unfiltered (gdb_stdlog, - "Record: record_mem to inferior addr = 0x%s len = %d.\n", + "Record: record_mem 0x%s to inferior addr = 0x%s len = %d.\n", + paddr_nz ((CORE_ADDR)record_list), paddr_nz (record_list->u.mem.addr), record_list->u.mem.len); } @@ -625,19 +626,13 @@ record_wait (ptid_t ptid, struct target_waitstatus *status) if (record_debug > 1) { fprintf_unfiltered (gdb_stdlog, - "Record: record_end to inferior need_dasm = %d.\n", + "Record: record_end 0x%s to inferior need_dasm = %d.\n", + paddr_nz ((CORE_ADDR)record_list), record_list->u.need_dasm); } if (record_execdir == EXEC_FORWARD) { - if (record_list == &record_first) - { - /* The first record_t, not a really record_t. - Goto next record_t. */ - goto next; - } - need_dasm = record_list->u.need_dasm; } if (need_dasm) @@ -706,21 +701,19 @@ record_wait (ptid_t ptid, struct target_waitstatus *status) } next: - if (record_execdir == EXEC_REVERSE) - { - if (record_list->prev && continue_flag) - record_list = record_list->prev; - else - record_list_status = 1; - } - else + if (continue_flag) { - if (record_list->next) - record_list = record_list->next; + if (record_execdir == EXEC_REVERSE) + { + if (record_list->prev) + record_list = record_list->prev; + } else - record_list_status = 2; + { + if (record_list->next) + record_list = record_list->next; + } } - } while (continue_flag); |