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

Unified Diff: src/log-utils.cc

Issue 125256: Implemented processing of compressed log files. (Closed)
Patch Set: Added tests Created 11 years, 6 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
Index: src/log-utils.cc
diff --git a/src/log-utils.cc b/src/log-utils.cc
index 028eb3a015b1ce782304442df652839156e68ee5..b31864be4695c752ebe210ad1ac77282c377a855 100644
--- a/src/log-utils.cc
+++ b/src/log-utils.cc
@@ -261,14 +261,20 @@ void LogMessageBuilder::AppendAddress(Address addr) {
void LogMessageBuilder::AppendAddress(Address addr, Address bias) {
- if (!FLAG_compress_log || bias == NULL) {
+ if (!FLAG_compress_log) {
Append("0x%" V8PRIxPTR, addr);
+ } else if (bias == NULL) {
+ Append("%" V8PRIxPTR, addr);
} else {
- intptr_t delta = addr - bias;
- // To avoid printing negative offsets in an unsigned form,
- // we are printing an absolute value with a sign.
- const char sign = delta >= 0 ? '+' : '-';
- if (sign == '-') { delta = -delta; }
+ uintptr_t delta;
+ char sign;
+ if (addr >= bias) {
+ delta = addr - bias;
+ sign = '+';
+ } else {
+ delta = bias - addr;
+ sign = '-';
+ }
Append("%c%" V8PRIxPTR, sign, delta);
}
}
« no previous file with comments | « src/log.cc ('k') | test/mjsunit/tools/logreader.js » ('j') | tools/logreader.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698