1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 17:55:07 +00:00
serenity/Userland/Libraries/LibCoredump/Inspector.h
Linus Groh 6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00

41 lines
1.2 KiB
C++

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