llvm/lldb/source/Target/Process.cpp

//===-- Process.cpp -------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include <atomic>
#include <memory>
#include <mutex>
#include <optional>

#include "llvm/ADT/ScopeExit.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/Threading.h"

#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Progress.h"
#include "lldb/Expression/DiagnosticManager.h"
#include "lldb/Expression/DynamicCheckerFunctions.h"
#include "lldb/Expression/UserExpression.h"
#include "lldb/Expression/UtilityFunction.h"
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/OptionParser.h"
#include "lldb/Host/Pipe.h"
#include "lldb/Host/Terminal.h"
#include "lldb/Host/ThreadLauncher.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionValueProperties.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/AssertFrameRecognizer.h"
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Target/InstrumentationRuntime.h"
#include "lldb/Target/JITLoader.h"
#include "lldb/Target/JITLoaderList.h"
#include "lldb/Target/Language.h"
#include "lldb/Target/LanguageRuntime.h"
#include "lldb/Target/MemoryHistory.h"
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Target/OperatingSystem.h"
#include "lldb/Target/Platform.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StopInfo.h"
#include "lldb/Target/StructuredDataPlugin.h"
#include "lldb/Target/SystemRuntime.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/TargetList.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadPlan.h"
#include "lldb/Target/ThreadPlanBase.h"
#include "lldb/Target/ThreadPlanCallFunction.h"
#include "lldb/Target/ThreadPlanStack.h"
#include "lldb/Target/UnixSignals.h"
#include "lldb/Target/VerboseTrapFrameRecognizer.h"
#include "lldb/Utility/AddressableBits.h"
#include "lldb/Utility/Event.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/NameMatches.h"
#include "lldb/Utility/ProcessInfo.h"
#include "lldb/Utility/SelectHelper.h"
#include "lldb/Utility/State.h"
#include "lldb/Utility/Timer.h"

usingnamespacelldb;
usingnamespacelldb_private;
usingnamespacestd::chrono;

// Comment out line below to disable memory caching, overriding the process
// setting target.process.disable-memory-cache
#define ENABLE_MEMORY_CACHING

#ifdef ENABLE_MEMORY_CACHING
#define DISABLE_MEM_CACHE_DEFAULT
#else
#define DISABLE_MEM_CACHE_DEFAULT
#endif

class ProcessOptionValueProperties
    : public Cloneable<ProcessOptionValueProperties, OptionValueProperties> {};

class ProcessMemoryIterator {};

static constexpr OptionEnumValueElement g_follow_fork_mode_values[] =;

#define LLDB_PROPERTIES_process
#include "TargetProperties.inc"

enum {};

#define LLDB_PROPERTIES_process_experimental
#include "TargetProperties.inc"

enum {};

class ProcessExperimentalOptionValueProperties
    : public Cloneable<ProcessExperimentalOptionValueProperties,
                       OptionValueProperties> {};

ProcessExperimentalProperties::ProcessExperimentalProperties()
    :{}

ProcessProperties::ProcessProperties(lldb_private::Process *process)
    :{}

ProcessProperties::~ProcessProperties() = default;

bool ProcessProperties::GetDisableMemoryCache() const {}

uint64_t ProcessProperties::GetMemoryCacheLineSize() const {}

Args ProcessProperties::GetExtraStartupCommands() const {}

void ProcessProperties::SetExtraStartupCommands(const Args &args) {}

FileSpec ProcessProperties::GetPythonOSPluginPath() const {}

uint32_t ProcessProperties::GetVirtualAddressableBits() const {}

void ProcessProperties::SetVirtualAddressableBits(uint32_t bits) {}

uint32_t ProcessProperties::GetHighmemVirtualAddressableBits() const {}

void ProcessProperties::SetHighmemVirtualAddressableBits(uint32_t bits) {}

void ProcessProperties::SetPythonOSPluginPath(const FileSpec &file) {}

bool ProcessProperties::GetIgnoreBreakpointsInExpressions() const {}

void ProcessProperties::SetIgnoreBreakpointsInExpressions(bool ignore) {}

bool ProcessProperties::GetUnwindOnErrorInExpressions() const {}

void ProcessProperties::SetUnwindOnErrorInExpressions(bool ignore) {}

bool ProcessProperties::GetStopOnSharedLibraryEvents() const {}

void ProcessProperties::SetStopOnSharedLibraryEvents(bool stop) {}

bool ProcessProperties::GetDisableLangRuntimeUnwindPlans() const {}

void ProcessProperties::SetDisableLangRuntimeUnwindPlans(bool disable) {}

bool ProcessProperties::GetDetachKeepsStopped() const {}

void ProcessProperties::SetDetachKeepsStopped(bool stop) {}

bool ProcessProperties::GetWarningsOptimization() const {}

bool ProcessProperties::GetWarningsUnsupportedLanguage() const {}

bool ProcessProperties::GetStopOnExec() const {}

std::chrono::seconds ProcessProperties::GetUtilityExpressionTimeout() const {}

std::chrono::seconds ProcessProperties::GetInterruptTimeout() const {}

bool ProcessProperties::GetSteppingRunsAllThreads() const {}

bool ProcessProperties::GetOSPluginReportsAllThreads() const {}

void ProcessProperties::SetOSPluginReportsAllThreads(bool does_report) {}

FollowForkMode ProcessProperties::GetFollowForkMode() const {}

ProcessSP Process::FindPlugin(lldb::TargetSP target_sp,
                              llvm::StringRef plugin_name,
                              ListenerSP listener_sp,
                              const FileSpec *crash_file_path,
                              bool can_connect) {}

llvm::StringRef Process::GetStaticBroadcasterClass() {}

Process::Process(lldb::TargetSP target_sp, ListenerSP listener_sp)
    :{}

Process::Process(lldb::TargetSP target_sp, ListenerSP listener_sp,
                 const UnixSignalsSP &unix_signals_sp)
    :{}

Process::~Process() {}

ProcessProperties &Process::GetGlobalProperties() {}

void Process::Finalize(bool destructing) {}

void Process::RegisterNotificationCallbacks(const Notifications &callbacks) {}

bool Process::UnregisterNotificationCallbacks(const Notifications &callbacks) {}

void Process::SynchronouslyNotifyStateChanged(StateType state) {}

// FIXME: We need to do some work on events before the general Listener sees
// them.
// For instance if we are continuing from a breakpoint, we need to ensure that
// we do the little "insert real insn, step & stop" trick.  But we can't do
// that when the event is delivered by the broadcaster - since that is done on
// the thread that is waiting for new events, so if we needed more than one
// event for our handling, we would stall.  So instead we do it when we fetch
// the event off of the queue.
//

StateType Process::GetNextEvent(EventSP &event_sp) {}

void Process::SyncIOHandler(uint32_t iohandler_id,
                            const Timeout<std::micro> &timeout) {}

StateType Process::WaitForProcessToStop(
    const Timeout<std::micro> &timeout, EventSP *event_sp_ptr, bool wait_always,
    ListenerSP hijack_listener_sp, Stream *stream, bool use_run_lock,
    SelectMostRelevant select_most_relevant) {}

bool Process::HandleProcessStateChangedEvent(
    const EventSP &event_sp, Stream *stream,
    SelectMostRelevant select_most_relevant,
    bool &pop_process_io_handler) {}

bool Process::HijackProcessEvents(ListenerSP listener_sp) {}

void Process::RestoreProcessEvents() {}

StateType Process::GetStateChangedEvents(EventSP &event_sp,
                                         const Timeout<std::micro> &timeout,
                                         ListenerSP hijack_listener_sp) {}

Event *Process::PeekAtStateChangedEvents() {}

StateType
Process::GetStateChangedEventsPrivate(EventSP &event_sp,
                                      const Timeout<std::micro> &timeout) {}

bool Process::GetEventsPrivate(EventSP &event_sp,
                               const Timeout<std::micro> &timeout,
                               bool control_only) {}

bool Process::IsRunning() const {}

int Process::GetExitStatus() {}

const char *Process::GetExitDescription() {}

bool Process::SetExitStatus(int status, llvm::StringRef exit_string) {}

bool Process::IsAlive() {}

// This static callback can be used to watch for local child processes on the
// current host. The child process exits, the process will be found in the
// global target list (we want to be completely sure that the
// lldb_private::Process doesn't go away before we can deliver the signal.
bool Process::SetProcessExitStatus(
    lldb::pid_t pid, bool exited,
    int signo,      // Zero for no signal
    int exit_status // Exit value of process if signal is zero
    ) {}

bool Process::UpdateThreadList(ThreadList &old_thread_list,
                               ThreadList &new_thread_list) {}

void Process::UpdateThreadListIfNeeded() {}

ThreadPlanStack *Process::FindThreadPlans(lldb::tid_t tid) {}

bool Process::PruneThreadPlansForTID(lldb::tid_t tid) {}

void Process::PruneThreadPlans() {}

bool Process::DumpThreadPlansForTID(Stream &strm, lldb::tid_t tid,
                                    lldb::DescriptionLevel desc_level,
                                    bool internal, bool condense_trivial,
                                    bool skip_unreported_plans) {}
void Process::DumpThreadPlans(Stream &strm, lldb::DescriptionLevel desc_level,
                              bool internal, bool condense_trivial,
                              bool skip_unreported_plans) {}

void Process::UpdateQueueListIfNeeded() {}

ThreadSP Process::CreateOSPluginThread(lldb::tid_t tid, lldb::addr_t context) {}

uint32_t Process::GetNextThreadIndexID(uint64_t thread_id) {}

bool Process::HasAssignedIndexIDToThread(uint64_t thread_id) {}

uint32_t Process::AssignIndexIDToThread(uint64_t thread_id) {}

StateType Process::GetState() {}

void Process::SetPublicState(StateType new_state, bool restarted) {}

Status Process::Resume() {}

Status Process::ResumeSynchronous(Stream *stream) {}

bool Process::StateChangedIsExternallyHijacked() {}

bool Process::StateChangedIsHijackedForSynchronousResume() {}

StateType Process::GetPrivateState() {}

void Process::SetPrivateState(StateType new_state) {}

void Process::SetRunningUserExpression(bool on) {}

void Process::SetRunningUtilityFunction(bool on) {}

addr_t Process::GetImageInfoAddress() {}

const lldb::ABISP &Process::GetABI() {}

std::vector<LanguageRuntime *> Process::GetLanguageRuntimes() {}

LanguageRuntime *Process::GetLanguageRuntime(lldb::LanguageType language) {}

bool Process::IsPossibleDynamicValue(ValueObject &in_value) {}

void Process::SetDynamicCheckers(DynamicCheckerFunctions *dynamic_checkers) {}

StopPointSiteList<BreakpointSite> &Process::GetBreakpointSiteList() {}

const StopPointSiteList<BreakpointSite> &
Process::GetBreakpointSiteList() const {}

void Process::DisableAllBreakpointSites() {}

Status Process::ClearBreakpointSiteByID(lldb::user_id_t break_id) {}

Status Process::DisableBreakpointSiteByID(lldb::user_id_t break_id) {}

Status Process::EnableBreakpointSiteByID(lldb::user_id_t break_id) {}

lldb::break_id_t
Process::CreateBreakpointSite(const BreakpointLocationSP &constituent,
                              bool use_hardware) {}

void Process::RemoveConstituentFromBreakpointSite(
    lldb::user_id_t constituent_id, lldb::user_id_t constituent_loc_id,
    BreakpointSiteSP &bp_site_sp) {}

size_t Process::RemoveBreakpointOpcodesFromBuffer(addr_t bp_addr, size_t size,
                                                  uint8_t *buf) const {}

size_t Process::GetSoftwareBreakpointTrapOpcode(BreakpointSite *bp_site) {}

Status Process::EnableSoftwareBreakpoint(BreakpointSite *bp_site) {}

Status Process::DisableSoftwareBreakpoint(BreakpointSite *bp_site) {}

// Uncomment to verify memory caching works after making changes to caching
// code
//#define VERIFY_MEMORY_READS

size_t Process::ReadMemory(addr_t addr, void *buf, size_t size, Status &error) {}

void Process::DoFindInMemory(lldb::addr_t start_addr, lldb::addr_t end_addr,
                             const uint8_t *buf, size_t size,
                             AddressRanges &matches, size_t alignment,
                             size_t max_matches) {}

AddressRanges Process::FindRangesInMemory(const uint8_t *buf, uint64_t size,
                                          const AddressRanges &ranges,
                                          size_t alignment, size_t max_matches,
                                          Status &error) {}

lldb::addr_t Process::FindInMemory(const uint8_t *buf, uint64_t size,
                                   const AddressRange &range, size_t alignment,
                                   Status &error) {}

size_t Process::ReadCStringFromMemory(addr_t addr, std::string &out_str,
                                      Status &error) {}

// Deprecated in favor of ReadStringFromMemory which has wchar support and
// correct code to find null terminators.
size_t Process::ReadCStringFromMemory(addr_t addr, char *dst,
                                      size_t dst_max_len,
                                      Status &result_error) {}

size_t Process::ReadMemoryFromInferior(addr_t addr, void *buf, size_t size,
                                       Status &error) {}

uint64_t Process::ReadUnsignedIntegerFromMemory(lldb::addr_t vm_addr,
                                                size_t integer_byte_size,
                                                uint64_t fail_value,
                                                Status &error) {}

int64_t Process::ReadSignedIntegerFromMemory(lldb::addr_t vm_addr,
                                             size_t integer_byte_size,
                                             int64_t fail_value,
                                             Status &error) {}

addr_t Process::ReadPointerFromMemory(lldb::addr_t vm_addr, Status &error) {}

bool Process::WritePointerToMemory(lldb::addr_t vm_addr, lldb::addr_t ptr_value,
                                   Status &error) {}

size_t Process::WriteMemoryPrivate(addr_t addr, const void *buf, size_t size,
                                   Status &error) {}

size_t Process::WriteMemory(addr_t addr, const void *buf, size_t size,
                            Status &error) {}

size_t Process::WriteScalarToMemory(addr_t addr, const Scalar &scalar,
                                    size_t byte_size, Status &error) {}

size_t Process::ReadScalarIntegerFromMemory(addr_t addr, uint32_t byte_size,
                                            bool is_signed, Scalar &scalar,
                                            Status &error) {}

Status Process::WriteObjectFile(std::vector<ObjectFile::LoadableData> entries) {}

#define USE_ALLOCATE_MEMORY_CACHE
addr_t Process::AllocateMemory(size_t size, uint32_t permissions,
                               Status &error) {}

addr_t Process::CallocateMemory(size_t size, uint32_t permissions,
                                Status &error) {}

bool Process::CanJIT() {}

void Process::SetCanJIT(bool can_jit) {}

void Process::SetCanRunCode(bool can_run_code) {}

Status Process::DeallocateMemory(addr_t ptr) {}

bool Process::GetWatchpointReportedAfter() {}

ModuleSP Process::ReadModuleFromMemory(const FileSpec &file_spec,
                                       lldb::addr_t header_addr,
                                       size_t size_to_read) {}

bool Process::GetLoadAddressPermissions(lldb::addr_t load_addr,
                                        uint32_t &permissions) {}

Status Process::EnableWatchpoint(WatchpointSP wp_sp, bool notify) {}

Status Process::DisableWatchpoint(WatchpointSP wp_sp, bool notify) {}

StateType
Process::WaitForProcessStopPrivate(EventSP &event_sp,
                                   const Timeout<std::micro> &timeout) {}

void Process::LoadOperatingSystemPlugin(bool flush) {}

Status Process::Launch(ProcessLaunchInfo &launch_info) {}

Status Process::LaunchPrivate(ProcessLaunchInfo &launch_info, StateType &state,
                              EventSP &event_sp) {}

Status Process::LoadCore() {}

DynamicLoader *Process::GetDynamicLoader() {}

void Process::SetDynamicLoader(DynamicLoaderUP dyld_up) {}

DataExtractor Process::GetAuxvData() {}

llvm::Expected<bool> Process::SaveCore(llvm::StringRef outfile) {}

JITLoaderList &Process::GetJITLoaders() {}

SystemRuntime *Process::GetSystemRuntime() {}

Process::AttachCompletionHandler::AttachCompletionHandler(Process *process,
                                                          uint32_t exec_count)
    :{}

Process::NextEventAction::EventActionResult
Process::AttachCompletionHandler::PerformAction(lldb::EventSP &event_sp) {}

Process::NextEventAction::EventActionResult
Process::AttachCompletionHandler::HandleBeingInterrupted() {}

const char *Process::AttachCompletionHandler::GetExitString() {}

ListenerSP ProcessAttachInfo::GetListenerForProcess(Debugger &debugger) {}

Status Process::WillLaunch(Module *module) {}

Status Process::WillAttachToProcessWithID(lldb::pid_t pid) {}

Status Process::WillAttachToProcessWithName(const char *process_name,
                                            bool wait_for_launch) {}

Status Process::Attach(ProcessAttachInfo &attach_info) {}

void Process::CompleteAttach() {}

Status Process::ConnectRemote(llvm::StringRef remote_url) {}

Status Process::PrivateResume() {}

Status Process::Halt(bool clear_thread_plans, bool use_run_lock) {}

lldb::addr_t Process::FindInMemory(lldb::addr_t low, lldb::addr_t high,
                                   const uint8_t *buf, size_t size) {}

Status Process::StopForDestroyOrDetach(lldb::EventSP &exit_event_sp) {}

Status Process::Detach(bool keep_stopped) {}

Status Process::Destroy(bool force_kill) {}

Status Process::DestroyImpl(bool force_kill) {}

Status Process::Signal(int signal) {}

void Process::SetUnixSignals(UnixSignalsSP &&signals_sp) {}

const lldb::UnixSignalsSP &Process::GetUnixSignals() {}

lldb::ByteOrder Process::GetByteOrder() const {}

uint32_t Process::GetAddressByteSize() const {}

bool Process::ShouldBroadcastEvent(Event *event_ptr) {}

bool Process::StartPrivateStateThread(bool is_secondary_thread) {}

void Process::PausePrivateStateThread() {}

void Process::ResumePrivateStateThread() {}

void Process::StopPrivateStateThread() {}

void Process::ControlPrivateStateThread(uint32_t signal) {}

void Process::SendAsyncInterrupt(Thread *thread) {}

void Process::HandlePrivateEvent(EventSP &event_sp) {}

Status Process::HaltPrivate() {}

thread_result_t Process::RunPrivateStateThread(bool is_secondary_thread) {}

// Process Event Data

Process::ProcessEventData::ProcessEventData() :{}

Process::ProcessEventData::ProcessEventData(const ProcessSP &process_sp,
                                            StateType state)
    :{}

Process::ProcessEventData::~ProcessEventData() = default;

llvm::StringRef Process::ProcessEventData::GetFlavorString() {}

llvm::StringRef Process::ProcessEventData::GetFlavor() const {}

bool Process::ProcessEventData::ShouldStop(Event *event_ptr,
                                           bool &found_valid_stopinfo) {}

bool Process::ProcessEventData::ForwardEventToPendingListeners(
    Event *event_ptr) {}

void Process::ProcessEventData::DoOnRemoval(Event *event_ptr) {}

void Process::ProcessEventData::Dump(Stream *s) const {}

const Process::ProcessEventData *
Process::ProcessEventData::GetEventDataFromEvent(const Event *event_ptr) {}

ProcessSP
Process::ProcessEventData::GetProcessFromEvent(const Event *event_ptr) {}

StateType Process::ProcessEventData::GetStateFromEvent(const Event *event_ptr) {}

bool Process::ProcessEventData::GetRestartedFromEvent(const Event *event_ptr) {}

void Process::ProcessEventData::SetRestartedInEvent(Event *event_ptr,
                                                    bool new_value) {}

size_t
Process::ProcessEventData::GetNumRestartedReasons(const Event *event_ptr) {}

const char *
Process::ProcessEventData::GetRestartedReasonAtIndex(const Event *event_ptr,
                                                     size_t idx) {}

void Process::ProcessEventData::AddRestartedReason(Event *event_ptr,
                                                   const char *reason) {}

bool Process::ProcessEventData::GetInterruptedFromEvent(
    const Event *event_ptr) {}

void Process::ProcessEventData::SetInterruptedInEvent(Event *event_ptr,
                                                      bool new_value) {}

bool Process::ProcessEventData::SetUpdateStateOnRemoval(Event *event_ptr) {}

lldb::TargetSP Process::CalculateTarget() {}

void Process::CalculateExecutionContext(ExecutionContext &exe_ctx) {}

// uint32_t
// Process::ListProcessesMatchingName (const char *name, StringList &matches,
// std::vector<lldb::pid_t> &pids)
//{
//    return 0;
//}
//
// ArchSpec
// Process::GetArchSpecForExistingProcess (lldb::pid_t pid)
//{
//    return Host::GetArchSpecForExistingProcess (pid);
//}
//
// ArchSpec
// Process::GetArchSpecForExistingProcess (const char *process_name)
//{
//    return Host::GetArchSpecForExistingProcess (process_name);
//}

EventSP Process::CreateEventFromProcessState(uint32_t event_type) {}

void Process::AppendSTDOUT(const char *s, size_t len) {}

void Process::AppendSTDERR(const char *s, size_t len) {}

void Process::BroadcastAsyncProfileData(const std::string &one_profile_data) {}

void Process::BroadcastStructuredData(const StructuredData::ObjectSP &object_sp,
                                      const StructuredDataPluginSP &plugin_sp) {}

StructuredDataPluginSP
Process::GetStructuredDataPlugin(llvm::StringRef type_name) const {}

size_t Process::GetAsyncProfileData(char *buf, size_t buf_size, Status &error) {}

// Process STDIO

size_t Process::GetSTDOUT(char *buf, size_t buf_size, Status &error) {}

size_t Process::GetSTDERR(char *buf, size_t buf_size, Status &error) {}

void Process::STDIOReadThreadBytesReceived(void *baton, const void *src,
                                           size_t src_len) {}

class IOHandlerProcessSTDIO : public IOHandler {};

void Process::SetSTDIOFileDescriptor(int fd) {}

bool Process::ProcessIOHandlerIsActive() {}

bool Process::PushProcessIOHandler() {}

bool Process::PopProcessIOHandler() {}

// The process needs to know about installed plug-ins
void Process::SettingsInitialize() {}

void Process::SettingsTerminate() {}

namespace {
// RestorePlanState is used to record the "is private", "is controlling" and
// "okay
// to discard" fields of the plan we are running, and reset it on Clean or on
// destruction. It will only reset the state once, so you can call Clean and
// then monkey with the state and it won't get reset on you again.

class RestorePlanState {};
} // anonymous namespace

static microseconds
GetOneThreadExpressionTimeout(const EvaluateExpressionOptions &options) {}

static Timeout<std::micro>
GetExpressionTimeout(const EvaluateExpressionOptions &options,
                     bool before_first_timeout) {}

static std::optional<ExpressionResults>
HandleStoppedEvent(lldb::tid_t thread_id, const ThreadPlanSP &thread_plan_sp,
                   RestorePlanState &restorer, const EventSP &event_sp,
                   EventSP &event_to_broadcast_sp,
                   const EvaluateExpressionOptions &options,
                   bool handle_interrupts) {}

ExpressionResults
Process::RunThreadPlan(ExecutionContext &exe_ctx,
                       lldb::ThreadPlanSP &thread_plan_sp,
                       const EvaluateExpressionOptions &options,
                       DiagnosticManager &diagnostic_manager) {}

const char *Process::ExecutionResultAsCString(ExpressionResults result) {}

void Process::GetStatus(Stream &strm) {}

size_t Process::GetThreadStatus(Stream &strm,
                                bool only_threads_with_stop_reason,
                                uint32_t start_frame, uint32_t num_frames,
                                uint32_t num_frames_with_source,
                                bool stop_format) {}

void Process::AddInvalidMemoryRegion(const LoadRange &region) {}

bool Process::RemoveInvalidMemoryRange(const LoadRange &region) {}

void Process::AddPreResumeAction(PreResumeActionCallback callback,
                                 void *baton) {}

bool Process::RunPreResumeActions() {}

void Process::ClearPreResumeActions() {}

void Process::ClearPreResumeAction(PreResumeActionCallback callback, void *baton)
{}

ProcessRunLock &Process::GetRunLock() {}

bool Process::CurrentThreadIsPrivateStateThread()
{}


void Process::Flush() {}

lldb::addr_t Process::GetCodeAddressMask() {}

lldb::addr_t Process::GetDataAddressMask() {}

lldb::addr_t Process::GetHighmemCodeAddressMask() {}

lldb::addr_t Process::GetHighmemDataAddressMask() {}

void Process::SetCodeAddressMask(lldb::addr_t code_address_mask) {}

void Process::SetDataAddressMask(lldb::addr_t data_address_mask) {}

void Process::SetHighmemCodeAddressMask(lldb::addr_t code_address_mask) {}

void Process::SetHighmemDataAddressMask(lldb::addr_t data_address_mask) {}

addr_t Process::FixCodeAddress(addr_t addr) {}

addr_t Process::FixDataAddress(addr_t addr) {}

addr_t Process::FixAnyAddress(addr_t addr) {}

void Process::DidExec() {}

addr_t Process::ResolveIndirectFunction(const Address *address, Status &error) {}

void Process::ModulesDidLoad(ModuleList &module_list) {}

void Process::PrintWarningOptimization(const SymbolContext &sc) {}

void Process::PrintWarningUnsupportedLanguage(const SymbolContext &sc) {}

bool Process::GetProcessInfo(ProcessInstanceInfo &info) {}

ThreadCollectionSP Process::GetHistoryThreads(lldb::addr_t addr) {}

InstrumentationRuntimeSP
Process::GetInstrumentationRuntime(lldb::InstrumentationRuntimeType type) {}

bool Process::GetModuleSpec(const FileSpec &module_file_spec,
                            const ArchSpec &arch, ModuleSpec &module_spec) {}

size_t Process::AddImageToken(lldb::addr_t image_ptr) {}

lldb::addr_t Process::GetImagePtrFromToken(size_t token) const {}

void Process::ResetImageToken(size_t token) {}

Address
Process::AdvanceAddressToNextBranchInstruction(Address default_stop_addr,
                                               AddressRange range_bounds) {}

Status Process::GetMemoryRegionInfo(lldb::addr_t load_addr,
                                    MemoryRegionInfo &range_info) {}

Status Process::GetMemoryRegions(lldb_private::MemoryRegionInfos &region_list) {}

Status
Process::ConfigureStructuredData(llvm::StringRef type_name,
                                 const StructuredData::ObjectSP &config_sp) {}

void Process::MapSupportedStructuredDataPlugins(
    const StructuredData::Array &supported_type_names) {}

bool Process::RouteAsyncStructuredData(
    const StructuredData::ObjectSP object_sp) {}

Status Process::UpdateAutomaticSignalFiltering() {}

UtilityFunction *Process::GetLoadImageUtilityFunction(
    Platform *platform,
    llvm::function_ref<std::unique_ptr<UtilityFunction>()> factory) {}

llvm::Expected<TraceSupportedResponse> Process::TraceSupported() {}

bool Process::CallVoidArgVoidPtrReturn(const Address *address,
                                       addr_t &returned_func,
                                       bool trap_exceptions) {}

llvm::Expected<const MemoryTagManager *> Process::GetMemoryTagManager() {}

llvm::Expected<std::vector<lldb::addr_t>>
Process::ReadMemoryTags(lldb::addr_t addr, size_t len) {}

Status Process::WriteMemoryTags(lldb::addr_t addr, size_t len,
                                const std::vector<lldb::addr_t> &tags) {}

// Create a CoreFileMemoryRange from a MemoryRegionInfo
static Process::CoreFileMemoryRange
CreateCoreFileMemoryRange(const MemoryRegionInfo &region) {}

// Add dirty pages to the core file ranges and return true if dirty pages
// were added. Return false if the dirty page information is not valid or in
// the region.
static bool AddDirtyPages(const MemoryRegionInfo &region,
                          Process::CoreFileMemoryRanges &ranges) {}

// Given a region, add the region to \a ranges.
//
// Only add the region if it isn't empty and if it has some permissions.
// If \a try_dirty_pages is true, then try to add only the dirty pages for a
// given region. If the region has dirty page information, only dirty pages
// will be added to \a ranges, else the entire range will be added to \a
// ranges.
static void AddRegion(const MemoryRegionInfo &region, bool try_dirty_pages,
                      Process::CoreFileMemoryRanges &ranges) {}

static void SaveOffRegionsWithStackPointers(
    Process &process, const SaveCoreOptions &core_options,
    const MemoryRegionInfos &regions, Process::CoreFileMemoryRanges &ranges,
    std::set<addr_t> &stack_ends) {}

// Save all memory regions that are not empty or have at least some permissions
// for a full core file style.
static void GetCoreFileSaveRangesFull(Process &process,
                                      const MemoryRegionInfos &regions,
                                      Process::CoreFileMemoryRanges &ranges,
                                      std::set<addr_t> &stack_ends) {}

// Save only the dirty pages to the core file. Make sure the process has at
// least some dirty pages, as some OS versions don't support reporting what
// pages are dirty within an memory region. If no memory regions have dirty
// page information fall back to saving out all ranges with write permissions.
static void GetCoreFileSaveRangesDirtyOnly(
    Process &process, const MemoryRegionInfos &regions,
    Process::CoreFileMemoryRanges &ranges, std::set<addr_t> &stack_ends) {}

// Save all thread stacks to the core file. Some OS versions support reporting
// when a memory region is stack related. We check on this information, but we
// also use the stack pointers of each thread and add those in case the OS
// doesn't support reporting stack memory. This function also attempts to only
// emit dirty pages from the stack if the memory regions support reporting
// dirty regions as this will make the core file smaller. If the process
// doesn't support dirty regions, then it will fall back to adding the full
// stack region.
static void GetCoreFileSaveRangesStackOnly(
    Process &process, const MemoryRegionInfos &regions,
    Process::CoreFileMemoryRanges &ranges, std::set<addr_t> &stack_ends) {}

Status Process::CalculateCoreFileSaveRanges(const SaveCoreOptions &options,
                                            CoreFileMemoryRanges &ranges) {}

std::vector<ThreadSP>
Process::CalculateCoreFileThreadList(const SaveCoreOptions &core_options) {}

void Process::SetAddressableBitMasks(AddressableBits bit_masks) {}