• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisãoec629fe1bbf72a9ceffea9252821fdd11e08449e (tree)
Hora2008-11-06 11:18:11
AutorHui Zhu <teawater@gmai...>
CommiterHui Zhu

Mensagem de Log

2008-11-06 Hui Zhu <teawater@gmail.com>

* 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.

Mudança Sumário

Diff

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
1+2008-11-06 Hui Zhu <teawater@gmail.com>
2+
3+ * record.c (record_wait): Set pc if forward execute,
4+ gdbarch_decr_pc_after_break is not 0 and this is not single
5+ step in replay mode.
6+ * linux-nat.c (my_waitpid_record): Add
7+ gdbarch_decr_pc_after_break to pc if need.
8+
19 2008-11-05 Hui Zhu <teawater@gmail.com>
210
311 * record.c (record_wait): Check breakpint before forward
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -514,7 +514,9 @@ my_waitpid_record (int pid, int *status, int flags)
514514 struct bp_location *bl;
515515 struct breakpoint *b;
516516 CORE_ADDR pc;
517+ CORE_ADDR decr_pc_after_break;
517518 struct lwp_info *lp;
519+ int is_breakpoint = 1;
518520
519521 wait_begin:
520522 ret = my_waitpid (pid, status, flags);
@@ -530,7 +532,7 @@ wait_begin:
530532
531533 if (WIFSTOPPED (*status) && WSTOPSIG (*status) == SIGTRAP)
532534 {
533- /* Check if there is a breakpoint */
535+ /* Check if there is a breakpoint. */
534536 pc = 0;
535537 registers_changed ();
536538 for (bl = bp_location_chain; bl; bl = bl->global_next)
@@ -602,7 +604,26 @@ wait_begin:
602604 goto wait_begin;
603605 }
604606
607+ is_breakpoint = 0;
608+
605609 out:
610+ /* Add gdbarch_decr_pc_after_break to pc because pc will be break at address
611+ add gdbarch_decr_pc_after_break when inferior non-step execute. */
612+ if (is_breakpoint)
613+ {
614+ decr_pc_after_break = gdbarch_decr_pc_after_break
615+ (get_regcache_arch (get_thread_regcache (pid_to_ptid (ret))));
616+ if (decr_pc_after_break)
617+ {
618+ if (!pc)
619+ {
620+ pc = regcache_read_pc (get_thread_regcache (pid_to_ptid (ret)));
621+ }
622+ regcache_write_pc (get_thread_regcache (pid_to_ptid (ret)),
623+ pc + decr_pc_after_break);
624+ }
625+ }
626+
606627 return ret;
607628 }
608629
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -513,6 +513,14 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
513513 "Process record: break at 0x%s.\n",
514514 paddr_nz (tmp_pc));
515515 }
516+ if (gdbarch_decr_pc_after_break (get_regcache_arch (regcache))
517+ && !record_resume_step)
518+ {
519+ regcache_write_pc (regcache,
520+ tmp_pc +
521+ gdbarch_decr_pc_after_break
522+ (get_regcache_arch (regcache)));
523+ }
516524 goto replay_out;
517525 }
518526 }
@@ -655,6 +663,15 @@ record_wait (ptid_t ptid, struct target_waitstatus *status)
655663 "Process record: break at 0x%s.\n",
656664 paddr_nz (tmp_pc));
657665 }
666+ if (gdbarch_decr_pc_after_break (get_regcache_arch (regcache))
667+ && execution_direction == EXEC_FORWARD
668+ && !record_resume_step)
669+ {
670+ regcache_write_pc (regcache,
671+ tmp_pc +
672+ gdbarch_decr_pc_after_break
673+ (get_regcache_arch (regcache)));
674+ }
658675 continue_flag = 0;
659676 }
660677 }