Commit issue 140001: fixes for 64-bit build cleanups.
a=dmaclach, r=jimb git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@664 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
f8bca185b9
commit
a453cc24f4
3 changed files with 22 additions and 22 deletions
|
@ -123,11 +123,11 @@ uint64 ByteReader::ReadEncodedPointer(const char *buffer,
|
|||
|
||||
// First, find the offset to START from the closest prior aligned
|
||||
// address.
|
||||
size_t skew = section_base_ & (AddressSize() - 1);
|
||||
uint64_t skew = section_base_ & (AddressSize() - 1);
|
||||
// Now find the offset from that aligned address to buffer.
|
||||
off_t offset = skew + (buffer - buffer_base_);
|
||||
uint64_t offset = skew + (buffer - buffer_base_);
|
||||
// Round up to the next boundary.
|
||||
size_t aligned = (offset + AddressSize() - 1) & -AddressSize();
|
||||
uint64_t aligned = (offset + AddressSize() - 1) & -AddressSize();
|
||||
// Convert back to a pointer.
|
||||
const char *aligned_buffer = buffer_base_ + (aligned - skew);
|
||||
// Finally, store the length and actually fetch the pointer.
|
||||
|
@ -156,7 +156,7 @@ uint64 ByteReader::ReadEncodedPointer(const char *buffer,
|
|||
case DW_EH_PE_uleb128:
|
||||
offset = ReadUnsignedLEB128(buffer, len);
|
||||
break;
|
||||
|
||||
|
||||
case DW_EH_PE_udata2:
|
||||
offset = ReadTwoBytes(buffer);
|
||||
*len = 2;
|
||||
|
|
|
@ -85,7 +85,7 @@ class ByteReader {
|
|||
//
|
||||
// - If N is between 0 and 0x7f, then its unsigned LEB128
|
||||
// representation is a single byte whose value is N.
|
||||
//
|
||||
//
|
||||
// - Otherwise, its unsigned LEB128 representation is (N & 0x7f) |
|
||||
// 0x80, followed by the unsigned LEB128 representation of N /
|
||||
// 128, rounded towards negative infinity.
|
||||
|
@ -104,7 +104,7 @@ class ByteReader {
|
|||
// - If N is between -0x40 and 0x3f, then its signed LEB128
|
||||
// representation is a single byte whose value is N in two's
|
||||
// complement.
|
||||
//
|
||||
//
|
||||
// - Otherwise, its signed LEB128 representation is (N & 0x7f) |
|
||||
// 0x80, followed by the signed LEB128 representation of N / 128,
|
||||
// rounded towards negative infinity.
|
||||
|
@ -301,7 +301,7 @@ class ByteReader {
|
|||
// Base addresses for Linux C++ exception handling data's encoded pointers.
|
||||
bool have_section_base_, have_text_base_, have_data_base_;
|
||||
bool have_function_base_;
|
||||
size_t section_base_, text_base_, data_base_, function_base_;
|
||||
uint64_t section_base_, text_base_, data_base_, function_base_;
|
||||
const char *buffer_base_;
|
||||
};
|
||||
|
||||
|
|
|
@ -88,12 +88,12 @@ static int PrintRegister(const char *name, u_int32_t value, int sequence) {
|
|||
|
||||
//=============================================================================
|
||||
static void PrintStack(const CallStack *stack, const string &cpu) {
|
||||
int frame_count = stack->frames()->size();
|
||||
size_t frame_count = stack->frames()->size();
|
||||
char buffer[1024];
|
||||
for (int frame_index = 0; frame_index < frame_count; ++frame_index) {
|
||||
for (size_t frame_index = 0; frame_index < frame_count; ++frame_index) {
|
||||
const StackFrame *frame = stack->frames()->at(frame_index);
|
||||
const CodeModule *module = frame->module;
|
||||
printf("%2d ", frame_index);
|
||||
printf("%2zu ", frame_index);
|
||||
|
||||
if (module) {
|
||||
// Module name (20 chars max)
|
||||
|
@ -106,7 +106,7 @@ static void PrintStack(const CallStack *stack, const string &cpu) {
|
|||
buffer[maxStr] = 0;
|
||||
|
||||
printf("%-*s",maxStr, buffer);
|
||||
|
||||
|
||||
u_int64_t instruction = frame->instruction;
|
||||
|
||||
// PPC only: Adjust the instruction to match that of Crash reporter. The
|
||||
|
@ -195,16 +195,16 @@ static void PrintRegisters(const CallStack *stack, const string &cpu) {
|
|||
static void PrintModules(const CodeModules *modules) {
|
||||
if (!modules)
|
||||
return;
|
||||
|
||||
|
||||
printf("\n");
|
||||
printf("Loaded modules:\n");
|
||||
|
||||
|
||||
u_int64_t main_address = 0;
|
||||
const CodeModule *main_module = modules->GetMainModule();
|
||||
if (main_module) {
|
||||
main_address = main_module->base_address();
|
||||
}
|
||||
|
||||
|
||||
unsigned int module_count = modules->module_count();
|
||||
for (unsigned int module_sequence = 0;
|
||||
module_sequence < module_count;
|
||||
|
@ -223,7 +223,7 @@ static void PrintModules(const CodeModules *modules) {
|
|||
}
|
||||
|
||||
static void ProcessSingleReport(Options *options, NSString *file_path) {
|
||||
string minidump_file([file_path fileSystemRepresentation]);
|
||||
string minidump_file([file_path fileSystemRepresentation]);
|
||||
BasicSourceLineResolver resolver;
|
||||
string search_dir = options->searchDir ?
|
||||
[options->searchDir fileSystemRepresentation] : "";
|
||||
|
@ -279,7 +279,7 @@ static void ProcessSingleReport(Options *options, NSString *file_path) {
|
|||
}
|
||||
|
||||
// Print all of the threads in the dump.
|
||||
int thread_count = process_state.threads()->size();
|
||||
int thread_count = static_cast<int>(process_state.threads()->size());
|
||||
const std::vector<google_breakpad::MinidumpMemoryRegion*>
|
||||
*thread_memory_regions = process_state.thread_memory_regions();
|
||||
|
||||
|
@ -338,15 +338,15 @@ static void Start(Options *options) {
|
|||
static void Usage(int argc, const char *argv[]) {
|
||||
fprintf(stderr, "Convert a minidump to a crash report. Breakpad symbol "
|
||||
"files will be used (or created if missing) in /tmp.\n"
|
||||
"If a symbol-file-search-dir is specified, any symbol "
|
||||
"files in it will be used instead of being loaded from "
|
||||
"modules on disk.\n"
|
||||
"If a symbol-file-search-dir is specified, any symbol "
|
||||
"files in it will be used instead of being loaded from "
|
||||
"modules on disk.\n"
|
||||
"If modules cannot be found at the paths stored in the "
|
||||
"minidump file, they will be searched for at "
|
||||
"minidump file, they will be searched for at "
|
||||
"<module-search-dir>/<path-in-minidump-file>.\n");
|
||||
fprintf(stderr, "Usage: %s [-s module-search-dir] [-S symbol-file-search-dir] "
|
||||
"minidump-file\n", argv[0]);
|
||||
fprintf(stderr, "\t-s: Specify a search directory to use for missing modules\n"
|
||||
fprintf(stderr, "\t-s: Specify a search directory to use for missing modules\n"
|
||||
"\t-S: Specify a search directory to use for symbol files\n"
|
||||
"\t-t: Print thread stack memory in hex\n"
|
||||
"\t-h: Usage\n"
|
||||
|
@ -371,7 +371,7 @@ static void SetupOptions(int argc, const char *argv[], Options *options) {
|
|||
stringWithFileSystemRepresentation:optarg
|
||||
length:strlen(optarg)];
|
||||
break;
|
||||
|
||||
|
||||
case 't':
|
||||
options->printThreadMemory = YES;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue