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

Side by Side Diff: base/debug/stack_trace_android.cc

Issue 185423006: Eliminate build warnings in base/ for Android x64 (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/debug/stack_trace.h" 5 #include "base/debug/stack_trace.h"
6 6
7 #include <android/log.h> 7 #include <android/log.h>
8 #include <unwind.h> 8 #include <unwind.h>
9 9
10 #include "base/debug/proc_maps_linux.h" 10 #include "base/debug/proc_maps_linux.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 std::vector<MappedMemoryRegion>::iterator iter = regions.begin(); 98 std::vector<MappedMemoryRegion>::iterator iter = regions.begin();
99 while (iter != regions.end()) { 99 while (iter != regions.end()) {
100 if (address >= iter->start && address < iter->end && 100 if (address >= iter->start && address < iter->end &&
101 !iter->path.empty()) { 101 !iter->path.empty()) {
102 break; 102 break;
103 } 103 }
104 ++iter; 104 ++iter;
105 } 105 }
106 106
107 *os << base::StringPrintf("#%02d 0x%08x ", i, address); 107 #ifdef __LP64__
bulach 2014/03/03 09:15:41 nit: similarly to the previous file, please move t
108 #define FMT_ADDR "0x%016lx"
109 #else
110 #define FMT_ADDR "0x%08x"
111 #endif
112 *os << base::StringPrintf("#%02zd " FMT_ADDR " ", i, address);
108 113
109 if (iter != regions.end()) { 114 if (iter != regions.end()) {
110 uintptr_t rel_pc = address - iter->start + iter->offset; 115 uintptr_t rel_pc = address - iter->start + iter->offset;
111 const char* path = iter->path.c_str(); 116 const char* path = iter->path.c_str();
112 *os << base::StringPrintf("%s+0x%08x", path, rel_pc); 117 *os << base::StringPrintf("%s+" FMT_ADDR, path, rel_pc);
113 } else { 118 } else {
114 *os << "<unknown>"; 119 *os << "<unknown>";
115 } 120 }
116 121
117 *os << "\n"; 122 *os << "\n";
118 } 123 }
119 } 124 }
120 125
121 } // namespace debug 126 } // namespace debug
122 } // namespace base 127 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698