LLDB  mainline
Process.h
Go to the documentation of this file.
1 //===-- Process.h -----------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_TARGET_PROCESS_H
10 #define LLDB_TARGET_PROCESS_H
11 
12 #include "lldb/Host/Config.h"
13 
14 #include <climits>
15 
16 #include <chrono>
17 #include <list>
18 #include <memory>
19 #include <mutex>
20 #include <string>
21 #include <unordered_set>
22 #include <vector>
23 
30 #include "lldb/Host/HostThread.h"
33 #include "lldb/Symbol/ObjectFile.h"
36 #include "lldb/Target/Memory.h"
38 #include "lldb/Target/QueueList.h"
39 #include "lldb/Target/ThreadList.h"
41 #include "lldb/Target/Trace.h"
42 #include "lldb/Utility/ArchSpec.h"
44 #include "lldb/Utility/Event.h"
45 #include "lldb/Utility/Listener.h"
48 #include "lldb/Utility/Status.h"
53 #include "lldb/lldb-private.h"
54 
55 #include "llvm/ADT/ArrayRef.h"
56 #include "llvm/Support/Threading.h"
57 #include "llvm/Support/VersionTuple.h"
58 
59 namespace lldb_private {
60 
61 template <typename B, typename S> struct Range;
62 
64 public:
66 };
67 
68 class ProcessProperties : public Properties {
69 public:
70  // Pass nullptr for "process" if the ProcessProperties are to be the global
71  // copy
73 
74  ~ProcessProperties() override;
75 
76  bool GetDisableMemoryCache() const;
77  uint64_t GetMemoryCacheLineSize() const;
79  void SetExtraStartupCommands(const Args &args);
83  void SetPythonOSPluginPath(const FileSpec &file);
85  void SetIgnoreBreakpointsInExpressions(bool ignore);
86  bool GetUnwindOnErrorInExpressions() const;
87  void SetUnwindOnErrorInExpressions(bool ignore);
88  bool GetStopOnSharedLibraryEvents() const;
89  void SetStopOnSharedLibraryEvents(bool stop);
91  void SetDisableLangRuntimeUnwindPlans(bool disable);
92  bool GetDetachKeepsStopped() const;
93  void SetDetachKeepsStopped(bool keep_stopped);
94  bool GetWarningsOptimization() const;
95  bool GetWarningsUnsupportedLanguage() const;
96  bool GetStopOnExec() const;
97  std::chrono::seconds GetUtilityExpressionTimeout() const;
98  std::chrono::seconds GetInterruptTimeout() const;
99  bool GetOSPluginReportsAllThreads() const;
100  void SetOSPluginReportsAllThreads(bool does_report);
101  bool GetSteppingRunsAllThreads() const;
103 
104 protected:
105  Process *m_process; // Can be nullptr for global ProcessProperties
106  std::unique_ptr<ProcessExperimentalProperties> m_experimental_properties_up;
107 };
108 
109 // ProcessAttachInfo
110 //
111 // Describes any information that is required to attach to a process.
112 
114 public:
115  ProcessAttachInfo() = default;
116 
120  m_async(false) {
121  ProcessInfo::operator=(launch_info);
123  SetResumeCount(launch_info.GetResumeCount());
124  SetListener(launch_info.GetListener());
125  SetHijackListener(launch_info.GetHijackListener());
126  m_detach_on_error = launch_info.GetDetachOnError();
127  }
128 
129  bool GetWaitForLaunch() const { return m_wait_for_launch; }
130 
131  void SetWaitForLaunch(bool b) { m_wait_for_launch = b; }
132 
133  bool GetAsync() const { return m_async; }
134 
135  void SetAsync(bool b) { m_async = b; }
136 
137  bool GetIgnoreExisting() const { return m_ignore_existing; }
138 
139  void SetIgnoreExisting(bool b) { m_ignore_existing = b; }
140 
142 
144 
146 
148 
149  const char *GetProcessPluginName() const {
150  return (m_plugin_name.empty() ? nullptr : m_plugin_name.c_str());
151  }
152 
153  void SetProcessPluginName(llvm::StringRef plugin) {
154  m_plugin_name = std::string(plugin);
155  }
156 
157  void Clear() {
159  m_plugin_name.clear();
160  m_resume_count = 0;
161  m_wait_for_launch = false;
162  m_ignore_existing = true;
163  m_continue_once_attached = false;
164  }
165 
166  bool ProcessInfoSpecified() const {
167  if (GetExecutableFile())
168  return true;
170  return true;
172  return true;
173  return false;
174  }
175 
176  lldb::ListenerSP GetHijackListener() const { return m_hijack_listener_sp; }
177 
178  void SetHijackListener(const lldb::ListenerSP &listener_sp) {
179  m_hijack_listener_sp = listener_sp;
180  }
181 
182  bool GetDetachOnError() const { return m_detach_on_error; }
183 
184  void SetDetachOnError(bool enable) { m_detach_on_error = enable; }
185 
186  // Get and set the actual listener that will be used for the process events
187  lldb::ListenerSP GetListener() const { return m_listener_sp; }
188 
189  void SetListener(const lldb::ListenerSP &listener_sp) {
190  m_listener_sp = listener_sp;
191  }
192 
193  lldb::ListenerSP GetListenerForProcess(Debugger &debugger);
194 
195 protected:
196  lldb::ListenerSP m_listener_sp;
197  lldb::ListenerSP m_hijack_listener_sp;
199  uint32_t m_resume_count = 0; // How many times do we resume after launching
200  bool m_wait_for_launch = false;
201  bool m_ignore_existing = true;
202  bool m_continue_once_attached = false; // Supports the use-case scenario of
203  // immediately continuing the process
204  // once attached.
206  true; // If we are debugging remotely, instruct the stub to
207  // detach rather than killing the target on error.
208  bool m_async =
209  false; // Use an async attach where we start the attach and return
210  // immediately (used by GUI programs with --waitfor so they can
211  // call SBProcess::Stop() to cancel attach)
212 };
213 
214 // This class tracks the Modification state of the process. Things that can
215 // currently modify the program are running the program (which will up the
216 // StopID) and writing memory (which will up the MemoryID.)
217 // FIXME: Should we also include modification of register states?
218 
220  friend bool operator==(const ProcessModID &lhs, const ProcessModID &rhs);
221 
222 public:
223  ProcessModID() = default;
224 
227 
228  const ProcessModID &operator=(const ProcessModID &rhs) {
229  if (this != &rhs) {
230  m_stop_id = rhs.m_stop_id;
231  m_memory_id = rhs.m_memory_id;
232  }
233  return *this;
234  }
235 
236  ~ProcessModID() = default;
237 
239  const uint32_t prev_stop_id = m_stop_id++;
242  return prev_stop_id;
243  }
244 
245  void BumpMemoryID() { m_memory_id++; }
246 
247  void BumpResumeID() {
248  m_resume_id++;
251  }
252 
254  return m_running_utility_function > 0;
255  }
256 
257  uint32_t GetStopID() const { return m_stop_id; }
259  uint32_t GetMemoryID() const { return m_memory_id; }
260  uint32_t GetResumeID() const { return m_resume_id; }
263  }
264 
265  bool MemoryIDEqual(const ProcessModID &compare) const {
266  return m_memory_id == compare.m_memory_id;
267  }
268 
269  bool StopIDEqual(const ProcessModID &compare) const {
270  return m_stop_id == compare.m_stop_id;
271  }
272 
274 
275  bool IsValid() const { return m_stop_id != UINT32_MAX; }
276 
278  // If we haven't yet resumed the target, then it can't be for a user
279  // expression...
280  if (m_resume_id == 0)
281  return false;
282 
284  }
285 
286  void SetRunningUserExpression(bool on) {
287  if (on)
289  else
291  }
292 
294  if (on)
296  else {
297  assert(m_running_utility_function > 0 &&
298  "Called SetRunningUtilityFunction(false) without calling "
299  "SetRunningUtilityFunction(true) before?");
301  }
302  }
303 
304  void SetStopEventForLastNaturalStopID(lldb::EventSP event_sp) {
305  m_last_natural_stop_event = std::move(event_sp);
306  }
307 
308  lldb::EventSP GetStopEventForStopID(uint32_t stop_id) const {
309  if (stop_id == m_last_natural_stop_id)
311  return lldb::EventSP();
312  }
313 
314 private:
323 };
324 
325 inline bool operator==(const ProcessModID &lhs, const ProcessModID &rhs) {
326  if (lhs.StopIDEqual(rhs) && lhs.MemoryIDEqual(rhs))
327  return true;
328  else
329  return false;
330 }
331 
332 inline bool operator!=(const ProcessModID &lhs, const ProcessModID &rhs) {
333  return (!lhs.StopIDEqual(rhs) || !lhs.MemoryIDEqual(rhs));
334 }
335 
336 /// \class Process Process.h "lldb/Target/Process.h"
337 /// A plug-in interface definition class for debugging a process.
338 class Process : public std::enable_shared_from_this<Process>,
339  public ProcessProperties,
340  public Broadcaster,
341  public ExecutionContextScope,
342  public PluginInterface {
343  friend class FunctionCaller; // For WaitForStateChangeEventsPrivate
344  friend class Debugger; // For PopProcessIOHandler and ProcessIOHandlerIsActive
345  friend class DynamicLoader; // For LoadOperatingSystemPlugin
346  friend class ProcessEventData;
347  friend class StopInfo;
348  friend class Target;
349  friend class ThreadList;
350 
351 public:
352  /// Broadcaster event bits definitions.
353  enum {
360  };
361 
362  enum {
366  };
367 
369  // We use a read/write lock to allow on or more clients to access the process
370  // state while the process is stopped (reader). We lock the write lock to
371  // control access to the process while it is running (readers, or clients
372  // that want the process stopped can block waiting for the process to stop,
373  // or just try to lock it to see if they can immediately access the stopped
374  // process. If the try read lock fails, then the process is running.
376 
377  // These two functions fill out the Broadcaster interface:
378 
380 
381  ConstString &GetBroadcasterClass() const override {
382  return GetStaticBroadcasterClass();
383  }
384 
385 /// A notification structure that can be used by clients to listen
386 /// for changes in a process's lifetime.
387 ///
388 /// \see RegisterNotificationCallbacks (const Notifications&) @see
389 /// UnregisterNotificationCallbacks (const Notifications&)
390  typedef struct {
391  void *baton;
392  void (*initialize)(void *baton, Process *process);
393  void (*process_state_changed)(void *baton, Process *process,
394  lldb::StateType state);
395  } Notifications;
396 
397  class ProcessEventData : public EventData {
398  friend class Process;
399 
400  public:
402  ProcessEventData(const lldb::ProcessSP &process, lldb::StateType state);
403 
404  ~ProcessEventData() override;
405 
406  static ConstString GetFlavorString();
407 
408  ConstString GetFlavor() const override;
409 
410  lldb::ProcessSP GetProcessSP() const { return m_process_wp.lock(); }
411 
412  lldb::StateType GetState() const { return m_state; }
413  bool GetRestarted() const { return m_restarted; }
414 
415  size_t GetNumRestartedReasons() { return m_restarted_reasons.size(); }
416 
417  const char *GetRestartedReasonAtIndex(size_t idx) {
418  return ((idx < m_restarted_reasons.size())
419  ? m_restarted_reasons[idx].c_str()
420  : nullptr);
421  }
422 
423  bool GetInterrupted() const { return m_interrupted; }
424 
425  void Dump(Stream *s) const override;
426 
427  virtual bool ShouldStop(Event *event_ptr, bool &found_valid_stopinfo);
428 
429  void DoOnRemoval(Event *event_ptr) override;
430 
431  static const Process::ProcessEventData *
432  GetEventDataFromEvent(const Event *event_ptr);
433 
434  static lldb::ProcessSP GetProcessFromEvent(const Event *event_ptr);
435 
436  static lldb::StateType GetStateFromEvent(const Event *event_ptr);
437 
438  static bool GetRestartedFromEvent(const Event *event_ptr);
439 
440  static size_t GetNumRestartedReasons(const Event *event_ptr);
441 
442  static const char *GetRestartedReasonAtIndex(const Event *event_ptr,
443  size_t idx);
444 
445  static void AddRestartedReason(Event *event_ptr, const char *reason);
446 
447  static void SetRestartedInEvent(Event *event_ptr, bool new_value);
448 
449  static bool GetInterruptedFromEvent(const Event *event_ptr);
450 
451  static void SetInterruptedInEvent(Event *event_ptr, bool new_value);
452 
453  static bool SetUpdateStateOnRemoval(Event *event_ptr);
454 
455  private:
457 
458  void SetRestarted(bool new_value) { m_restarted = new_value; }
459 
460  void SetInterrupted(bool new_value) { m_interrupted = new_value; }
461 
462  void AddRestartedReason(const char *reason) {
463  m_restarted_reasons.push_back(reason);
464  }
465 
466  lldb::ProcessWP m_process_wp;
468  std::vector<std::string> m_restarted_reasons;
469  bool m_restarted = false; // For "eStateStopped" events, this is true if the
470  // target was automatically restarted.
471  int m_update_state = 0;
472  bool m_interrupted = false;
473 
474  ProcessEventData(const ProcessEventData &) = delete;
475  const ProcessEventData &operator=(const ProcessEventData &) = delete;
476  };
477 
478  /// Destructor.
479  ///
480  /// The destructor is virtual since this class is designed to be inherited
481  /// from by the plug-in instance.
482  ~Process() override;
483 
484  static void SettingsInitialize();
485 
486  static void SettingsTerminate();
487 
489 
490  /// Find a Process plug-in that can debug \a module using the currently
491  /// selected architecture.
492  ///
493  /// Scans all loaded plug-in interfaces that implement versions of the
494  /// Process plug-in interface and returns the first instance that can debug
495  /// the file.
496  ///
497  /// \see Process::CanDebug ()
498  static lldb::ProcessSP FindPlugin(lldb::TargetSP target_sp,
499  llvm::StringRef plugin_name,
500  lldb::ListenerSP listener_sp,
501  const FileSpec *crash_file_path,
502  bool can_connect);
503 
504  /// Static function that can be used with the \b host function
505  /// Host::StartMonitoringChildProcess ().
506  ///
507  /// This function can be used by lldb_private::Process subclasses when they
508  /// want to watch for a local process and have its exit status automatically
509  /// set when the host child process exits. Subclasses should call
510  /// Host::StartMonitoringChildProcess () with:
511  /// callback = Process::SetHostProcessExitStatus
512  /// pid = Process::GetID()
513  /// monitor_signals = false
514  static bool
515  SetProcessExitStatus(lldb::pid_t pid, // The process ID we want to monitor
516  bool exited,
517  int signo, // Zero for no signal
518  int status); // Exit value of process if signal is zero
519 
521 
523 
524  /// Returns the pid of the process or LLDB_INVALID_PROCESS_ID if there is
525  /// no known pid.
526  lldb::pid_t GetID() const { return m_pid; }
527 
528  /// Sets the stored pid.
529  ///
530  /// This does not change the pid of underlying process.
531  void SetID(lldb::pid_t new_pid) { m_pid = new_pid; }
532 
534 
535  /// Check if a plug-in instance can debug the file in \a module.
536  ///
537  /// Each plug-in is given a chance to say whether it can debug the file in
538  /// \a module. If the Process plug-in instance can debug a file on the
539  /// current system, it should return \b true.
540  ///
541  /// \return
542  /// Returns \b true if this Process plug-in instance can
543  /// debug the executable, \b false otherwise.
544  virtual bool CanDebug(lldb::TargetSP target,
545  bool plugin_specified_by_name) = 0;
546 
547  /// This object is about to be destroyed, do any necessary cleanup.
548  ///
549  /// Subclasses that override this method should always call this superclass
550  /// method.
551  virtual void Finalize();
552 
553  /// Return whether this object is valid (i.e. has not been finalized.)
554  ///
555  /// \return
556  /// Returns \b true if this Process has not been finalized
557  /// and \b false otherwise.
558  bool IsValid() const { return !m_finalizing; }
559 
560  /// Return a multi-word command object that can be used to expose plug-in
561  /// specific commands.
562  ///
563  /// This object will be used to resolve plug-in commands and can be
564  /// triggered by a call to:
565  ///
566  /// (lldb) process command <args>
567  ///
568  /// \return
569  /// A CommandObject which can be one of the concrete subclasses
570  /// of CommandObject like CommandObjectRaw, CommandObjectParsed,
571  /// or CommandObjectMultiword.
572  virtual CommandObject *GetPluginCommandObject() { return nullptr; }
573 
574  /// Launch a new process.
575  ///
576  /// Launch a new process by spawning a new process using the target object's
577  /// executable module's file as the file to launch.
578  ///
579  /// This function is not meant to be overridden by Process subclasses. It
580  /// will first call Process::WillLaunch (Module *) and if that returns \b
581  /// true, Process::DoLaunch (Module*, char const *[],char const *[],const
582  /// char *,const char *, const char *) will be called to actually do the
583  /// launching. If DoLaunch returns \b true, then Process::DidLaunch() will
584  /// be called.
585  ///
586  /// \param[in] launch_info
587  /// Details regarding the environment, STDIN/STDOUT/STDERR
588  /// redirection, working path, etc. related to the requested launch.
589  ///
590  /// \return
591  /// An error object. Call GetID() to get the process ID if
592  /// the error object is success.
593  virtual Status Launch(ProcessLaunchInfo &launch_info);
594 
595  virtual Status LoadCore();
596 
597  virtual Status DoLoadCore() {
598  Status error;
599  error.SetErrorStringWithFormatv(
600  "error: {0} does not support loading core files.", GetPluginName());
601  return error;
602  }
603 
604  // FUTURE WORK: GetLoadImageUtilityFunction are the first use we've
605  // had of having other plugins cache data in the Process. This is handy for
606  // long-living plugins - like the Platform - which manage interactions whose
607  // lifetime is governed by the Process lifetime. If we find we need to do
608  // this more often, we should construct a general solution to the problem.
609  // The consensus suggestion was that we have a token based registry in the
610  // Process. Some undecided questions are (1) who manages the tokens. It's
611  // probably best that you add the element and get back a token that
612  // represents it. That will avoid collisions. But there may be some utility
613  // in the registerer controlling the token? (2) whether the thing added
614  // should be simply owned by Process, and just go away when it does (3)
615  // whether the registree should be notified of the Process' demise.
616  //
617  // We are postponing designing this till we have at least a second use case.
618  /// Get the cached UtilityFunction that assists in loading binary images
619  /// into the process.
620  ///
621  /// \param[in] platform
622  /// The platform fetching the UtilityFunction.
623  /// \param[in] factory
624  /// A function that will be called only once per-process in a
625  /// thread-safe way to create the UtilityFunction if it has not
626  /// been initialized yet.
627  ///
628  /// \return
629  /// The cached utility function or null if the platform is not the
630  /// same as the target's platform.
632  Platform *platform,
633  llvm::function_ref<std::unique_ptr<UtilityFunction>()> factory);
634 
635  /// Get the dynamic loader plug-in for this process.
636  ///
637  /// The default action is to let the DynamicLoader plug-ins check the main
638  /// executable and the DynamicLoader will select itself automatically.
639  /// Subclasses can override this if inspecting the executable is not
640  /// desired, or if Process subclasses can only use a specific DynamicLoader
641  /// plug-in.
642  virtual DynamicLoader *GetDynamicLoader();
643 
644  void SetDynamicLoader(lldb::DynamicLoaderUP dyld);
645 
646  // Returns AUXV structure found in many ELF-based environments.
647  //
648  // The default action is to return an empty data buffer.
649  //
650  // \return
651  // A data extractor containing the contents of the AUXV data.
652  virtual DataExtractor GetAuxvData();
653 
654  /// Sometimes processes know how to retrieve and load shared libraries. This
655  /// is normally done by DynamicLoader plug-ins, but sometimes the connection
656  /// to the process allows retrieving this information. The dynamic loader
657  /// plug-ins can use this function if they can't determine the current
658  /// shared library load state.
659  ///
660  /// \return
661  /// A status object indicating if the operation was sucessful or not.
663  return llvm::make_error<llvm::StringError>("Not implemented.",
664  llvm::inconvertibleErrorCode());
665  }
666 
667  /// Query remote GDBServer for a detailed loaded library list
668  /// \return
669  /// The list of modules currently loaded by the process, or an error.
670  virtual llvm::Expected<LoadedModuleInfoList> GetLoadedModuleList() {
671  return llvm::createStringError(llvm::inconvertibleErrorCode(),
672  "Not implemented");
673  }
674 
675  /// Save core dump into the specified file.
676  ///
677  /// \param[in] outfile
678  /// Path to store core dump in.
679  ///
680  /// \return
681  /// true if saved successfully, false if saving the core dump
682  /// is not supported by the plugin, error otherwise.
683  virtual llvm::Expected<bool> SaveCore(llvm::StringRef outfile);
684 
685 protected:
686  virtual JITLoaderList &GetJITLoaders();
687 
688 public:
689  /// Get the system architecture for this process.
690  virtual ArchSpec GetSystemArchitecture() { return {}; }
691 
692  /// Get the system runtime plug-in for this process.
693  ///
694  /// \return
695  /// Returns a pointer to the SystemRuntime plugin for this Process
696  /// if one is available. Else returns nullptr.
697  virtual SystemRuntime *GetSystemRuntime();
698 
699  /// Attach to an existing process using the process attach info.
700  ///
701  /// This function is not meant to be overridden by Process subclasses. It
702  /// will first call WillAttach (lldb::pid_t) or WillAttach (const char *),
703  /// and if that returns \b true, DoAttach (lldb::pid_t) or DoAttach (const
704  /// char *) will be called to actually do the attach. If DoAttach returns \b
705  /// true, then Process::DidAttach() will be called.
706  ///
707  /// \param[in] attach_info
708  /// The process attach info.
709  ///
710  /// \return
711  /// Returns \a pid if attaching was successful, or
712  /// LLDB_INVALID_PROCESS_ID if attaching fails.
713  virtual Status Attach(ProcessAttachInfo &attach_info);
714 
715  /// Attach to a remote system via a URL
716  ///
717  /// \param[in] remote_url
718  /// The URL format that we are connecting to.
719  ///
720  /// \return
721  /// Returns an error object.
722  virtual Status ConnectRemote(llvm::StringRef remote_url);
723 
724  bool GetShouldDetach() const { return m_should_detach; }
725 
726  void SetShouldDetach(bool b) { m_should_detach = b; }
727 
728  /// Get the image vector for the current process.
729  ///
730  /// \return
731  /// The constant reference to the member m_image_tokens.
732  const std::vector<lldb::addr_t>& GetImageTokens() { return m_image_tokens; }
733 
734  /// Get the image information address for the current process.
735  ///
736  /// Some runtimes have system functions that can help dynamic loaders locate
737  /// the dynamic loader information needed to observe shared libraries being
738  /// loaded or unloaded. This function is in the Process interface (as
739  /// opposed to the DynamicLoader interface) to ensure that remote debugging
740  /// can take advantage of this functionality.
741  ///
742  /// \return
743  /// The address of the dynamic loader information, or
744  /// LLDB_INVALID_ADDRESS if this is not supported by this
745  /// interface.
747 
748  /// Called when the process is about to broadcast a public stop.
749  ///
750  /// There are public and private stops. Private stops are when the process
751  /// is doing things like stepping and the client doesn't need to know about
752  /// starts and stop that implement a thread plan. Single stepping over a
753  /// source line in code might end up being implemented by one or more
754  /// process starts and stops. Public stops are when clients will be notified
755  /// that the process is stopped. These events typically trigger UI updates
756  /// (thread stack frames to be displayed, variables to be displayed, and
757  /// more). This function can be overriden and allows process subclasses to
758  /// do something before the eBroadcastBitStateChanged event is sent to
759  /// public clients.
760  virtual void WillPublicStop() {}
761 
762 /// Register for process and thread notifications.
763 ///
764 /// Clients can register notification callbacks by filling out a
765 /// Process::Notifications structure and calling this function.
766 ///
767 /// \param[in] callbacks
768 /// A structure that contains the notification baton and
769 /// callback functions.
770 ///
771 /// \see Process::Notifications
773 
774 /// Unregister for process and thread notifications.
775 ///
776 /// Clients can unregister notification callbacks by passing a copy of the
777 /// original baton and callbacks in \a callbacks.
778 ///
779 /// \param[in] callbacks
780 /// A structure that contains the notification baton and
781 /// callback functions.
782 ///
783 /// \return
784 /// Returns \b true if the notification callbacks were
785 /// successfully removed from the process, \b false otherwise.
786 ///
787 /// \see Process::Notifications
789 
790  //==================================================================
791  // Built in Process Control functions
792  //==================================================================
793  /// Resumes all of a process's threads as configured using the Thread run
794  /// control functions.
795  ///
796  /// Threads for a process should be updated with one of the run control
797  /// actions (resume, step, or suspend) that they should take when the
798  /// process is resumed. If no run control action is given to a thread it
799  /// will be resumed by default.
800  ///
801  /// This function is not meant to be overridden by Process subclasses. This
802  /// function will take care of disabling any breakpoints that threads may be
803  /// stopped at, single stepping, and re-enabling breakpoints, and enabling
804  /// the basic flow control that the plug-in instances need not worry about.
805  ///
806  /// N.B. This function also sets the Write side of the Run Lock, which is
807  /// unset when the corresponding stop event is pulled off the Public Event
808  /// Queue. If you need to resume the process without setting the Run Lock,
809  /// use PrivateResume (though you should only do that from inside the
810  /// Process class.
811  ///
812  /// \return
813  /// Returns an error object.
814  ///
815  /// \see Thread:Resume()
816  /// \see Thread:Step()
817  /// \see Thread:Suspend()
818  Status Resume();
819 
821 
822  /// Halts a running process.
823  ///
824  /// This function is not meant to be overridden by Process subclasses. If
825  /// the process is successfully halted, a eStateStopped process event with
826  /// GetInterrupted will be broadcast. If false, we will halt the process
827  /// with no events generated by the halt.
828  ///
829  /// \param[in] clear_thread_plans
830  /// If true, when the process stops, clear all thread plans.
831  ///
832  /// \param[in] use_run_lock
833  /// Whether to release the run lock after the stop.
834  ///
835  /// \return
836  /// Returns an error object. If the error is empty, the process is
837  /// halted.
838  /// otherwise the halt has failed.
839  Status Halt(bool clear_thread_plans = false, bool use_run_lock = true);
840 
841  /// Detaches from a running or stopped process.
842  ///
843  /// This function is not meant to be overridden by Process subclasses.
844  ///
845  /// \param[in] keep_stopped
846  /// If true, don't resume the process on detach.
847  ///
848  /// \return
849  /// Returns an error object.
850  Status Detach(bool keep_stopped);
851 
852  /// Kills the process and shuts down all threads that were spawned to track
853  /// and monitor the process.
854  ///
855  /// This function is not meant to be overridden by Process subclasses.
856  ///
857  /// \param[in] force_kill
858  /// Whether lldb should force a kill (instead of a detach) from
859  /// the inferior process. Normally if lldb launched a binary and
860  /// Destory is called, lldb kills it. If lldb attached to a
861  /// running process and Destory is called, lldb detaches. If
862  /// this behavior needs to be over-ridden, this is the bool that
863  /// can be used.
864  ///
865  /// \return
866  /// Returns an error object.
867  Status Destroy(bool force_kill);
868 
869  /// Sends a process a UNIX signal \a signal.
870  ///
871  /// This function is not meant to be overridden by Process subclasses.
872  ///
873  /// \return
874  /// Returns an error object.
875  Status Signal(int signal);
876 
877  void SetUnixSignals(lldb::UnixSignalsSP &&signals_sp);
878 
879  const lldb::UnixSignalsSP &GetUnixSignals();
880 
881  //==================================================================
882  // Plug-in Process Control Overrides
883  //==================================================================
884 
885  /// Called before attaching to a process.
886  ///
887  /// \return
888  /// Returns an error object.
890 
891  /// Called before attaching to a process.
892  ///
893  /// Allow Process plug-ins to execute some code before attaching a process.
894  ///
895  /// \return
896  /// Returns an error object.
898  return Status();
899  }
900 
901  /// Called before attaching to a process.
902  ///
903  /// \return
904  /// Returns an error object.
905  Status WillAttachToProcessWithName(const char *process_name,
906  bool wait_for_launch);
907 
908  /// Called before attaching to a process.
909  ///
910  /// Allow Process plug-ins to execute some code before attaching a process.
911  ///
912  /// \return
913  /// Returns an error object.
914  virtual Status DoWillAttachToProcessWithName(const char *process_name,
915  bool wait_for_launch) {
916  return Status();
917  }
918 
919  /// Attach to a remote system via a URL
920  ///
921  /// \param[in] remote_url
922  /// The URL format that we are connecting to.
923  ///
924  /// \return
925  /// Returns an error object.
926  virtual Status DoConnectRemote(llvm::StringRef remote_url) {
927  Status error;
928  error.SetErrorString("remote connections are not supported");
929  return error;
930  }
931 
932  /// Attach to an existing process using a process ID.
933  ///
934  /// \param[in] pid
935  /// The process ID that we should attempt to attach to.
936  ///
937  /// \param[in] attach_info
938  /// Information on how to do the attach. For example, GetUserID()
939  /// will return the uid to attach as.
940  ///
941  /// \return
942  /// Returns a successful Status attaching was successful, or
943  /// an appropriate (possibly platform-specific) error code if
944  /// attaching fails.
945  /// hanming : need flag
947  const ProcessAttachInfo &attach_info) {
948  Status error;
949  error.SetErrorStringWithFormatv(
950  "error: {0} does not support attaching to a process by pid",
951  GetPluginName());
952  return error;
953  }
954 
955  /// Attach to an existing process using a partial process name.
956  ///
957  /// \param[in] process_name
958  /// The name of the process to attach to.
959  ///
960  /// \param[in] attach_info
961  /// Information on how to do the attach. For example, GetUserID()
962  /// will return the uid to attach as.
963  ///
964  /// \return
965  /// Returns a successful Status attaching was successful, or
966  /// an appropriate (possibly platform-specific) error code if
967  /// attaching fails.
968  virtual Status
969  DoAttachToProcessWithName(const char *process_name,
970  const ProcessAttachInfo &attach_info) {
971  Status error;
972  error.SetErrorString("attach by name is not supported");
973  return error;
974  }
975 
976  /// Called after attaching a process.
977  ///
978  /// \param[in] process_arch
979  /// If you can figure out the process architecture after attach, fill it
980  /// in here.
981  ///
982  /// Allow Process plug-ins to execute some code after attaching to a
983  /// process.
984  virtual void DidAttach(ArchSpec &process_arch) { process_arch.Clear(); }
985 
986  /// Called after a process re-execs itself.
987  ///
988  /// Allow Process plug-ins to execute some code after a process has exec'ed
989  /// itself. Subclasses typically should override DoDidExec() as the
990  /// lldb_private::Process class needs to remove its dynamic loader, runtime,
991  /// ABI and other plug-ins, as well as unload all shared libraries.
992  virtual void DidExec();
993 
994  /// Subclasses of Process should implement this function if they need to do
995  /// anything after a process exec's itself.
996  virtual void DoDidExec() {}
997 
998  /// Called after a reported fork.
999  virtual void DidFork(lldb::pid_t child_pid, lldb::tid_t child_tid) {}
1000 
1001  /// Called after a reported vfork.
1002  virtual void DidVFork(lldb::pid_t child_pid, lldb::tid_t child_tid) {}
1003 
1004  /// Called after reported vfork completion.
1005  virtual void DidVForkDone() {}
1006 
1007  /// Called before launching to a process.
1008  /// \return
1009  /// Returns an error object.
1010  Status WillLaunch(Module *module);
1011 
1012  /// Called before launching to a process.
1013  ///
1014  /// Allow Process plug-ins to execute some code before launching a process.
1015  ///
1016  /// \return
1017  /// Returns an error object.
1018  virtual Status DoWillLaunch(Module *module) { return Status(); }
1019 
1020  /// Launch a new process.
1021  ///
1022  /// Launch a new process by spawning a new process using \a exe_module's
1023  /// file as the file to launch. Launch details are provided in \a
1024  /// launch_info.
1025  ///
1026  /// \param[in] exe_module
1027  /// The module from which to extract the file specification and
1028  /// launch.
1029  ///
1030  /// \param[in] launch_info
1031  /// Details (e.g. arguments, stdio redirection, etc.) for the
1032  /// requested launch.
1033  ///
1034  /// \return
1035  /// An Status instance indicating success or failure of the
1036  /// operation.
1037  virtual Status DoLaunch(Module *exe_module, ProcessLaunchInfo &launch_info) {
1038  Status error;
1039  error.SetErrorStringWithFormatv(
1040  "error: {0} does not support launching processes", GetPluginName());
1041  return error;
1042  }
1043 
1044  /// Called after launching a process.
1045  ///
1046  /// Allow Process plug-ins to execute some code after launching a process.
1047  virtual void DidLaunch() {}
1048 
1049  /// Called before resuming to a process.
1050  ///
1051  /// Allow Process plug-ins to execute some code before resuming a process.
1052  ///
1053  /// \return
1054  /// Returns an error object.
1055  virtual Status WillResume() { return Status(); }
1056 
1057  /// Resumes all of a process's threads as configured using the Thread run
1058  /// control functions.
1059  ///
1060  /// Threads for a process should be updated with one of the run control
1061  /// actions (resume, step, or suspend) that they should take when the
1062  /// process is resumed. If no run control action is given to a thread it
1063  /// will be resumed by default.
1064  ///
1065  /// \return
1066  /// Returns \b true if the process successfully resumes using
1067  /// the thread run control actions, \b false otherwise.
1068  ///
1069  /// \see Thread:Resume()
1070  /// \see Thread:Step()
1071  /// \see Thread:Suspend()
1072  virtual Status DoResume() {
1073  Status error;
1074  error.SetErrorStringWithFormatv(
1075  "error: {0} does not support resuming processes", GetPluginName());
1076  return error;
1077  }
1078 
1079  /// Called after resuming a process.
1080  ///
1081  /// Allow Process plug-ins to execute some code after resuming a process.
1082  virtual void DidResume() {}
1083 
1084  /// Called before halting to a process.
1085  ///
1086  /// Allow Process plug-ins to execute some code before halting a process.
1087  ///
1088  /// \return
1089  /// Returns an error object.
1090  virtual Status WillHalt() { return Status(); }
1091 
1092  /// Halts a running process.
1093  ///
1094  /// DoHalt must produce one and only one stop StateChanged event if it
1095  /// actually stops the process. If the stop happens through some natural
1096  /// event (for instance a SIGSTOP), then forwarding that event will do.
1097  /// Otherwise, you must generate the event manually. This function is called
1098  /// from the context of the private state thread.
1099  ///
1100  /// \param[out] caused_stop
1101  /// If true, then this Halt caused the stop, otherwise, the
1102  /// process was already stopped.
1103  ///
1104  /// \return
1105  /// Returns \b true if the process successfully halts, \b false
1106  /// otherwise.
1107  virtual Status DoHalt(bool &caused_stop) {
1108  Status error;
1109  error.SetErrorStringWithFormatv(
1110  "error: {0} does not support halting processes", GetPluginName());
1111  return error;
1112  }
1113 
1114  /// Called after halting a process.
1115  ///
1116  /// Allow Process plug-ins to execute some code after halting a process.
1117  virtual void DidHalt() {}
1118 
1119  /// Called before detaching from a process.
1120  ///
1121  /// Allow Process plug-ins to execute some code before detaching from a
1122  /// process.
1123  ///
1124  /// \return
1125  /// Returns an error object.
1126  virtual Status WillDetach() { return Status(); }
1127 
1128  /// Detaches from a running or stopped process.
1129  ///
1130  /// \return
1131  /// Returns \b true if the process successfully detaches, \b
1132  /// false otherwise.
1133  virtual Status DoDetach(bool keep_stopped) {
1134  Status error;
1135  error.SetErrorStringWithFormatv(
1136  "error: {0} does not support detaching from processes",
1137  GetPluginName());
1138  return error;
1139  }
1140 
1141  /// Called after detaching from a process.
1142  ///
1143  /// Allow Process plug-ins to execute some code after detaching from a
1144  /// process.
1145  virtual void DidDetach() {}
1146 
1147  virtual bool DetachRequiresHalt() { return false; }
1148 
1149  /// Called before sending a signal to a process.
1150  ///
1151  /// Allow Process plug-ins to execute some code before sending a signal to a
1152  /// process.
1153  ///
1154  /// \return
1155  /// Returns no error if it is safe to proceed with a call to
1156  /// Process::DoSignal(int), otherwise an error describing what
1157  /// prevents the signal from being sent.
1158  virtual Status WillSignal() { return Status(); }
1159 
1160  /// Sends a process a UNIX signal \a signal.
1161  ///
1162  /// \return
1163  /// Returns an error object.
1164  virtual Status DoSignal(int signal) {
1165  Status error;
1166  error.SetErrorStringWithFormatv(
1167  "error: {0} does not support sending signals to processes",
1168  GetPluginName());
1169  return error;
1170  }
1171 
1172  virtual Status WillDestroy() { return Status(); }
1173 
1174  virtual Status DoDestroy() = 0;
1175 
1176  virtual void DidDestroy() {}
1177 
1178  virtual bool DestroyRequiresHalt() { return true; }
1179 
1180  /// Called after sending a signal to a process.
1181  ///
1182  /// Allow Process plug-ins to execute some code after sending a signal to a
1183  /// process.
1184  virtual void DidSignal() {}
1185 
1186  /// Currently called as part of ShouldStop.
1187  /// FIXME: Should really happen when the target stops before the
1188  /// event is taken from the queue...
1189  ///
1190  /// This callback is called as the event
1191  /// is about to be queued up to allow Process plug-ins to execute some code
1192  /// prior to clients being notified that a process was stopped. Common
1193  /// operations include updating the thread list, invalidating any thread
1194  /// state (registers, stack, etc) prior to letting the notification go out.
1195  ///
1196  virtual void RefreshStateAfterStop() = 0;
1197 
1198  /// Sometimes the connection to a process can detect the host OS version
1199  /// that the process is running on. The current platform should be checked
1200  /// first in case the platform is connected, but clients can fall back onto
1201  /// this function if the platform fails to identify the host OS version. The
1202  /// platform should be checked first in case you are running a simulator
1203  /// platform that might itself be running natively, but have different
1204  /// heuristics for figuring out which OS is is emulating.
1205  ///
1206  /// \return
1207  /// Returns the version tuple of the host OS. In case of failure an empty
1208  /// VersionTuple is returner.
1209  virtual llvm::VersionTuple GetHostOSVersion() { return llvm::VersionTuple(); }
1210 
1211  /// \return the macCatalyst version of the host OS.
1212  virtual llvm::VersionTuple GetHostMacCatalystVersion() { return {}; }
1213 
1214  /// Get the target object pointer for this module.
1215  ///
1216  /// \return
1217  /// A Target object pointer to the target that owns this
1218  /// module.
1219  Target &GetTarget() { return *m_target_wp.lock(); }
1220 
1221  /// Get the const target object pointer for this module.
1222  ///
1223  /// \return
1224  /// A const Target object pointer to the target that owns this
1225  /// module.
1226  const Target &GetTarget() const { return *m_target_wp.lock(); }
1227 
1228  /// Flush all data in the process.
1229  ///
1230  /// Flush the memory caches, all threads, and any other cached data in the
1231  /// process.
1232  ///
1233  /// This function can be called after a world changing event like adding a
1234  /// new symbol file, or after the process makes a large context switch (from
1235  /// boot ROM to booted into an OS).
1236  void Flush();
1237 
1238  /// Get accessor for the current process state.
1239  ///
1240  /// \return
1241  /// The current state of the process.
1242  ///
1243  /// \see lldb::StateType
1245 
1247  RunThreadPlan(ExecutionContext &exe_ctx, lldb::ThreadPlanSP &thread_plan_sp,
1248  const EvaluateExpressionOptions &options,
1249  DiagnosticManager &diagnostic_manager);
1250 
1251  static const char *ExecutionResultAsCString(lldb::ExpressionResults result);
1252 
1253  void GetStatus(Stream &ostrm);
1254 
1255  size_t GetThreadStatus(Stream &ostrm, bool only_threads_with_stop_reason,
1256  uint32_t start_frame, uint32_t num_frames,
1257  uint32_t num_frames_with_source,
1258  bool stop_format);
1259 
1260  void SendAsyncInterrupt();
1261 
1262  // Notify this process class that modules got loaded.
1263  //
1264  // If subclasses override this method, they must call this version before
1265  // doing anything in the subclass version of the function.
1266  virtual void ModulesDidLoad(ModuleList &module_list);
1267 
1268  /// Retrieve the list of shared libraries that are loaded for this process
1269  /// This method is used on pre-macOS 10.12, pre-iOS 10, pre-tvOS 10, pre-
1270  /// watchOS 3 systems. The following two methods are for newer versions of
1271  /// those OSes.
1272  ///
1273  /// For certain platforms, the time it takes for the DynamicLoader plugin to
1274  /// read all of the shared libraries out of memory over a slow communication
1275  /// channel may be too long. In that instance, the gdb-remote stub may be
1276  /// able to retrieve the necessary information about the solibs out of
1277  /// memory and return a concise summary sufficient for the DynamicLoader
1278  /// plugin.
1279  ///
1280  /// \param [in] image_list_address
1281  /// The address where the table of shared libraries is stored in memory,
1282  /// if that is appropriate for this platform. Else this may be
1283  /// passed as LLDB_INVALID_ADDRESS.
1284  ///
1285  /// \param [in] image_count
1286  /// The number of shared libraries that are present in this process, if
1287  /// that is appropriate for this platofrm Else this may be passed as
1288  /// LLDB_INVALID_ADDRESS.
1289  ///
1290  /// \return
1291  /// A StructuredDataSP object which, if non-empty, will contain the
1292  /// information the DynamicLoader needs to get the initial scan of
1293  /// solibs resolved.
1296  lldb::addr_t image_count) {
1297  return StructuredData::ObjectSP();
1298  }
1299 
1300  // On macOS 10.12, tvOS 10, iOS 10, watchOS 3 and newer, debugserver can
1301  // return the full list of loaded shared libraries without needing any input.
1304  return StructuredData::ObjectSP();
1305  }
1306 
1307  // On macOS 10.12, tvOS 10, iOS 10, watchOS 3 and newer, debugserver can
1308  // return information about binaries given their load addresses.
1310  const std::vector<lldb::addr_t> &load_addresses) {
1311  return StructuredData::ObjectSP();
1312  }
1313 
1314  // Get information about the library shared cache, if that exists
1315  //
1316  // On macOS 10.12, tvOS 10, iOS 10, watchOS 3 and newer, debugserver can
1317  // return information about the library shared cache (a set of standard
1318  // libraries that are loaded at the same location for all processes on a
1319  // system) in use.
1321  return StructuredData::ObjectSP();
1322  }
1323 
1324  /// Print a user-visible warning about a module being built with
1325  /// optimization
1326  ///
1327  /// Prints a async warning message to the user one time per Module where a
1328  /// function is found that was compiled with optimization, per Process.
1329  ///
1330  /// \param [in] sc
1331  /// A SymbolContext with eSymbolContextFunction and eSymbolContextModule
1332  /// pre-computed.
1333  void PrintWarningOptimization(const SymbolContext &sc);
1334 
1335  /// Print a user-visible warning about a function written in a
1336  /// language that this version of LLDB doesn't support.
1337  ///
1338  /// \see PrintWarningOptimization
1340 
1341  virtual bool GetProcessInfo(ProcessInstanceInfo &info);
1342 
1343  /// Get the exit status for a process.
1344  ///
1345  /// \return
1346  /// The process's return code, or -1 if the current process
1347  /// state is not eStateExited.
1348  int GetExitStatus();
1349 
1350  /// Get a textual description of what the process exited.
1351  ///
1352  /// \return
1353  /// The textual description of why the process exited, or nullptr
1354  /// if there is no description available.
1355  const char *GetExitDescription();
1356 
1357  virtual void DidExit() {}
1358 
1361 
1362  void SetCodeAddressMask(lldb::addr_t code_address_mask) {
1363  m_code_address_mask = code_address_mask;
1364  }
1365 
1366  void SetDataAddressMask(lldb::addr_t data_address_mask) {
1367  m_data_address_mask = data_address_mask;
1368  }
1369 
1370  /// Get the Modification ID of the process.
1371  ///
1372  /// \return
1373  /// The modification ID of the process.
1374  ProcessModID GetModID() const { return m_mod_id; }
1375 
1376  const ProcessModID &GetModIDRef() const { return m_mod_id; }
1377 
1378  uint32_t GetStopID() const { return m_mod_id.GetStopID(); }
1379 
1381 
1384  }
1385 
1387  return m_mod_id.GetLastNaturalStopID();
1388  }
1389 
1390  lldb::EventSP GetStopEventForStopID(uint32_t stop_id) const {
1391  return m_mod_id.GetStopEventForStopID(stop_id);
1392  }
1393 
1394  /// Set accessor for the process exit status (return code).
1395  ///
1396  /// Sometimes a child exits and the exit can be detected by global functions
1397  /// (signal handler for SIGCHLD for example). This accessor allows the exit
1398  /// status to be set from an external source.
1399  ///
1400  /// Setting this will cause a eStateExited event to be posted to the process
1401  /// event queue.
1402  ///
1403  /// \param[in] exit_status
1404  /// The value for the process's return code.
1405  ///
1406  /// \see lldb::StateType
1407  virtual bool SetExitStatus(int exit_status, const char *cstr);
1408 
1409  /// Check if a process is still alive.
1410  ///
1411  /// \return
1412  /// Returns \b true if the process is still valid, \b false
1413  /// otherwise.
1414  virtual bool IsAlive();
1415 
1416  virtual bool IsLiveDebugSession() const { return true; };
1417 
1418  /// Before lldb detaches from a process, it warns the user that they are
1419  /// about to lose their debug session. In some cases, this warning doesn't
1420  /// need to be emitted -- for instance, with core file debugging where the
1421  /// user can reconstruct the "state" by simply re-running the debugger on
1422  /// the core file.
1423  ///
1424  /// \return
1425  /// Returns \b true if the user should be warned about detaching from
1426  /// this process.
1427  virtual bool WarnBeforeDetach() const { return true; }
1428 
1429  /// Read of memory from a process.
1430  ///
1431  /// This function will read memory from the current process's address space
1432  /// and remove any traps that may have been inserted into the memory.
1433  ///
1434  /// This function is not meant to be overridden by Process subclasses, the
1435  /// subclasses should implement Process::DoReadMemory (lldb::addr_t, size_t,
1436  /// void *).
1437  ///
1438  /// \param[in] vm_addr
1439  /// A virtual load address that indicates where to start reading
1440  /// memory from.
1441  ///
1442  /// \param[out] buf
1443  /// A byte buffer that is at least \a size bytes long that
1444  /// will receive the memory bytes.
1445  ///
1446  /// \param[in] size
1447  /// The number of bytes to read.
1448  ///
1449  /// \param[out] error
1450  /// An error that indicates the success or failure of this
1451  /// operation. If error indicates success (error.Success()),
1452  /// then the value returned can be trusted, otherwise zero
1453  /// will be returned.
1454  ///
1455  /// \return
1456  /// The number of bytes that were actually read into \a buf. If
1457  /// the returned number is greater than zero, yet less than \a
1458  /// size, then this function will get called again with \a
1459  /// vm_addr, \a buf, and \a size updated appropriately. Zero is
1460  /// returned in the case of an error.
1461  virtual size_t ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
1462  Status &error);
1463 
1464  /// Read of memory from a process.
1465  ///
1466  /// This function has the same semantics of ReadMemory except that it
1467  /// bypasses caching.
1468  ///
1469  /// \param[in] vm_addr
1470  /// A virtual load address that indicates where to start reading
1471  /// memory from.
1472  ///
1473  /// \param[out] buf
1474  /// A byte buffer that is at least \a size bytes long that
1475  /// will receive the memory bytes.
1476  ///
1477  /// \param[in] size
1478  /// The number of bytes to read.
1479  ///
1480  /// \param[out] error
1481  /// An error that indicates the success or failure of this
1482  /// operation. If error indicates success (error.Success()),
1483  /// then the value returned can be trusted, otherwise zero
1484  /// will be returned.
1485  ///
1486  /// \return
1487  /// The number of bytes that were actually read into \a buf. If
1488  /// the returned number is greater than zero, yet less than \a
1489  /// size, then this function will get called again with \a
1490  /// vm_addr, \a buf, and \a size updated appropriately. Zero is
1491  /// returned in the case of an error.
1492  size_t ReadMemoryFromInferior(lldb::addr_t vm_addr, void *buf, size_t size,
1493  Status &error);
1494 
1495  /// Read a NULL terminated C string from memory
1496  ///
1497  /// This function will read a cache page at a time until the NULL
1498  /// C string terminator is found. It will stop reading if the NULL
1499  /// termination byte isn't found before reading \a cstr_max_len bytes, and
1500  /// the results are always guaranteed to be NULL terminated (at most
1501  /// cstr_max_len - 1 bytes will be read).
1502  size_t ReadCStringFromMemory(lldb::addr_t vm_addr, char *cstr,
1503  size_t cstr_max_len, Status &error);
1504 
1505  size_t ReadCStringFromMemory(lldb::addr_t vm_addr, std::string &out_str,
1506  Status &error);
1507 
1508  /// Reads an unsigned integer of the specified byte size from process
1509  /// memory.
1510  ///
1511  /// \param[in] load_addr
1512  /// A load address of the integer to read.
1513  ///
1514  /// \param[in] byte_size
1515  /// The size in byte of the integer to read.
1516  ///
1517  /// \param[in] fail_value
1518  /// The value to return if we fail to read an integer.
1519  ///
1520  /// \param[out] error
1521  /// An error that indicates the success or failure of this
1522  /// operation. If error indicates success (error.Success()),
1523  /// then the value returned can be trusted, otherwise zero
1524  /// will be returned.
1525  ///
1526  /// \return
1527  /// The unsigned integer that was read from the process memory
1528  /// space. If the integer was smaller than a uint64_t, any
1529  /// unused upper bytes will be zero filled. If the process
1530  /// byte order differs from the host byte order, the integer
1531  /// value will be appropriately byte swapped into host byte
1532  /// order.
1533  uint64_t ReadUnsignedIntegerFromMemory(lldb::addr_t load_addr,
1534  size_t byte_size, uint64_t fail_value,
1535  Status &error);
1536 
1537  int64_t ReadSignedIntegerFromMemory(lldb::addr_t load_addr, size_t byte_size,
1538  int64_t fail_value, Status &error);
1539 
1541 
1542  bool WritePointerToMemory(lldb::addr_t vm_addr, lldb::addr_t ptr_value,
1543  Status &error);
1544 
1545  /// Actually do the writing of memory to a process.
1546  ///
1547  /// \param[in] vm_addr
1548  /// A virtual load address that indicates where to start writing
1549  /// memory to.
1550  ///
1551  /// \param[in] buf
1552  /// A byte buffer that is at least \a size bytes long that
1553  /// contains the data to write.
1554  ///
1555  /// \param[in] size
1556  /// The number of bytes to write.
1557  ///
1558  /// \param[out] error
1559  /// An error value in case the memory write fails.
1560  ///
1561  /// \return
1562  /// The number of bytes that were actually written.
1563  virtual size_t DoWriteMemory(lldb::addr_t vm_addr, const void *buf,
1564  size_t size, Status &error) {
1565  error.SetErrorStringWithFormatv(
1566  "error: {0} does not support writing to processes", GetPluginName());
1567  return 0;
1568  }
1569 
1570  /// Write all or part of a scalar value to memory.
1571  ///
1572  /// The value contained in \a scalar will be swapped to match the byte order
1573  /// of the process that is being debugged. If \a size is less than the size
1574  /// of scalar, the least significant \a size bytes from scalar will be
1575  /// written. If \a size is larger than the byte size of scalar, then the
1576  /// extra space will be padded with zeros and the scalar value will be
1577  /// placed in the least significant bytes in memory.
1578  ///
1579  /// \param[in] vm_addr
1580  /// A virtual load address that indicates where to start writing
1581  /// memory to.
1582  ///
1583  /// \param[in] scalar
1584  /// The scalar to write to the debugged process.
1585  ///
1586  /// \param[in] size
1587  /// This value can be smaller or larger than the scalar value
1588  /// itself. If \a size is smaller than the size of \a scalar,
1589  /// the least significant bytes in \a scalar will be used. If
1590  /// \a size is larger than the byte size of \a scalar, then
1591  /// the extra space will be padded with zeros. If \a size is
1592  /// set to UINT32_MAX, then the size of \a scalar will be used.
1593  ///
1594  /// \param[out] error
1595  /// An error value in case the memory write fails.
1596  ///
1597  /// \return
1598  /// The number of bytes that were actually written.
1599  size_t WriteScalarToMemory(lldb::addr_t vm_addr, const Scalar &scalar,
1600  size_t size, Status &error);
1601 
1602  size_t ReadScalarIntegerFromMemory(lldb::addr_t addr, uint32_t byte_size,
1603  bool is_signed, Scalar &scalar,
1604  Status &error);
1605 
1606  /// Write memory to a process.
1607  ///
1608  /// This function will write memory to the current process's address space
1609  /// and maintain any traps that might be present due to software
1610  /// breakpoints.
1611  ///
1612  /// This function is not meant to be overridden by Process subclasses, the
1613  /// subclasses should implement Process::DoWriteMemory (lldb::addr_t,
1614  /// size_t, void *).
1615  ///
1616  /// \param[in] vm_addr
1617  /// A virtual load address that indicates where to start writing
1618  /// memory to.
1619  ///
1620  /// \param[in] buf
1621  /// A byte buffer that is at least \a size bytes long that
1622  /// contains the data to write.
1623  ///
1624  /// \param[in] size
1625  /// The number of bytes to write.
1626  ///
1627  /// \return
1628  /// The number of bytes that were actually written.
1629  // TODO: change this to take an ArrayRef<uint8_t>
1630  size_t WriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size,
1631  Status &error);
1632 
1633  /// Actually allocate memory in the process.
1634  ///
1635  /// This function will allocate memory in the process's address space. This
1636  /// can't rely on the generic function calling mechanism, since that
1637  /// requires this function.
1638  ///
1639  /// \param[in] size
1640  /// The size of the allocation requested.
1641  ///
1642  /// \return
1643  /// The address of the allocated buffer in the process, or
1644  /// LLDB_INVALID_ADDRESS if the allocation failed.
1645 
1646  virtual lldb::addr_t DoAllocateMemory(size_t size, uint32_t permissions,
1647  Status &error) {
1648  error.SetErrorStringWithFormatv(
1649  "error: {0} does not support allocating in the debug process",
1650  GetPluginName());
1651  return LLDB_INVALID_ADDRESS;
1652  }
1653 
1654  virtual Status WriteObjectFile(std::vector<ObjectFile::LoadableData> entries);
1655 
1656  /// The public interface to allocating memory in the process.
1657  ///
1658  /// This function will allocate memory in the process's address space. This
1659  /// can't rely on the generic function calling mechanism, since that
1660  /// requires this function.
1661  ///
1662  /// \param[in] size
1663  /// The size of the allocation requested.
1664  ///
1665  /// \param[in] permissions
1666  /// Or together any of the lldb::Permissions bits. The permissions on
1667  /// a given memory allocation can't be changed after allocation. Note
1668  /// that a block that isn't set writable can still be written on from
1669  /// lldb,
1670  /// just not by the process itself.
1671  ///
1672  /// \param[in,out] error
1673  /// An error object to fill in if things go wrong.
1674  /// \return
1675  /// The address of the allocated buffer in the process, or
1676  /// LLDB_INVALID_ADDRESS if the allocation failed.
1677  lldb::addr_t AllocateMemory(size_t size, uint32_t permissions, Status &error);
1678 
1679  /// The public interface to allocating memory in the process, this also
1680  /// clears the allocated memory.
1681  ///
1682  /// This function will allocate memory in the process's address space. This
1683  /// can't rely on the generic function calling mechanism, since that
1684  /// requires this function.
1685  ///
1686  /// \param[in] size
1687  /// The size of the allocation requested.
1688  ///
1689  /// \param[in] permissions
1690  /// Or together any of the lldb::Permissions bits. The permissions on
1691  /// a given memory allocation can't be changed after allocation. Note
1692  /// that a block that isn't set writable can still be written on from
1693  /// lldb,
1694  /// just not by the process itself.
1695  ///
1696  /// \param[in,out] error
1697  /// An error object to fill in if things go wrong.
1698  ///
1699  /// \return
1700  /// The address of the allocated buffer in the process, or
1701  /// LLDB_INVALID_ADDRESS if the allocation failed.
1702 
1703  lldb::addr_t CallocateMemory(size_t size, uint32_t permissions,
1704  Status &error);
1705 
1706  /// If this architecture and process supports memory tagging, return a tag
1707  /// manager that can be used to maniupulate those memory tags.
1708  ///
1709  /// \return
1710  /// Either a valid pointer to a tag manager or an error describing why one
1711  /// could not be provided.
1712  llvm::Expected<const MemoryTagManager *> GetMemoryTagManager();
1713 
1714  /// Read memory tags for the range addr to addr+len. It is assumed
1715  /// that this range has already been granule aligned.
1716  /// (see MemoryTagManager::MakeTaggedRange)
1717  ///
1718  /// This calls DoReadMemoryTags to do the target specific operations.
1719  ///
1720  /// \param[in] addr
1721  /// Start of memory range to read tags for.
1722  ///
1723  /// \param[in] len
1724  /// Length of memory range to read tags for (in bytes).
1725  ///
1726  /// \return
1727  /// If this architecture or process does not support memory tagging,
1728  /// an error saying so.
1729  /// If it does, either the memory tags or an error describing a
1730  /// failure to read or unpack them.
1731  virtual llvm::Expected<std::vector<lldb::addr_t>>
1732  ReadMemoryTags(lldb::addr_t addr, size_t len);
1733 
1734  /// Write memory tags for a range of memory.
1735  /// (calls DoWriteMemoryTags to do the target specific work)
1736  ///
1737  /// \param[in] addr
1738  /// The address to start writing tags from. It is assumed that this
1739  /// address is granule aligned.
1740  ///
1741  /// \param[in] len
1742  /// The size of the range to write tags for. It is assumed that this
1743  /// is some multiple of the granule size. This len can be different
1744  /// from (number of tags * granule size) in the case where you want
1745  /// lldb-server to repeat tags across the range.
1746  ///
1747  /// \param[in] tags
1748  /// Allocation tags to be written. Since lldb-server can repeat tags for a
1749  /// range, the number of tags doesn't have to match the number of granules
1750  /// in the range. (though most of the time it will)
1751  ///
1752  /// \return
1753  /// A Status telling you if the write succeeded or not.
1754  Status WriteMemoryTags(lldb::addr_t addr, size_t len,
1755  const std::vector<lldb::addr_t> &tags);
1756 
1757  /// Resolve dynamically loaded indirect functions.
1758  ///
1759  /// \param[in] address
1760  /// The load address of the indirect function to resolve.
1761  ///
1762  /// \param[out] error
1763  /// An error value in case the resolve fails.
1764  ///
1765  /// \return
1766  /// The address of the resolved function.
1767  /// LLDB_INVALID_ADDRESS if the resolution failed.
1768  virtual lldb::addr_t ResolveIndirectFunction(const Address *address,
1769  Status &error);
1770 
1771  /// Locate the memory region that contains load_addr.
1772  ///
1773  /// If load_addr is within the address space the process has mapped
1774  /// range_info will be filled in with the start and end of that range as
1775  /// well as the permissions for that range and range_info. GetMapped will
1776  /// return true.
1777  ///
1778  /// If load_addr is outside any mapped region then range_info will have its
1779  /// start address set to load_addr and the end of the range will indicate
1780  /// the start of the next mapped range or be set to LLDB_INVALID_ADDRESS if
1781  /// there are no valid mapped ranges between load_addr and the end of the
1782  /// process address space.
1783  ///
1784  /// GetMemoryRegionInfo calls DoGetMemoryRegionInfo. Override that function in
1785  /// process subclasses.
1786  ///
1787  /// \param[in] load_addr
1788  /// The load address to query the range_info for. May include non
1789  /// address bits, these will be removed by the the ABI plugin if there is
1790  /// one.
1791  ///
1792  /// \param[out] range_info
1793  /// An range_info value containing the details of the range.
1794  ///
1795  /// \return
1796  /// An error value.
1798  MemoryRegionInfo &range_info);
1799 
1800  /// Obtain all the mapped memory regions within this process.
1801  ///
1802  /// \param[out] region_list
1803  /// A vector to contain MemoryRegionInfo objects for all mapped
1804  /// ranges.
1805  ///
1806  /// \return
1807  /// An error value.
1808  virtual Status
1810 
1812  Status error;
1813  num = 0;
1814  error.SetErrorString("Process::GetWatchpointSupportInfo() not supported");
1815  return error;
1816  }
1817 
1818  virtual Status GetWatchpointSupportInfo(uint32_t &num, bool &after) {
1819  Status error;
1820  num = 0;
1821  after = true;
1822  error.SetErrorString("Process::GetWatchpointSupportInfo() not supported");
1823  return error;
1824  }
1825 
1826  lldb::ModuleSP ReadModuleFromMemory(const FileSpec &file_spec,
1827  lldb::addr_t header_addr,
1828  size_t size_to_read = 512);
1829 
1830  /// Attempt to get the attributes for a region of memory in the process.
1831  ///
1832  /// It may be possible for the remote debug server to inspect attributes for
1833  /// a region of memory in the process, such as whether there is a valid page
1834  /// of memory at a given address or whether that page is
1835  /// readable/writable/executable by the process.
1836  ///
1837  /// \param[in] load_addr
1838  /// The address of interest in the process.
1839  ///
1840  /// \param[out] permissions
1841  /// If this call returns successfully, this bitmask will have
1842  /// its Permissions bits set to indicate whether the region is
1843  /// readable/writable/executable. If this call fails, the
1844  /// bitmask values are undefined.
1845  ///
1846  /// \return
1847  /// Returns true if it was able to determine the attributes of the
1848  /// memory region. False if not.
1849  virtual bool GetLoadAddressPermissions(lldb::addr_t load_addr,
1850  uint32_t &permissions);
1851 
1852  /// Determines whether executing JIT-compiled code in this process is
1853  /// possible.
1854  ///
1855  /// \return
1856  /// True if execution of JIT code is possible; false otherwise.
1857  bool CanJIT();
1858 
1859  /// Sets whether executing JIT-compiled code in this process is possible.
1860  ///
1861  /// \param[in] can_jit
1862  /// True if execution of JIT code is possible; false otherwise.
1863  void SetCanJIT(bool can_jit);
1864 
1865  /// Determines whether executing function calls using the interpreter is
1866  /// possible for this process.
1867  ///
1868  /// \return
1869  /// True if possible; false otherwise.
1871 
1872  /// Sets whether executing function calls using the interpreter is possible
1873  /// for this process.
1874  ///
1875  /// \param[in] can_interpret_function_calls
1876  /// True if possible; false otherwise.
1877  void SetCanInterpretFunctionCalls(bool can_interpret_function_calls) {
1878  m_can_interpret_function_calls = can_interpret_function_calls;
1879  }
1880 
1881  /// Sets whether executing code in this process is possible. This could be
1882  /// either through JIT or interpreting.
1883  ///
1884  /// \param[in] can_run_code
1885  /// True if execution of code is possible; false otherwise.
1886  void SetCanRunCode(bool can_run_code);
1887 
1888  /// Actually deallocate memory in the process.
1889  ///
1890  /// This function will deallocate memory in the process's address space that
1891  /// was allocated with AllocateMemory.
1892  ///
1893  /// \param[in] ptr
1894  /// A return value from AllocateMemory, pointing to the memory you
1895  /// want to deallocate.
1896  ///
1897  /// \return
1898  /// \b true if the memory was deallocated, \b false otherwise.
1900  Status error;
1901  error.SetErrorStringWithFormatv(
1902  "error: {0} does not support deallocating in the debug process",
1903  GetPluginName());
1904  return error;
1905  }
1906 
1907  /// The public interface to deallocating memory in the process.
1908  ///
1909  /// This function will deallocate memory in the process's address space that
1910  /// was allocated with AllocateMemory.
1911  ///
1912  /// \param[in] ptr
1913  /// A return value from AllocateMemory, pointing to the memory you
1914  /// want to deallocate.
1915  ///
1916  /// \return
1917  /// \b true if the memory was deallocated, \b false otherwise.
1919 
1920  /// Get any available STDOUT.
1921  ///
1922  /// Calling this method is a valid operation only if all of the following
1923  /// conditions are true: 1) The process was launched, and not attached to.
1924  /// 2) The process was not launched with eLaunchFlagDisableSTDIO. 3) The
1925  /// process was launched without supplying a valid file path
1926  /// for STDOUT.
1927  ///
1928  /// Note that the implementation will probably need to start a read thread
1929  /// in the background to make sure that the pipe is drained and the STDOUT
1930  /// buffered appropriately, to prevent the process from deadlocking trying
1931  /// to write to a full buffer.
1932  ///
1933  /// Events will be queued indicating that there is STDOUT available that can
1934  /// be retrieved using this function.
1935  ///
1936  /// \param[out] buf
1937  /// A buffer that will receive any STDOUT bytes that are
1938  /// currently available.
1939  ///
1940  /// \param[in] buf_size
1941  /// The size in bytes for the buffer \a buf.
1942  ///
1943  /// \return
1944  /// The number of bytes written into \a buf. If this value is
1945  /// equal to \a buf_size, another call to this function should
1946  /// be made to retrieve more STDOUT data.
1947  virtual size_t GetSTDOUT(char *buf, size_t buf_size, Status &error);
1948 
1949  /// Get any available STDERR.
1950  ///
1951  /// Calling this method is a valid operation only if all of the following
1952  /// conditions are true: 1) The process was launched, and not attached to.
1953  /// 2) The process was not launched with eLaunchFlagDisableSTDIO. 3) The
1954  /// process was launched without supplying a valid file path
1955  /// for STDERR.
1956  ///
1957  /// Note that the implementation will probably need to start a read thread
1958  /// in the background to make sure that the pipe is drained and the STDERR
1959  /// buffered appropriately, to prevent the process from deadlocking trying
1960  /// to write to a full buffer.
1961  ///
1962  /// Events will be queued indicating that there is STDERR available that can
1963  /// be retrieved using this function.
1964  ///
1965  /// \param[in] buf
1966  /// A buffer that will receive any STDERR bytes that are
1967  /// currently available.
1968  ///
1969  /// \param[out] buf_size
1970  /// The size in bytes for the buffer \a buf.
1971  ///
1972  /// \return
1973  /// The number of bytes written into \a buf. If this value is
1974  /// equal to \a buf_size, another call to this function should
1975  /// be made to retrieve more STDERR data.
1976  virtual size_t GetSTDERR(char *buf, size_t buf_size, Status &error);
1977 
1978  /// Puts data into this process's STDIN.
1979  ///
1980  /// Calling this method is a valid operation only if all of the following
1981  /// conditions are true: 1) The process was launched, and not attached to.
1982  /// 2) The process was not launched with eLaunchFlagDisableSTDIO. 3) The
1983  /// process was launched without supplying a valid file path
1984  /// for STDIN.
1985  ///
1986  /// \param[in] buf
1987  /// A buffer that contains the data to write to the process's STDIN.
1988  ///
1989  /// \param[in] buf_size
1990  /// The size in bytes for the buffer \a buf.
1991  ///
1992  /// \return
1993  /// The number of bytes written into \a buf. If this value is
1994  /// less than \a buf_size, another call to this function should
1995  /// be made to write the rest of the data.
1996  virtual size_t PutSTDIN(const char *buf, size_t buf_size, Status &error) {
1997  error.SetErrorString("stdin unsupported");
1998  return 0;
1999  }
2000 
2001  /// Get any available profile data.
2002  ///
2003  /// \param[out] buf
2004  /// A buffer that will receive any profile data bytes that are
2005  /// currently available.
2006  ///
2007  /// \param[out] buf_size
2008  /// The size in bytes for the buffer \a buf.
2009  ///
2010  /// \return
2011  /// The number of bytes written into \a buf. If this value is
2012  /// equal to \a buf_size, another call to this function should
2013  /// be made to retrieve more profile data.
2014  virtual size_t GetAsyncProfileData(char *buf, size_t buf_size, Status &error);
2015 
2016  // Process Breakpoints
2018 
2020  Status error;
2021  error.SetErrorStringWithFormatv(
2022  "error: {0} does not support enabling breakpoints", GetPluginName());
2023  return error;
2024  }
2025 
2027  Status error;
2028  error.SetErrorStringWithFormatv(
2029  "error: {0} does not support disabling breakpoints", GetPluginName());
2030  return error;
2031  }
2032 
2033  // This is implemented completely using the lldb::Process API. Subclasses
2034  // don't need to implement this function unless the standard flow of read
2035  // existing opcode, write breakpoint opcode, verify breakpoint opcode doesn't
2036  // work for a specific process plug-in.
2038 
2039  // This is implemented completely using the lldb::Process API. Subclasses
2040  // don't need to implement this function unless the standard flow of
2041  // restoring original opcode in memory and verifying the restored opcode
2042  // doesn't work for a specific process plug-in.
2044 
2046 
2048 
2050 
2052 
2053  lldb::break_id_t CreateBreakpointSite(const lldb::BreakpointLocationSP &owner,
2054  bool use_hardware);
2055 
2057 
2059 
2060  // BreakpointLocations use RemoveOwnerFromBreakpointSite to remove themselves
2061  // from the owner's list of this breakpoint sites.
2063  lldb::user_id_t owner_loc_id,
2064  lldb::BreakpointSiteSP &bp_site_sp);
2065 
2066  // Process Watchpoints (optional)
2067  virtual Status EnableWatchpoint(Watchpoint *wp, bool notify = true);
2068 
2069  virtual Status DisableWatchpoint(Watchpoint *wp, bool notify = true);
2070 
2071  // Thread Queries
2072 
2073  /// Update the thread list.
2074  ///
2075  /// This method performs some general clean up before invoking
2076  /// \a DoUpdateThreadList, which should be implemented by each
2077  /// process plugin.
2078  ///
2079  /// \return
2080  /// \b true if the new thread list could be generated, \b false otherwise.
2081  bool UpdateThreadList(ThreadList &old_thread_list,
2082  ThreadList &new_thread_list);
2083 
2084  void UpdateThreadListIfNeeded();
2085 
2087 
2088  // When ExtendedBacktraces are requested, the HistoryThreads that are created
2089  // need an owner -- they're saved here in the Process. The threads in this
2090  // list are not iterated over - driver programs need to request the extended
2091  // backtrace calls starting from a root concrete thread one by one.
2093 
2095 
2096  uint32_t GetNextThreadIndexID(uint64_t thread_id);
2097 
2098  lldb::ThreadSP CreateOSPluginThread(lldb::tid_t tid, lldb::addr_t context);
2099 
2100  // Returns true if an index id has been assigned to a thread.
2101  bool HasAssignedIndexIDToThread(uint64_t sb_thread_id);
2102 
2103  // Given a thread_id, it will assign a more reasonable index id for display
2104  // to the user. If the thread_id has previously been assigned, the same index
2105  // id will be used.
2106  uint32_t AssignIndexIDToThread(uint64_t thread_id);
2107 
2108  // Queue Queries
2109 
2110  void UpdateQueueListIfNeeded();
2111 
2114  return m_queue_list;
2115  }
2116 
2119  return m_queue_list.Queues();
2120  }
2121 
2122  // Event Handling
2123  lldb::StateType GetNextEvent(lldb::EventSP &event_sp);
2124 
2125  // Returns the process state when it is stopped. If specified, event_sp_ptr
2126  // is set to the event which triggered the stop. If wait_always = false, and
2127  // the process is already stopped, this function returns immediately. If the
2128  // process is hijacked and use_run_lock is true (the default), then this
2129  // function releases the run lock after the stop. Setting use_run_lock to
2130  // false will avoid this behavior.
2133  lldb::EventSP *event_sp_ptr = nullptr,
2134  bool wait_always = true,
2135  lldb::ListenerSP hijack_listener = lldb::ListenerSP(),
2136  Stream *stream = nullptr, bool use_run_lock = true);
2137 
2139 
2140  /// Waits for the process state to be running within a given msec timeout.
2141  ///
2142  /// The main purpose of this is to implement an interlock waiting for
2143  /// HandlePrivateEvent to push an IOHandler.
2144  ///
2145  /// \param[in] timeout
2146  /// The maximum time length to wait for the process to transition to the
2147  /// eStateRunning state.
2148  void SyncIOHandler(uint32_t iohandler_id, const Timeout<std::micro> &timeout);
2149 
2151  lldb::EventSP &event_sp, const Timeout<std::micro> &timeout,
2152  lldb::ListenerSP
2153  hijack_listener); // Pass an empty ListenerSP to use builtin listener
2154 
2155  /// Centralize the code that handles and prints descriptions for process
2156  /// state changes.
2157  ///
2158  /// \param[in] event_sp
2159  /// The process state changed event
2160  ///
2161  /// \param[in] stream
2162  /// The output stream to get the state change description
2163  ///
2164  /// \param[in,out] pop_process_io_handler
2165  /// If this value comes in set to \b true, then pop the Process IOHandler
2166  /// if needed.
2167  /// Else this variable will be set to \b true or \b false to indicate if
2168  /// the process
2169  /// needs to have its process IOHandler popped.
2170  ///
2171  /// \return
2172  /// \b true if the event describes a process state changed event, \b false
2173  /// otherwise.
2174  static bool HandleProcessStateChangedEvent(const lldb::EventSP &event_sp,
2175  Stream *stream,
2176  bool &pop_process_io_handler);
2177 
2179 
2181  public:
2182  ProcessEventHijacker(Process &process, lldb::ListenerSP listener_sp)
2183  : m_process(process) {
2184  m_process.HijackProcessEvents(std::move(listener_sp));
2185  }
2186 
2188 
2189  private:
2191  };
2192 
2193  friend class ProcessEventHijacker;
2194  friend class ProcessProperties;
2195  /// If you need to ensure that you and only you will hear about some public
2196  /// event, then make a new listener, set to listen to process events, and
2197  /// then call this with that listener. Then you will have to wait on that
2198  /// listener explicitly for events (rather than using the GetNextEvent &
2199  /// WaitFor* calls above. Be sure to call RestoreProcessEvents when you are
2200  /// done.
2201  ///
2202  /// \param[in] listener_sp
2203  /// This is the new listener to whom all process events will be delivered.
2204  ///
2205  /// \return
2206  /// Returns \b true if the new listener could be installed,
2207  /// \b false otherwise.
2208  bool HijackProcessEvents(lldb::ListenerSP listener_sp);
2209 
2210  /// Restores the process event broadcasting to its normal state.
2211  ///
2212  void RestoreProcessEvents();
2213 
2215 
2217 
2218  const lldb::ABISP &GetABI();
2219 
2221 
2222  std::vector<LanguageRuntime *> GetLanguageRuntimes();
2223 
2225 
2226  bool IsPossibleDynamicValue(ValueObject &in_value);
2227 
2228  bool IsRunning() const;
2229 
2231  return m_dynamic_checkers_up.get();
2232  }
2233 
2234  void SetDynamicCheckers(DynamicCheckerFunctions *dynamic_checkers);
2235 
2236 /// Prune ThreadPlanStacks for unreported threads.
2237 ///
2238 /// \param[in] tid
2239 /// The tid whose Plan Stack we are seeking to prune.
2240 ///
2241 /// \return
2242 /// \b true if the TID is found or \b false if not.
2244 
2245 /// Prune ThreadPlanStacks for all unreported threads.
2246 void PruneThreadPlans();
2247 
2248  /// Find the thread plan stack associated with thread with \a tid.
2249  ///
2250  /// \param[in] tid
2251  /// The tid whose Plan Stack we are seeking.
2252  ///
2253  /// \return
2254  /// Returns a ThreadPlan if the TID is found or nullptr if not.
2256 
2257  /// Dump the thread plans associated with thread with \a tid.
2258  ///
2259  /// \param[in,out] strm
2260  /// The stream to which to dump the output
2261  ///
2262  /// \param[in] tid
2263  /// The tid whose Plan Stack we are dumping
2264  ///
2265  /// \param[in] desc_level
2266  /// How much detail to dump
2267  ///
2268  /// \param[in] internal
2269  /// If \b true dump all plans, if false only user initiated plans
2270  ///
2271  /// \param[in] condense_trivial
2272  /// If true, only dump a header if the plan stack is just the base plan.
2273  ///
2274  /// \param[in] skip_unreported_plans
2275  /// If true, only dump a plan if it is currently backed by an
2276  /// lldb_private::Thread *.
2277  ///
2278  /// \return
2279  /// Returns \b true if TID was found, \b false otherwise
2280  bool DumpThreadPlansForTID(Stream &strm, lldb::tid_t tid,
2281  lldb::DescriptionLevel desc_level, bool internal,
2282  bool condense_trivial, bool skip_unreported_plans);
2283 
2284  /// Dump all the thread plans for this process.
2285  ///
2286  /// \param[in,out] strm
2287  /// The stream to which to dump the output
2288  ///
2289  /// \param[in] desc_level
2290  /// How much detail to dump
2291  ///
2292  /// \param[in] internal
2293  /// If \b true dump all plans, if false only user initiated plans
2294  ///
2295  /// \param[in] condense_trivial
2296  /// If true, only dump a header if the plan stack is just the base plan.
2297  ///
2298  /// \param[in] skip_unreported_plans
2299  /// If true, skip printing all thread plan stacks that don't currently
2300  /// have a backing lldb_private::Thread *.
2301  void DumpThreadPlans(Stream &strm, lldb::DescriptionLevel desc_level,
2302  bool internal, bool condense_trivial,
2303  bool skip_unreported_plans);
2304 
2305  /// Call this to set the lldb in the mode where it breaks on new thread
2306  /// creations, and then auto-restarts. This is useful when you are trying
2307  /// to run only one thread, but either that thread or the kernel is creating
2308  /// new threads in the process. If you stop when the thread is created, you
2309  /// can immediately suspend it, and keep executing only the one thread you
2310  /// intend.
2311  ///
2312  /// \return
2313  /// Returns \b true if we were able to start up the notification
2314  /// \b false otherwise.
2315  virtual bool StartNoticingNewThreads() { return true; }
2316 
2317  /// Call this to turn off the stop & notice new threads mode.
2318  ///
2319  /// \return
2320  /// Returns \b true if we were able to start up the notification
2321  /// \b false otherwise.
2322  virtual bool StopNoticingNewThreads() { return true; }
2323 
2324  void SetRunningUserExpression(bool on);
2325  void SetRunningUtilityFunction(bool on);
2326 
2327  // lldb::ExecutionContextScope pure virtual functions
2328  lldb::TargetSP CalculateTarget() override;
2329 
2330  lldb::ProcessSP CalculateProcess() override { return shared_from_this(); }
2331 
2332  lldb::ThreadSP CalculateThread() override { return lldb::ThreadSP(); }
2333 
2334  lldb::StackFrameSP CalculateStackFrame() override {
2335  return lldb::StackFrameSP();
2336  }
2337 
2338  void CalculateExecutionContext(ExecutionContext &exe_ctx) override;
2339 
2340  void SetSTDIOFileDescriptor(int file_descriptor);
2341 
2342  // Add a permanent region of memory that should never be read or written to.
2343  // This can be used to ensure that memory reads or writes to certain areas of
2344  // memory never end up being sent to the DoReadMemory or DoWriteMemory
2345  // functions which can improve performance.
2346  void AddInvalidMemoryRegion(const LoadRange &region);
2347 
2348  // Remove a permanent region of memory that should never be read or written
2349  // to that was previously added with AddInvalidMemoryRegion.
2350  bool RemoveInvalidMemoryRange(const LoadRange &region);
2351 
2352  // If the setup code of a thread plan needs to do work that might involve
2353  // calling a function in the target, it should not do that work directly in
2354  // one of the thread plan functions (DidPush/WillResume) because such work
2355  // needs to be handled carefully. Instead, put that work in a
2356  // PreResumeAction callback, and register it with the process. It will get
2357  // done before the actual "DoResume" gets called.
2358 
2359  typedef bool(PreResumeActionCallback)(void *);
2360 
2361  void AddPreResumeAction(PreResumeActionCallback callback, void *baton);
2362 
2363  bool RunPreResumeActions();
2364 
2365  void ClearPreResumeActions();
2366 
2367  void ClearPreResumeAction(PreResumeActionCallback callback, void *baton);
2368 
2370 
2372 
2373  virtual Status SendEventData(const char *data) {
2374  Status return_error("Sending an event is not supported for this process.");
2375  return return_error;
2376  }
2377 
2378  lldb::ThreadCollectionSP GetHistoryThreads(lldb::addr_t addr);
2379 
2380  lldb::InstrumentationRuntimeSP
2382 
2383  /// Try to fetch the module specification for a module with the given file
2384  /// name and architecture. Process sub-classes have to override this method
2385  /// if they support platforms where the Platform object can't get the module
2386  /// spec for all module.
2387  ///
2388  /// \param[in] module_file_spec
2389  /// The file name of the module to get specification for.
2390  ///
2391  /// \param[in] arch
2392  /// The architecture of the module to get specification for.
2393  ///
2394  /// \param[out] module_spec
2395  /// The fetched module specification if the return value is
2396  /// \b true, unchanged otherwise.
2397  ///
2398  /// \return
2399  /// Returns \b true if the module spec fetched successfully,
2400  /// \b false otherwise.
2401  virtual bool GetModuleSpec(const FileSpec &module_file_spec,
2402  const ArchSpec &arch, ModuleSpec &module_spec);
2403 
2404  virtual void PrefetchModuleSpecs(llvm::ArrayRef<FileSpec> module_file_specs,
2405  const llvm::Triple &triple) {}
2406 
2407  /// Try to find the load address of a file.
2408  /// The load address is defined as the address of the first memory region
2409  /// what contains data mapped from the specified file.
2410  ///
2411  /// \param[in] file
2412  /// The name of the file whose load address we are looking for
2413  ///
2414  /// \param[out] is_loaded
2415  /// \b True if the file is loaded into the memory and false
2416  /// otherwise.
2417  ///
2418  /// \param[out] load_addr
2419  /// The load address of the file if it is loaded into the
2420  /// processes address space, LLDB_INVALID_ADDRESS otherwise.
2421  virtual Status GetFileLoadAddress(const FileSpec &file, bool &is_loaded,
2422  lldb::addr_t &load_addr) {
2423  return Status("Not supported");
2424  }
2425 
2426  size_t AddImageToken(lldb::addr_t image_ptr);
2427 
2428  lldb::addr_t GetImagePtrFromToken(size_t token) const;
2429 
2430  void ResetImageToken(size_t token);
2431 
2432  /// Find the next branch instruction to set a breakpoint on
2433  ///
2434  /// When instruction stepping through a source line, instead of stepping
2435  /// through each instruction, we can put a breakpoint on the next branch
2436  /// instruction (within the range of instructions we are stepping through)
2437  /// and continue the process to there, yielding significant performance
2438  /// benefits over instruction stepping.
2439  ///
2440  /// \param[in] default_stop_addr
2441  /// The address of the instruction where lldb would put a
2442  /// breakpoint normally.
2443  ///
2444  /// \param[in] range_bounds
2445  /// The range which the breakpoint must be contained within.
2446  /// Typically a source line.
2447  ///
2448  /// \return
2449  /// The address of the next branch instruction, or the end of
2450  /// the range provided in range_bounds. If there are any
2451  /// problems with the disassembly or getting the instructions,
2452  /// the original default_stop_addr will be returned.
2454  AddressRange range_bounds);
2455 
2456  /// Configure asynchronous structured data feature.
2457  ///
2458  /// Each Process type that supports using an asynchronous StructuredData
2459  /// feature should implement this to enable/disable/configure the feature.
2460  /// The default implementation here will always return an error indiciating
2461  /// the feature is unsupported.
2462  ///
2463  /// StructuredDataPlugin implementations will call this to configure a
2464  /// feature that has been reported as being supported.
2465  ///
2466  /// \param[in] type_name
2467  /// The StructuredData type name as previously discovered by
2468  /// the Process-derived instance.
2469  ///
2470  /// \param[in] config_sp
2471  /// Configuration data for the feature being enabled. This config
2472  /// data, which may be null, will be passed along to the feature
2473  /// to process. The feature will dictate whether this is a dictionary,
2474  /// an array or some other object. If the feature needs to be
2475  /// set up properly before it can be enabled, then the config should
2476  /// also take an enable/disable flag.
2477  ///
2478  /// \return
2479  /// Returns the result of attempting to configure the feature.
2480  virtual Status
2482  const StructuredData::ObjectSP &config_sp);
2483 
2484  /// Broadcasts the given structured data object from the given plugin.
2485  ///
2486  /// StructuredDataPlugin instances can use this to optionally broadcast any
2487  /// of their data if they want to make it available for clients. The data
2488  /// will come in on the structured data event bit
2489  /// (eBroadcastBitStructuredData).
2490  ///
2491  /// \param[in] object_sp
2492  /// The structured data object to broadcast.
2493  ///
2494  /// \param[in] plugin_sp
2495  /// The plugin that will be reported in the event's plugin
2496  /// parameter.
2497  void BroadcastStructuredData(const StructuredData::ObjectSP &object_sp,
2498  const lldb::StructuredDataPluginSP &plugin_sp);
2499 
2500  /// Returns the StructuredDataPlugin associated with a given type name, if
2501  /// there is one.
2502  ///
2503  /// There will only be a plugin for a given StructuredDataType if the
2504  /// debugged process monitor claims that the feature is supported. This is
2505  /// one way to tell whether a feature is available.
2506  ///
2507  /// \return
2508  /// The plugin if one is available for the specified feature;
2509  /// otherwise, returns an empty shared pointer.
2510  lldb::StructuredDataPluginSP
2511  GetStructuredDataPlugin(ConstString type_name) const;
2512 
2513 protected:
2514  friend class Trace;
2515 
2516  /// Construct with a shared pointer to a target, and the Process listener.
2517  /// Uses the Host UnixSignalsSP by default.
2518  Process(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp);
2519 
2520  /// Construct with a shared pointer to a target, the Process listener, and
2521  /// the appropriate UnixSignalsSP for the process.
2522  Process(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
2523  const lldb::UnixSignalsSP &unix_signals_sp);
2524 
2525  /// Get the processor tracing type supported for this process.
2526  /// Responses might be different depending on the architecture and
2527  /// capabilities of the underlying OS.
2528  ///
2529  /// \return
2530  /// The supported trace type or an \a llvm::Error if tracing is
2531  /// not supported for the inferior.
2532  virtual llvm::Expected<TraceSupportedResponse> TraceSupported();
2533 
2534  /// Start tracing a process or its threads.
2535  ///
2536  /// \param[in] request
2537  /// JSON object with the information necessary to start tracing. In the
2538  /// case of gdb-remote processes, this JSON object should conform to the
2539  /// jLLDBTraceStart packet.
2540  ///
2541  /// \return
2542  /// \a llvm::Error::success if the operation was successful, or
2543  /// \a llvm::Error otherwise.
2544  virtual llvm::Error TraceStart(const llvm::json::Value &request) {
2545  return llvm::make_error<UnimplementedError>();
2546  }
2547 
2548  /// Stop tracing a live process or its threads.
2549  ///
2550  /// \param[in] request
2551  /// The information determining which threads or process to stop tracing.
2552  ///
2553  /// \return
2554  /// \a llvm::Error::success if the operation was successful, or
2555  /// \a llvm::Error otherwise.
2556  virtual llvm::Error TraceStop(const TraceStopRequest &request) {
2557  return llvm::make_error<UnimplementedError>();
2558  }
2559 
2560  /// Get the current tracing state of the process and its threads.
2561  ///
2562  /// \param[in] type
2563  /// Tracing technology type to consider.
2564  ///
2565  /// \return
2566  /// A JSON object string with custom data depending on the trace
2567  /// technology, or an \a llvm::Error in case of errors.
2568  virtual llvm::Expected<std::string> TraceGetState(llvm::StringRef type) {
2569  return llvm::make_error<UnimplementedError>();
2570  }
2571 
2572  /// Get binary data given a trace technology and a data identifier.
2573  ///
2574  /// \param[in] request
2575  /// Object with the params of the requested data.
2576  ///
2577  /// \return
2578  /// A vector of bytes with the requested data, or an \a llvm::Error in
2579  /// case of failures.
2580  virtual llvm::Expected<std::vector<uint8_t>>
2582  return llvm::make_error<UnimplementedError>();
2583  }
2584 
2585  // This calls a function of the form "void * (*)(void)".
2586  bool CallVoidArgVoidPtrReturn(const Address *address,
2587  lldb::addr_t &returned_func,
2588  bool trap_exceptions = false);
2589 
2590  /// Update the thread list following process plug-in's specific logic.
2591  ///
2592  /// This method should only be invoked by \a UpdateThreadList.
2593  ///
2594  /// \return
2595  /// \b true if the new thread list could be generated, \b false otherwise.
2596  virtual bool DoUpdateThreadList(ThreadList &old_thread_list,
2597  ThreadList &new_thread_list) = 0;
2598 
2599  /// Actually do the reading of memory from a process.
2600  ///
2601  /// Subclasses must override this function and can return fewer bytes than
2602  /// requested when memory requests are too large. This class will break up
2603  /// the memory requests and keep advancing the arguments along as needed.
2604  ///
2605  /// \param[in] vm_addr
2606  /// A virtual load address that indicates where to start reading
2607  /// memory from.
2608  ///
2609  /// \param[in] size
2610  /// The number of bytes to read.
2611  ///
2612  /// \param[out] buf
2613  /// A byte buffer that is at least \a size bytes long that
2614  /// will receive the memory bytes.
2615  ///
2616  /// \param[out] error
2617  /// An error that indicates the success or failure of this
2618  /// operation. If error indicates success (error.Success()),
2619  /// then the value returned can be trusted, otherwise zero
2620  /// will be returned.
2621  ///
2622  /// \return
2623  /// The number of bytes that were actually read into \a buf.
2624  /// Zero is returned in the case of an error.
2625  virtual size_t DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
2626  Status &error) = 0;
2627 
2628  /// DoGetMemoryRegionInfo is called by GetMemoryRegionInfo after it has
2629  /// removed non address bits from load_addr. Override this method in
2630  /// subclasses of Process.
2631  ///
2632  /// See GetMemoryRegionInfo for details of the logic.
2633  ///
2634  /// \param[in] load_addr
2635  /// The load address to query the range_info for. (non address bits
2636  /// removed)
2637  ///
2638  /// \param[out] range_info
2639  /// An range_info value containing the details of the range.
2640  ///
2641  /// \return
2642  /// An error value.
2644  MemoryRegionInfo &range_info) {
2645  return Status("Process::DoGetMemoryRegionInfo() not supported");
2646  }
2647 
2649 
2650  /// The "private" side of resuming a process. This doesn't alter the state
2651  /// of m_run_lock, but just causes the process to resume.
2652  ///
2653  /// \return
2654  /// An Status object describing the success or failure of the resume.
2656 
2657  // Called internally
2658  void CompleteAttach();
2659 
2660  // NextEventAction provides a way to register an action on the next event
2661  // that is delivered to this process. There is currently only one next event
2662  // action allowed in the process at one time. If a new "NextEventAction" is
2663  // added while one is already present, the old action will be discarded (with
2664  // HandleBeingUnshipped called after it is discarded.)
2665  //
2666  // If you want to resume the process as a result of a resume action, call
2667  // RequestResume, don't call Resume directly.
2669  public:
2674  };
2675 
2676  NextEventAction(Process *process) : m_process(process) {}
2677 
2678  virtual ~NextEventAction() = default;
2679 
2680  virtual EventActionResult PerformAction(lldb::EventSP &event_sp) = 0;
2681  virtual void HandleBeingUnshipped() {}
2683  virtual const char *GetExitString() = 0;
2685 
2686  protected:
2688  };
2689 
2691  if (m_next_event_action_up.get())
2692  m_next_event_action_up->HandleBeingUnshipped();
2693 
2694  m_next_event_action_up.reset(next_event_action);
2695  }
2696 
2697  // This is the completer for Attaching:
2699  public:
2700  AttachCompletionHandler(Process *process, uint32_t exec_count);
2701 
2702  ~AttachCompletionHandler() override = default;
2703 
2704  EventActionResult PerformAction(lldb::EventSP &event_sp) override;
2706  const char *GetExitString() override;
2707 
2708  private:
2711  };
2712 
2715  return state != lldb::eStateInvalid && state != lldb::eStateDetached &&
2717  }
2718 
2720 
2721  /// Loads any plugins associated with asynchronous structured data and maps
2722  /// the relevant supported type name to the plugin.
2723  ///
2724  /// Processes can receive asynchronous structured data from the process
2725  /// monitor. This method will load and map any structured data plugins that
2726  /// support the given set of supported type names. Later, if any of these
2727  /// features are enabled, the process monitor is free to generate
2728  /// asynchronous structured data. The data must come in as a single \b
2729  /// StructuredData::Dictionary. That dictionary must have a string field
2730  /// named 'type', with a value that equals the relevant type name string
2731  /// (one of the values in \b supported_type_names).
2732  ///
2733  /// \param[in] supported_type_names
2734  /// An array of zero or more type names. Each must be unique.
2735  /// For each entry in the list, a StructuredDataPlugin will be
2736  /// searched for that supports the structured data type name.
2738  const StructuredData::Array &supported_type_names);
2739 
2740  /// Route the incoming structured data dictionary to the right plugin.
2741  ///
2742  /// The incoming structured data must be a dictionary, and it must have a
2743  /// key named 'type' that stores a string value. The string value must be
2744  /// the name of the structured data feature that knows how to handle it.
2745  ///
2746  /// \param[in] object_sp
2747  /// When non-null and pointing to a dictionary, the 'type'
2748  /// key's string value is used to look up the plugin that
2749  /// was registered for that structured data type. It then
2750  /// calls the following method on the StructuredDataPlugin
2751  /// instance:
2752  ///
2753  /// virtual void
2754  /// HandleArrivalOfStructuredData(Process &process,
2755  /// ConstString type_name,
2756  /// const StructuredData::ObjectSP
2757  /// &object_sp)
2758  ///
2759  /// \return
2760  /// True if the structured data was routed to a plugin; otherwise,
2761  /// false.
2762  bool RouteAsyncStructuredData(const StructuredData::ObjectSP object_sp);
2763 
2764  /// Check whether the process supports memory tagging.
2765  ///
2766  /// \return
2767  /// true if the process supports memory tagging,
2768  /// false otherwise.
2769  virtual bool SupportsMemoryTagging() { return false; }
2770 
2771  /// Does the final operation to read memory tags. E.g. sending a GDB packet.
2772  /// It assumes that ReadMemoryTags has checked that memory tagging is enabled
2773  /// and has expanded the memory range as needed.
2774  ///
2775  /// \param[in] addr
2776  /// Start of address range to read memory tags for.
2777  ///
2778  /// \param[in] len
2779  /// Length of the memory range to read tags for (in bytes).
2780  ///
2781  /// \param[in] type
2782  /// Type of tags to read (get this from a MemoryTagManager)
2783  ///
2784  /// \return
2785  /// The packed tag data received from the remote or an error
2786  /// if the read failed.
2787  virtual llvm::Expected<std::vector<uint8_t>>
2788  DoReadMemoryTags(lldb::addr_t addr, size_t len, int32_t type) {
2789  return llvm::createStringError(
2790  llvm::inconvertibleErrorCode(),
2791  llvm::formatv("{0} does not support reading memory tags",
2792  GetPluginName()));
2793  }
2794 
2795  /// Does the final operation to write memory tags. E.g. sending a GDB packet.
2796  /// It assumes that WriteMemoryTags has checked that memory tagging is enabled
2797  /// and has packed the tag data.
2798  ///
2799  /// \param[in] addr
2800  /// Start of address range to write memory tags for.
2801  ///
2802  /// \param[in] len
2803  /// Length of the memory range to write tags for (in bytes).
2804  ///
2805  /// \param[in] type
2806  /// Type of tags to read (get this from a MemoryTagManager)
2807  ///
2808  /// \param[in] tags
2809  /// Packed tags to be written.
2810  ///
2811  /// \return
2812  /// Status telling you whether the write succeeded.
2813  virtual Status DoWriteMemoryTags(lldb::addr_t addr, size_t len, int32_t type,
2814  const std::vector<uint8_t> &tags) {
2815  Status status;
2816  status.SetErrorStringWithFormatv("{0} does not support writing memory tags",
2817  GetPluginName());
2818  return status;
2819  }
2820 
2821  // Type definitions
2822  typedef std::map<lldb::LanguageType, lldb::LanguageRuntimeSP>
2824 
2826  bool (*callback)(void *);
2827  void *baton;
2829  void *in_baton)
2830  : callback(in_callback), baton(in_baton) {}
2832  return callback == rhs.callback && baton == rhs.baton;
2833  }
2834  };
2835 
2836  using StructuredDataPluginMap =
2837  std::map<ConstString, lldb::StructuredDataPluginSP>;
2838 
2839  // Member variables
2840  std::weak_ptr<Target> m_target_wp; ///< The target that owns this process.
2844  m_private_state; // The actual state of our process
2845  Broadcaster m_private_state_broadcaster; // This broadcaster feeds state
2846  // changed events into the private
2847  // state thread's listener.
2849  // broadcaster, used to
2850  // pause, resume & stop the
2851  // private state thread.
2852  lldb::ListenerSP m_private_state_listener_sp; // This is the listener for the
2853  // private state thread.
2854  HostThread m_private_state_thread; ///< Thread ID for the thread that watches
2855  ///internal state events
2856  ProcessModID m_mod_id; ///< Tracks the state of the process over stops and
2857  ///other alterations.
2858  uint32_t m_process_unique_id; ///< Each lldb_private::Process class that is
2859  ///created gets a unique integer ID that
2860  ///increments with each new instance
2861  uint32_t m_thread_index_id; ///< Each thread is created with a 1 based index
2862  ///that won't get re-used.
2863  std::map<uint64_t, uint32_t> m_thread_id_to_index_id_map;
2864  int m_exit_status; ///< The exit status of the process, or -1 if not set.
2865  std::string m_exit_string; ///< A textual description of why a process exited.
2866  std::mutex m_exit_status_mutex; ///< Mutex so m_exit_status m_exit_string can
2867  ///be safely accessed from multiple threads
2868  std::recursive_mutex m_thread_mutex;
2869  ThreadList m_thread_list_real; ///< The threads for this process as are known
2870  ///to the protocol we are debugging with
2871  ThreadList m_thread_list; ///< The threads for this process as the user will
2872  ///see them. This is usually the same as
2873  ///< m_thread_list_real, but might be different if there is an OS plug-in
2874  ///creating memory threads
2875  ThreadPlanStackMap m_thread_plans; ///< This is the list of thread plans for
2876  /// threads in m_thread_list, as well as
2877  /// threads we knew existed, but haven't
2878  /// determined that they have died yet.
2879  ThreadList m_extended_thread_list; ///< Owner for extended threads that may be
2880  ///generated, cleared on natural stops
2881  uint32_t m_extended_thread_stop_id; ///< The natural stop id when
2882  ///extended_thread_list was last updated
2883  QueueList
2884  m_queue_list; ///< The list of libdispatch queues at a given stop point
2885  uint32_t m_queue_list_stop_id; ///< The natural stop id when queue list was
2886  ///last fetched
2887  std::vector<Notifications> m_notifications; ///< The list of notifications
2888  ///that this process can deliver.
2889  std::vector<lldb::addr_t> m_image_tokens;
2890  lldb::ListenerSP m_listener_sp; ///< Shared pointer to the listener used for
2891  ///public events. Can not be empty.
2892  BreakpointSiteList m_breakpoint_site_list; ///< This is the list of breakpoint
2893  ///locations we intend to insert in
2894  ///the target.
2895  lldb::DynamicLoaderUP m_dyld_up;
2896  lldb::JITLoaderListUP m_jit_loaders_up;
2897  lldb::DynamicCheckerFunctionsUP m_dynamic_checkers_up; ///< The functions used
2898  /// by the expression
2899  /// parser to validate
2900  /// data that
2901  /// expressions use.
2902  lldb::OperatingSystemUP m_os_up;
2903  lldb::SystemRuntimeUP m_system_runtime_up;
2904  lldb::UnixSignalsSP
2905  m_unix_signals_sp; /// This is the current signal set for this process.
2906  lldb::ABISP m_abi_sp;
2907  lldb::IOHandlerSP m_process_input_reader;
2909  std::recursive_mutex m_stdio_communication_mutex;
2910  bool m_stdin_forward; /// Remember if stdin must be forwarded to remote debug
2911  /// server
2914  std::recursive_mutex m_profile_data_comm_mutex;
2915  std::vector<std::string> m_profile_data;
2919  bool m_should_detach; /// Should we detach if the process object goes away
2920  /// with an explicit call to Kill or Detach?
2922  std::recursive_mutex m_language_runtimes_mutex;
2924  std::unique_ptr<NextEventAction> m_next_event_action_up;
2925  std::vector<PreResumeCallbackAndBaton> m_pre_resume_actions;
2929  bool m_resume_requested; // If m_currently_handling_event or
2930  // m_currently_handling_do_on_removals are true,
2931  // Resume will only request a resume, using this
2932  // flag to check.
2933 
2934  /// This is set at the beginning of Process::Finalize() to stop functions
2935  /// from looking up or creating things during or after a finalize call.
2936  std::atomic<bool> m_finalizing;
2937 
2938  /// Mask for code an data addresses. The default value (0) means no mask is
2939  /// set. The bits set to 1 indicate bits that are NOT significant for
2940  /// addressing.
2941  /// @{
2944  /// @}
2945 
2948  lldb::StateType m_last_broadcast_state; /// This helps with the Public event
2949  /// coalescing in
2950  /// ShouldBroadcastEvent.
2951  std::map<lldb::addr_t, lldb::addr_t> m_resolved_indirect_addresses;
2953  bool m_can_interpret_function_calls; // Some targets, e.g the OSX kernel,
2954  // don't support the ability to modify
2955  // the stack.
2958 
2960 
2961  std::unique_ptr<UtilityFunction> m_dlopen_utility_func_up;
2963 
2964  size_t RemoveBreakpointOpcodesFromBuffer(lldb::addr_t addr, size_t size,
2965  uint8_t *buf) const;
2966 
2968 
2969  void SetPublicState(lldb::StateType new_state, bool restarted);
2970 
2971  void SetPrivateState(lldb::StateType state);
2972 
2973  bool StartPrivateStateThread(bool is_secondary_thread = false);
2974 
2975  void StopPrivateStateThread();
2976 
2977  void PausePrivateStateThread();
2978 
2979  void ResumePrivateStateThread();
2980 
2981 private:
2982  // The starts up the private state thread that will watch for events from the
2983  // debugee. Pass true for is_secondary_thread in the case where you have to
2984  // temporarily spin up a secondary state thread to handle events from a hand-
2985  // called function on the primary private state thread.
2986 
2987  lldb::thread_result_t RunPrivateStateThread(bool is_secondary_thread);
2988 
2989 protected:
2990  void HandlePrivateEvent(lldb::EventSP &event_sp);
2991 
2992  Status HaltPrivate();
2993 
2994  lldb::StateType WaitForProcessStopPrivate(lldb::EventSP &event_sp,
2995  const Timeout<std::micro> &timeout);
2996 
2997  // This waits for both the state change broadcaster, and the control
2998  // broadcaster. If control_only, it only waits for the control broadcaster.
2999 
3000  bool GetEventsPrivate(lldb::EventSP &event_sp,
3001  const Timeout<std::micro> &timeout, bool control_only);
3002 
3004  GetStateChangedEventsPrivate(lldb::EventSP &event_sp,
3005  const Timeout<std::micro> &timeout);
3006 
3007  size_t WriteMemoryPrivate(lldb::addr_t addr, const void *buf, size_t size,
3008  Status &error);
3009 
3010  void AppendSTDOUT(const char *s, size_t len);
3011 
3012  void AppendSTDERR(const char *s, size_t len);
3013 
3014  void BroadcastAsyncProfileData(const std::string &one_profile_data);
3015 
3016  static void STDIOReadThreadBytesReceived(void *baton, const void *src,
3017  size_t src_len);
3018 
3019  bool PushProcessIOHandler();
3020 
3021  bool PopProcessIOHandler();
3022 
3023  bool ProcessIOHandlerIsActive();
3024 
3025  bool ProcessIOHandlerExists() const {
3026  return static_cast<bool>(m_process_input_reader);
3027  }
3028 
3029  Status StopForDestroyOrDetach(lldb::EventSP &exit_event_sp);
3030 
3032 
3033  void LoadOperatingSystemPlugin(bool flush);
3034 
3035 private:
3036  Status DestroyImpl(bool force_kill);
3037 
3038  /// This is the part of the event handling that for a process event. It
3039  /// decides what to do with the event and returns true if the event needs to
3040  /// be propagated to the user, and false otherwise. If the event is not
3041  /// propagated, this call will most likely set the target to executing
3042  /// again. There is only one place where this call should be called,
3043  /// HandlePrivateEvent. Don't call it from anywhere else...
3044  ///
3045  /// \param[in] event_ptr
3046  /// This is the event we are handling.
3047  ///
3048  /// \return
3049  /// Returns \b true if the event should be reported to the
3050  /// user, \b false otherwise.
3051  bool ShouldBroadcastEvent(Event *event_ptr);
3052 
3053  void ControlPrivateStateThread(uint32_t signal);
3054 
3056  lldb::EventSP &event_sp);
3057 
3058  Process(const Process &) = delete;
3059  const Process &operator=(const Process &) = delete;
3060 };
3061 
3062 /// RAII guard that should be acquired when an utility function is called within
3063 /// a given process.
3066 
3067 public:
3069  if (m_process)
3071  }
3073  if (m_process)
3075  }
3076 };
3077 
3078 } // namespace lldb_private
3079 
3080 #endif // LLDB_TARGET_PROCESS_H
lldb_private::Process::ProcessEventData::m_interrupted
bool m_interrupted
Definition: Process.h:472
lldb_private::ProcessAttachInfo::SetDetachOnError
void SetDetachOnError(bool enable)
Definition: Process.h:184
lldb_private::Process::MapSupportedStructuredDataPlugins
void MapSupportedStructuredDataPlugins(const StructuredData::Array &supported_type_names)
Loads any plugins associated with asynchronous structured data and maps the relevant supported type n...
Definition: Process.cpp:5926
lldb_private::Process::IsValid
bool IsValid() const
Return whether this object is valid (i.e.
Definition: Process.h:558
lldb_private::Process::LoadModules
virtual llvm::Error LoadModules()
Sometimes processes know how to retrieve and load shared libraries.
Definition: Process.h:662
lldb_private::Process::AttachCompletionHandler::GetExitString
const char * GetExitString() override
Definition: Process.cpp:2752
lldb_private::ProcessModID::ProcessModID
ProcessModID()=default
lldb_private::ProcessModID::m_memory_id
uint32_t m_memory_id
Definition: Process.h:318
lldb_private::ProcessInstanceInfo
Definition: ProcessInfo.h:106
lldb_private::ProcessProperties::GetInterruptTimeout
std::chrono::seconds GetInterruptTimeout() const
Definition: Process.cpp:315
lldb_private::Process::StopLocker
ProcessRunLock::ProcessRunLocker StopLocker
Definition: Process.h:375
lldb_private::ProcessLaunchInfo::GetDetachOnError
bool GetDetachOnError() const
Definition: ProcessLaunchInfo.h:143
lldb_private::Process::operator=
const Process & operator=(const Process &)=delete
lldb_private::Process::m_process_unique_id
uint32_t m_process_unique_id
Each lldb_private::Process class that is created gets a unique integer ID that increments with each n...
Definition: Process.h:2858
lldb_private::UtilityFunctionScope::~UtilityFunctionScope
~UtilityFunctionScope()
Definition: Process.h:3072
lldb_private::Process::PrintWarningOptimization
void PrintWarningOptimization(const SymbolContext &sc)
Print a user-visible warning about a module being built with optimization.
Definition: Process.cpp:5743
lldb_private::Process::StartPrivateStateThread
bool StartPrivateStateThread(bool is_secondary_thread=false)
Definition: Process.cpp:3524
lldb_private::ProcessProperties::GetDisableMemoryCache
bool GetDisableMemoryCache() const
Definition: Process.cpp:190
lldb_private::Process::ProcessEventData::m_restarted_reasons
std::vector< std::string > m_restarted_reasons
Definition: Process.h:468
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::Process::m_can_interpret_function_calls
bool m_can_interpret_function_calls
Definition: Process.h:2953
lldb_private::Process::m_profile_data
std::vector< std::string > m_profile_data
Definition: Process.h:2915
lldb_private::ProcessProperties::SetOSPluginReportsAllThreads
void SetOSPluginReportsAllThreads(bool does_report)
Definition: Process.cpp:341
lldb_private::Process::m_public_state
ThreadSafeValue< lldb::StateType > m_public_state
Definition: Process.h:2842
lldb_private::Process::m_target_wp
std::weak_ptr< Target > m_target_wp
The target that owns this process.
Definition: Process.h:2840
lldb_private::ProcessModID::GetStopID
uint32_t GetStopID() const
Definition: Process.h:257
lldb_private::Process::GetShouldDetach
bool GetShouldDetach() const
Definition: Process.h:724
lldb_private::Process::GetThreadStatus
size_t GetThreadStatus(Stream &ostrm, bool only_threads_with_stop_reason, uint32_t start_frame, uint32_t num_frames, uint32_t num_frames_with_source, bool stop_format)
Definition: Process.cpp:5520
lldb_private::Process::AllocateMemory
lldb::addr_t AllocateMemory(size_t size, uint32_t permissions, Status &error)
The public interface to allocating memory in the process.
Definition: Process.cpp:2263
lldb_private::ArchSpec
Definition: ArchSpec.h:32
lldb_private::ProcessModID::SetStopEventForLastNaturalStopID
void SetStopEventForLastNaturalStopID(lldb::EventSP event_sp)
Definition: Process.h:304
lldb_private::ThreadSafeValue::GetValue
T GetValue() const
Definition: ThreadSafeValue.h:25
lldb_private::Process::GetOperatingSystem
OperatingSystem * GetOperatingSystem()
Definition: Process.h:2220
lldb_private::Process::NextEventAction::eEventActionRetry
@ eEventActionRetry
Definition: Process.h:2672
lldb_private::Process::DeallocateMemory
Status DeallocateMemory(lldb::addr_t ptr)
The public interface to deallocating memory in the process.
Definition: Process.cpp:2334
lldb_private::Process::GetStatus
void GetStatus(Stream &ostrm)
Definition: Process.cpp:5500
lldb_private::Process::m_should_detach
bool m_should_detach
Definition: Process.h:2919
lldb_private::Process::m_allocated_memory_cache
AllocatedMemoryCache m_allocated_memory_cache
Definition: Process.h:2918
lldb_private::Process::DidAttach
virtual void DidAttach(ArchSpec &process_arch)
Called after attaching a process.
Definition: Process.h:984
lldb_private::ProcessProperties::GetWarningsOptimization
bool GetWarningsOptimization() const
Definition: Process.cpp:290
lldb_private::Process::RefreshStateAfterStop
virtual void RefreshStateAfterStop()=0
Currently called as part of ShouldStop.
lldb_private::ProcessProperties::ProcessProperties
ProcessProperties(lldb_private::Process *process)
Definition: Process.cpp:159
lldb_private::Process::m_thread_list
ThreadList m_thread_list
The threads for this process as the user will see them.
Definition: Process.h:2871
lldb_private::Process::DestroyRequiresHalt
virtual bool DestroyRequiresHalt()
Definition: Process.h:1178
lldb_private::ProcessModID::SetInvalid
void SetInvalid()
Definition: Process.h:273
lldb_private::ProcessAttachInfo::SetResumeCount
void SetResumeCount(uint32_t c)
Definition: Process.h:147
lldb_private::Process::m_stdin_forward
bool m_stdin_forward
Definition: Process.h:2910
lldb_private::ProcessModID::IsValid
bool IsValid() const
Definition: Process.h:275
lldb_private::TraceGetBinaryDataRequest
jLLDBTraceGetBinaryData gdb-remote packet
Definition: TraceGDBRemotePackets.h:149
lldb_private::Process::PrivateStateThreadIsValid
bool PrivateStateThreadIsValid() const
Definition: Process.h:2713
lldb_private::Process::StopForDestroyOrDetach
Status StopForDestroyOrDetach(lldb::EventSP &exit_event_sp)
Definition: Process.cpp:3159
lldb_private::Process::eBroadcastBitInterrupt
@ eBroadcastBitInterrupt
Definition: Process.h:355
lldb_private::Event
Definition: Event.h:182
lldb_private::Process::ReadMemory
virtual size_t ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, Status &error)
Read of memory from a process.
Definition: Process.cpp:1922
lldb_private::QueueList::Queues
QueueIterable Queues()
Iterate over the list of queues.
Definition: QueueList.h:60
lldb_private::Process::SendAsyncInterrupt
void SendAsyncInterrupt()
Definition: Process.cpp:3644
lldb_private::Process::Process
Process(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp)
Construct with a shared pointer to a target, and the Process listener.
LLDB_INVALID_PROCESS_ID
#define LLDB_INVALID_PROCESS_ID
Definition: lldb-defines.h:81
lldb_private::Process::GetResumeID
uint32_t GetResumeID() const
Definition: Process.h:1380
lldb_private::Process::RemoveBreakpointOpcodesFromBuffer
size_t RemoveBreakpointOpcodesFromBuffer(lldb::addr_t addr, size_t size, uint8_t *buf) const
Definition: Process.cpp:1715
lldb_private::JITLoaderList
Definition: JITLoaderList.h:22
lldb_private::Process::m_memory_cache
MemoryCache m_memory_cache
Definition: Process.h:2917
lldb_private::Process::ProcessEventData::GetInterruptedFromEvent
static bool GetInterruptedFromEvent(const Event *event_ptr)
Definition: Process.cpp:4183
lldb_private::ProcessAttachInfo::m_resume_count
uint32_t m_resume_count
Definition: Process.h:199
lldb_private::Process::ProcessEventData::SetInterrupted
void SetInterrupted(bool new_value)
Definition: Process.h:460
lldb_private::Process::ReadScalarIntegerFromMemory
size_t ReadScalarIntegerFromMemory(lldb::addr_t addr, uint32_t byte_size, bool is_signed, Scalar &scalar, Status &error)
Definition: Process.cpp:2221
lldb_private::Process::ProcessEventData::GetStateFromEvent
static lldb::StateType GetStateFromEvent(const Event *event_ptr)
Definition: Process.cpp:4130
lldb_private::Process::DidVForkDone
virtual void DidVForkDone()
Called after reported vfork completion.
Definition: Process.h:1005
lldb_private::ProcessInstanceInfo::Clear
void Clear()
Definition: ProcessInfo.h:114
lldb_private::Process::ProcessIOHandlerExists
bool ProcessIOHandlerExists() const
Definition: Process.h:3025
lldb_private::StructuredData::Array
Definition: StructuredData.h:165
lldb_private::Process::SetRunningUserExpression
void SetRunningUserExpression(bool on)
Definition: Process.cpp:1473
lldb_private::HostThread
Definition: HostThread.h:29
lldb_private::ProcessAttachInfo::GetContinueOnceAttached
bool GetContinueOnceAttached() const
Definition: Process.h:141
lldb_private::Process::Notifications
A notification structure that can be used by clients to listen for changes in a process's lifetime.
Definition: Process.h:390
lldb_private::ProcessProperties::GetPythonOSPluginPath
FileSpec GetPythonOSPluginPath() const
Definition: Process.cpp:214
lldb_private::Process::GetJITLoaders
virtual JITLoaderList & GetJITLoaders()
Definition: Process.cpp:2666
StructuredData.h
lldb_private::Process::m_finalizing
std::atomic< bool > m_finalizing
This is set at the beginning of Process::Finalize() to stop functions from looking up or creating thi...
Definition: Process.h:2936
lldb_private::Process::GetBroadcasterClass
ConstString & GetBroadcasterClass() const override
This needs to be filled in if you are going to register the broadcaster with the broadcaster manager ...
Definition: Process.h:381
lldb_private::Process::GetEventsPrivate
bool GetEventsPrivate(lldb::EventSP &event_sp, const Timeout< std::micro > &timeout, bool control_only)
Definition: Process.cpp:1018
lldb_private::Process::DidSignal
virtual void DidSignal()
Called after sending a signal to a process.
Definition: Process.h:1184
lldb_private::UtilityFunctionScope::m_process
Process * m_process
Definition: Process.h:3065
lldb_private::Process::GetSystemArchitecture
virtual ArchSpec GetSystemArchitecture()
Get the system architecture for this process.
Definition: Process.h:690
lldb_private::Process::DoAllocateMemory
virtual lldb::addr_t DoAllocateMemory(size_t size, uint32_t permissions, Status &error)
Actually allocate memory in the process.
Definition: Process.h:1646
lldb_private::Predicate< uint32_t >
lldb_private::Process::m_private_state
ThreadSafeValue< lldb::StateType > m_private_state
Definition: Process.h:2844
lldb_private::Process::WillAttachToProcessWithName
Status WillAttachToProcessWithName(const char *process_name, bool wait_for_launch)
Called before attaching to a process.
Definition: Process.cpp:2773
lldb_private::Process::m_force_next_event_delivery
bool m_force_next_event_delivery
Definition: Process.h:2947
lldb_private::Process::m_extended_thread_stop_id
uint32_t m_extended_thread_stop_id
The natural stop id when extended_thread_list was last updated.
Definition: Process.h:2881
lldb_private::Process::GetExitDescription
const char * GetExitDescription()
Get a textual description of what the process exited.
Definition: Process.cpp:1043
lldb_private::ProcessModID::MemoryIDEqual
bool MemoryIDEqual(const ProcessModID &compare) const
Definition: Process.h:265
lldb_private::Process::GetPrivateState
lldb::StateType GetPrivateState()
Definition: Process.cpp:1411
lldb_private::Process::DoWriteMemoryTags
virtual Status DoWriteMemoryTags(lldb::addr_t addr, size_t len, int32_t type, const std::vector< uint8_t > &tags)
Does the final operation to write memory tags.
Definition: Process.h:2813
InstrumentationRuntime.h
lldb_private::Process::GetLastNaturalStopID
uint32_t GetLastNaturalStopID() const
Definition: Process.h:1386
lldb_private::Process::PrivateResume
Status PrivateResume()
The "private" side of resuming a process.
Definition: Process.cpp:3062
lldb::ExpressionResults
ExpressionResults
The results of expression evaluation.
Definition: lldb-enumerations.h:270
lldb_private::PluginInterface
Definition: PluginInterface.h:16
lldb_private::Process::m_iohandler_sync
Predicate< uint32_t > m_iohandler_sync
Definition: Process.h:2916
lldb_private::ProcessProperties::~ProcessProperties
~ProcessProperties() override
lldb_private::Process::EnableSoftwareBreakpoint
virtual Status EnableSoftwareBreakpoint(BreakpointSite *bp_site)
Definition: Process.cpp:1752
lldb_private::Process::ModulesDidLoad
virtual void ModulesDidLoad(ModuleList &module_list)
Definition: Process.cpp:5709
lldb_private::Process::PruneThreadPlans
void PruneThreadPlans()
Prune ThreadPlanStacks for all unreported threads.
Definition: Process.cpp:1234
lldb_private::Process::DumpThreadPlansForTID
bool DumpThreadPlansForTID(Stream &strm, lldb::tid_t tid, lldb::DescriptionLevel desc_level, bool internal, bool condense_trivial, bool skip_unreported_plans)
Dump the thread plans associated with thread with tid.
Definition: Process.cpp:1238
lldb_private::ProcessProperties::GetOSPluginReportsAllThreads
bool GetOSPluginReportsAllThreads() const
Definition: Process.cpp:328
ProcessLaunchInfo.h
lldb_private::Process::NextEventAction::eEventActionExit
@ eEventActionExit
Definition: Process.h:2673
lldb_private::Process::GetQueueList
QueueList & GetQueueList()
Definition: Process.h:2112
lldb_private::ProcessProperties::m_experimental_properties_up
std::unique_ptr< ProcessExperimentalProperties > m_experimental_properties_up
Definition: Process.h:106
lldb_private::Process::ProcessEventHijacker::ProcessEventHijacker
ProcessEventHijacker(Process &process, lldb::ListenerSP listener_sp)
Definition: Process.h:2182
lldb_private::Process::RemoveInvalidMemoryRange
bool RemoveInvalidMemoryRange(const LoadRange &region)
Definition: Process.cpp:5570
lldb_private::Process::m_last_broadcast_state
lldb::StateType m_last_broadcast_state
Definition: Process.h:2948
lldb_private::Process::GetModIDRef
const ProcessModID & GetModIDRef() const
Definition: Process.h:1376
lldb_private::Process::GetMemoryRegionInfo
Status GetMemoryRegionInfo(lldb::addr_t load_addr, MemoryRegionInfo &range_info)
Locate the memory region that contains load_addr.
Definition: Process.cpp:5874
lldb_private::ProcessModID::operator=
const ProcessModID & operator=(const ProcessModID &rhs)
Definition: Process.h:228
lldb_private::ProcessProperties::SetDisableLangRuntimeUnwindPlans
void SetDisableLangRuntimeUnwindPlans(bool disable)
Definition: Process.cpp:273
lldb_private::Process::GetStateChangedEventsPrivate
lldb::StateType GetStateChangedEventsPrivate(lldb::EventSP &event_sp, const Timeout< std::micro > &timeout)
Definition: Process.cpp:1000
lldb_private::Process::CanDebug
virtual bool CanDebug(lldb::TargetSP target, bool plugin_specified_by_name)=0
Check if a plug-in instance can debug the file in module.
lldb_private::Process::SetDynamicLoader
void SetDynamicLoader(lldb::DynamicLoaderUP dyld)
Definition: Process.cpp:2656
lldb_private::ProcessAttachInfo::m_plugin_name
std::string m_plugin_name
Definition: Process.h:198
lldb_private::Process::SetCodeAddressMask
void SetCodeAddressMask(lldb::addr_t code_address_mask)
Definition: Process.h:1362
lldb_private::ProcessProperties::GetUtilityExpressionTimeout
std::chrono::seconds GetUtilityExpressionTimeout() const
Definition: Process.cpp:308
lldb_private::Process::WillLaunch
Status WillLaunch(Module *module)
Called before launching to a process.
Definition: Process.cpp:2763
lldb_private::Process::ReadModuleFromMemory
lldb::ModuleSP ReadModuleFromMemory(const FileSpec &file_spec, lldb::addr_t header_addr, size_t size_to_read=512)
Definition: Process.cpp:2354
lldb_private::Process::SetDynamicCheckers
void SetDynamicCheckers(DynamicCheckerFunctions *dynamic_checkers)
Definition: Process.cpp:1558
lldb_private::Scalar
Definition: Scalar.h:34
lldb_private::Process::HaltPrivate
Status HaltPrivate()
Definition: Process.cpp:3763
lldb_private::Process::m_structured_data_plugin_map
StructuredDataPluginMap m_structured_data_plugin_map
Definition: Process.h:2957
lldb_private::Process::DidResume
virtual void DidResume()
Called after resuming a process.
Definition: Process.h:1082
lldb_private::Process
Definition: Process.h:338
lldb_private::Process::GetLoadedModuleList
virtual llvm::Expected< LoadedModuleInfoList > GetLoadedModuleList()
Query remote GDBServer for a detailed loaded library list.
Definition: Process.h:670
lldb_private::Process::NextEventAction::RequestResume
void RequestResume()
Definition: Process.h:2684
lldb_private::EventData
Definition: Event.h:36
lldb_private::Process::m_queue_list
QueueList m_queue_list
The list of libdispatch queues at a given stop point.
Definition: Process.h:2884
lldb_private::ProcessModID::BumpResumeID
void BumpResumeID()
Definition: Process.h:247
lldb_private::Process::ClearBreakpointSiteByID
Status ClearBreakpointSiteByID(lldb::user_id_t break_id)
Definition: Process.cpp:1577
lldb_private::Process::GetBreakpointSiteList
BreakpointSiteList & GetBreakpointSiteList()
Definition: Process.cpp:1562
lldb_private::Process::m_os_up
lldb::OperatingSystemUP m_os_up
Definition: Process.h:2902
lldb_private::Process::GetThreadList
ThreadList & GetThreadList()
Definition: Process.h:2086
lldb_private::Process::DoAttachToProcessWithID
virtual Status DoAttachToProcessWithID(lldb::pid_t pid, const ProcessAttachInfo &attach_info)
Attach to an existing process using a process ID.
Definition: Process.h:946
lldb_private::Process::GetMemoryRegions
virtual Status GetMemoryRegions(lldb_private::MemoryRegionInfos &region_list)
Obtain all the mapped memory regions within this process.
Definition: Process.cpp:5881
lldb_private::Process::GetTarget
Target & GetTarget()
Get the target object pointer for this module.
Definition: Process.h:1219
lldb_private::InstrumentationRuntimeCollection
std::map< lldb::InstrumentationRuntimeType, lldb::InstrumentationRuntimeSP > InstrumentationRuntimeCollection
Definition: InstrumentationRuntime.h:25
lldb_private::Process::m_language_runtimes
LanguageRuntimeCollection m_language_runtimes
Should we detach if the process object goes away with an explicit call to Kill or Detach?
Definition: Process.h:2921
lldb_private::Process::ConnectRemote
virtual Status ConnectRemote(llvm::StringRef remote_url)
Attach to a remote system via a URL.
Definition: Process.cpp:3030
lldb_private::EvaluateExpressionOptions
Definition: Target.h:277
lldb_private::ProcessRunLock::ProcessRunLocker
Definition: ProcessRunLock.h:36
lldb_private::Process::StopNoticingNewThreads
virtual bool StopNoticingNewThreads()
Call this to turn off the stop & notice new threads mode.
Definition: Process.h:2322
lldb_private::Process::AssignIndexIDToThread
uint32_t AssignIndexIDToThread(uint64_t thread_id)
Definition: Process.cpp:1281
lldb_private::ProcessProperties::SetStopOnSharedLibraryEvents
void SetStopOnSharedLibraryEvents(bool stop)
Definition: Process.cpp:262
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::Process::SetCanInterpretFunctionCalls
void SetCanInterpretFunctionCalls(bool can_interpret_function_calls)
Sets whether executing function calls using the interpreter is possible for this process.
Definition: Process.h:1877
lldb_private::ProcessAttachInfo::GetListener
lldb::ListenerSP GetListener() const
Definition: Process.h:187
BreakpointSiteList.h
lldb_private::Process::m_stderr_data
std::string m_stderr_data
Definition: Process.h:2913
lldb_private::Module
Definition: Module.h:85
lldb_private::Process::ReadSignedIntegerFromMemory
int64_t ReadSignedIntegerFromMemory(lldb::addr_t load_addr, size_t byte_size, int64_t fail_value, Status &error)
Definition: Process.cpp:2074
ProcessRunLock.h
lldb_private::SystemRuntime
Definition: SystemRuntime.h:43
lldb_private::Process::UpdateAutomaticSignalFiltering
virtual Status UpdateAutomaticSignalFiltering()
Definition: Process.cpp:6030
lldb_private::ProcessInfo::GetProcessID
lldb::pid_t GetProcessID() const
Definition: ProcessInfo.h:66
lldb_private::Process::GetStopEventForStopID
lldb::EventSP GetStopEventForStopID(uint32_t stop_id) const
Definition: Process.h:1390
Trace.h
lldb_private::Process::NextEventAction::PerformAction
virtual EventActionResult PerformAction(lldb::EventSP &event_sp)=0
lldb_private::ProcessProperties::GetUnwindOnErrorInExpressions
bool GetUnwindOnErrorInExpressions() const
Definition: Process.cpp:245
lldb_private::Process::ClearPreResumeAction
void ClearPreResumeAction(PreResumeActionCallback callback, void *baton)
Definition: Process.cpp:5594
lldb_private::Process::GetModID
ProcessModID GetModID() const
Get the Modification ID of the process.
Definition: Process.h:1374
lldb_private::Process::m_process_input_reader
lldb::IOHandlerSP m_process_input_reader
Definition: Process.h:2907
ThreadPlanStack.h
lldb_private::Process::DoDetach
virtual Status DoDetach(bool keep_stopped)
Detaches from a running or stopped process.
Definition: Process.h:1133
lldb_private::MemoryRegionInfo
Definition: MemoryRegionInfo.h:21
lldb_private::Process::DoConnectRemote
virtual Status DoConnectRemote(llvm::StringRef remote_url)
Attach to a remote system via a URL.
Definition: Process.h:926
lldb_private::Process::DoDidExec
virtual void DoDidExec()
Subclasses of Process should implement this function if they need to do anything after a process exec...
Definition: Process.h:996
lldb_private::Process::PreResumeCallbackAndBaton
Definition: Process.h:2825
lldb_private::Process::m_exit_status_mutex
std::mutex m_exit_status_mutex
Mutex so m_exit_status m_exit_string can be safely accessed from multiple threads.
Definition: Process.h:2866
lldb_private::Status::SetErrorStringWithFormatv
void SetErrorStringWithFormatv(const char *format, Args &&... args)
Definition: Status.h:173
lldb_private::Process::DoReadMemoryTags
virtual llvm::Expected< std::vector< uint8_t > > DoReadMemoryTags(lldb::addr_t addr, size_t len, int32_t type)
Does the final operation to read memory tags.
Definition: Process.h:2788
lldb_private::Process::IsAlive
virtual bool IsAlive()
Check if a process is still alive.
Definition: Process.cpp:1085
lldb_private::Process::m_dynamic_checkers_up
lldb::DynamicCheckerFunctionsUP m_dynamic_checkers_up
The functions used by the expression parser to validate data that expressions use.
Definition: Process.h:2897
lldb_private::Process::NextEventAction::~NextEventAction
virtual ~NextEventAction()=default
lldb_private::Process::DoHalt
virtual Status DoHalt(bool &caused_stop)
Halts a running process.
Definition: Process.h:1107
lldb_private::Process::TraceGetBinaryData
virtual llvm::Expected< std::vector< uint8_t > > TraceGetBinaryData(const TraceGetBinaryDataRequest &request)
Get binary data given a trace technology and a data identifier.
Definition: Process.h:2581
lldb_private::Process::AppendSTDERR
void AppendSTDERR(const char *s, size_t len)
Definition: Process.cpp:4245
lldb_private::Process::ProcessEventData::ProcessEventData
ProcessEventData()
Definition: Process.cpp:3904
lldb_private::Process::m_private_state_listener_sp
lldb::ListenerSP m_private_state_listener_sp
Definition: Process.h:2852
lldb_private::Process::eBroadcastInternalStateControlStop
@ eBroadcastInternalStateControlStop
Definition: Process.h:363
lldb_private::Process::m_can_jit
enum lldb_private::Process::@33 m_can_jit
lldb_private::ProcessProperties::GetDetachKeepsStopped
bool GetDetachKeepsStopped() const
Definition: Process.cpp:279
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Process::SetID
void SetID(lldb::pid_t new_pid)
Sets the stored pid.
Definition: Process.h:531
lldb_private::Process::ReadCStringFromMemory
size_t ReadCStringFromMemory(lldb::addr_t vm_addr, char *cstr, size_t cstr_max_len, Status &error)
Read a NULL terminated C string from memory.
Definition: Process.cpp:1988
lldb_private::Args
Definition: Args.h:33
lldb_private::Process::Halt
Status Halt(bool clear_thread_plans=false, bool use_run_lock=true)
Halts a running process.
Definition: Process.cpp:3118
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::Process::ProcessEventData::~ProcessEventData
~ProcessEventData() override
lldb_private::Process::m_unix_signals_sp
lldb::UnixSignalsSP m_unix_signals_sp
Definition: Process.h:2905
lldb_private::Process::GetRunLock
ProcessRunLock & GetRunLock()
Definition: Process.cpp:5604
lldb_private::Process::UpdateThreadList
bool UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)
Update the thread list.
Definition: Process.cpp:1133
lldb_private::Process::FindThreadPlans
ThreadPlanStack * FindThreadPlans(lldb::tid_t tid)
Find the thread plan stack associated with thread with tid.
Definition: Process.cpp:1226
lldb_private::Process::SetPrivateState
void SetPrivateState(lldb::StateType state)
Definition: Process.cpp:1413
lldb_private::ProcessProperties::SetUnwindOnErrorInExpressions
void SetUnwindOnErrorInExpressions(bool ignore)
Definition: Process.cpp:251
lldb_private::ProcessAttachInfo::m_async
bool m_async
Definition: Process.h:208
lldb_private::ProcessAttachInfo::SetListener
void SetListener(const lldb::ListenerSP &listener_sp)
Definition: Process.h:189
lldb_private::Process::ProcessEventData::AddRestartedReason
void AddRestartedReason(const char *reason)
Definition: Process.h:462
lldb_private::Process::WriteMemory
size_t WriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size, Status &error)
Write memory to a process.
Definition: Process.cpp:2121
lldb_private::Process::PopProcessIOHandler
bool PopProcessIOHandler()
Definition: Process.cpp:4530
lldb_private::Process::m_dlopen_utility_func_up
std::unique_ptr< UtilityFunction > m_dlopen_utility_func_up
Definition: Process.h:2961
lldb_private::ProcessAttachInfo::SetContinueOnceAttached
void SetContinueOnceAttached(bool b)
Definition: Process.h:143
Listener.h
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:469
lldb_private::Process::PrintWarningUnsupportedLanguage
void PrintWarningUnsupportedLanguage(const SymbolContext &sc)
Print a user-visible warning about a function written in a language that this version of LLDB doesn't...
Definition: Process.cpp:5751
lldb_private::Process::WillDetach
virtual Status WillDetach()
Called before detaching from a process.
Definition: Process.h:1126
lldb_private::Process::RestoreProcessEvents
void RestoreProcessEvents()
Restores the process event broadcasting to its normal state.
Definition: Process.cpp:954
lldb_private::Process::TraceStart
virtual llvm::Error TraceStart(const llvm::json::Value &request)
Start tracing a process or its threads.
Definition: Process.h:2544
lldb_private::ProcessModID::m_last_user_expression_resume
uint32_t m_last_user_expression_resume
Definition: Process.h:319
lldb_private::Process::SynchronouslyNotifyStateChanged
void SynchronouslyNotifyStateChanged(lldb::StateType state)
Definition: Process.cpp:594
lldb_private::Process::BroadcastAsyncProfileData
void BroadcastAsyncProfileData(const std::string &one_profile_data)
Definition: Process.cpp:4252
lldb_private::Process::WarnBeforeDetach
virtual bool WarnBeforeDetach() const
Before lldb detaches from a process, it warns the user that they are about to lose their debug sessio...
Definition: Process.h:1427
lldb_private::Process::RunPrivateStateThread
lldb::thread_result_t RunPrivateStateThread(bool is_secondary_thread)
Definition: Process.cpp:3777
lldb_private::PluginInterface::GetPluginName
virtual llvm::StringRef GetPluginName()=0
lldb_private::Process::ProcessEventData::GetInterrupted
bool GetInterrupted() const
Definition: Process.h:423
lldb_private::Process::LanguageRuntimeCollection
std::map< lldb::LanguageType, lldb::LanguageRuntimeSP > LanguageRuntimeCollection
Definition: Process.h:2823
lldb_private::Process::CallocateMemory
lldb::addr_t CallocateMemory(size_t size, uint32_t permissions, Status &error)
The public interface to allocating memory in the process, this also clears the allocated memory.
Definition: Process.cpp:2286
lldb_private::Process::GetAsyncProfileData
virtual size_t GetAsyncProfileData(char *buf, size_t buf_size, Status &error)
Get any available profile data.
Definition: Process.cpp:4275
lldb_private::Process::GetInstrumentationRuntime
lldb::InstrumentationRuntimeSP GetInstrumentationRuntime(lldb::InstrumentationRuntimeType type)
Definition: Process.cpp:5794
lldb_private::Process::PrefetchModuleSpecs
virtual void PrefetchModuleSpecs(llvm::ArrayRef< FileSpec > module_file_specs, const llvm::Triple &triple)
Definition: Process.h:2404
lldb_private::Process::DidExec
virtual void DidExec()
Called after a process re-execs itself.
Definition: Process.cpp:5645
lldb_private::Process::GetState
lldb::StateType GetState()
Get accessor for the current process state.
Definition: Process.cpp:1295
lldb_private::ProcessAttachInfo::SetProcessPluginName
void SetProcessPluginName(llvm::StringRef plugin)
Definition: Process.h:153
lldb_private::Process::Queues
QueueList::QueueIterable Queues()
Definition: Process.h:2117
lldb_private::Process::ReadMemoryFromInferior
size_t ReadMemoryFromInferior(lldb::addr_t vm_addr, void *buf, size_t size, Status &error)
Read of memory from a process.
Definition: Process.cpp:2034
lldb::eStateExited
@ eStateExited
Process has exited and can't be examined.
Definition: lldb-enumerations.h:90
lldb_private::Process::NextEventAction::m_process
Process * m_process
Definition: Process.h:2687
lldb_private::Process::GetIOHandlerID
uint32_t GetIOHandlerID() const
Definition: Process.h:2138
lldb_private::ProcessAttachInfo::GetListenerForProcess
lldb::ListenerSP GetListenerForProcess(Debugger &debugger)
Definition: Process.cpp:2756
lldb_private::Process::NextEventAction
Definition: Process.h:2668
lldb_private::ProcessAttachInfo::m_listener_sp
lldb::ListenerSP m_listener_sp
Definition: Process.h:196
lldb_private::Process::Signal
Status Signal(int signal)
Sends a process a UNIX signal signal.
Definition: Process.cpp:3342
Broadcaster.h
lldb_private::Process::CurrentThreadIsPrivateStateThread
bool CurrentThreadIsPrivateStateThread()
Definition: Process.cpp:5611
lldb_private::Process::CanJIT
bool CanJIT()
Determines whether executing JIT-compiled code in this process is possible.
Definition: Process.cpp:2296
lldb_private::ProcessModID::GetMemoryID
uint32_t GetMemoryID() const
Definition: Process.h:259
lldb_private::Process::SetRunningUtilityFunction
void SetRunningUtilityFunction(bool on)
Definition: Process.cpp:1477
lldb_private::Process::DestroyImpl
Status DestroyImpl(bool force_kill)
Definition: Process.cpp:3272
lldb_private::Process::DisableBreakpointSiteByID
Status DisableBreakpointSiteByID(lldb::user_id_t break_id)
Definition: Process.cpp:1586
lldb_private::Process::ProcessEventData::SetInterruptedInEvent
static void SetInterruptedInEvent(Event *event_ptr, bool new_value)
Definition: Process.cpp:4192
lldb_private::Process::HijackProcessEvents
bool HijackProcessEvents(lldb::ListenerSP listener_sp)
If you need to ensure that you and only you will hear about some public event, then make a new listen...
Definition: Process.cpp:946
lldb_private::Properties
Definition: UserSettingsController.h:33
lldb_private::Process::HandleProcessStateChangedEvent
static bool HandleProcessStateChangedEvent(const lldb::EventSP &event_sp, Stream *stream, bool &pop_process_io_handler)
Centralize the code that handles and prints descriptions for process state changes.
Definition: Process.cpp:715
lldb_private::ProcessProperties::GetFollowForkMode
FollowForkMode GetFollowForkMode() const
Definition: Process.cpp:351
lldb_private::Process::WriteMemoryPrivate
size_t WriteMemoryPrivate(lldb::addr_t addr, const void *buf, size_t size, Status &error)
Definition: Process.cpp:2105
lldb_private::Process::RouteAsyncStructuredData
bool RouteAsyncStructuredData(const StructuredData::ObjectSP object_sp)
Route the incoming structured data dictionary to the right plugin.
Definition: Process.cpp:6001
lldb_private::Trace
Definition: Trace.h:46
lldb_private::operator==
bool operator==(const Address &lhs, const Address &rhs)
Definition: Address.cpp:1016
lldb_private::LockingAdaptedIterable
Definition: Iterable.h:171
lldb_private::Process::DoUpdateThreadList
virtual bool DoUpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)=0
Update the thread list following process plug-in's specific logic.
lldb_private::FileSpec
Definition: FileSpec.h:55
lldb_private::Process::ResolveIndirectFunction
virtual lldb::addr_t ResolveIndirectFunction(const Address *address, Status &error)
Resolve dynamically loaded indirect functions.
Definition: Process.cpp:5679
lldb_private::ProcessAttachInfo::m_continue_once_attached
bool m_continue_once_attached
Definition: Process.h:202
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::Process::m_pid
lldb::pid_t m_pid
Definition: Process.h:2841
lldb_private::Process::TraceGetState
virtual llvm::Expected< std::string > TraceGetState(llvm::StringRef type)
Get the current tracing state of the process and its threads.
Definition: Process.h:2568
lldb_private::Process::m_notifications
std::vector< Notifications > m_notifications
The list of notifications that this process can deliver.
Definition: Process.h:2887
lldb_private::Process::ClearPreResumeActions
void ClearPreResumeActions()
Definition: Process.cpp:5592
lldb_private::Process::Flush
void Flush()
Flush all data in the process.
Definition: Process.cpp:5617
lldb_private::Process::HasAssignedIndexIDToThread
bool HasAssignedIndexIDToThread(uint64_t sb_thread_id)
Definition: Process.cpp:1276
lldb_private::Process::m_code_address_mask
lldb::addr_t m_code_address_mask
Mask for code an data addresses.
Definition: Process.h:2942
lldb_private::Process::eBroadcastInternalStateControlResume
@ eBroadcastInternalStateControlResume
Definition: Process.h:365
lldb_private::Process::DumpThreadPlans
void DumpThreadPlans(Stream &strm, lldb::DescriptionLevel desc_level, bool internal, bool condense_trivial, bool skip_unreported_plans)
Dump all the thread plans for this process.
Definition: Process.cpp:1245
lldb_private::Process::ShouldBroadcastEvent
bool ShouldBroadcastEvent(Event *event_ptr)
This is the part of the event handling that for a process event.
Definition: Process.cpp:3370
ProcessInfo.h
HostThread.h
lldb_private::Process::HandlePrivateEvent
void HandlePrivateEvent(lldb::EventSP &event_sp)
Definition: Process.cpp:3652
lldb_private::Process::CompleteAttach
void CompleteAttach()
Definition: Process.cpp:2900
lldb_private::Process::ProcessEventData::m_restarted
bool m_restarted
Definition: Process.h:469
lldb_private::Process::ProcessEventData::GetProcessSP
lldb::ProcessSP GetProcessSP() const
Definition: Process.h:410
lldb_private::Process::eBroadcastBitStateChanged
@ eBroadcastBitStateChanged
Definition: Process.h:354
lldb_private::Process::NextEventAction::GetExitString
virtual const char * GetExitString()=0
bool
lldb_private::Process::UnregisterNotificationCallbacks
bool UnregisterNotificationCallbacks(const Process::Notifications &callbacks)
Unregister for process and thread notifications.
Definition: Process.cpp:581
lldb_private::BreakpointSite
Definition: BreakpointSite.h:35
lldb_private::Process::m_stdio_communication
ThreadedCommunication m_stdio_communication
Definition: Process.h:2908
lldb_private::ProcessRunLock
Definition: ProcessRunLock.h:25
lldb_private::Process::CallVoidArgVoidPtrReturn
bool CallVoidArgVoidPtrReturn(const Address *address, lldb::addr_t &returned_func, bool trap_exceptions=false)
Definition: Process.cpp:6053
ThreadSafeValue.h
lldb_private::ProcessProperties::SetPythonOSPluginPath
void SetPythonOSPluginPath(const FileSpec &file)
Definition: Process.cpp:229
lldb_private::Process::GetDynamicCheckers
DynamicCheckerFunctions * GetDynamicCheckers()
Definition: Process.h:2230
lldb_private::Process::ProcessEventData::m_state
lldb::StateType m_state
Definition: Process.h:467
lldb_private::Process::Threads
ThreadList::ThreadIterable Threads()
Definition: Process.h:2094
lldb_private::Process::GetSoftwareBreakpointTrapOpcode
size_t GetSoftwareBreakpointTrapOpcode(BreakpointSite *bp_site)
Definition: Process.cpp:1745
lldb_private::ProcessProperties::GetWarningsUnsupportedLanguage
bool GetWarningsUnsupportedLanguage() const
Definition: Process.cpp:296
lldb_private::ProcessLaunchInfo
Definition: ProcessLaunchInfo.h:31
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::ModuleList
Definition: ModuleList.h:82
lldb_private::Process::IsLiveDebugSession
virtual bool IsLiveDebugSession() const
Definition: Process.h:1416
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::Process::LoadOperatingSystemPlugin
void LoadOperatingSystemPlugin(bool flush)
Definition: Process.cpp:2433
lldb_private::ProcessModID::SetRunningUtilityFunction
void SetRunningUtilityFunction(bool on)
Definition: Process.h:293
lldb_private::ProcessAttachInfo::Clear
void Clear()
Definition: Process.h:157
lldb_private::Process::ProcessEventData::GetEventDataFromEvent
static const Process::ProcessEventData * GetEventDataFromEvent(const Event *event_ptr)
Definition: Process.cpp:4111
lldb_private::Process::DoWillAttachToProcessWithName
virtual Status DoWillAttachToProcessWithName(const char *process_name, bool wait_for_launch)
Called before attaching to a process.
Definition: Process.h:914
lldb_private::ProcessProperties::GetIgnoreBreakpointsInExpressions
bool GetIgnoreBreakpointsInExpressions() const
Definition: Process.cpp:234
lldb_private::Process::STDIOReadThreadBytesReceived
static void STDIOReadThreadBytesReceived(void *baton, const void *src, size_t src_len)
Definition: Process.cpp:4338
lldb_private::Process::TraceStop
virtual llvm::Error TraceStop(const TraceStopRequest &request)
Stop tracing a live process or its threads.
Definition: Process.h:2556
lldb_private::Process::DoDestroy
virtual Status DoDestroy()=0
lldb_private::Process::TraceSupported
virtual llvm::Expected< TraceSupportedResponse > TraceSupported()
Get the processor tracing type supported for this process.
Definition: Process.cpp:6046
lldb_private::ProcessModID::m_last_natural_stop_event
lldb::EventSP m_last_natural_stop_event
Definition: Process.h:322
lldb_private::Process::SetDataAddressMask
void SetDataAddressMask(lldb::addr_t data_address_mask)
Definition: Process.h:1366
lldb_private::Process::DisableSoftwareBreakpoint
virtual Status DisableSoftwareBreakpoint(BreakpointSite *bp_site)
Definition: Process.cpp:1828
UnimplementedError.h
lldb_private::Process::StructuredDataPluginMap
std::map< ConstString, lldb::StructuredDataPluginSP > StructuredDataPluginMap
Definition: Process.h:2837
lldb_private::Process::m_exit_status
int m_exit_status
The exit status of the process, or -1 if not set.
Definition: Process.h:2864
lldb_private::Process::ForceNextEventDelivery
void ForceNextEventDelivery()
Definition: Process.h:2719
lldb_private::Watchpoint
Definition: Watchpoint.h:24
lldb_private::Process::NextEventAction::NextEventAction
NextEventAction(Process *process)
Definition: Process.h:2676
lldb_private::Process::GetLoadedDynamicLibrariesInfos
virtual lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos(lldb::addr_t image_list_address, lldb::addr_t image_count)
Retrieve the list of shared libraries that are loaded for this process This method is used on pre-mac...
Definition: Process.h:1295
NameMatches.h
lldb_private::Process::IsRunning
bool IsRunning() const
Definition: Process.cpp:1031
lldb_private::Process::GetCodeAddressMask
lldb::addr_t GetCodeAddressMask()
Definition: Process.cpp:5625
lldb_private::Process::ProcessEventData::GetFlavorString
static ConstString GetFlavorString()
Definition: Process.cpp:3915
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb_private::Process::EnableBreakpointSiteByID
Status EnableBreakpointSiteByID(lldb::user_id_t break_id)
Definition: Process.cpp:1600
lldb_private::Process::m_dyld_up
lldb::DynamicLoaderUP m_dyld_up
Definition: Process.h:2895
lldb_private::Process::ProcessEventData
Definition: Process.h:397
lldb_private::Process::m_mod_id
ProcessModID m_mod_id
Tracks the state of the process over stops and other alterations.
Definition: Process.h:2856
lldb_private::Process::ExecutionResultAsCString
static const char * ExecutionResultAsCString(lldb::ExpressionResults result)
Definition: Process.cpp:5463
lldb_private::Process::eBroadcastBitStructuredData
@ eBroadcastBitStructuredData
Definition: Process.h:359
lldb_private::Process::SetExitStatus
virtual bool SetExitStatus(int exit_status, const char *cstr)
Set accessor for the process exit status (return code).
Definition: Process.cpp:1051
lldb_private::Process::ProcessEventData::GetProcessFromEvent
static lldb::ProcessSP GetProcessFromEvent(const Event *event_ptr)
Definition: Process.cpp:4122
lldb_private::MemoryRegionInfos
Definition: MemoryRegionInfo.h:172
lldb_private::ProcessProperties::GetStopOnExec
bool GetStopOnExec() const
Definition: Process.cpp:302
lldb_private::Process::ConfigureStructuredData
virtual Status ConfigureStructuredData(ConstString type_name, const StructuredData::ObjectSP &config_sp)
Configure asynchronous structured data feature.
Definition: Process.cpp:5918
lldb_private::ProcessModID::m_stop_id
uint32_t m_stop_id
Definition: Process.h:315
lldb_private::Process::PreResumeCallbackAndBaton::callback
bool(* callback)(void *)
Definition: Process.h:2826
lldb_private::ThreadPlanStackMap
Definition: ThreadPlanStack.h:116
lldb_private::Process::Finalize
virtual void Finalize()
This object is about to be destroyed, do any necessary cleanup.
Definition: Process.cpp:512
lldb_private::Process::SupportsMemoryTagging
virtual bool SupportsMemoryTagging()
Check whether the process supports memory tagging.
Definition: Process.h:2769
lldb_private::Process::ProcessEventData::m_update_state
int m_update_state
Definition: Process.h:471
lldb::break_id_t
int32_t break_id_t
Definition: lldb-types.h:88
lldb_private::ProcessAttachInfo::SetAsync
void SetAsync(bool b)
Definition: Process.h:135
lldb_private::Process::ProcessEventData::GetRestartedFromEvent
static bool GetRestartedFromEvent(const Event *event_ptr)
Definition: Process.cpp:4138
lldb_private::Process::GetHostMacCatalystVersion
virtual llvm::VersionTuple GetHostMacCatalystVersion()
Definition: Process.h:1212
lldb_private::Process::GetNextThreadIndexID
uint32_t GetNextThreadIndexID(uint64_t thread_id)
Definition: Process.cpp:1272
lldb_private::Process::RemoveOwnerFromBreakpointSite
void RemoveOwnerFromBreakpointSite(lldb::user_id_t owner_id, lldb::user_id_t owner_loc_id, lldb::BreakpointSiteSP &bp_site_sp)
Definition: Process.cpp:1703
lldb_private::Process::GetAddressByteSize
uint32_t GetAddressByteSize() const
Definition: Process.cpp:3366
lldb_private::ThreadList
Definition: ThreadList.h:26
lldb_private::Process::AddPreResumeAction
void AddPreResumeAction(PreResumeActionCallback callback, void *baton)
Definition: Process.cpp:5575
lldb_private::ConstString
Definition: ConstString.h:39
lldb_private::Process::Destroy
Status Destroy(bool force_kill)
Kills the process and shuts down all threads that were spawned to track and monitor the process.
Definition: Process.cpp:3264
lldb_private::Process::SaveCore
virtual llvm::Expected< bool > SaveCore(llvm::StringRef outfile)
Save core dump into the specified file.
Definition: Process.cpp:2662
lldb_private::Process::ProcessEventData::GetState
lldb::StateType GetState() const
Definition: Process.h:412
lldb_private::Process::GetAuxvData
virtual DataExtractor GetAuxvData()
Definition: Process.cpp:2660
lldb_private::Process::DoReadMemory
virtual size_t DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, Status &error)=0
Actually do the reading of memory from a process.
lldb_private::ThreadCollection::Threads
virtual ThreadIterable Threads()
Definition: ThreadCollection.h:46
lldb_private::Process::SetProcessExitStatus
static bool SetProcessExitStatus(lldb::pid_t pid, bool exited, int signo, int status)
Static function that can be used with the host function Host::StartMonitoringChildProcess ().
Definition: Process.cpp:1105
lldb_private::AddressRange
Definition: AddressRange.h:25
lldb_private::Process::m_next_event_action_up
std::unique_ptr< NextEventAction > m_next_event_action_up
Definition: Process.h:2924
lldb_private::ProcessProperties::GetSteppingRunsAllThreads
bool GetSteppingRunsAllThreads() const
Definition: Process.cpp:322
lldb_private::Process::UpdateThreadListIfNeeded
void UpdateThreadListIfNeeded()
Definition: Process.cpp:1139
lldb_private::Process::m_queue_list_stop_id
uint32_t m_queue_list_stop_id
The natural stop id when queue list was last fetched.
Definition: Process.h:2885
lldb_private::Process::m_run_thread_plan_lock
std::mutex m_run_thread_plan_lock
Definition: Process.h:2956
lldb_private::ProcessModID::GetLastNaturalStopID
uint32_t GetLastNaturalStopID() const
Definition: Process.h:258
lldb_private::Process::m_abi_sp
lldb::ABISP m_abi_sp
This is the current signal set for this process.
Definition: Process.h:2906
lldb_private::Process::m_public_run_lock
ProcessRunLock m_public_run_lock
Definition: Process.h:2926
lldb_private::OperatingSystem
Definition: OperatingSystem.h:27
PluginInterface.h
lldb_private::Range
Definition: Process.h:61
lldb_private::Process::GetGlobalProperties
static ProcessProperties & GetGlobalProperties()
Definition: Process.cpp:504
lldb_private::ProcessLaunchInfo::GetListener
lldb::ListenerSP GetListener() const
Definition: ProcessLaunchInfo.h:125
lldb_private::DynamicLoader
Definition: DynamicLoader.h:52
lldb::eStateDetached
@ eStateDetached
Process has been detached and can't be examined.
Definition: lldb-enumerations.h:89
lldb_private::Process::PutSTDIN
virtual size_t PutSTDIN(const char *buf, size_t buf_size, Status &error)
Puts data into this process's STDIN.
Definition: Process.h:1996
lldb_private::Process::eBroadcastBitSTDERR
@ eBroadcastBitSTDERR
Definition: Process.h:357
lldb_private::Process::eBroadcastBitProfileData
@ eBroadcastBitProfileData
Definition: Process.h:358
lldb_private::Process::AttachCompletionHandler::HandleBeingInterrupted
EventActionResult HandleBeingInterrupted() override
Definition: Process.cpp:2748
lldb_private::Process::GetMemoryTagManager
llvm::Expected< const MemoryTagManager * > GetMemoryTagManager()
If this architecture and process supports memory tagging, return a tag manager that can be used to ma...
Definition: Process.cpp:6108
lldb_private::Process::Attach
virtual Status Attach(ProcessAttachInfo &attach_info)
Attach to an existing process using the process attach info.
Definition: Process.cpp:2779
lldb_private::ProcessAttachInfo::SetHijackListener
void SetHijackListener(const lldb::ListenerSP &listener_sp)
Definition: Process.h:178
lldb_private::Process::m_thread_mutex
std::recursive_mutex m_thread_mutex
Definition: Process.h:2868
lldb_private::Process::m_dlopen_utility_func_flag_once
llvm::once_flag m_dlopen_utility_func_flag_once
Definition: Process.h:2962
lldb_private::Process::m_private_state_thread
HostThread m_private_state_thread
Thread ID for the thread that watches internal state events.
Definition: Process.h:2854
lldb_private::Debugger
Definition: Debugger.h:74
lldb_private::Process::GetHistoryThreads
lldb::ThreadCollectionSP GetHistoryThreads(lldb::addr_t addr)
Definition: Process.cpp:5777
lldb_private::Process::ResumeSynchronous
Status ResumeSynchronous(Stream *stream)
Definition: Process.cpp:1357
lldb_private::Process::PruneThreadPlansForTID
bool PruneThreadPlansForTID(lldb::tid_t tid)
Prune ThreadPlanStacks for unreported threads.
Definition: Process.cpp:1230
lldb_private::Process::StartNoticingNewThreads
virtual bool StartNoticingNewThreads()
Call this to set the lldb in the mode where it breaks on new thread creations, and then auto-restarts...
Definition: Process.h:2315
lldb_private::LanguageRuntime
Definition: LanguageRuntime.h:60
ThreadList.h
lldb_private::Process::WillResume
virtual Status WillResume()
Called before resuming to a process.
Definition: Process.h:1055
lldb_private::Process::GetDynamicLoader
virtual DynamicLoader * GetDynamicLoader()
Get the dynamic loader plug-in for this process.
Definition: Process.cpp:2650
lldb_private::Process::m_currently_handling_do_on_removals
bool m_currently_handling_do_on_removals
Definition: Process.h:2928
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::ProcessModID::m_running_utility_function
uint32_t m_running_utility_function
Definition: Process.h:321
lldb_private::Process::AttachCompletionHandler::~AttachCompletionHandler
~AttachCompletionHandler() override=default
lldb_private::ProcessModID::BumpStopID
uint32_t BumpStopID()
Definition: Process.h:238
lldb_private::Process::ProcessEventData::GetRestarted
bool GetRestarted() const
Definition: Process.h:413
lldb_private::ProcessAttachInfo::GetAsync
bool GetAsync() const
Definition: Process.h:133
lldb_private::Process::DoGetMemoryRegionInfo
virtual Status DoGetMemoryRegionInfo(lldb::addr_t load_addr, MemoryRegionInfo &range_info)
DoGetMemoryRegionInfo is called by GetMemoryRegionInfo after it has removed non address bits from loa...
Definition: Process.h:2643
lldb_private::Process::m_exit_string
std::string m_exit_string
A textual description of why a process exited.
Definition: Process.h:2865
lldb_private::Process::SetUnixSignals
void SetUnixSignals(lldb::UnixSignalsSP &&signals_sp)
Definition: Process.cpp:3352
lldb_private::Process::DidHalt
virtual void DidHalt()
Called after halting a process.
Definition: Process.h:1117
lldb_private::Process::DidLaunch
virtual void DidLaunch()
Called after launching a process.
Definition: Process.h:1047
lldb_private::ProcessProperties::m_process
Process * m_process
Definition: Process.h:105
lldb_private::Process::GetUnixSignals
const lldb::UnixSignalsSP & GetUnixSignals()
Definition: Process.cpp:3357
Event.h
lldb_private::ProcessAttachInfo::ProcessAttachInfo
ProcessAttachInfo()=default
LoadedModuleInfoList.h
lldb_private::Process::SendEventData
virtual Status SendEventData(const char *data)
Definition: Process.h:2373
lldb_private::Process::WillHalt
virtual Status WillHalt()
Called before halting to a process.
Definition: Process.h:1090
lldb_private::Process::ResumePrivateStateThread
void ResumePrivateStateThread()
Definition: Process.cpp:3579
lldb_private::operator!=
bool operator!=(const Address &lhs, const Address &rhs)
Definition: Address.cpp:1022
lldb_private::Process::eBroadcastInternalStateControlPause
@ eBroadcastInternalStateControlPause
Definition: Process.h:364
lldb_private::Process::SetShouldDetach
void SetShouldDetach(bool b)
Definition: Process.h:726
lldb_private::ProcessAttachInfo
Definition: Process.h:113
ObjectFile.h
lldb-private.h
lldb_private::Process::SetNextEventAction
void SetNextEventAction(Process::NextEventAction *next_event_action)
Definition: Process.h:2690
lldb_private::Process::GetLanguageRuntimes
std::vector< LanguageRuntime * > GetLanguageRuntimes()
Definition: Process.cpp:1489
lldb_private::Process::GetExitStatus
int GetExitStatus()
Get the exit status for a process.
Definition: Process.cpp:1035
lldb_private::Process::ControlPrivateStateThread
void ControlPrivateStateThread(uint32_t signal)
Definition: Process.cpp:3594
lldb_private::ProcessModID::ProcessModID
ProcessModID(const ProcessModID &rhs)
Definition: Process.h:225
lldb_private::Process::eCanJITDontKnow
@ eCanJITDontKnow
Definition: Process.h:2959
lldb_private::Process::AddInvalidMemoryRegion
void AddInvalidMemoryRegion(const LoadRange &region)
Definition: Process.cpp:5566
lldb_private::CommandObject
Definition: CommandObject.h:67
lldb_private::ProcessModID::m_last_natural_stop_id
uint32_t m_last_natural_stop_id
Definition: Process.h:316
UserIDResolver.h
lldb_private::Process::CalculateTarget
lldb::TargetSP CalculateTarget() override
Definition: Process.cpp:4210
lldb_private::Process::SettingsInitialize
static void SettingsInitialize()
Definition: Process.cpp:4538
lldb_private::ProcessAttachInfo::GetResumeCount
uint32_t GetResumeCount() const
Definition: Process.h:145
lldb_private::ProcessModID::GetStopEventForStopID
lldb::EventSP GetStopEventForStopID(uint32_t stop_id) const
Definition: Process.h:308
lldb_private::ProcessProperties::GetDisableLangRuntimeUnwindPlans
bool GetDisableLangRuntimeUnwindPlans() const
Definition: Process.cpp:267
lldb_private::Process::DoSignal
virtual Status DoSignal(int signal)
Sends a process a UNIX signal signal.
Definition: Process.h:1164
lldb_private::ProcessModID::m_running_user_expression
uint32_t m_running_user_expression
Definition: Process.h:320
lldb_private::Process::GetExtendedThreadList
ThreadList & GetExtendedThreadList()
Definition: Process.h:2092
lldb_private::Process::DetachRequiresHalt
virtual bool DetachRequiresHalt()
Definition: Process.h:1147
lldb_private::TraceStopRequest
jLLDBTraceStop gdb-remote packet
Definition: TraceGDBRemotePackets.h:64
lldb_private::Process::GetWatchpointSupportInfo
virtual Status GetWatchpointSupportInfo(uint32_t &num)
Definition: Process.h:1811
lldb_private::Process::CreateOSPluginThread
lldb::ThreadSP CreateOSPluginThread(lldb::tid_t tid, lldb::addr_t context)
Definition: Process.cpp:1265
lldb_private::Process::LoadRange
Range< lldb::addr_t, lldb::addr_t > LoadRange
Definition: Process.h:368
lldb_private::Process::AttachCompletionHandler
Definition: Process.h:2698
lldb_private::Process::ProcessEventData::AddRestartedReason
static void AddRestartedReason(Event *event_ptr, const char *reason)
Definition: Process.cpp:4175
lldb_private::Process::ProcessEventData::GetNumRestartedReasons
size_t GetNumRestartedReasons()
Definition: Process.h:415
lldb_private::ProcessLaunchInfo::GetProcessPluginName
const char * GetProcessPluginName() const
Definition: ProcessLaunchInfo.cpp:131
lldb_private::Process::GetSTDOUT
virtual size_t GetSTDOUT(char *buf, size_t buf_size, Status &error)
Get any available STDOUT.
Definition: Process.cpp:4300
lldb_private::ModuleSpec
Definition: ModuleSpec.h:27
lldb_private::ProcessModID::m_resume_id
uint32_t m_resume_id
Definition: Process.h:317
lldb_private::ProcessProperties::SetIgnoreBreakpointsInExpressions
void SetIgnoreBreakpointsInExpressions(bool ignore)
Definition: Process.cpp:240
lldb_private::ProcessInstanceInfo::GetParentProcessID
lldb::pid_t GetParentProcessID() const
Definition: ProcessInfo.h:133
lldb_private::Process::GetUniqueID
uint32_t GetUniqueID() const
Definition: Process.h:533
lldb_private::Process::IsPossibleDynamicValue
bool IsPossibleDynamicValue(ValueObject &in_value)
Definition: Process.cpp:1537
lldb_private::Process::SetPublicState
void SetPublicState(lldb::StateType new_state, bool restarted)
Definition: Process.cpp:1299
lldb_private::Process::ProcessEventData::SetRestartedInEvent
static void SetRestartedInEvent(Event *event_ptr, bool new_value)
Definition: Process.cpp:4146
lldb_private::Status
Definition: Status.h:44
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
lldb_private::ProcessLaunchInfo::GetResumeCount
uint32_t GetResumeCount() const
Definition: ProcessLaunchInfo.h:80
lldb_private::ProcessAttachInfo::m_hijack_listener_sp
lldb::ListenerSP m_hijack_listener_sp
Definition: Process.h:197
lldb_private::Timeout< std::micro >
lldb_private::Process::GetLastUserExpressionResumeID
uint32_t GetLastUserExpressionResumeID() const
Definition: Process.h:1382
lldb_private::Process::GetHostOSVersion
virtual llvm::VersionTuple GetHostOSVersion()
Sometimes the connection to a process can detect the host OS version that the process is running on.
Definition: Process.h:1209
lldb_private::Process::m_private_state_broadcaster
Broadcaster m_private_state_broadcaster
Definition: Process.h:2845
lldb_private::ProcessModID::SetRunningUserExpression
void SetRunningUserExpression(bool on)
Definition: Process.h:286
lldb_private::Process::StateChangedIsExternallyHijacked
bool StateChangedIsExternallyHijacked()
Definition: Process.cpp:1391
lldb_private::Process::DidExit
virtual void DidExit()
Definition: Process.h:1357
lldb_private::Process::GetLoadedDynamicLibrariesInfos
virtual lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos()
Definition: Process.h:1303
lldb_private::Process::DoWillAttachToProcessWithID
virtual Status DoWillAttachToProcessWithID(lldb::pid_t pid)
Called before attaching to a process.
Definition: Process.h:897
uint32_t
lldb_private::AllocatedMemoryCache
Definition: Memory.h:112
lldb_private::Process::DoAttachToProcessWithName
virtual Status DoAttachToProcessWithName(const char *process_name, const ProcessAttachInfo &attach_info)
Attach to an existing process using a partial process name.
Definition: Process.h:969
UserSettingsController.h
lldb_private::Process::m_language_runtimes_mutex
std::recursive_mutex m_language_runtimes_mutex
Definition: Process.h:2922
lldb_private::Process::m_extended_thread_list
ThreadList m_extended_thread_list
Owner for extended threads that may be generated, cleared on natural stops.
Definition: Process.h:2879
Memory.h
lldb_private::ProcessModID::StopIDEqual
bool StopIDEqual(const ProcessModID &compare) const
Definition: Process.h:269
lldb::thread_result_t
void * thread_result_t
Definition: lldb-types.h:62
lldb_private::Process::WaitForProcessStopPrivate
lldb::StateType WaitForProcessStopPrivate(lldb::EventSP &event_sp, const Timeout< std::micro > &timeout)
Definition: Process.cpp:2412
lldb_private::Process::DoLaunch
virtual Status DoLaunch(Module *exe_module, ProcessLaunchInfo &launch_info)
Launch a new process.
Definition: Process.h:1037
lldb_private::Process::m_breakpoint_site_list
BreakpointSiteList m_breakpoint_site_list
This is the list of breakpoint locations we intend to insert in the target.
Definition: Process.h:2892
lldb_private::ProcessProperties::GetStopOnSharedLibraryEvents
bool GetStopOnSharedLibraryEvents() const
Definition: Process.cpp:256
lldb_private::Process::GetSystemRuntime
virtual SystemRuntime * GetSystemRuntime()
Get the system runtime plug-in for this process.
Definition: Process.cpp:2674
lldb_private::Address
Definition: Address.h:59
lldb_private::Process::AddImageToken
size_t AddImageToken(lldb::addr_t image_ptr)
Definition: Process.cpp:5809
lldb_private::ProcessProperties::SetDetachKeepsStopped
void SetDetachKeepsStopped(bool keep_stopped)
Definition: Process.cpp:285
lldb_private::Process::PreResumeCallbackAndBaton::PreResumeCallbackAndBaton
PreResumeCallbackAndBaton(PreResumeActionCallback in_callback, void *in_baton)
Definition: Process.h:2828
lldb_private::Process::m_instrumentation_runtimes
InstrumentationRuntimeCollection m_instrumentation_runtimes
Definition: Process.h:2923
lldb_private::FollowForkMode
FollowForkMode
Definition: lldb-private-enumerations.h:170
lldb_private::Process::ProcessEventHijacker::~ProcessEventHijacker
~ProcessEventHijacker()
Definition: Process.h:2187
lldb_private::ProcessModID
Definition: Process.h:219
lldb_private::ProcessAttachInfo::GetProcessPluginName
const char * GetProcessPluginName() const
Definition: Process.h:149
lldb::pid_t
uint64_t pid_t
Definition: lldb-types.h:85
lldb_private::Process::Launch
virtual Status Launch(ProcessLaunchInfo &launch_info)
Launch a new process.
Definition: Process.cpp:2441
lldb_private::MemoryCache
Definition: Memory.h:21
lldb_private::Process::m_system_runtime_up
lldb::SystemRuntimeUP m_system_runtime_up
Definition: Process.h:2903
lldb_private::ProcessProperties::SetVirtualAddressableBits
void SetVirtualAddressableBits(uint32_t bits)
Definition: Process.cpp:225
lldb_private::ProcessAttachInfo::GetIgnoreExisting
bool GetIgnoreExisting() const
Definition: Process.h:137
lldb_private::Process::NextEventAction::HandleBeingInterrupted
virtual EventActionResult HandleBeingInterrupted()=0
lldb_private::Process::GetModuleSpec
virtual bool GetModuleSpec(const FileSpec &module_file_spec, const ArchSpec &arch, ModuleSpec &module_spec)
Try to fetch the module specification for a module with the given file name and architecture.
Definition: Process.cpp:5803
ExecutionContextScope.h
ThreadedCommunication.h
lldb_private::Process::EnableWatchpoint
virtual Status EnableWatchpoint(Watchpoint *wp, bool notify=true)
Definition: Process.cpp:2399
lldb_private::Process::GetNextEvent
lldb::StateType GetNextEvent(lldb::EventSP &event_sp)
Definition: Process.cpp:615
lldb_private::ProcessAttachInfo::m_detach_on_error
bool m_detach_on_error
Definition: Process.h:205
lldb_private::Process::RegisterNotificationCallbacks
void RegisterNotificationCallbacks(const Process::Notifications &callbacks)
Register for process and thread notifications.
Definition: Process.cpp:575
lldb_private::ProcessAttachInfo::SetIgnoreExisting
void SetIgnoreExisting(bool b)
Definition: Process.h:139
lldb_private::DiagnosticManager
Definition: DiagnosticManager.h:93
lldb_private::Process::GetLanguageRuntime
LanguageRuntime * GetLanguageRuntime(lldb::LanguageType language)
Definition: Process.cpp:1509
ArchSpec.h
lldb_private::Process::WaitForProcessToStop
lldb::StateType WaitForProcessToStop(const Timeout< std::micro > &timeout, lldb::EventSP *event_sp_ptr=nullptr, bool wait_always=true, lldb::ListenerSP hijack_listener=lldb::ListenerSP(), Stream *stream=nullptr, bool use_run_lock=true)
Definition: Process.cpp:647
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:19
lldb_private::Process::Detach
Status Detach(bool keep_stopped)
Detaches from a running or stopped process.
Definition: Process.cpp:3212
lldb_private::Process::AdvanceAddressToNextBranchInstruction
Address AdvanceAddressToNextBranchInstruction(Address default_stop_addr, AddressRange range_bounds)
Find the next branch instruction to set a breakpoint on.
Definition: Process.cpp:5826
lldb_private::Process::m_thread_index_id
uint32_t m_thread_index_id
Each thread is created with a 1 based index that won't get re-used.
Definition: Process.h:2861
lldb_private::Process::m_data_address_mask
lldb::addr_t m_data_address_mask
Definition: Process.h:2943
lldb_private::ProcessExperimentalProperties
Definition: Process.h:63
lldb_private::Process::m_image_tokens
std::vector< lldb::addr_t > m_image_tokens
Definition: Process.h:2889
lldb_private::Process::DoWriteMemory
virtual size_t DoWriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size, Status &error)
Actually do the writing of memory to a process.
Definition: Process.h:1563
lldb_private::Process::GetStructuredDataPlugin
lldb::StructuredDataPluginSP GetStructuredDataPlugin(ConstString type_name) const
Returns the StructuredDataPlugin associated with a given type name, if there is one.
Definition: Process.cpp:4267
lldb_private::Process::CanInterpretFunctionCalls
bool CanInterpretFunctionCalls()
Determines whether executing function calls using the interpreter is possible for this process.
Definition: Process.h:1870
lldb_private::Process::DidVFork
virtual void DidVFork(lldb::pid_t child_pid, lldb::tid_t child_tid)
Called after a reported vfork.
Definition: Process.h:1002
lldb_private::Process::CalculateProcess
lldb::ProcessSP CalculateProcess() override
Definition: Process.h:2330
lldb_private::UtilityFunctionScope
RAII guard that should be acquired when an utility function is called within a given process.
Definition: Process.h:3064
lldb_private::Process::AppendSTDOUT
void AppendSTDOUT(const char *s, size_t len)
Definition: Process.cpp:4238
lldb_private::ProcessLaunchInfo::GetHijackListener
lldb::ListenerSP GetHijackListener() const
Definition: ProcessLaunchInfo.h:131
lldb_private::Process::ProcessEventData::Dump
void Dump(Stream *s) const override
Definition: Process.cpp:4098
lldb_private::Process::WillPublicStop
virtual void WillPublicStop()
Called when the process is about to broadcast a public stop.
Definition: Process.h:760
lldb_private::Process::WritePointerToMemory
bool WritePointerToMemory(lldb::addr_t vm_addr, lldb::addr_t ptr_value, Status &error)
Definition: Process.cpp:2093
lldb_private::Process::PushProcessIOHandler
bool PushProcessIOHandler()
Definition: Process.cpp:4511
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
lldb_private::Process::m_pre_resume_actions
std::vector< PreResumeCallbackAndBaton > m_pre_resume_actions
Definition: Process.h:2925
lldb_private::Process::RunPreResumeActions
bool RunPreResumeActions()
Definition: Process.cpp:5580
lldb_private::Process::LoadCore
virtual Status LoadCore()
Definition: Process.cpp:2604
lldb_private::Platform
Definition: Platform.h:71
lldb_private::Process::Notifications::baton
void * baton
Definition: Process.h:391
lldb_private::Process::eBroadcastBitSTDOUT
@ eBroadcastBitSTDOUT
Definition: Process.h:356
lldb_private::Process::GetStaticBroadcasterClass
static ConstString & GetStaticBroadcasterClass()
Definition: Process.cpp:398
lldb_private::Process::DisableAllBreakpointSites
void DisableAllBreakpointSites()
Definition: Process.cpp:1570
lldb_private::Process::GetID
lldb::pid_t GetID() const
Returns the pid of the process or LLDB_INVALID_PROCESS_ID if there is no known pid.
Definition: Process.h:526
lldb_private::Process::DidDetach
virtual void DidDetach()
Called after detaching from a process.
Definition: Process.h:1145
lldb_private::Process::WriteScalarToMemory
size_t WriteScalarToMemory(lldb::addr_t vm_addr, const Scalar &scalar, size_t size, Status &error)
Write all or part of a scalar value to memory.
Definition: Process.cpp:2203
lldb_private::Process::m_listener_sp
lldb::ListenerSP m_listener_sp
Shared pointer to the listener used for public events.
Definition: Process.h:2890
lldb_private::ProcessExperimentalProperties::ProcessExperimentalProperties
ProcessExperimentalProperties()
Definition: Process.cpp:153
lldb_private::Process::m_thread_plans
ThreadPlanStackMap m_thread_plans
This is the list of thread plans for threads in m_thread_list, as well as threads we knew existed,...
Definition: Process.h:2875
lldb_private::ProcessAttachInfo::ProcessAttachInfo
ProcessAttachInfo(const ProcessLaunchInfo &launch_info)
Definition: Process.h:117
lldb_private::ThreadPlanStack
Definition: ThreadPlanStack.h:31
lldb_private::ProcessModID::BumpMemoryID
void BumpMemoryID()
Definition: Process.h:245
lldb_private::Process::ProcessEventHijacker
Definition: Process.h:2180
lldb_private::ProcessModID::GetLastUserExpressionResumeID
uint32_t GetLastUserExpressionResumeID() const
Definition: Process.h:261
lldb_private::Process::DoDeallocateMemory
virtual Status DoDeallocateMemory(lldb::addr_t ptr)
Actually deallocate memory in the process.
Definition: Process.h:1899
Status.h
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private::Process::ReadMemoryTags
virtual llvm::Expected< std::vector< lldb::addr_t > > ReadMemoryTags(lldb::addr_t addr, size_t len)
Read memory tags for the range addr to addr+len.
Definition: Process.cpp:6127
lldb_private::Process::ProcessIOHandlerIsActive
bool ProcessIOHandlerIsActive()
Definition: Process.cpp:4505
lldb_private::Process::DidDestroy
virtual void DidDestroy()
Definition: Process.h:1176
lldb_private::Process::DoLoadCore
virtual Status DoLoadCore()
Definition: Process.h:597
lldb_private::Process::LaunchPrivate
Status LaunchPrivate(ProcessLaunchInfo &launch_info, lldb::StateType &state, lldb::EventSP &event_sp)
Definition: Process.cpp:2473
lldb_private::HostThread::IsJoinable
bool IsJoinable() const
Definition: HostThread.cpp:30
lldb_private::ProcessProperties::GetMemoryCacheLineSize
uint64_t GetMemoryCacheLineSize() const
Definition: Process.cpp:196
lldb_private::Process::GetImageInfoAddress
virtual lldb::addr_t GetImageInfoAddress()
Get the image information address for the current process.
Definition: Process.cpp:1481
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::Process::m_destroy_in_process
bool m_destroy_in_process
Definition: Process.h:2952
lldb_private::Process::AttachCompletionHandler::m_exit_string
std::string m_exit_string
Definition: Process.h:2710
lldb_private::Process::GetLoadedDynamicLibrariesInfos
virtual lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos(const std::vector< lldb::addr_t > &load_addresses)
Definition: Process.h:1309
lldb_private::Process::GetImageTokens
const std::vector< lldb::addr_t > & GetImageTokens()
Get the image vector for the current process.
Definition: Process.h:732
lldb_private::Process::PreResumeCallbackAndBaton::baton
void * baton
Definition: Process.h:2827
lldb_private::Process::StateChangedIsHijackedForSynchronousResume
bool StateChangedIsHijackedForSynchronousResume()
Definition: Process.cpp:1401
lldb_private::Process::GetWatchpointSupportInfo
virtual Status GetWatchpointSupportInfo(uint32_t &num, bool &after)
Definition: Process.h:1818
lldb_private::Process::WillDestroy
virtual Status WillDestroy()
Definition: Process.h:1172
lldb_private::Process::SettingsTerminate
static void SettingsTerminate()
Definition: Process.cpp:4540
lldb_private::ProcessAttachInfo::m_wait_for_launch
bool m_wait_for_launch
Definition: Process.h:200
lldb_private::StopInfo
Definition: StopInfo.h:20
lldb_private::Process::eCanJITNo
@ eCanJITNo
Definition: Process.h:2959
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:30
lldb_private::ProcessInfo::GetExecutableFile
FileSpec & GetExecutableFile()
Definition: ProcessInfo.h:41
lldb_private::Process::~Process
~Process() override
Destructor.
Definition: Process.cpp:493
lldb_private::Process::ProcessEventData::SetUpdateStateOnRemoval
void SetUpdateStateOnRemoval()
Definition: Process.h:456
lldb_private::Process::GetImagePtrFromToken
lldb::addr_t GetImagePtrFromToken(size_t token) const
Definition: Process.cpp:5814
lldb_private::ThreadedCommunication
Definition: ThreadedCommunication.h:61
lldb_private::ProcessProperties::SetExtraStartupCommands
void SetExtraStartupCommands(const Args &args)
Definition: Process.cpp:209
lldb::eStateInvalid
@ eStateInvalid
Definition: lldb-enumerations.h:74
lldb_private::Process::ProcessEventData::m_process_wp
lldb::ProcessWP m_process_wp
Definition: Process.h:466
lldb_private::Process::EnableBreakpointSite
virtual Status EnableBreakpointSite(BreakpointSite *bp_site)
Definition: Process.h:2019
lldb_private::ProcessProperties::GetExtraStartupCommands
Args GetExtraStartupCommands() const
Definition: Process.cpp:202
lldb_private::Process::WriteObjectFile
virtual Status WriteObjectFile(std::vector< ObjectFile::LoadableData > entries)
Definition: Process.cpp:2251
lldb_private::Process::NextEventAction::eEventActionSuccess
@ eEventActionSuccess
Definition: Process.h:2671
lldb_private::Process::AttachCompletionHandler::PerformAction
EventActionResult PerformAction(lldb::EventSP &event_sp) override
Definition: Process.cpp:2691
lldb_private::Process::PreResumeCallbackAndBaton::operator==
bool operator==(const PreResumeCallbackAndBaton &rhs)
Definition: Process.h:2831
lldb_private::Process::CalculateStackFrame
lldb::StackFrameSP CalculateStackFrame() override
Definition: Process.h:2334
lldb_private::Process::GetABI
const lldb::ABISP & GetABI()
Definition: Process.cpp:1483
lldb_private::Process::Resume
Status Resume()
Resumes all of a process's threads as configured using the Thread run control functions.
Definition: Process.cpp:1339
lldb_private::Process::m_resume_requested
bool m_resume_requested
Definition: Process.h:2929
lldb_private::Process::GetSTDERR
virtual size_t GetSTDERR(char *buf, size_t buf_size, Status &error)
Get any available STDERR.
Definition: Process.cpp:4319
lldb_private::Process::CreateBreakpointSite
lldb::break_id_t CreateBreakpointSite(const lldb::BreakpointLocationSP &owner, bool use_hardware)
Definition: Process.cpp:1614
lldb_private::QueueList
Definition: QueueList.h:28
lldb_private::Process::m_thread_list_real
ThreadList m_thread_list_real
The threads for this process as are known to the protocol we are debugging with.
Definition: Process.h:2869
lldb_private::ThreadSafeValue< lldb::StateType >
lldb_private::Process::ReadUnsignedIntegerFromMemory
uint64_t ReadUnsignedIntegerFromMemory(lldb::addr_t load_addr, size_t byte_size, uint64_t fail_value, Status &error)
Reads an unsigned integer of the specified byte size from process memory.
Definition: Process.cpp:2063
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
lldb_private::Process::ProcessEventHijacker::m_process
Process & m_process
Definition: Process.h:2190
lldb_private::Process::GetByteOrder
lldb::ByteOrder GetByteOrder() const
Definition: Process.cpp:3362
lldb_private::Process::GetSharedCacheInfo
virtual lldb_private::StructuredData::ObjectSP GetSharedCacheInfo()
Definition: Process.h:1320
lldb_private::Process::AttachCompletionHandler::m_exec_count
uint32_t m_exec_count
Definition: Process.h:2709
lldb_private::Process::m_stdout_data
std::string m_stdout_data
Remember if stdin must be forwarded to remote debug server.
Definition: Process.h:2912
lldb_private::Process::DisableWatchpoint
virtual Status DisableWatchpoint(Watchpoint *wp, bool notify=true)
Definition: Process.cpp:2405
lldb_private::Process::m_thread_id_to_index_id_map
std::map< uint64_t, uint32_t > m_thread_id_to_index_id_map
Definition: Process.h:2863
lldb_private::DynamicCheckerFunctions
Encapsulates dynamic check functions used by expressions.
Definition: DynamicCheckerFunctions.h:30
lldb_private::Predicate::GetValue
T GetValue() const
Value get accessor.
Definition: Predicate.h:70
lldb_private::Process::ReadPointerFromMemory
lldb::addr_t ReadPointerFromMemory(lldb::addr_t vm_addr, Status &error)
Definition: Process.cpp:2085
lldb_private::ProcessProperties
Definition: Process.h:68
lldb_private::ProcessModID::GetResumeID
uint32_t GetResumeID() const
Definition: Process.h:260
lldb_private::ProcessAttachInfo::GetWaitForLaunch
bool GetWaitForLaunch() const
Definition: Process.h:129
lldb_private::bits
static uint32_t bits(const uint32_t val, const uint32_t msbit, const uint32_t lsbit)
Definition: ARMUtils.h:265
lldb_private::Process::m_stdio_communication_mutex
std::recursive_mutex m_stdio_communication_mutex
Definition: Process.h:2909
lldb_private::UtilityFunctionScope::UtilityFunctionScope
UtilityFunctionScope(Process *p)
Definition: Process.h:3068
lldb_private::Process::GetFileLoadAddress
virtual Status GetFileLoadAddress(const FileSpec &file, bool &is_loaded, lldb::addr_t &load_addr)
Try to find the load address of a file.
Definition: Process.h:2421
lldb_private::Process::ProcessEventData::GetFlavor
ConstString GetFlavor() const override
Definition: Process.cpp:3920
lldb_private::Process::SetCanJIT
void SetCanJIT(bool can_jit)
Sets whether executing JIT-compiled code in this process is possible.
Definition: Process.cpp:2325
lldb_private::ProcessModID::IsRunningUtilityFunction
bool IsRunningUtilityFunction() const
Definition: Process.h:253
lldb_private::Process::DoWillLaunch
virtual Status DoWillLaunch(Module *module)
Called before launching to a process.
Definition: Process.h:1018
lldb_private::Process::RunThreadPlan
lldb::ExpressionResults RunThreadPlan(ExecutionContext &exe_ctx, lldb::ThreadPlanSP &thread_plan_sp, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager)
Definition: Process.cpp:4675
lldb_private::Process::m_resolved_indirect_addresses
std::map< lldb::addr_t, lldb::addr_t > m_resolved_indirect_addresses
This helps with the Public event coalescing in ShouldBroadcastEvent.
Definition: Process.h:2951
lldb_private::ProcessAttachInfo::GetDetachOnError
bool GetDetachOnError() const
Definition: Process.h:182
lldb_private::ArchSpec::Clear
void Clear()
Clears the object state.
Definition: ArchSpec.cpp:524
lldb_private::Process::NextEventAction::EventActionResult
EventActionResult
Definition: Process.h:2670
lldb_private::Process::DidFork
virtual void DidFork(lldb::pid_t child_pid, lldb::tid_t child_tid)
Called after a reported fork.
Definition: Process.h:999
lldb_private::Broadcaster
Definition: Broadcaster.h:242
lldb_private::Process::GetStopID
uint32_t GetStopID() const
Definition: Process.h:1378
lldb_private::ProcessModID::operator==
friend bool operator==(const ProcessModID &lhs, const ProcessModID &rhs)
Definition: Process.h:325
lldb_private::ProcessAttachInfo::GetHijackListener
lldb::ListenerSP GetHijackListener() const
Definition: Process.h:176
lldb_private::Process::GetLoadImageUtilityFunction
UtilityFunction * GetLoadImageUtilityFunction(Platform *platform, llvm::function_ref< std::unique_ptr< UtilityFunction >()> factory)
Get the cached UtilityFunction that assists in loading binary images into the process.
Definition: Process.cpp:6036
lldb_private::Process::GetPluginCommandObject
virtual CommandObject * GetPluginCommandObject()
Return a multi-word command object that can be used to expose plug-in specific commands.
Definition: Process.h:572
lldb_private::Process::m_private_state_control_broadcaster
Broadcaster m_private_state_control_broadcaster
Definition: Process.h:2848
MemoryTagManager.h
lldb_private::Process::m_profile_data_comm_mutex
std::recursive_mutex m_profile_data_comm_mutex
Definition: Process.h:2914
lldb_private::Process::ProcessEventData::SetRestarted
void SetRestarted(bool new_value)
Definition: Process.h:458
lldb_private::Process::GetTarget
const Target & GetTarget() const
Get the const target object pointer for this module.
Definition: Process.h:1226
lldb_private::Process::ProcessEventData::DoOnRemoval
void DoOnRemoval(Event *event_ptr) override
Definition: Process.cpp:4030
lldb_private::Process::FindPlugin
static lldb::ProcessSP FindPlugin(lldb::TargetSP target_sp, llvm::StringRef plugin_name, lldb::ListenerSP listener_sp, const FileSpec *crash_file_path, bool can_connect)
Find a Process plug-in that can debug module using the currently selected architecture.
Definition: Process.cpp:357
lldb_private::Process::UpdateQueueListIfNeeded
void UpdateQueueListIfNeeded()
Definition: Process.cpp:1252
lldb_private::Process::SetCanRunCode
void SetCanRunCode(bool can_run_code)
Sets whether executing code in this process is possible.
Definition: Process.cpp:2329
lldb_private::ProcessModID::IsLastResumeForUserExpression
bool IsLastResumeForUserExpression() const
Definition: Process.h:277
lldb_private::Process::AttachCompletionHandler::AttachCompletionHandler
AttachCompletionHandler(Process *process, uint32_t exec_count)
Definition: Process.cpp:2680
lldb_private::Process::WillAttachToProcessWithID
Status WillAttachToProcessWithID(lldb::pid_t pid)
Called before attaching to a process.
Definition: Process.cpp:2768
lldb_private::ProcessProperties::GetVirtualAddressableBits
uint32_t GetVirtualAddressableBits() const
Definition: Process.cpp:219
lldb_private::Process::SyncIOHandler
void SyncIOHandler(uint32_t iohandler_id, const Timeout< std::micro > &timeout)
Waits for the process state to be running within a given msec timeout.
Definition: Process.cpp:626
lldb_private::ProcessAttachInfo::SetWaitForLaunch
void SetWaitForLaunch(bool b)
Definition: Process.h:131
TraceGDBRemotePackets.h
lldb_private::BreakpointSiteList
Definition: BreakpointSiteList.h:23
QueueList.h
lldb_private::ProcessModID::~ProcessModID
~ProcessModID()=default
lldb_private::Process::BroadcastStructuredData
void BroadcastStructuredData(const StructuredData::ObjectSP &object_sp, const lldb::StructuredDataPluginSP &plugin_sp)
Broadcasts the given structured data object from the given plugin.
Definition: Process.cpp:4259
lldb_private::Process::GetDataAddressMask
lldb::addr_t GetDataAddressMask()
Definition: Process.cpp:5635
lldb_private::Process::m_private_run_lock
ProcessRunLock m_private_run_lock
Definition: Process.h:2927
lldb_private::Process::SetSTDIOFileDescriptor
void SetSTDIOFileDescriptor(int file_descriptor)
Definition: Process.cpp:4488
lldb_private::Process::WriteMemoryTags
Status WriteMemoryTags(lldb::addr_t addr, size_t len, const std::vector< lldb::addr_t > &tags)
Write memory tags for a range of memory.
Definition: Process.cpp:6143
lldb_private::Process::PausePrivateStateThread
void PausePrivateStateThread()
Definition: Process.cpp:3575
lldb_private::Process::GetProcessInfo
virtual bool GetProcessInfo(ProcessInstanceInfo &info)
Definition: Process.cpp:5767
lldb_private::Process::PeekAtStateChangedEvents
Event * PeekAtStateChangedEvents()
Definition: Process.cpp:980
lldb_private::Process::GetStateChangedEvents
lldb::StateType GetStateChangedEvents(lldb::EventSP &event_sp, const Timeout< std::micro > &timeout, lldb::ListenerSP hijack_listener)
Definition: Process.cpp:956
lldb_private::Process::PreResumeActionCallback
bool() PreResumeActionCallback(void *)
Definition: Process.h:2359
lldb_private::Process::DoResume
virtual Status DoResume()
Resumes all of a process's threads as configured using the Thread run control functions.
Definition: Process.h:1072
lldb::DescriptionLevel
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
Definition: lldb-enumerations.h:207
lldb_private::Process::CalculateExecutionContext
void CalculateExecutionContext(ExecutionContext &exe_ctx) override
Reconstruct the object's execution context into sc.
Definition: Process.cpp:4212
lldb_private::UtilityFunction
Definition: UtilityFunction.h:30
lldb_private::Process::NextEventAction::HandleBeingUnshipped
virtual void HandleBeingUnshipped()
Definition: Process.h:2681
lldb_private::ProcessAttachInfo::ProcessInfoSpecified
bool ProcessInfoSpecified() const
Definition: Process.h:166
lldb_private::Process::ProcessEventData::GetRestartedReasonAtIndex
const char * GetRestartedReasonAtIndex(size_t idx)
Definition: Process.h:417
lldb_private::Process::GetLoadAddressPermissions
virtual bool GetLoadAddressPermissions(lldb::addr_t load_addr, uint32_t &permissions)
Attempt to get the attributes for a region of memory in the process.
Definition: Process.cpp:2374
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86
lldb::InstrumentationRuntimeType
InstrumentationRuntimeType
Definition: lldb-enumerations.h:485
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138
lldb_private::Process::ProcessEventData::operator=
const ProcessEventData & operator=(const ProcessEventData &)=delete
lldb_private::Process::ProcessEventData::ShouldStop
virtual bool ShouldStop(Event *event_ptr, bool &found_valid_stopinfo)
Definition: Process.cpp:3924
lldb_private::FunctionCaller
Definition: FunctionCaller.h:56
lldb_private::Process::StopPrivateStateThread
void StopPrivateStateThread()
Definition: Process.cpp:3583
lldb_private::Process::CalculateThread
lldb::ThreadSP CalculateThread() override
Definition: Process.h:2332
lldb_private::Process::eCanJITYes
@ eCanJITYes
Definition: Process.h:2959
lldb_private::Process::ResetImageToken
void ResetImageToken(size_t token)
Definition: Process.cpp:5820
lldb_private::Process::m_clear_thread_plans_on_stop
bool m_clear_thread_plans_on_stop
Definition: Process.h:2946
lldb_private::Process::WillSignal
virtual Status WillSignal()
Called before sending a signal to a process.
Definition: Process.h:1158
lldb_private::Process::m_jit_loaders_up
lldb::JITLoaderListUP m_jit_loaders_up
Definition: Process.h:2896
lldb_private::ProcessAttachInfo::m_ignore_existing
bool m_ignore_existing
Definition: Process.h:201
lldb_private::Process::DisableBreakpointSite
virtual Status DisableBreakpointSite(BreakpointSite *bp_site)
Definition: Process.h:2026