LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2013 The Go Authors. All rights reserved. | 1 // Copyright 2013 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #include <u.h> | 5 #include <u.h> |
6 #include <libc.h> | 6 #include <libc.h> |
7 #include <bio.h> | 7 #include <bio.h> |
8 #include <link.h> | 8 #include <link.h> |
9 | 9 |
10 static void | 10 static void |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 if(v == 0 && !it->start) { | 340 if(v == 0 && !it->start) { |
341 it->done = 1; | 341 it->done = 1; |
342 return; | 342 return; |
343 } | 343 } |
344 it->start = 0; | 344 it->start = 0; |
345 dv = (int32)(v>>1) ^ ((int32)(v<<31)>>31); | 345 dv = (int32)(v>>1) ^ ((int32)(v<<31)>>31); |
346 it->value += dv; | 346 it->value += dv; |
347 ········ | 347 ········ |
348 // pc delta | 348 // pc delta |
349 v = getvarint(&it->p); | 349 v = getvarint(&it->p); |
350 » it->nextpc = it->pc + v; | 350 » it->nextpc = it->pc + v*it->pcscale; |
351 } | 351 } |
352 | 352 |
353 void | 353 void |
354 pciterinit(Pciter *it, Pcdata *d) | 354 pciterinit(Link *ctxt, Pciter *it, Pcdata *d) |
355 { | 355 { |
356 it->d = *d; | 356 it->d = *d; |
357 it->p = it->d.p; | 357 it->p = it->d.p; |
358 it->pc = 0; | 358 it->pc = 0; |
359 it->nextpc = 0; | 359 it->nextpc = 0; |
360 it->value = -1; | 360 it->value = -1; |
361 it->start = 1; | 361 it->start = 1; |
362 it->done = 0; | 362 it->done = 0; |
| 363 it->pcscale = ctxt->arch->minlc; |
363 pciternext(it); | 364 pciternext(it); |
364 } | 365 } |
LEFT | RIGHT |