Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1569)

Unified Diff: runtime/vm/debugger.cc

Issue 875443002: Store pc offset instead of absolute pc in the pc descriptors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed arm/mips/arm64 build Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_descriptors_test.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
===================================================================
--- runtime/vm/debugger.cc (revision 43041)
+++ runtime/vm/debugger.cc (working copy)
@@ -387,8 +387,9 @@
token_pos_ = Scanner::kNoSourcePos;
GetPcDescriptors();
PcDescriptors::Iterator iter(pc_desc_, RawPcDescriptors::kAnyKind);
+ uword pc_offset = pc_ - code().EntryPoint();
while (iter.MoveNext()) {
- if (iter.Pc() == pc_) {
+ if (iter.PcOffset() == pc_offset) {
try_index_ = iter.TryIndex();
token_pos_ = iter.TokenPos();
break;
@@ -1470,14 +1471,14 @@
const TokenStream& tokens = TokenStream::Handle(script.tokens());
const intptr_t begin_pos = best_fit_pos;
const intptr_t end_of_line_pos = LastTokenOnLine(tokens, begin_pos);
- uword lowest_pc = kUwordMax;
+ uword lowest_pc_offset = kUwordMax;
PcDescriptors::Iterator iter(desc, kSafepointKind);
while (iter.MoveNext()) {
const intptr_t pos = iter.TokenPos();
if ((pos != Scanner::kNoSourcePos) &&
(begin_pos <= pos) && (pos <= end_of_line_pos) &&
- (iter.Pc() < lowest_pc)) {
- lowest_pc = iter.Pc();
+ (iter.PcOffset() < lowest_pc_offset)) {
+ lowest_pc_offset = iter.PcOffset();
best_fit_pos = pos;
}
}
@@ -1501,7 +1502,7 @@
Code& code = Code::Handle(func.unoptimized_code());
ASSERT(!code.IsNull());
PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors());
- uword lowest_pc = kUwordMax;
+ uword lowest_pc_offset = kUwordMax;
RawPcDescriptors::Kind lowest_kind = RawPcDescriptors::kAnyKind;
// Find the safe point with the lowest compiled code address
// that maps to the token position of the source breakpoint.
@@ -1508,15 +1509,16 @@
PcDescriptors::Iterator iter(desc, kSafepointKind);
while (iter.MoveNext()) {
if (iter.TokenPos() == bpt->token_pos_) {
- if (iter.Pc() < lowest_pc) {
- lowest_pc = iter.Pc();
+ if (iter.PcOffset() < lowest_pc_offset) {
+ lowest_pc_offset = iter.PcOffset();
lowest_kind = iter.Kind();
}
}
}
- if (lowest_pc == kUwordMax) {
+ if (lowest_pc_offset == kUwordMax) {
return;
}
+ uword lowest_pc = code.EntryPoint() + lowest_pc_offset;
CodeBreakpoint* code_bpt = GetCodeBreakpoint(lowest_pc);
if (code_bpt == NULL) {
// No code breakpoint for this code exists; create one.
« no previous file with comments | « runtime/vm/code_descriptors_test.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698