diff options
author | Hui Zhu <teawater@gmail.com> | 2008-11-06 02:18:10 +0000 |
---|---|---|
committer | Hui Zhu <teawater@gmail.com> | 2008-11-06 02:18:10 +0000 |
commit | 58daec0383c8af898ff653484ca30f6f7fe40fb8 (patch) | |
tree | 0d0ee893040da4809cf24e5ca876261e27827f1f /gdb/linux-nat.c | |
parent | fc9fcca80df5fec41e30c47a55bfc24133d4c0cc (diff) | |
download | gdb-58daec0383c8af898ff653484ca30f6f7fe40fb8.tar.gz |
2008-11-06 Hui Zhu <teawater@gmail.com>cvs/reverse-20080930-branch
* record.c (record_wait): Set pc if forward execute,
gdbarch_decr_pc_after_break is not 0 and this is not single
step in replay mode.
* linux-nat.c (my_waitpid_record): Add
gdbarch_decr_pc_after_break to pc if need.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r-- | gdb/linux-nat.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index b63f863e563..2f4c62153cb 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -514,7 +514,9 @@ my_waitpid_record (int pid, int *status, int flags) struct bp_location *bl; struct breakpoint *b; CORE_ADDR pc; + CORE_ADDR decr_pc_after_break; struct lwp_info *lp; + int is_breakpoint = 1; wait_begin: ret = my_waitpid (pid, status, flags); @@ -530,7 +532,7 @@ wait_begin: if (WIFSTOPPED (*status) && WSTOPSIG (*status) == SIGTRAP) { - /* Check if there is a breakpoint */ + /* Check if there is a breakpoint. */ pc = 0; registers_changed (); for (bl = bp_location_chain; bl; bl = bl->global_next) @@ -602,7 +604,26 @@ wait_begin: goto wait_begin; } + is_breakpoint = 0; + out: + /* Add gdbarch_decr_pc_after_break to pc because pc will be break at address + add gdbarch_decr_pc_after_break when inferior non-step execute. */ + if (is_breakpoint) + { + decr_pc_after_break = gdbarch_decr_pc_after_break + (get_regcache_arch (get_thread_regcache (pid_to_ptid (ret)))); + if (decr_pc_after_break) + { + if (!pc) + { + pc = regcache_read_pc (get_thread_regcache (pid_to_ptid (ret))); + } + regcache_write_pc (get_thread_regcache (pid_to_ptid (ret)), + pc + decr_pc_after_break); + } + } + return ret; } |