Mark Mentovai 56399b2553 snapshot/mac: MachOImageAnnotationsReader test shouldn’t crash with a
nullptr ProcessReader::Module.

Prior to 64b87325b9de, the alignment problem meant that the Module for
dyld was looking at the wrong address instead of dyld’s correct load
address when a 32-bit process attempted to examine a crashing 64-bit
process. This resulted in a crash during the
MachOImageAnnotationsReader.CrashDyld test.

ProcessReader::Module pointers are permitted to be nullptr. This allows
minimal module data (its name) to be preserved even when no sense can be
made of the module based on its load address. The producer,
ProcessReader::InitializeModules(), and the non-test consumer,
ModuleSnapshotMac::Initialize(), both accept this correctly. The
producer’s documentation is updated to call this out. The ProcessReader
test is also updated to tolerate this case without crashing by adding
assertions.

TEST=snapshot_test MachOImageAnnotationsReader.*, ProcessReader.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/989713002
2015-03-08 21:02:42 -04:00
..
2015-03-06 16:05:34 -08:00
2015-03-06 16:05:34 -08:00
2014-10-02 17:09:37 -04:00