#include "snapshot/crashpad_types/image_annotation_reader.h"
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
#include "base/types/cxx23_to_underlying.h"
#include "build/build_config.h"
#include "client/annotation.h"
#include "client/annotation_list.h"
#include "client/simple_string_dictionary.h"
#include "gtest/gtest.h"
#include "test/multiprocess_exec.h"
#include "test/process_type.h"
#include "util/file/file_io.h"
#include "util/misc/from_pointer_cast.h"
#include "util/process/process_memory_native.h"
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include "test/linux/fake_ptrace_connection.h"
#endif
namespace crashpad {
namespace test {
namespace {
void ExpectSimpleMap(const std::map<std::string, std::string>& map,
const SimpleStringDictionary& expected_map) { … }
void ExpectAnnotationList(const std::vector<AnnotationSnapshot>& list,
AnnotationList& expected_list) { … }
void BuildTestStructures(
std::vector<std::unique_ptr<Annotation>>* annotations_storage,
SimpleStringDictionary* into_map,
AnnotationList* into_annotation_list) { … }
void ExpectAnnotations(ProcessType process,
bool is_64_bit,
VMAddress simple_map_address,
VMAddress annotation_list_address) { … }
TEST(ImageAnnotationReader, ReadFromSelf) { … }
CRASHPAD_CHILD_TEST_MAIN(ReadAnnotationsFromChildTestMain) { … }
class ReadFromChildTest : public MultiprocessExec { … };
TEST(ImageAnnotationReader, ReadFromChild) { … }
}
}
}