Chromium Code Reviews| Index: runtime/vm/debugger.cc |
| =================================================================== |
| --- runtime/vm/debugger.cc (revision 5651) |
| +++ runtime/vm/debugger.cc (working copy) |
| @@ -317,12 +317,23 @@ |
| pc_ = desc.PC(pc_desc_index); |
| ASSERT(pc_ != 0); |
| breakpoint_kind_ = desc.DescriptorKind(pc_desc_index); |
| + ASSERT((breakpoint_kind_ == PcDescriptors::kIcCall) || |
| + (breakpoint_kind_ == PcDescriptors::kFuncCall) || |
| + (breakpoint_kind_ == PcDescriptors::kReturn)); |
| } |
| CodeBreakpoint::~CodeBreakpoint() { |
| // Make sure we don't leave patched code behind. |
| ASSERT(!IsEnabled()); |
| + // Poison the data so we catch use after free errors. |
| +#ifdef DEBUG |
| + function_ = Function::null(); |
| + pc_ = 0ul; |
| + src_bpt_ = NULL; |
| + next_ = NULL; |
| + breakpoint_kind_ = PcDescriptors::kOther; |
| +#endif |
| } |
| @@ -518,6 +529,7 @@ |
| return; |
| } |
| } |
| + RemoveInternalBreakpoints(); |
| Code& code = Code::Handle(target_function.unoptimized_code()); |
| ASSERT(!code.IsNull()); |
| PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors()); |
| @@ -880,12 +892,10 @@ |
| if (stack_trace->Length() > 1) { |
| ActivationFrame* caller = stack_trace->ActivationFrameAt(1); |
| func = caller->DartFunction().raw(); |
| - RemoveInternalBreakpoints(); |
| } |
| } |
| InstrumentForStepping(func); |
| } else if (resume_action_ == kStepInto) { |
| - RemoveInternalBreakpoints(); |
| if (bpt->breakpoint_kind_ == PcDescriptors::kIcCall) { |
| int num_args, num_named_args; |
| uword target; |
| @@ -916,7 +926,6 @@ |
| } else { |
| ASSERT(resume_action_ == kStepOut); |
| // Set stepping breakpoints in the caller. |
| - RemoveInternalBreakpoints(); |
| if (stack_trace->Length() > 1) { |
| ActivationFrame* caller = stack_trace->ActivationFrameAt(1); |
| InstrumentForStepping(caller->DartFunction()); |
|
siva
2012/03/19 22:45:22
Ditto question.
hausner
2012/03/19 23:35:15
Ditto.
|