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

Side by Side Diff: client/linux/minidump_writer/linux_dumper.cc

Issue 1211863002: Adjust breakpad module size to match adjusted start_addr. (Closed) Base URL: https://chromium.googlesource.com/external/google-breakpad/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010, Google Inc. 1 // Copyright (c) 2010, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 MappingInfo* mapping = mappings_[i]; 503 MappingInfo* mapping = mappings_[i];
504 if (!(mapping->exec && mapping->name[0] == '/')) { 504 if (!(mapping->exec && mapping->name[0] == '/')) {
505 continue; 505 continue;
506 } 506 }
507 ElfW(Ehdr) ehdr; 507 ElfW(Ehdr) ehdr;
508 if (!GetLoadedElfHeader(mapping->start_addr, &ehdr)) { 508 if (!GetLoadedElfHeader(mapping->start_addr, &ehdr)) {
509 continue; 509 continue;
510 } 510 }
511 if (ehdr.e_type == ET_DYN) { 511 if (ehdr.e_type == ET_DYN) {
512 // Compute the effective load bias for this mapped library, and update 512 // Compute the effective load bias for this mapped library, and update
513 // the mapping to hold that rather than |start_addr|. Where the library 513 // the mapping to hold that rather than |start_addr|, at the same time
514 // does not contain Android packed relocations, GetEffectiveLoadBias() 514 // adjusting |size| to account for the change in |start_addr|. Where
515 // returns |start_addr| and the mapping entry is not changed. 515 // the library does not contain Android packed relocations,
516 mapping->start_addr = GetEffectiveLoadBias(&ehdr, mapping->start_addr); 516 // GetEffectiveLoadBias() returns |start_addr| and the mapping entry
517 // is not changed.
518 const uintptr_t load_bias = GetEffectiveLoadBias(&ehdr,
519 mapping->start_addr);
520 mapping->size += mapping->start_addr - load_bias;
Primiano Tucci (use gerrit) 2015/06/25 14:44:01 can load_bias ever be > start_addr (maybe by mista
simonb (inactive) 2015/06/25 15:14:35 From coding errors in the proc/$$/maps or ELF data
521 mapping->start_addr = load_bias;
517 } 522 }
518 } 523 }
519 } 524 }
520 525
521 #endif // __ANDROID__ 526 #endif // __ANDROID__
522 527
523 // Get information about the stack, given the stack pointer. We don't try to 528 // Get information about the stack, given the stack pointer. We don't try to
524 // walk the stack since we might not have all the information needed to do 529 // walk the stack since we might not have all the information needed to do
525 // unwind. So we just grab, up to, 32k of stack. 530 // unwind. So we just grab, up to, 32k of stack.
526 bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len, 531 bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 exe_stat.st_dev == new_path_stat.st_dev && 596 exe_stat.st_dev == new_path_stat.st_dev &&
592 exe_stat.st_ino == new_path_stat.st_ino) { 597 exe_stat.st_ino == new_path_stat.st_ino) {
593 return false; 598 return false;
594 } 599 }
595 600
596 my_memcpy(path, exe_link, NAME_MAX); 601 my_memcpy(path, exe_link, NAME_MAX);
597 return true; 602 return true;
598 } 603 }
599 604
600 } // namespace google_breakpad 605 } // namespace google_breakpad
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698