/* * Copyright (c) 2021, Itamar S. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include "Reader.h" #include #include namespace Coredump { class Inspector : public Debug::ProcessInspector { AK_MAKE_NONCOPYABLE(Inspector); AK_MAKE_NONMOVABLE(Inspector); public: static OwnPtr create(String const& coredump_path, Function on_progress = {}); virtual ~Inspector() override = default; // ^Debug::ProcessInspector virtual bool poke(void* address, FlatPtr data) override; virtual Optional peek(void* address) const override; virtual PtraceRegisters get_registers() const override; virtual void set_registers(PtraceRegisters const&) override; virtual void for_each_loaded_library(Function) const override; private: Inspector(NonnullOwnPtr&&, Function on_progress); void parse_loaded_libraries(Function on_progress); size_t number_of_libraries_in_coredump() const; NonnullOwnPtr m_reader; NonnullOwnPtrVector m_loaded_libraries; }; }