mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-26 23:01:05 +08:00
fuchsia: Miscellaneous fixes to get symbol resolution working
- Endian-swaps the 3 integer fields of the build id when returning it for use as the module id (see bug 229). - Removes the "app:" prefix on the main binary, as this prevents the crash server from matching the binary name (and it isn't particularly useful anyway) - Map "<vDSO>" to "libzircon.so" as that's what it actually is, so that symbols for it can be found. Bug: crashpad:196, crashpad:229 Change-Id: Ie4abc732b7696345b96c34dbb1a7d2cc2cfcf77f Reviewed-on: https://chromium-review.googlesource.com/1035461 Reviewed-by: Joshua Peraza <jperaza@chromium.org> Commit-Queue: Scott Graham <scottmg@chromium.org>
This commit is contained in:
parent
a107b8b95d
commit
bce68d7975
@ -14,6 +14,8 @@
|
||||
|
||||
#include "snapshot/elf/module_snapshot_elf.h"
|
||||
|
||||
#include <endian.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
@ -144,6 +146,13 @@ void ModuleSnapshotElf::UUIDAndAge(crashpad::UUID* uuid, uint32_t* age) const {
|
||||
notes->NextNote(nullptr, nullptr, &desc);
|
||||
desc.insert(desc.end(), 16 - std::min(desc.size(), size_t{16}), '\0');
|
||||
uuid->InitializeFromBytes(reinterpret_cast<const uint8_t*>(&desc[0]));
|
||||
|
||||
// TODO(scottmg): https://crashpad.chromium.org/bug/229. These are
|
||||
// endian-swapped to match FileID::ConvertIdentifierToUUIDString() in
|
||||
// Breakpad. This is necessary as this identifier is used for symbol lookup.
|
||||
uuid->data_1 = htobe32(uuid->data_1);
|
||||
uuid->data_2 = htobe16(uuid->data_2);
|
||||
uuid->data_3 = htobe16(uuid->data_3);
|
||||
}
|
||||
|
||||
std::string ModuleSnapshotElf::DebugFileName() const {
|
||||
|
@ -130,7 +130,7 @@ void ProcessReaderFuchsia::InitializeModules() {
|
||||
// retrieves (some of) the data into internal structures. It may be worth
|
||||
// trying to refactor/upstream some of this into Fuchsia.
|
||||
|
||||
std::string app_name("app:");
|
||||
std::string app_name;
|
||||
{
|
||||
char name[ZX_MAX_NAME_LEN];
|
||||
zx_status_t status =
|
||||
@ -140,7 +140,7 @@ void ProcessReaderFuchsia::InitializeModules() {
|
||||
return;
|
||||
}
|
||||
|
||||
app_name += name;
|
||||
app_name = name;
|
||||
}
|
||||
|
||||
// Starting from the ld.so's _dl_debug_addr, read the link_map structure and
|
||||
@ -206,6 +206,16 @@ void ProcessReaderFuchsia::InitializeModules() {
|
||||
LOG(ERROR) << "ReadCString name";
|
||||
}
|
||||
|
||||
// The vDSO is libzircon.so, but it's not actually loaded normally, it's
|
||||
// injected by the kernel, so doesn't have a normal name. When dump_syms is
|
||||
// run on libzircon.so, it uses that file name, and in order for the crash
|
||||
// server to match symbols both the debug id and the name of the binary have
|
||||
// to match. So, map from "<vDSO>" to "libzircon.so" so that symbol
|
||||
// resolution works correctly.
|
||||
if (dsoname == "<vDSO>") {
|
||||
dsoname = "libzircon.so";
|
||||
}
|
||||
|
||||
Module module;
|
||||
if (dsoname.empty()) {
|
||||
module.name = app_name;
|
||||
|
@ -41,8 +41,7 @@ class ProcessReaderFuchsia {
|
||||
Module();
|
||||
~Module();
|
||||
|
||||
//! \brief The `ZX_PROP_NAME` of the module. Will be prepended with "app:"
|
||||
//! for the main executable.
|
||||
//! \brief The `ZX_PROP_NAME` of the module.
|
||||
std::string name;
|
||||
|
||||
//! \brief An image reader for the module.
|
||||
|
Loading…
x
Reference in New Issue
Block a user