X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Frecord-full.c;h=f307b4876fcae111e3c2ae282ac7263be8240e00;hb=35fd2deb6916e972248d52b1bc1d584fa9059f8f;hp=595e357a3b5c8af5cc487d41b7e7500d6ceb3292;hpb=7cc53fba0a4e5c316a6e86fdae28f8cc9d0f9a68;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/record-full.c b/gdb/record-full.c index 595e357a3b..f307b4876f 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -1,6 +1,6 @@ /* Process record and replay target for GDB, the GNU debugger. - Copyright (C) 2013-2015 Free Software Foundation, Inc. + Copyright (C) 2013-2016 Free Software Foundation, Inc. This file is part of GDB. @@ -535,26 +535,18 @@ record_full_arch_list_add_end (void) } static void -record_full_check_insn_num (int set_terminal) +record_full_check_insn_num (void) { if (record_full_insn_num == record_full_insn_max_num) { /* Ask user what to do. */ if (record_full_stop_at_limit) { - int q; - - if (set_terminal) - target_terminal_ours (); - q = yquery (_("Do you want to auto delete previous execution " + if (!yquery (_("Do you want to auto delete previous execution " "log entries when record/replay buffer becomes " - "full (record full stop-at-limit)?")); - if (set_terminal) - target_terminal_inferior (); - if (q) - record_full_stop_at_limit = 0; - else + "full (record full stop-at-limit)?"))) error (_("Process record: stopped by user.")); + record_full_stop_at_limit = 0; } } } @@ -583,7 +575,7 @@ record_full_message (struct regcache *regcache, enum gdb_signal signal) record_full_arch_list_tail = NULL; /* Check record_full_insn_num. */ - record_full_check_insn_num (1); + record_full_check_insn_num (); /* If gdb sends a signal value to target_resume, save it in the 'end' field of the previous instruction. @@ -726,7 +718,8 @@ record_full_exec_insn (struct regcache *regcache, /* Nothing to do if the entry is flagged not_accessible. */ if (!entry->u.mem.mem_entry_not_accessible) { - gdb_byte *mem = (gdb_byte *) alloca (entry->u.mem.len); + gdb_byte *mem = (gdb_byte *) xmalloc (entry->u.mem.len); + struct cleanup *cleanup = make_cleanup (xfree, mem); if (record_debug > 1) fprintf_unfiltered (gdb_stdlog, @@ -771,6 +764,8 @@ record_full_exec_insn (struct regcache *regcache, record_full_stop_reason = TARGET_STOPPED_BY_WATCHPOINT; } } + + do_cleanups (cleanup); } } break; @@ -1417,7 +1412,7 @@ static void record_full_registers_change (struct regcache *regcache, int regnum) { /* Check record_full_insn_num. */ - record_full_check_insn_num (0); + record_full_check_insn_num (); record_full_arch_list_head = NULL; record_full_arch_list_tail = NULL; @@ -1543,7 +1538,7 @@ record_full_xfer_partial (struct target_ops *ops, enum target_object object, } /* Check record_full_insn_num */ - record_full_check_insn_num (0); + record_full_check_insn_num (); /* Record registers change to list as an instruction. */ record_full_arch_list_head = NULL; @@ -1647,6 +1642,7 @@ record_full_insert_breakpoint (struct target_ops *ops, { struct record_full_breakpoint *bp; int in_target_beneath = 0; + int ix; if (!RECORD_FULL_IS_REPLAY) { @@ -1667,6 +1663,32 @@ record_full_insert_breakpoint (struct target_ops *ops, in_target_beneath = 1; } + else + { + CORE_ADDR addr = bp_tgt->reqstd_address; + int bplen; + + gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen); + + bp_tgt->placed_address = addr; + bp_tgt->placed_size = bplen; + } + + /* Use the existing entries if found in order to avoid duplication + in record_full_breakpoints. */ + + for (ix = 0; + VEC_iterate (record_full_breakpoint_p, + record_full_breakpoints, ix, bp); + ++ix) + { + if (bp->addr == bp_tgt->placed_address + && bp->address_space == bp_tgt->placed_address_space) + { + gdb_assert (bp->in_target_beneath == in_target_beneath); + return 0; + } + } bp = XNEW (struct record_full_breakpoint); bp->addr = bp_tgt->placed_address;