This is an archive of the discontinued LLVM Phabricator instance.

Minidump/Windows: Fix module lookup
ClosedPublic

Authored by labath on Aug 8 2019, 8:44 AM.

Details

Summary

When opening a minidump, we were failing to find an executable because
we were searching for i386-unknown-windows, whereas we recognize the
pe/coff files as i386-pc-windows. This fixes the triple computation code
in the minidump parser to match pe/coff, and adds an appropriate test.

NB: I'm not sure setting the vendor to "pc" is really correct for
arm(64) windows, but right now that seems to match what we do in the
pe/coff case (ArchSpec.cpp:935).

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Aug 8 2019, 8:44 AM
amccarth accepted this revision.Aug 8 2019, 10:14 AM

This looks fine, and thanks for the tests for a one-line fix.

I'm curious, though, where is the matching code? Should "unknown" be treated as a wildcard when trying to find the matching module?

This revision is now accepted and ready to land.Aug 8 2019, 10:14 AM
labath added a comment.Aug 9 2019, 1:19 AM

I'm curious, though, where is the matching code? Should "unknown" be treated as a wildcard when trying to find the matching module?

The matching code lives ArchSpec::IsEqualTo, and its behavior is a topic that comes up regularly (I think the last discussion was here http://lists.llvm.org/pipermail/lldb-dev/2018-December/014437.html). The summary of the problem is that there are instances when people want/need/... to e.g. use "unknown" OS to mean that there really is no OS (because we're debugging a bare metal target for instance), but there are also other cases that want to treat it as a wildcard. Lldb gets around this by having a concept of a "specified" and "unspecified" unknown, but that is sort of an abuse of the llvm Triple class, because it works by examining the string representation of the triple fields and treating "" and "unknown" differently (even though they both resolve to the UnknownOS enum).

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2019, 2:13 AM