LLDB  mainline
SBProcess.cpp
Go to the documentation of this file.
1 //===-- SBProcess.cpp -----------------------------------------------------===//
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 #include "lldb/API/SBProcess.h"
10 #include "SBReproducerPrivate.h"
11 
12 #include <cinttypes>
13 
14 #include "lldb/lldb-defines.h"
15 #include "lldb/lldb-types.h"
16 
17 #include "lldb/Core/Debugger.h"
18 #include "lldb/Core/Module.h"
20 #include "lldb/Core/StreamFile.h"
23 #include "lldb/Target/Process.h"
26 #include "lldb/Target/Target.h"
27 #include "lldb/Target/Thread.h"
28 #include "lldb/Utility/Args.h"
30 #include "lldb/Utility/State.h"
31 #include "lldb/Utility/Stream.h"
32 
33 #include "lldb/API/SBBroadcaster.h"
35 #include "lldb/API/SBDebugger.h"
36 #include "lldb/API/SBEvent.h"
37 #include "lldb/API/SBFile.h"
38 #include "lldb/API/SBFileSpec.h"
41 #include "lldb/API/SBStream.h"
42 #include "lldb/API/SBStringList.h"
44 #include "lldb/API/SBThread.h"
46 #include "lldb/API/SBTrace.h"
47 #include "lldb/API/SBUnixSignals.h"
48 
49 using namespace lldb;
50 using namespace lldb_private;
51 
52 SBProcess::SBProcess() : m_opaque_wp() {
54 }
55 
56 // SBProcess constructor
57 
58 SBProcess::SBProcess(const SBProcess &rhs) : m_opaque_wp(rhs.m_opaque_wp) {
60 }
61 
62 SBProcess::SBProcess(const lldb::ProcessSP &process_sp)
63  : m_opaque_wp(process_sp) {
64  LLDB_RECORD_CONSTRUCTOR(SBProcess, (const lldb::ProcessSP &), process_sp);
65 }
66 
69  SBProcess, operator=,(const lldb::SBProcess &), rhs);
70 
71  if (this != &rhs)
73  return LLDB_RECORD_RESULT(*this);
74 }
75 
76 // Destructor
77 SBProcess::~SBProcess() = default;
78 
82 
83  return Process::GetStaticBroadcasterClass().AsCString();
84 }
85 
86 const char *SBProcess::GetPluginName() {
88 
89  ProcessSP process_sp(GetSP());
90  if (process_sp) {
91  return ConstString(process_sp->GetPluginName()).GetCString();
92  }
93  return "<Unknown>";
94 }
95 
98 
99  ProcessSP process_sp(GetSP());
100  if (process_sp) {
101  return ConstString(process_sp->GetPluginName()).GetCString();
102  }
103  return "<Unknown>";
104 }
105 
106 lldb::ProcessSP SBProcess::GetSP() const { return m_opaque_wp.lock(); }
107 
108 void SBProcess::SetSP(const ProcessSP &process_sp) { m_opaque_wp = process_sp; }
109 
112 
113  m_opaque_wp.reset();
114 }
115 
116 bool SBProcess::IsValid() const {
118  return this->operator bool();
119 }
120 SBProcess::operator bool() const {
121  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBProcess, operator bool);
122 
123  ProcessSP process_sp(m_opaque_wp.lock());
124  return ((bool)process_sp && process_sp->IsValid());
125 }
126 
127 bool SBProcess::RemoteLaunch(char const **argv, char const **envp,
128  const char *stdin_path, const char *stdout_path,
129  const char *stderr_path,
130  const char *working_directory,
131  uint32_t launch_flags, bool stop_at_entry,
132  lldb::SBError &error) {
134  (const char **, const char **, const char *, const char *,
135  const char *, const char *, uint32_t, bool,
136  lldb::SBError &),
137  argv, envp, stdin_path, stdout_path, stderr_path,
138  working_directory, launch_flags, stop_at_entry, error);
139 
140  ProcessSP process_sp(GetSP());
141  if (process_sp) {
142  std::lock_guard<std::recursive_mutex> guard(
143  process_sp->GetTarget().GetAPIMutex());
144  if (process_sp->GetState() == eStateConnected) {
145  if (stop_at_entry)
146  launch_flags |= eLaunchFlagStopAtEntry;
147  ProcessLaunchInfo launch_info(FileSpec(stdin_path), FileSpec(stdout_path),
148  FileSpec(stderr_path),
149  FileSpec(working_directory), launch_flags);
150  Module *exe_module = process_sp->GetTarget().GetExecutableModulePointer();
151  if (exe_module)
152  launch_info.SetExecutableFile(exe_module->GetPlatformFileSpec(), true);
153  if (argv)
154  launch_info.GetArguments().AppendArguments(argv);
155  if (envp)
156  launch_info.GetEnvironment() = Environment(envp);
157  error.SetError(process_sp->Launch(launch_info));
158  } else {
159  error.SetErrorString("must be in eStateConnected to call RemoteLaunch");
160  }
161  } else {
162  error.SetErrorString("unable to attach pid");
163  }
164 
165  return error.Success();
166 }
167 
169  lldb::SBError &error) {
171  (lldb::pid_t, lldb::SBError &), pid, error);
172 
173  ProcessSP process_sp(GetSP());
174  if (process_sp) {
175  std::lock_guard<std::recursive_mutex> guard(
176  process_sp->GetTarget().GetAPIMutex());
177  if (process_sp->GetState() == eStateConnected) {
178  ProcessAttachInfo attach_info;
179  attach_info.SetProcessID(pid);
180  error.SetError(process_sp->Attach(attach_info));
181  } else {
182  error.SetErrorString(
183  "must be in eStateConnected to call RemoteAttachToProcessWithID");
184  }
185  } else {
186  error.SetErrorString("unable to attach pid");
187  }
188 
189  return error.Success();
190 }
191 
194 
195  uint32_t num_threads = 0;
196  ProcessSP process_sp(GetSP());
197  if (process_sp) {
198  Process::StopLocker stop_locker;
199 
200  const bool can_update = stop_locker.TryLock(&process_sp->GetRunLock());
201  std::lock_guard<std::recursive_mutex> guard(
202  process_sp->GetTarget().GetAPIMutex());
203  num_threads = process_sp->GetThreadList().GetSize(can_update);
204  }
205 
206  return num_threads;
207 }
208 
212 
213  SBThread sb_thread;
214  ThreadSP thread_sp;
215  ProcessSP process_sp(GetSP());
216  if (process_sp) {
217  std::lock_guard<std::recursive_mutex> guard(
218  process_sp->GetTarget().GetAPIMutex());
219  thread_sp = process_sp->GetThreadList().GetSelectedThread();
220  sb_thread.SetThread(thread_sp);
221  }
222 
223  return LLDB_RECORD_RESULT(sb_thread);
224 }
225 
227  lldb::addr_t context) {
229  (lldb::tid_t, lldb::addr_t), tid, context);
230 
231  SBThread sb_thread;
232  ThreadSP thread_sp;
233  ProcessSP process_sp(GetSP());
234  if (process_sp) {
235  std::lock_guard<std::recursive_mutex> guard(
236  process_sp->GetTarget().GetAPIMutex());
237  thread_sp = process_sp->CreateOSPluginThread(tid, context);
238  sb_thread.SetThread(thread_sp);
239  }
240 
241  return LLDB_RECORD_RESULT(sb_thread);
242 }
243 
246 
247  SBTarget sb_target;
248  TargetSP target_sp;
249  ProcessSP process_sp(GetSP());
250  if (process_sp) {
251  target_sp = process_sp->GetTarget().shared_from_this();
252  sb_target.SetSP(target_sp);
253  }
254 
255  return LLDB_RECORD_RESULT(sb_target);
256 }
257 
258 size_t SBProcess::PutSTDIN(const char *src, size_t src_len) {
259  LLDB_RECORD_METHOD(size_t, SBProcess, PutSTDIN, (const char *, size_t), src,
260  src_len);
261 
262  size_t ret_val = 0;
263  ProcessSP process_sp(GetSP());
264  if (process_sp) {
265  Status error;
266  ret_val = process_sp->PutSTDIN(src, src_len, error);
267  }
268 
269  return ret_val;
270 }
271 
272 size_t SBProcess::GetSTDOUT(char *dst, size_t dst_len) const {
274  (char *, size_t), dst, "", dst_len);
275 
276  size_t bytes_read = 0;
277  ProcessSP process_sp(GetSP());
278  if (process_sp) {
279  Status error;
280  bytes_read = process_sp->GetSTDOUT(dst, dst_len, error);
281  }
282 
283  return bytes_read;
284 }
285 
286 size_t SBProcess::GetSTDERR(char *dst, size_t dst_len) const {
288  (char *, size_t), dst, "", dst_len);
289 
290  size_t bytes_read = 0;
291  ProcessSP process_sp(GetSP());
292  if (process_sp) {
293  Status error;
294  bytes_read = process_sp->GetSTDERR(dst, dst_len, error);
295  }
296 
297  return bytes_read;
298 }
299 
300 size_t SBProcess::GetAsyncProfileData(char *dst, size_t dst_len) const {
302  (char *, size_t), dst, "", dst_len);
303 
304  size_t bytes_read = 0;
305  ProcessSP process_sp(GetSP());
306  if (process_sp) {
307  Status error;
308  bytes_read = process_sp->GetAsyncProfileData(dst, dst_len, error);
309  }
310 
311  return bytes_read;
312 }
313 
314 void SBProcess::ReportEventState(const SBEvent &event, SBFile out) const {
316  (const SBEvent &, SBFile), event, out);
317 
318  return ReportEventState(event, out.m_opaque_sp);
319 }
320 
321 void SBProcess::ReportEventState(const SBEvent &event, FILE *out) const {
323  (const lldb::SBEvent &, FILE *), event, out);
324  FileSP outfile = std::make_shared<NativeFile>(out, false);
325  return ReportEventState(event, outfile);
326 }
327 
328 void SBProcess::ReportEventState(const SBEvent &event, FileSP out) const {
329 
331  (const SBEvent &, FileSP), event, out);
332 
333  if (!out || !out->IsValid())
334  return;
335 
336  ProcessSP process_sp(GetSP());
337  if (process_sp) {
338  StreamFile stream(out);
339  const StateType event_state = SBProcess::GetStateFromEvent(event);
340  stream.Printf("Process %" PRIu64 " %s\n",
341  process_sp->GetID(), SBDebugger::StateAsCString(event_state));
342  }
343 }
344 
346  SBCommandReturnObject &result) {
349  event, result);
350 
351  ProcessSP process_sp(GetSP());
352  if (process_sp) {
353  const StateType event_state = SBProcess::GetStateFromEvent(event);
354  char message[1024];
355  ::snprintf(message, sizeof(message), "Process %" PRIu64 " %s\n",
356  process_sp->GetID(), SBDebugger::StateAsCString(event_state));
357 
358  result.AppendMessage(message);
359  }
360 }
361 
364  (const lldb::SBThread &), thread);
365 
366  ProcessSP process_sp(GetSP());
367  if (process_sp) {
368  std::lock_guard<std::recursive_mutex> guard(
369  process_sp->GetTarget().GetAPIMutex());
370  return process_sp->GetThreadList().SetSelectedThreadByID(
371  thread.GetThreadID());
372  }
373  return false;
374 }
375 
378  tid);
379 
380 
381  bool ret_val = false;
382  ProcessSP process_sp(GetSP());
383  if (process_sp) {
384  std::lock_guard<std::recursive_mutex> guard(
385  process_sp->GetTarget().GetAPIMutex());
386  ret_val = process_sp->GetThreadList().SetSelectedThreadByID(tid);
387  }
388 
389  return ret_val;
390 }
391 
394  index_id);
395 
396  bool ret_val = false;
397  ProcessSP process_sp(GetSP());
398  if (process_sp) {
399  std::lock_guard<std::recursive_mutex> guard(
400  process_sp->GetTarget().GetAPIMutex());
401  ret_val = process_sp->GetThreadList().SetSelectedThreadByIndexID(index_id);
402  }
403 
404 
405  return ret_val;
406 }
407 
410  index);
411 
412  SBThread sb_thread;
413  ThreadSP thread_sp;
414  ProcessSP process_sp(GetSP());
415  if (process_sp) {
416  Process::StopLocker stop_locker;
417  const bool can_update = stop_locker.TryLock(&process_sp->GetRunLock());
418  std::lock_guard<std::recursive_mutex> guard(
419  process_sp->GetTarget().GetAPIMutex());
420  thread_sp = process_sp->GetThreadList().GetThreadAtIndex(index, can_update);
421  sb_thread.SetThread(thread_sp);
422  }
423 
424  return LLDB_RECORD_RESULT(sb_thread);
425 }
426 
429 
430  uint32_t num_queues = 0;
431  ProcessSP process_sp(GetSP());
432  if (process_sp) {
433  Process::StopLocker stop_locker;
434  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
435  std::lock_guard<std::recursive_mutex> guard(
436  process_sp->GetTarget().GetAPIMutex());
437  num_queues = process_sp->GetQueueList().GetSize();
438  }
439  }
440 
441  return num_queues;
442 }
443 
446  index);
447 
448  SBQueue sb_queue;
449  QueueSP queue_sp;
450  ProcessSP process_sp(GetSP());
451  if (process_sp) {
452  Process::StopLocker stop_locker;
453  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
454  std::lock_guard<std::recursive_mutex> guard(
455  process_sp->GetTarget().GetAPIMutex());
456  queue_sp = process_sp->GetQueueList().GetQueueAtIndex(index);
457  sb_queue.SetQueue(queue_sp);
458  }
459  }
460 
461  return LLDB_RECORD_RESULT(sb_queue);
462 }
463 
464 uint32_t SBProcess::GetStopID(bool include_expression_stops) {
466  include_expression_stops);
467 
468  ProcessSP process_sp(GetSP());
469  if (process_sp) {
470  std::lock_guard<std::recursive_mutex> guard(
471  process_sp->GetTarget().GetAPIMutex());
472  if (include_expression_stops)
473  return process_sp->GetStopID();
474  else
475  return process_sp->GetLastNaturalStopID();
476  }
477  return 0;
478 }
479 
482  (uint32_t), stop_id);
483 
484  SBEvent sb_event;
485  EventSP event_sp;
486  ProcessSP process_sp(GetSP());
487  if (process_sp) {
488  std::lock_guard<std::recursive_mutex> guard(
489  process_sp->GetTarget().GetAPIMutex());
490  event_sp = process_sp->GetStopEventForStopID(stop_id);
491  sb_event.reset(event_sp);
492  }
493 
494  return LLDB_RECORD_RESULT(sb_event);
495 }
496 
499 
500  StateType ret_val = eStateInvalid;
501  ProcessSP process_sp(GetSP());
502  if (process_sp) {
503  std::lock_guard<std::recursive_mutex> guard(
504  process_sp->GetTarget().GetAPIMutex());
505  ret_val = process_sp->GetState();
506  }
507 
508  return ret_val;
509 }
510 
513 
514  int exit_status = 0;
515  ProcessSP process_sp(GetSP());
516  if (process_sp) {
517  std::lock_guard<std::recursive_mutex> guard(
518  process_sp->GetTarget().GetAPIMutex());
519  exit_status = process_sp->GetExitStatus();
520  }
521 
522  return exit_status;
523 }
524 
527 
528  const char *exit_desc = nullptr;
529  ProcessSP process_sp(GetSP());
530  if (process_sp) {
531  std::lock_guard<std::recursive_mutex> guard(
532  process_sp->GetTarget().GetAPIMutex());
533  exit_desc = process_sp->GetExitDescription();
534  }
535  return exit_desc;
536 }
537 
540 
542  ProcessSP process_sp(GetSP());
543  if (process_sp)
544  ret_val = process_sp->GetID();
545 
546  return ret_val;
547 }
548 
551 
552  uint32_t ret_val = 0;
553  ProcessSP process_sp(GetSP());
554  if (process_sp)
555  ret_val = process_sp->GetUniqueID();
556  return ret_val;
557 }
558 
561 
562  ByteOrder byteOrder = eByteOrderInvalid;
563  ProcessSP process_sp(GetSP());
564  if (process_sp)
565  byteOrder = process_sp->GetTarget().GetArchitecture().GetByteOrder();
566 
567 
568  return byteOrder;
569 }
570 
573 
574  uint32_t size = 0;
575  ProcessSP process_sp(GetSP());
576  if (process_sp)
577  size = process_sp->GetTarget().GetArchitecture().GetAddressByteSize();
578 
579 
580  return size;
581 }
582 
585 
586  SBError sb_error;
587  ProcessSP process_sp(GetSP());
588 
589  if (process_sp) {
590  std::lock_guard<std::recursive_mutex> guard(
591  process_sp->GetTarget().GetAPIMutex());
592 
593  if (process_sp->GetTarget().GetDebugger().GetAsyncExecution())
594  sb_error.ref() = process_sp->Resume();
595  else
596  sb_error.ref() = process_sp->ResumeSynchronous(nullptr);
597  } else
598  sb_error.SetErrorString("SBProcess is invalid");
599 
600  return LLDB_RECORD_RESULT(sb_error);
601 }
602 
605 
606  SBError sb_error;
607  ProcessSP process_sp(GetSP());
608  if (process_sp) {
609  std::lock_guard<std::recursive_mutex> guard(
610  process_sp->GetTarget().GetAPIMutex());
611  sb_error.SetError(process_sp->Destroy(false));
612  } else
613  sb_error.SetErrorString("SBProcess is invalid");
614 
615  return LLDB_RECORD_RESULT(sb_error);
616 }
617 
620 
621  SBError sb_error;
622  ProcessSP process_sp(GetSP());
623  if (process_sp) {
624  std::lock_guard<std::recursive_mutex> guard(
625  process_sp->GetTarget().GetAPIMutex());
626  sb_error.SetError(process_sp->Halt());
627  } else
628  sb_error.SetErrorString("SBProcess is invalid");
629 
630  return LLDB_RECORD_RESULT(sb_error);
631 }
632 
635 
636  SBError sb_error;
637  ProcessSP process_sp(GetSP());
638  if (process_sp) {
639  std::lock_guard<std::recursive_mutex> guard(
640  process_sp->GetTarget().GetAPIMutex());
641  sb_error.SetError(process_sp->Destroy(true));
642  } else
643  sb_error.SetErrorString("SBProcess is invalid");
644 
645  return LLDB_RECORD_RESULT(sb_error);
646 }
647 
650 
651  // FIXME: This should come from a process default.
652  bool keep_stopped = false;
653  return LLDB_RECORD_RESULT(Detach(keep_stopped));
654 }
655 
656 SBError SBProcess::Detach(bool keep_stopped) {
657  LLDB_RECORD_METHOD(lldb::SBError, SBProcess, Detach, (bool), keep_stopped);
658 
659  SBError sb_error;
660  ProcessSP process_sp(GetSP());
661  if (process_sp) {
662  std::lock_guard<std::recursive_mutex> guard(
663  process_sp->GetTarget().GetAPIMutex());
664  sb_error.SetError(process_sp->Detach(keep_stopped));
665  } else
666  sb_error.SetErrorString("SBProcess is invalid");
667 
668  return LLDB_RECORD_RESULT(sb_error);
669 }
670 
673 
674  SBError sb_error;
675  ProcessSP process_sp(GetSP());
676  if (process_sp) {
677  std::lock_guard<std::recursive_mutex> guard(
678  process_sp->GetTarget().GetAPIMutex());
679  sb_error.SetError(process_sp->Signal(signo));
680  } else
681  sb_error.SetErrorString("SBProcess is invalid");
682 
683  return LLDB_RECORD_RESULT(sb_error);
684 }
685 
688 
689  if (auto process_sp = GetSP())
690  return LLDB_RECORD_RESULT(SBUnixSignals{process_sp});
691 
693 }
694 
697 
698  ProcessSP process_sp(GetSP());
699  if (process_sp) {
700  process_sp->SendAsyncInterrupt();
701  }
702 }
703 
706  tid);
707 
708  SBThread sb_thread;
709  ThreadSP thread_sp;
710  ProcessSP process_sp(GetSP());
711  if (process_sp) {
712  Process::StopLocker stop_locker;
713  const bool can_update = stop_locker.TryLock(&process_sp->GetRunLock());
714  std::lock_guard<std::recursive_mutex> guard(
715  process_sp->GetTarget().GetAPIMutex());
716  thread_sp = process_sp->GetThreadList().FindThreadByID(tid, can_update);
717  sb_thread.SetThread(thread_sp);
718  }
719 
720  return LLDB_RECORD_RESULT(sb_thread);
721 }
722 
725  index_id);
726 
727  SBThread sb_thread;
728  ThreadSP thread_sp;
729  ProcessSP process_sp(GetSP());
730  if (process_sp) {
731  Process::StopLocker stop_locker;
732  const bool can_update = stop_locker.TryLock(&process_sp->GetRunLock());
733  std::lock_guard<std::recursive_mutex> guard(
734  process_sp->GetTarget().GetAPIMutex());
735  thread_sp =
736  process_sp->GetThreadList().FindThreadByIndexID(index_id, can_update);
737  sb_thread.SetThread(thread_sp);
738  }
739 
740  return LLDB_RECORD_RESULT(sb_thread);
741 }
742 
745  (const lldb::SBEvent &), event);
746 
747  StateType ret_val = Process::ProcessEventData::GetStateFromEvent(event.get());
748 
749  return ret_val;
750 }
751 
754  (const lldb::SBEvent &), event);
755 
756  bool ret_val = Process::ProcessEventData::GetRestartedFromEvent(event.get());
757 
758  return ret_val;
759 }
760 
763  (const lldb::SBEvent &), event);
764 
765  return Process::ProcessEventData::GetNumRestartedReasons(event.get());
766 }
767 
768 const char *
770  size_t idx) {
771  LLDB_RECORD_STATIC_METHOD(const char *, SBProcess,
773  (const lldb::SBEvent &, size_t), event, idx);
774 
775  return Process::ProcessEventData::GetRestartedReasonAtIndex(event.get(), idx);
776 }
777 
780  (const lldb::SBEvent &), event);
781 
782  ProcessSP process_sp =
783  Process::ProcessEventData::GetProcessFromEvent(event.get());
784  if (!process_sp) {
785  // StructuredData events also know the process they come from. Try that.
786  process_sp = EventDataStructuredData::GetProcessFromEvent(event.get());
787  }
788 
789  return LLDB_RECORD_RESULT(SBProcess(process_sp));
790 }
791 
794  (const lldb::SBEvent &), event);
795 
796  return Process::ProcessEventData::GetInterruptedFromEvent(event.get());
797 }
798 
803  event);
804 
805  return LLDB_RECORD_RESULT(SBStructuredData(event.GetSP()));
806 }
807 
810  (const lldb::SBEvent &), event);
811 
812  return (event.GetBroadcasterClass() == SBProcess::GetBroadcasterClass()) &&
814 }
815 
818  (const lldb::SBEvent &), event);
819 
820  EventSP event_sp = event.GetSP();
821  EventData *event_data = event_sp ? event_sp->GetData() : nullptr;
822  return event_data && (event_data->GetFlavor() ==
823  EventDataStructuredData::GetFlavorString());
824 }
825 
829 
830 
831  ProcessSP process_sp(GetSP());
832 
833  SBBroadcaster broadcaster(process_sp.get(), false);
834 
835 
836  return LLDB_RECORD_RESULT(broadcaster);
837 }
838 
842 
843  return Process::GetStaticBroadcasterClass().AsCString();
844 }
845 
846 size_t SBProcess::ReadMemory(addr_t addr, void *dst, size_t dst_len,
847  SBError &sb_error) {
849  (lldb::addr_t, void *, size_t, lldb::SBError &), addr, dst,
850  dst_len, sb_error);
851 
852  size_t bytes_read = 0;
853 
854  ProcessSP process_sp(GetSP());
855 
856 
857  if (process_sp) {
858  Process::StopLocker stop_locker;
859  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
860  std::lock_guard<std::recursive_mutex> guard(
861  process_sp->GetTarget().GetAPIMutex());
862  bytes_read = process_sp->ReadMemory(addr, dst, dst_len, sb_error.ref());
863  } else {
864  sb_error.SetErrorString("process is running");
865  }
866  } else {
867  sb_error.SetErrorString("SBProcess is invalid");
868  }
869 
870  return bytes_read;
871 }
872 
873 size_t SBProcess::ReadCStringFromMemory(addr_t addr, void *buf, size_t size,
874  lldb::SBError &sb_error) {
876  (lldb::addr_t, void *, size_t, lldb::SBError &), addr, buf,
877  size, sb_error);
878 
879  size_t bytes_read = 0;
880  ProcessSP process_sp(GetSP());
881  if (process_sp) {
882  Process::StopLocker stop_locker;
883  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
884  std::lock_guard<std::recursive_mutex> guard(
885  process_sp->GetTarget().GetAPIMutex());
886  bytes_read = process_sp->ReadCStringFromMemory(addr, (char *)buf, size,
887  sb_error.ref());
888  } else {
889  sb_error.SetErrorString("process is running");
890  }
891  } else {
892  sb_error.SetErrorString("SBProcess is invalid");
893  }
894  return bytes_read;
895 }
896 
898  lldb::SBError &sb_error) {
900  (lldb::addr_t, uint32_t, lldb::SBError &), addr, byte_size,
901  sb_error);
902 
903  uint64_t value = 0;
904  ProcessSP process_sp(GetSP());
905  if (process_sp) {
906  Process::StopLocker stop_locker;
907  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
908  std::lock_guard<std::recursive_mutex> guard(
909  process_sp->GetTarget().GetAPIMutex());
910  value = process_sp->ReadUnsignedIntegerFromMemory(addr, byte_size, 0,
911  sb_error.ref());
912  } else {
913  sb_error.SetErrorString("process is running");
914  }
915  } else {
916  sb_error.SetErrorString("SBProcess is invalid");
917  }
918  return value;
919 }
920 
922  lldb::SBError &sb_error) {
924  (lldb::addr_t, lldb::SBError &), addr, sb_error);
925 
927  ProcessSP process_sp(GetSP());
928  if (process_sp) {
929  Process::StopLocker stop_locker;
930  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
931  std::lock_guard<std::recursive_mutex> guard(
932  process_sp->GetTarget().GetAPIMutex());
933  ptr = process_sp->ReadPointerFromMemory(addr, sb_error.ref());
934  } else {
935  sb_error.SetErrorString("process is running");
936  }
937  } else {
938  sb_error.SetErrorString("SBProcess is invalid");
939  }
940  return ptr;
941 }
942 
943 size_t SBProcess::WriteMemory(addr_t addr, const void *src, size_t src_len,
944  SBError &sb_error) {
946  (lldb::addr_t, const void *, size_t, lldb::SBError &), addr,
947  src, src_len, sb_error);
948 
949  size_t bytes_written = 0;
950 
951  ProcessSP process_sp(GetSP());
952 
953  if (process_sp) {
954  Process::StopLocker stop_locker;
955  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
956  std::lock_guard<std::recursive_mutex> guard(
957  process_sp->GetTarget().GetAPIMutex());
958  bytes_written =
959  process_sp->WriteMemory(addr, src, src_len, sb_error.ref());
960  } else {
961  sb_error.SetErrorString("process is running");
962  }
963  }
964 
965  return bytes_written;
966 }
967 
970  description);
971 
972  Stream &strm = description.ref();
973 
974  ProcessSP process_sp(GetSP());
975  if (process_sp) {
976  char path[PATH_MAX];
977  GetTarget().GetExecutable().GetPath(path, sizeof(path));
978  Module *exe_module = process_sp->GetTarget().GetExecutableModulePointer();
979  const char *exe_name = nullptr;
980  if (exe_module)
981  exe_name = exe_module->GetFileSpec().GetFilename().AsCString();
982 
983  strm.Printf("SBProcess: pid = %" PRIu64 ", state = %s, threads = %d%s%s",
984  process_sp->GetID(), lldb_private::StateAsCString(GetState()),
985  GetNumThreads(), exe_name ? ", executable = " : "",
986  exe_name ? exe_name : "");
987  } else
988  strm.PutCString("No value");
989 
990  return true;
991 }
992 
996  SBStructuredData data;
997  ProcessSP process_sp(GetSP());
998  if (!process_sp)
999  return LLDB_RECORD_RESULT(data);
1000 
1001  PlatformSP platform_sp = process_sp->GetTarget().GetPlatform();
1002 
1003  if (!platform_sp)
1004  return LLDB_RECORD_RESULT(data);
1005 
1006  auto expected_data =
1007  platform_sp->FetchExtendedCrashInformation(*process_sp.get());
1008 
1009  if (!expected_data)
1010  return LLDB_RECORD_RESULT(data);
1011 
1012  StructuredData::ObjectSP fetched_data = *expected_data;
1013  data.m_impl_up->SetObjectSP(fetched_data);
1014  return LLDB_RECORD_RESULT(data);
1015 }
1016 
1017 uint32_t
1021  (lldb::SBError &), sb_error);
1022 
1023  uint32_t num = 0;
1024  ProcessSP process_sp(GetSP());
1025  if (process_sp) {
1026  std::lock_guard<std::recursive_mutex> guard(
1027  process_sp->GetTarget().GetAPIMutex());
1028  sb_error.SetError(process_sp->GetWatchpointSupportInfo(num));
1029  } else {
1030  sb_error.SetErrorString("SBProcess is invalid");
1031  }
1032  return num;
1033 }
1034 
1036  lldb::SBError &sb_error) {
1039  sb_remote_image_spec, sb_error);
1040 
1041  return LoadImage(SBFileSpec(), sb_remote_image_spec, sb_error);
1042 }
1043 
1045  const lldb::SBFileSpec &sb_remote_image_spec,
1046  lldb::SBError &sb_error) {
1049  (const lldb::SBFileSpec &, const lldb::SBFileSpec &, lldb::SBError &),
1050  sb_local_image_spec, sb_remote_image_spec, sb_error);
1051 
1052  ProcessSP process_sp(GetSP());
1053  if (process_sp) {
1054  Process::StopLocker stop_locker;
1055  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
1056  std::lock_guard<std::recursive_mutex> guard(
1057  process_sp->GetTarget().GetAPIMutex());
1058  PlatformSP platform_sp = process_sp->GetTarget().GetPlatform();
1059  return platform_sp->LoadImage(process_sp.get(), *sb_local_image_spec,
1060  *sb_remote_image_spec, sb_error.ref());
1061  } else {
1062  sb_error.SetErrorString("process is running");
1063  }
1064  } else {
1065  sb_error.SetErrorString("process is invalid");
1066  }
1067  return LLDB_INVALID_IMAGE_TOKEN;
1068 }
1069 
1071  SBStringList &paths,
1072  lldb::SBFileSpec &loaded_path,
1073  lldb::SBError &error) {
1077  image_spec, paths, loaded_path, error);
1078 
1079  ProcessSP process_sp(GetSP());
1080  if (process_sp) {
1081  Process::StopLocker stop_locker;
1082  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
1083  std::lock_guard<std::recursive_mutex> guard(
1084  process_sp->GetTarget().GetAPIMutex());
1085  PlatformSP platform_sp = process_sp->GetTarget().GetPlatform();
1086  size_t num_paths = paths.GetSize();
1087  std::vector<std::string> paths_vec;
1088  paths_vec.reserve(num_paths);
1089  for (size_t i = 0; i < num_paths; i++)
1090  paths_vec.push_back(paths.GetStringAtIndex(i));
1091  FileSpec loaded_spec;
1092 
1093  uint32_t token = platform_sp->LoadImageUsingPaths(
1094  process_sp.get(), *image_spec, paths_vec, error.ref(), &loaded_spec);
1095  if (token != LLDB_INVALID_IMAGE_TOKEN)
1096  loaded_path = loaded_spec;
1097  return token;
1098  } else {
1099  error.SetErrorString("process is running");
1100  }
1101  } else {
1102  error.SetErrorString("process is invalid");
1103  }
1104 
1105  return LLDB_INVALID_IMAGE_TOKEN;
1106 }
1107 
1110  image_token);
1111 
1112  lldb::SBError sb_error;
1113  ProcessSP process_sp(GetSP());
1114  if (process_sp) {
1115  Process::StopLocker stop_locker;
1116  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
1117  std::lock_guard<std::recursive_mutex> guard(
1118  process_sp->GetTarget().GetAPIMutex());
1119  PlatformSP platform_sp = process_sp->GetTarget().GetPlatform();
1120  sb_error.SetError(
1121  platform_sp->UnloadImage(process_sp.get(), image_token));
1122  } else {
1123  sb_error.SetErrorString("process is running");
1124  }
1125  } else
1126  sb_error.SetErrorString("invalid process");
1127  return LLDB_RECORD_RESULT(sb_error);
1128 }
1129 
1130 lldb::SBError SBProcess::SendEventData(const char *event_data) {
1132  event_data);
1133 
1134  lldb::SBError sb_error;
1135  ProcessSP process_sp(GetSP());
1136  if (process_sp) {
1137  Process::StopLocker stop_locker;
1138  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
1139  std::lock_guard<std::recursive_mutex> guard(
1140  process_sp->GetTarget().GetAPIMutex());
1141  sb_error.SetError(process_sp->SendEventData(event_data));
1142  } else {
1143  sb_error.SetErrorString("process is running");
1144  }
1145  } else
1146  sb_error.SetErrorString("invalid process");
1147  return LLDB_RECORD_RESULT(sb_error);
1148 }
1149 
1152 
1153  ProcessSP process_sp(GetSP());
1154  if (process_sp && process_sp->GetSystemRuntime()) {
1155  SystemRuntime *runtime = process_sp->GetSystemRuntime();
1156  return runtime->GetExtendedBacktraceTypes().size();
1157  }
1158  return 0;
1159 }
1160 
1163  (uint32_t), idx);
1164 
1165  ProcessSP process_sp(GetSP());
1166  if (process_sp && process_sp->GetSystemRuntime()) {
1167  SystemRuntime *runtime = process_sp->GetSystemRuntime();
1168  const std::vector<ConstString> &names =
1169  runtime->GetExtendedBacktraceTypes();
1170  if (idx < names.size()) {
1171  return names[idx].AsCString();
1172  }
1173  }
1174  return nullptr;
1175 }
1176 
1179  (lldb::addr_t), addr);
1180 
1181  ProcessSP process_sp(GetSP());
1182  SBThreadCollection threads;
1183  if (process_sp) {
1184  threads = SBThreadCollection(process_sp->GetHistoryThreads(addr));
1185  }
1186  return LLDB_RECORD_RESULT(threads);
1187 }
1188 
1193 
1194  ProcessSP process_sp(GetSP());
1195  if (!process_sp)
1196  return false;
1197 
1198  std::lock_guard<std::recursive_mutex> guard(
1199  process_sp->GetTarget().GetAPIMutex());
1200 
1201  InstrumentationRuntimeSP runtime_sp =
1202  process_sp->GetInstrumentationRuntime(type);
1203 
1204  if (!runtime_sp.get())
1205  return false;
1206 
1207  return runtime_sp->IsActive();
1208 }
1209 
1210 lldb::SBError SBProcess::SaveCore(const char *file_name) {
1212  file_name);
1213 
1215  ProcessSP process_sp(GetSP());
1216  if (!process_sp) {
1217  error.SetErrorString("SBProcess is invalid");
1218  return LLDB_RECORD_RESULT(error);
1219  }
1220 
1221  std::lock_guard<std::recursive_mutex> guard(
1222  process_sp->GetTarget().GetAPIMutex());
1223 
1224  if (process_sp->GetState() != eStateStopped) {
1225  error.SetErrorString("the process is not stopped");
1226  return LLDB_RECORD_RESULT(error);
1227  }
1228 
1229  FileSpec core_file(file_name);
1231  error.ref() = PluginManager::SaveCore(process_sp, core_file, core_style, "");
1232  return LLDB_RECORD_RESULT(error);
1233 }
1234 
1237  SBMemoryRegionInfo &sb_region_info) {
1239  (lldb::addr_t, lldb::SBMemoryRegionInfo &), load_addr,
1240  sb_region_info);
1241 
1242  lldb::SBError sb_error;
1243  ProcessSP process_sp(GetSP());
1244  if (process_sp) {
1245  Process::StopLocker stop_locker;
1246  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
1247  std::lock_guard<std::recursive_mutex> guard(
1248  process_sp->GetTarget().GetAPIMutex());
1249 
1250  sb_error.ref() =
1251  process_sp->GetMemoryRegionInfo(load_addr, sb_region_info.ref());
1252  } else {
1253  sb_error.SetErrorString("process is running");
1254  }
1255  } else {
1256  sb_error.SetErrorString("SBProcess is invalid");
1257  }
1258  return LLDB_RECORD_RESULT(sb_error);
1259 }
1260 
1264 
1265  lldb::SBMemoryRegionInfoList sb_region_list;
1266 
1267  ProcessSP process_sp(GetSP());
1268  Process::StopLocker stop_locker;
1269  if (process_sp && stop_locker.TryLock(&process_sp->GetRunLock())) {
1270  std::lock_guard<std::recursive_mutex> guard(
1271  process_sp->GetTarget().GetAPIMutex());
1272 
1273  process_sp->GetMemoryRegions(sb_region_list.ref());
1274  }
1275 
1276  return LLDB_RECORD_RESULT(sb_region_list);
1277 }
1278 
1281 
1282  lldb::SBProcessInfo sb_proc_info;
1283  ProcessSP process_sp(GetSP());
1284  ProcessInstanceInfo proc_info;
1285  if (process_sp && process_sp->GetProcessInfo(proc_info)) {
1286  sb_proc_info.SetProcessInfo(proc_info);
1287  }
1288  return LLDB_RECORD_RESULT(sb_proc_info);
1289 }
1290 
1292  lldb::SBError &sb_error) {
1294  (size_t, uint32_t, lldb::SBError &), size, permissions,
1295  sb_error);
1296 
1298  ProcessSP process_sp(GetSP());
1299  if (process_sp) {
1300  Process::StopLocker stop_locker;
1301  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
1302  std::lock_guard<std::recursive_mutex> guard(
1303  process_sp->GetTarget().GetAPIMutex());
1304  addr = process_sp->AllocateMemory(size, permissions, sb_error.ref());
1305  } else {
1306  sb_error.SetErrorString("process is running");
1307  }
1308  } else {
1309  sb_error.SetErrorString("SBProcess is invalid");
1310  }
1311  return addr;
1312 }
1313 
1316  ptr);
1317 
1318  lldb::SBError sb_error;
1319  ProcessSP process_sp(GetSP());
1320  if (process_sp) {
1321  Process::StopLocker stop_locker;
1322  if (stop_locker.TryLock(&process_sp->GetRunLock())) {
1323  std::lock_guard<std::recursive_mutex> guard(
1324  process_sp->GetTarget().GetAPIMutex());
1325  Status error = process_sp->DeallocateMemory(ptr);
1326  sb_error.SetError(error);
1327  } else {
1328  sb_error.SetErrorString("process is running");
1329  }
1330  } else {
1331  sb_error.SetErrorString("SBProcess is invalid");
1332  }
1333  return sb_error;
1334 }
1335 
1336 namespace lldb_private {
1337 namespace repro {
1338 
1339 template <>
1343  LLDB_REGISTER_CONSTRUCTOR(SBProcess, (const lldb::ProcessSP &));
1345  SBProcess, operator=,(const lldb::SBProcess &));
1346  LLDB_REGISTER_STATIC_METHOD(const char *, SBProcess,
1347  GetBroadcasterClassName, ());
1348  LLDB_REGISTER_METHOD(const char *, SBProcess, GetPluginName, ());
1349  LLDB_REGISTER_METHOD(const char *, SBProcess, GetShortPluginName, ());
1350  LLDB_REGISTER_METHOD(void, SBProcess, Clear, ());
1351  LLDB_REGISTER_METHOD_CONST(bool, SBProcess, IsValid, ());
1352  LLDB_REGISTER_METHOD_CONST(bool, SBProcess, operator bool, ());
1353  LLDB_REGISTER_METHOD(bool, SBProcess, RemoteLaunch,
1354  (const char **, const char **, const char *,
1355  const char *, const char *, const char *, uint32_t,
1356  bool, lldb::SBError &));
1357  LLDB_REGISTER_METHOD(bool, SBProcess, RemoteAttachToProcessWithID,
1358  (lldb::pid_t, lldb::SBError &));
1359  LLDB_REGISTER_METHOD(uint32_t, SBProcess, GetNumThreads, ());
1361  ());
1362  LLDB_REGISTER_METHOD(lldb::SBThread, SBProcess, CreateOSPluginThread,
1365  LLDB_REGISTER_METHOD(size_t, SBProcess, PutSTDIN, (const char *, size_t));
1366  LLDB_REGISTER_METHOD_CONST(void, SBProcess, ReportEventState,
1367  (const lldb::SBEvent &, FILE *));
1368  LLDB_REGISTER_METHOD_CONST(void, SBProcess, ReportEventState,
1369  (const lldb::SBEvent &, FileSP));
1370  LLDB_REGISTER_METHOD_CONST(void, SBProcess, ReportEventState,
1371  (const lldb::SBEvent &, SBFile));
1373  void, SBProcess, AppendEventStateReport,
1375  LLDB_REGISTER_METHOD(bool, SBProcess, SetSelectedThread,
1376  (const lldb::SBThread &));
1377  LLDB_REGISTER_METHOD(bool, SBProcess, SetSelectedThreadByID, (lldb::tid_t));
1378  LLDB_REGISTER_METHOD(bool, SBProcess, SetSelectedThreadByIndexID,
1379  (uint32_t));
1380  LLDB_REGISTER_METHOD(lldb::SBThread, SBProcess, GetThreadAtIndex, (size_t));
1381  LLDB_REGISTER_METHOD(uint32_t, SBProcess, GetNumQueues, ());
1382  LLDB_REGISTER_METHOD(lldb::SBQueue, SBProcess, GetQueueAtIndex, (size_t));
1383  LLDB_REGISTER_METHOD(uint32_t, SBProcess, GetStopID, (bool));
1384  LLDB_REGISTER_METHOD(lldb::SBEvent, SBProcess, GetStopEventForStopID,
1385  (uint32_t));
1387  LLDB_REGISTER_METHOD(int, SBProcess, GetExitStatus, ());
1388  LLDB_REGISTER_METHOD(const char *, SBProcess, GetExitDescription, ());
1389  LLDB_REGISTER_METHOD(lldb::pid_t, SBProcess, GetProcessID, ());
1390  LLDB_REGISTER_METHOD(uint32_t, SBProcess, GetUniqueID, ());
1392  LLDB_REGISTER_METHOD_CONST(uint32_t, SBProcess, GetAddressByteSize, ());
1398  LLDB_REGISTER_METHOD(lldb::SBError, SBProcess, Detach, (bool));
1399  LLDB_REGISTER_METHOD(lldb::SBError, SBProcess, Signal, (int));
1400  LLDB_REGISTER_METHOD(lldb::SBUnixSignals, SBProcess, GetUnixSignals, ());
1401  LLDB_REGISTER_METHOD(void, SBProcess, SendAsyncInterrupt, ());
1403  (lldb::tid_t));
1404  LLDB_REGISTER_METHOD(lldb::SBThread, SBProcess, GetThreadByIndexID,
1405  (uint32_t));
1407  (const lldb::SBEvent &));
1408  LLDB_REGISTER_STATIC_METHOD(bool, SBProcess, GetRestartedFromEvent,
1409  (const lldb::SBEvent &));
1411  GetNumRestartedReasonsFromEvent,
1412  (const lldb::SBEvent &));
1413  LLDB_REGISTER_STATIC_METHOD(const char *, SBProcess,
1414  GetRestartedReasonAtIndexFromEvent,
1415  (const lldb::SBEvent &, size_t));
1417  (const lldb::SBEvent &));
1418  LLDB_REGISTER_STATIC_METHOD(bool, SBProcess, GetInterruptedFromEvent,
1419  (const lldb::SBEvent &));
1421  GetStructuredDataFromEvent,
1422  (const lldb::SBEvent &));
1423  LLDB_REGISTER_STATIC_METHOD(bool, SBProcess, EventIsProcessEvent,
1424  (const lldb::SBEvent &));
1425  LLDB_REGISTER_STATIC_METHOD(bool, SBProcess, EventIsStructuredDataEvent,
1426  (const lldb::SBEvent &));
1428  ());
1429  LLDB_REGISTER_STATIC_METHOD(const char *, SBProcess, GetBroadcasterClass,
1430  ());
1431  LLDB_REGISTER_METHOD(uint64_t, SBProcess, ReadUnsignedFromMemory,
1433  LLDB_REGISTER_METHOD(lldb::addr_t, SBProcess, ReadPointerFromMemory,
1435  LLDB_REGISTER_METHOD(bool, SBProcess, GetDescription, (lldb::SBStream &));
1437  GetExtendedCrashInformation, ());
1439  GetNumSupportedHardwareWatchpoints,
1440  (lldb::SBError &));
1444  uint32_t, SBProcess, LoadImage,
1445  (const lldb::SBFileSpec &, const lldb::SBFileSpec &, lldb::SBError &));
1446  LLDB_REGISTER_METHOD(uint32_t, SBProcess, LoadImageUsingPaths,
1451  (const char *));
1452  LLDB_REGISTER_METHOD(uint32_t, SBProcess, GetNumExtendedBacktraceTypes, ());
1453  LLDB_REGISTER_METHOD(const char *, SBProcess,
1454  GetExtendedBacktraceTypeAtIndex, (uint32_t));
1456  (lldb::addr_t));
1457  LLDB_REGISTER_METHOD(bool, SBProcess, IsInstrumentationRuntimePresent,
1459  LLDB_REGISTER_METHOD(lldb::SBError, SBProcess, SaveCore, (const char *));
1460  LLDB_REGISTER_METHOD(lldb::SBError, SBProcess, GetMemoryRegionInfo,
1463  GetMemoryRegions, ());
1464  LLDB_REGISTER_METHOD(lldb::SBProcessInfo, SBProcess, GetProcessInfo, ());
1465  LLDB_REGISTER_METHOD(lldb::addr_t, SBProcess, AllocateMemory,
1466  (size_t, uint32_t, lldb::SBError &));
1467  LLDB_REGISTER_METHOD(lldb::SBError, SBProcess, DeallocateMemory,
1468  (lldb::addr_t));
1469 
1470  LLDB_REGISTER_CHAR_PTR_METHOD_CONST(size_t, SBProcess, GetSTDOUT);
1471  LLDB_REGISTER_CHAR_PTR_METHOD_CONST(size_t, SBProcess, GetSTDERR);
1472  LLDB_REGISTER_CHAR_PTR_METHOD_CONST(size_t, SBProcess, GetAsyncProfileData);
1473 }
1474 
1475 }
1476 }
lldb::SBStringList
Definition: SBStringList.h:16
lldb_private::ProcessInfo::GetArguments
Args & GetArguments()
Definition: ProcessInfo.h:75
lldb::SBDebugger::StateAsCString
static const char * StateAsCString(lldb::StateType state)
Definition: SBDebugger.cpp:689
lldb_private::ProcessInstanceInfo
Definition: ProcessInfo.h:108
LLDB_RECORD_STATIC_METHOD_NO_ARGS
#define LLDB_RECORD_STATIC_METHOD_NO_ARGS(Result, Class, Method)
Definition: ReproducerInstrumentation.h:174
lldb::SBEvent::get
lldb_private::Event * get() const
Definition: SBEvent.cpp:139
lldb::SBThreadCollection
class LLDB_API SBThreadCollection
Definition: SBDefines.h:76
lldb::SBStream::ref
lldb_private::Stream & ref()
Definition: SBStream.cpp:178
lldb::SBProcess::Kill
lldb::SBError Kill()
Definition: SBProcess.cpp:633
lldb::SBProcess::GetStateFromEvent
static lldb::StateType GetStateFromEvent(const lldb::SBEvent &event)
Definition: SBProcess.cpp:743
lldb::SBThread
Definition: SBThread.h:20
lldb_private::EventData::GetFlavor
virtual ConstString GetFlavor() const =0
lldb::SBStringList::GetSize
uint32_t GetSize() const
Definition: SBStringList.cpp:102
lldb::SBProcess::GetAsyncProfileData
size_t GetAsyncProfileData(char *dst, size_t dst_len) const
Definition: SBProcess.cpp:300
lldb::SBFile::m_opaque_sp
FileSP m_opaque_sp
Definition: SBFile.h:45
lldb::SBThread::SetThread
void SetThread(const lldb::ThreadSP &lldb_object_sp)
Definition: SBThread.cpp:379
lldb::SBProcess::IsInstrumentationRuntimePresent
bool IsInstrumentationRuntimePresent(InstrumentationRuntimeType type)
Definition: SBProcess.cpp:1189
lldb::SBProcess::Detach
lldb::SBError Detach()
Definition: SBProcess.cpp:648
lldb_private::ProcessInfo::SetExecutableFile
void SetExecutableFile(const FileSpec &exe_file, bool add_exe_file_as_first_arg)
Definition: ProcessInfo.cpp:62
lldb::SBProcess::SBProcess
SBProcess()
Definition: SBProcess.cpp:52
lldb::SBProcess::GetQueueAtIndex
lldb::SBQueue GetQueueAtIndex(size_t index)
Definition: SBProcess.cpp:444
LLDB_INVALID_PROCESS_ID
#define LLDB_INVALID_PROCESS_ID
Definition: lldb-defines.h:93
lldb::SBProcess::GetState
lldb::StateType GetState()
Definition: SBProcess.cpp:497
LLDB_RECORD_RESULT
#define LLDB_RECORD_RESULT(Result)
Definition: ReproducerInstrumentation.h:211
lldb::SBTarget::GetExecutable
lldb::SBFileSpec GetExecutable()
Definition: SBTarget.cpp:577
lldb::SBCommandReturnObject
Definition: SBCommandReturnObject.h:24
LLDB_RECORD_METHOD_CONST_NO_ARGS
#define LLDB_RECORD_METHOD_CONST_NO_ARGS(Result, Class, Method)
Definition: ReproducerInstrumentation.h:168
lldb::SBError
Definition: SBError.h:20
lldb::SBStructuredData
class LLDB_API SBStructuredData
Definition: SBDefines.h:70
lldb::SBProcess::DeallocateMemory
lldb::SBError DeallocateMemory(lldb::addr_t ptr)
Deallocate memory in the process.
Definition: SBProcess.cpp:1314
lldb::SBProcess::GetPluginName
const char * GetPluginName()
Definition: SBProcess.cpp:86
lldb::SBProcess::IsValid
bool IsValid() const
Definition: SBProcess.cpp:116
lldb-defines.h
SBStringList.h
lldb::SBProcess::GetNumSupportedHardwareWatchpoints
uint32_t GetNumSupportedHardwareWatchpoints(lldb::SBError &error) const
Definition: SBProcess.cpp:1018
LLDB_RECORD_CHAR_PTR_METHOD_CONST
#define LLDB_RECORD_CHAR_PTR_METHOD_CONST(Result, Class, Method, Signature, StrOut,...)
Definition: ReproducerInstrumentation.h:201
lldb::SBProcess::SetSP
void SetSP(const lldb::ProcessSP &process_sp)
Definition: SBProcess.cpp:108
lldb::SBProcess::LoadImageUsingPaths
uint32_t LoadImageUsingPaths(const lldb::SBFileSpec &image_spec, SBStringList &paths, lldb::SBFileSpec &loaded_path, lldb::SBError &error)
Load a shared library into this process, starting with a library name and a list of paths,...
Definition: SBProcess.cpp:1070
LLDB_RECORD_METHOD_NO_ARGS
#define LLDB_RECORD_METHOD_NO_ARGS(Result, Class, Method)
Definition: ReproducerInstrumentation.h:165
lldb_private::Args::AppendArguments
void AppendArguments(const Args &rhs)
Definition: Args.cpp:293
lldb::SBProcess::Continue
lldb::SBError Continue()
Definition: SBProcess.cpp:583
lldb_private::EventData
Definition: Event.h:36
Module.h
lldb::SBProcess::GetByteOrder
lldb::ByteOrder GetByteOrder() const
Definition: SBProcess.cpp:559
lldb::SBProcess::GetExitStatus
int GetExitStatus()
Definition: SBProcess.cpp:511
lldb_private::StateAsCString
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
Definition: State.cpp:14
lldb_private::ProcessRunLock::ProcessRunLocker
Definition: ProcessRunLock.h:36
lldb::SBProcess::AllocateMemory
lldb::addr_t AllocateMemory(size_t size, uint32_t permissions, lldb::SBError &error)
Allocate memory within the process.
Definition: SBProcess.cpp:1291
lldb::SBThreadCollection
Definition: SBThreadCollection.h:16
LLDB_RECORD_CONSTRUCTOR_NO_ARGS
#define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)
Definition: ReproducerInstrumentation.h:136
lldb::SBProcess::ReadPointerFromMemory
lldb::addr_t ReadPointerFromMemory(addr_t addr, lldb::SBError &error)
Definition: SBProcess.cpp:921
lldb::SBProcessInfo
Definition: SBProcessInfo.h:16
lldb_private::Module
Definition: Module.h:84
lldb_private::SystemRuntime
Definition: SystemRuntime.h:43
lldb_private::ConstString::AsCString
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:193
lldb::SBProcess::SetSelectedThreadByIndexID
bool SetSelectedThreadByIndexID(uint32_t index_id)
Definition: SBProcess.cpp:392
LLDB_REGISTER_METHOD_CONST
#define LLDB_REGISTER_METHOD_CONST(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:98
lldb::SBProcess::SendAsyncInterrupt
void SendAsyncInterrupt()
Definition: SBProcess.cpp:695
lldb::SBEvent
Definition: SBEvent.h:21
lldb::SBProcess::GetUnixSignals
lldb::SBUnixSignals GetUnixSignals()
Definition: SBProcess.cpp:686
lldb_private::ProcessInfo::SetProcessID
void SetProcessID(lldb::pid_t pid)
Definition: ProcessInfo.h:69
lldb::SBProcess
Definition: SBProcess.h:23
lldb::SBProcess::UnloadImage
lldb::SBError UnloadImage(uint32_t image_token)
Definition: SBProcess.cpp:1108
lldb::SBMemoryRegionInfoList::ref
lldb_private::MemoryRegionInfos & ref()
Definition: SBMemoryRegionInfoList.cpp:78
lldb::SBProcess::ReportEventState
void ReportEventState(const lldb::SBEvent &event, FILE *out) const
Definition: SBProcess.cpp:321
lldb_private::Stream
Definition: Stream.h:28
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb::SBProcess::GetDescription
bool GetDescription(lldb::SBStream &description)
Definition: SBProcess.cpp:968
SBReproducerPrivate.h
SBMemoryRegionInfo.h
lldb::SBProcess::GetSTDOUT
size_t GetSTDOUT(char *dst, size_t dst_len) const
Definition: SBProcess.cpp:272
LLDB_REGISTER_CONSTRUCTOR
#define LLDB_REGISTER_CONSTRUCTOR(Class, Signature)
Definition: ReproducerInstrumentation.h:89
lldb::SBProcess::~SBProcess
~SBProcess()
Debugger.h
lldb::SBProcess::GetMemoryRegions
lldb::SBMemoryRegionInfoList GetMemoryRegions()
Return the list of memory regions within the process.
Definition: SBProcess.cpp:1261
lldb::SBProcessInfo::SetProcessInfo
void SetProcessInfo(const lldb_private::ProcessInstanceInfo &proc_info_ref)
Definition: SBProcessInfo.cpp:47
lldb::SBStructuredData::m_impl_up
StructuredDataImplUP m_impl_up
Definition: SBStructuredData.h:104
Process.h
lldb::SBMemoryRegionInfo::ref
lldb_private::MemoryRegionInfo & ref()
Definition: SBMemoryRegionInfo.cpp:91
lldb::SBMemoryRegionInfoList
Definition: SBMemoryRegionInfoList.h:18
lldb::eStateStopped
@ eStateStopped
Process or thread is stopped and can be examined.
Definition: lldb-enumerations.h:84
lldb::SBProcess::CreateOSPluginThread
lldb::SBThread CreateOSPluginThread(lldb::tid_t tid, lldb::addr_t context)
Definition: SBProcess.cpp:226
lldb_private::Module::GetPlatformFileSpec
const FileSpec & GetPlatformFileSpec() const
Get accessor for the module platform file specification.
Definition: Module.h:490
Target.h
lldb_private::Module::GetFileSpec
const FileSpec & GetFileSpec() const
Get const accessor for the module file specification.
Definition: Module.h:476
lldb::SBTarget
Definition: SBTarget.h:29
lldb_private::FileSpec
Definition: FileSpec.h:56
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb::SBStringList::GetStringAtIndex
const char * GetStringAtIndex(size_t idx)
Definition: SBStringList.cpp:111
SBStream.h
ProcessInfo.h
lldb::SBFile
Definition: SBFile.h:16
lldb::SBProcess::GetShortPluginName
const char * GetShortPluginName()
Definition: SBProcess.cpp:96
lldb::SBProcess::m_opaque_wp
lldb::ProcessWP m_opaque_wp
Definition: SBProcess.h:430
LLDB_RECORD_METHOD
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature,...)
Definition: ReproducerInstrumentation.h:158
lldb::SBProcess::Clear
void Clear()
Definition: SBProcess.cpp:110
lldb::SBCommandReturnObject::AppendMessage
void AppendMessage(const char *message)
Definition: SBCommandReturnObject.cpp:199
lldb_private::ProcessLaunchInfo
Definition: ProcessLaunchInfo.h:31
SBThread.h
Args.h
MemoryRegionInfo.h
lldb_private::SystemRuntime::GetExtendedBacktraceTypes
virtual const std::vector< ConstString > & GetExtendedBacktraceTypes()
Return a list of thread origin extended backtraces that may be available.
Definition: SystemRuntime.cpp:42
lldb::SBProcess::GetProcessID
lldb::pid_t GetProcessID()
Gets the process ID.
Definition: SBProcess.cpp:538
lldb_private::ProcessRunLock::ProcessRunLocker::TryLock
bool TryLock(ProcessRunLock *lock)
Definition: ProcessRunLock.h:43
lldb::SBEvent::GetSP
lldb::EventSP & GetSP() const
Definition: SBEvent.cpp:137
lldb::SBEvent::reset
void reset(lldb::EventSP &event_sp)
lldb::eStateConnected
@ eStateConnected
Process is connected to remote debug services, but not launched or attached to anything yet.
Definition: lldb-enumerations.h:76
lldb::SBProcess::GetSTDERR
size_t GetSTDERR(char *dst, size_t dst_len) const
Definition: SBProcess.cpp:286
SBFileSpec.h
lldb_private::repro::RegisterMethods< SBProcess >
void RegisterMethods< SBProcess >(Registry &R)
Definition: SBProcess.cpp:1340
lldb::SBProcess::GetStopEventForStopID
lldb::SBEvent GetStopEventForStopID(uint32_t stop_id)
Gets the stop event corresponding to stop ID.
Definition: SBProcess.cpp:480
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb::SBProcess::SendEventData
lldb::SBError SendEventData(const char *data)
Definition: SBProcess.cpp:1130
lldb::SBProcess::GetHistoryThreads
lldb::SBThreadCollection GetHistoryThreads(addr_t addr)
Definition: SBProcess.cpp:1177
lldb::SBProcess::GetBroadcaster
lldb::SBBroadcaster GetBroadcaster() const
Definition: SBProcess.cpp:826
SBBroadcaster.h
lldb_private::ConstString
Definition: ConstString.h:40
lldb::SBProcess::ReadMemory
size_t ReadMemory(addr_t addr, void *buf, size_t size, lldb::SBError &error)
Definition: SBProcess.cpp:846
lldb::SBProcess::AppendEventStateReport
void AppendEventStateReport(const lldb::SBEvent &event, lldb::SBCommandReturnObject &result)
Definition: SBProcess.cpp:345
lldb::SBError::SetErrorString
void SetErrorString(const char *err_str)
Definition: SBError.cpp:124
lldb::SBProcess::GetExtendedCrashInformation
SBStructuredData GetExtendedCrashInformation()
Definition: SBProcess.cpp:993
SBDebugger.h
lldb::SBProcess::LoadImage
uint32_t LoadImage(lldb::SBFileSpec &remote_image_spec, lldb::SBError &error)
Load a shared library into this process.
Definition: SBProcess.cpp:1035
LLDB_REGISTER_STATIC_METHOD
#define LLDB_REGISTER_STATIC_METHOD(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:103
lldb::SBProcess::RemoteLaunch
bool RemoteLaunch(char const **argv, char const **envp, const char *stdin_path, const char *stdout_path, const char *stderr_path, const char *working_directory, uint32_t launch_flags, bool stop_at_entry, lldb::SBError &error)
Definition: SBProcess.cpp:127
Thread.h
lldb::SBError::SetError
void SetError(uint32_t err, lldb::ErrorType type)
Definition: SBError.cpp:97
SBMemoryRegionInfoList.h
lldb_private::ProcessAttachInfo
Definition: Process.h:113
lldb::SBProcess::GetProcessFromEvent
static lldb::SBProcess GetProcessFromEvent(const lldb::SBEvent &event)
Definition: SBProcess.cpp:778
lldb::SBProcess::GetNumExtendedBacktraceTypes
uint32_t GetNumExtendedBacktraceTypes()
Return the number of different thread-origin extended backtraces this process can support.
Definition: SBProcess.cpp:1150
lldb-types.h
lldb::SBProcess::GetStopID
uint32_t GetStopID(bool include_expression_stops=false)
Definition: SBProcess.cpp:464
lldb::SBProcess::GetBroadcasterClass
static const char * GetBroadcasterClass()
Definition: SBProcess.cpp:839
lldb::SBProcess::GetUniqueID
uint32_t GetUniqueID()
Gets the unique ID associated with this process object.
Definition: SBProcess.cpp:549
lldb::SBProcess::PutSTDIN
size_t PutSTDIN(const char *src, size_t src_len)
Definition: SBProcess.cpp:258
LLDB_RECORD_CONSTRUCTOR
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature,...)
Definition: ReproducerInstrumentation.h:133
StreamFile.h
lldb_private::repro::Registry
The registry contains a unique mapping between functions and their ID.
Definition: ReproducerInstrumentation.h:517
SBFile.h
lldb::SBProcess::GetExtendedBacktraceTypeAtIndex
const char * GetExtendedBacktraceTypeAtIndex(uint32_t idx)
Return the name of one of the thread-origin extended backtrace methods.
Definition: SBProcess.cpp:1161
lldb::SBProcess::GetStructuredDataFromEvent
static lldb::SBStructuredData GetStructuredDataFromEvent(const lldb::SBEvent &event)
Definition: SBProcess.cpp:800
lldb_private::Status
Definition: Status.h:44
lldb::eSaveCoreFull
@ eSaveCoreFull
Definition: lldb-enumerations.h:1138
lldb::eByteOrderInvalid
@ eByteOrderInvalid
Definition: lldb-enumerations.h:139
message
message(FATAL_ERROR "invalid libipt include path provided") endif() include_directories($
Definition: Plugins/Trace/intel-pt/CMakeLists.txt:6
uint32_t
lldb::SBProcess::SetSelectedThreadByID
bool SetSelectedThreadByID(lldb::tid_t tid)
Definition: SBProcess.cpp:376
LLDB_INVALID_IMAGE_TOKEN
#define LLDB_INVALID_IMAGE_TOKEN
Definition: lldb-defines.h:89
lldb::SBProcess::GetNumQueues
uint32_t GetNumQueues()
Definition: SBProcess.cpp:427
lldb::SBQueue
Definition: SBQueue.h:19
lldb::SBProcess::GetSP
lldb::ProcessSP GetSP() const
Definition: SBProcess.cpp:106
lldb_private::ProcessInfo::GetEnvironment
Environment & GetEnvironment()
Definition: ProcessInfo.h:87
lldb::SBProcess::GetProcessInfo
lldb::SBProcessInfo GetProcessInfo()
Return information about the process.
Definition: SBProcess.cpp:1279
lldb::SBFileSpec::GetPath
uint32_t GetPath(char *dst_path, size_t dst_len) const
Definition: SBFileSpec.cpp:145
lldb::SBStructuredData
Definition: SBStructuredData.h:17
lldb::pid_t
uint64_t pid_t
Definition: lldb-types.h:85
lldb::SBProcess::Destroy
lldb::SBError Destroy()
Definition: SBProcess.cpp:603
lldb::SBProcess::GetAddressByteSize
uint32_t GetAddressByteSize() const
Definition: SBProcess.cpp:571
lldb::SBProcess::SetSelectedThread
bool SetSelectedThread(const lldb::SBThread &thread)
Definition: SBProcess.cpp:362
lldb::SBEvent::GetBroadcasterClass
const char * GetBroadcasterClass() const
Definition: SBEvent.cpp:97
lldb::SBProcess::SaveCore
lldb::SBError SaveCore(const char *file_name)
Save the state of the process in a core file (or mini dump on Windows).
Definition: SBProcess.cpp:1210
lldb::SaveCoreStyle
SaveCoreStyle
Definition: lldb-enumerations.h:1136
LLDB_REGISTER_CHAR_PTR_METHOD_CONST
#define LLDB_REGISTER_CHAR_PTR_METHOD_CONST(Result, Class, Method)
Definition: ReproducerInstrumentation.h:121
lldb::SBMemoryRegionInfo
Definition: SBMemoryRegionInfo.h:17
lldb::SBProcess::GetThreadByIndexID
lldb::SBThread GetThreadByIndexID(uint32_t index_id)
Definition: SBProcess.cpp:723
lldb::SBProcess::EventIsProcessEvent
static bool EventIsProcessEvent(const lldb::SBEvent &event)
Definition: SBProcess.cpp:808
lldb_private::Environment
Definition: Environment.h:18
lldb::SBProcess::GetThreadAtIndex
lldb::SBThread GetThreadAtIndex(size_t index)
Definition: SBProcess.cpp:408
lldb::SBProcess::Signal
lldb::SBError Signal(int signal)
Definition: SBProcess.cpp:671
PluginManager.h
SystemRuntime.h
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:86
lldb_private::ConstString::GetCString
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:216
SBStructuredData.h
lldb::SBFileSpec
Definition: SBFileSpec.h:16
SBTrace.h
StructuredDataImpl.h
SBEvent.h
lldb_private::Stream::Printf
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
lldb::SBTarget::SetSP
void SetSP(const lldb::TargetSP &target_sp)
Definition: SBTarget.cpp:607
lldb::SBQueue::SetQueue
void SetQueue(const lldb::QueueSP &queue_sp)
Definition: SBQueue.cpp:263
lldb::SBProcess::RemoteAttachToProcessWithID
bool RemoteAttachToProcessWithID(lldb::pid_t pid, lldb::SBError &error)
Remote connection related functions.
Definition: SBProcess.cpp:168
lldb::SBError::ref
lldb_private::Status & ref()
Definition: SBError.cpp:159
lldb::SBProcess::WriteMemory
size_t WriteMemory(addr_t addr, const void *buf, size_t size, lldb::SBError &error)
Definition: SBProcess.cpp:943
lldb::SBProcess::GetBroadcasterClassName
static const char * GetBroadcasterClassName()
Definition: SBProcess.cpp:79
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb::SBProcess::GetInterruptedFromEvent
static bool GetInterruptedFromEvent(const lldb::SBEvent &event)
Definition: SBProcess.cpp:792
SBCommandReturnObject.h
lldb::SBProcess::GetNumRestartedReasonsFromEvent
static size_t GetNumRestartedReasonsFromEvent(const lldb::SBEvent &event)
Definition: SBProcess.cpp:761
lldb::SBProcess::GetMemoryRegionInfo
lldb::SBError GetMemoryRegionInfo(lldb::addr_t load_addr, lldb::SBMemoryRegionInfo &region_info)
Query the address load_addr and store the details of the memory region that contains it in the suppli...
Definition: SBProcess.cpp:1236
lldb::SBProcess::operator=
const lldb::SBProcess & operator=(const lldb::SBProcess &rhs)
Definition: SBProcess.cpp:67
SBThreadCollection.h
lldb::eStateInvalid
@ eStateInvalid
Definition: lldb-enumerations.h:74
lldb::SBProcess::GetSelectedThread
lldb::SBThread GetSelectedThread() const
Definition: SBProcess.cpp:209
SBUnixSignals.h
lldb::SBBroadcaster
Definition: SBBroadcaster.h:16
State.h
SBProcess.h
lldb_private::StreamFile
Definition: StreamFile.h:22
LLDB_RECORD_STATIC_METHOD
#define LLDB_RECORD_STATIC_METHOD(Result, Class, Method, Signature,...)
Definition: ReproducerInstrumentation.h:171
lldb::SBProcess::ReadUnsignedFromMemory
uint64_t ReadUnsignedFromMemory(addr_t addr, uint32_t byte_size, lldb::SBError &error)
Definition: SBProcess.cpp:897
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
Stream.h
lldb::SBProcess::GetExitDescription
const char * GetExitDescription()
Definition: SBProcess.cpp:525
lldb_private::Stream::PutCString
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
lldb::SBProcess::Stop
lldb::SBError Stop()
Definition: SBProcess.cpp:618
LLDB_RECORD_DUMMY
#define LLDB_RECORD_DUMMY(Result, Class, Method, Signature,...)
The LLDB_RECORD_DUMMY macro is special because it doesn't actually record anything.
Definition: ReproducerInstrumentation.h:216
lldb::SBStream
Definition: SBStream.h:18
lldb::SBThread::GetThreadID
lldb::tid_t GetThreadID() const
Definition: SBThread.cpp:383
LLDB_RECORD_METHOD_CONST
#define LLDB_RECORD_METHOD_CONST(Result, Class, Method, Signature,...)
Definition: ReproducerInstrumentation.h:161
PATH_MAX
#define PATH_MAX
Definition: windows/PosixApi.h:25
lldb::SBProcess::GetThreadByID
lldb::SBThread GetThreadByID(lldb::tid_t sb_thread_id)
Definition: SBProcess.cpp:704
lldb::SBProcess::ReadCStringFromMemory
size_t ReadCStringFromMemory(addr_t addr, void *buf, size_t size, lldb::SBError &error)
Definition: SBProcess.cpp:873
lldb::SBProcess::GetNumThreads
uint32_t GetNumThreads()
Definition: SBProcess.cpp:192
lldb::SBProcess::EventIsStructuredDataEvent
static bool EventIsStructuredDataEvent(const lldb::SBEvent &event)
Definition: SBProcess.cpp:816
lldb
Definition: SBAddress.h:15
lldb::SBFileSpec
class LLDB_API SBFileSpec
Definition: SBDefines.h:46
lldb::SBProcess::GetTarget
lldb::SBTarget GetTarget() const
Definition: SBProcess.cpp:244
RegisterContext.h
lldb_private::FileSpec::GetFilename
ConstString & GetFilename()
Filename string get accessor.
Definition: FileSpec.cpp:341
lldb::SBProcess::GetRestartedFromEvent
static bool GetRestartedFromEvent(const lldb::SBEvent &event)
Definition: SBProcess.cpp:752
lldb::SBProcess::GetRestartedReasonAtIndexFromEvent
static const char * GetRestartedReasonAtIndexFromEvent(const lldb::SBEvent &event, size_t idx)
Definition: SBProcess.cpp:769
lldb::SBUnixSignals
Definition: SBUnixSignals.h:17
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_REGISTER_METHOD
#define LLDB_REGISTER_METHOD(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:93