LLDB mainline
ProcessFreeBSDKernelCore.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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/Core/Module.h"
12#include "lldb/Symbol/Type.h"
15#include "lldb/Utility/Log.h"
17
21
22using namespace lldb;
23using namespace lldb_private;
24
26
27namespace {
28
29#define LLDB_PROPERTIES_processfreebsdkernelcore
30#include "ProcessFreeBSDKernelCoreProperties.inc"
31
32enum {
33#define LLDB_PROPERTIES_processfreebsdkernelcore
34#include "ProcessFreeBSDKernelCorePropertiesEnum.inc"
35};
36
37class PluginProperties : public Properties {
38public:
39 static llvm::StringRef GetSettingName() {
41 }
42
43 PluginProperties() : Properties() {
44 m_collection_sp = std::make_shared<OptionValueProperties>(GetSettingName());
45 m_collection_sp->Initialize(g_processfreebsdkernelcore_properties_def);
46 }
47
48 ~PluginProperties() override = default;
49
50 bool GetReadOnly() const {
51 const uint32_t idx = ePropertyReadOnly;
52 return GetPropertyAtIndexAs<bool>(idx, true);
53 }
54};
55
56} // namespace
57
58static PluginProperties &GetGlobalPluginProperties() {
59 static PluginProperties g_settings;
60 return g_settings;
61}
62
64 ListenerSP listener_sp,
65 kvm_t *kvm,
66 const FileSpec &core_file)
67 : PostMortemProcess(target_sp, listener_sp, core_file), m_kvm(kvm) {}
68
70 m_thread_list.Clear();
71
72 // We need to call finalize on the process before destroying ourselves to
73 // make sure all of the broadcaster cleanup goes as planned. If we destruct
74 // this class, then Process::~Process() might have problems trying to fully
75 // destroy the broadcaster.
76 Finalize(/*destructing=*/true);
77}
78
80 lldb::TargetSP target_sp, ListenerSP listener_sp,
81 const FileSpec *crash_file, bool can_connect) {
82 ModuleSP executable = target_sp->GetExecutableModule();
83 if (crash_file && !can_connect && executable) {
84 kvm_t *kvm =
85 kvm_open2(executable->GetFileSpec().GetPath().c_str(),
86 crash_file->GetPath().c_str(), O_RDONLY, nullptr, nullptr);
87 if (kvm)
88 return std::make_shared<ProcessFreeBSDKernelCore>(target_sp, listener_sp,
89 kvm, *crash_file);
90 }
91 return nullptr;
92}
93
99
102 debugger, PluginProperties::GetSettingName())) {
103 const bool is_global_setting = true;
106 "Properties for the freebsd-kernel process plug-in.",
107 is_global_setting);
108 }
109}
110
114
116 bool plugin_specified_by_name) {
117 return true;
118}
119
121 // The core is already loaded by CreateInstance().
123
124 return Status();
125}
126
133
135 if (!m_kvm)
136 return Status::FromErrorString("kvm file descriptor is not set.");
137
138 kvm_close(m_kvm);
139 return Status();
140}
141
148
150 const void *buf, size_t size,
151 Status &error) {
152 if (GetGlobalPluginProperties().GetReadOnly()) {
154 "Memory writes are currently disabled. You can enable them with "
155 "`settings set plugin.process.freebsd-kernel-core.read-only false`.");
156 return 0;
157 }
158
159 ssize_t rd = 0;
160 rd = kvm_write(m_kvm, addr, buf, size);
161 if (rd < 0 || static_cast<size_t>(rd) != size) {
162 error = Status::FromErrorStringWithFormat("Writing memory failed: %s",
163 GetError());
164 return rd > 0 ? rd : 0;
165 }
166 return rd;
167}
168
170 ThreadList &new_thread_list) {
171 if (old_thread_list.GetSize(false) == 0) {
172 // Make up the thread the first time this is called so we can set our one
173 // and only core thread state up.
174
175 // We cannot construct a thread without a register context as that crashes
176 // LLDB but we can construct a process without threads to provide minimal
177 // memory reading support.
178 switch (GetTarget().GetArchitecture().GetMachine()) {
179 case llvm::Triple::arm:
180 case llvm::Triple::aarch64:
181 case llvm::Triple::ppc64le:
182 case llvm::Triple::riscv64:
183 case llvm::Triple::x86:
184 case llvm::Triple::x86_64:
185 break;
186 default:
187 return false;
188 }
189
191
192 // struct field offsets are written as symbols so that we don't have
193 // to figure them out ourselves
194 int32_t offset_p_list = ReadSignedIntegerFromMemory(
195 FindSymbol("proc_off_p_list"), 4, -1, error);
196 int32_t offset_p_pid =
197 ReadSignedIntegerFromMemory(FindSymbol("proc_off_p_pid"), 4, -1, error);
198 int32_t offset_p_threads = ReadSignedIntegerFromMemory(
199 FindSymbol("proc_off_p_threads"), 4, -1, error);
200 int32_t offset_p_comm = ReadSignedIntegerFromMemory(
201 FindSymbol("proc_off_p_comm"), 4, -1, error);
202
203 int32_t offset_td_tid = ReadSignedIntegerFromMemory(
204 FindSymbol("thread_off_td_tid"), 4, -1, error);
205 int32_t offset_td_plist = ReadSignedIntegerFromMemory(
206 FindSymbol("thread_off_td_plist"), 4, -1, error);
207 int32_t offset_td_pcb = ReadSignedIntegerFromMemory(
208 FindSymbol("thread_off_td_pcb"), 4, -1, error);
209 int32_t offset_td_oncpu = ReadSignedIntegerFromMemory(
210 FindSymbol("thread_off_td_oncpu"), 4, -1, error);
211 int32_t offset_td_name = ReadSignedIntegerFromMemory(
212 FindSymbol("thread_off_td_name"), 4, -1, error);
213
214 // Fail if we were not able to read any of the offsets.
215 if (offset_p_list == -1 || offset_p_pid == -1 || offset_p_threads == -1 ||
216 offset_p_comm == -1 || offset_td_tid == -1 || offset_td_plist == -1 ||
217 offset_td_pcb == -1 || offset_td_oncpu == -1 || offset_td_name == -1)
218 return false;
219
220 // dumptid contains the thread-id of the crashing thread
221 // dumppcb contains its PCB
222 int32_t dumptid =
223 ReadSignedIntegerFromMemory(FindSymbol("dumptid"), 4, -1, error);
224 lldb::addr_t dumppcb = FindSymbol("dumppcb");
225
226 // stoppcbs is an array of PCBs on all CPUs.
227 // Each element is of size pcb_size.
228 int32_t pcbsize =
229 ReadSignedIntegerFromMemory(FindSymbol("pcb_size"), 4, -1, error);
230 lldb::addr_t stoppcbs = FindSymbol("stoppcbs");
231
232 // Read stopped_cpus bitmask and mp_maxid for CPU validation.
233 lldb::addr_t stopped_cpus = FindSymbol("stopped_cpus");
234 uint32_t mp_maxid = 0;
235
236 if (stopped_cpus != LLDB_INVALID_ADDRESS) {
237 // https://cgit.freebsd.org/src/tree/sys/kern/subr_smp.c
238 mp_maxid =
239 ReadSignedIntegerFromMemory(FindSymbol("mp_maxid"), 4, 0, error);
240 if (error.Fail())
241 stopped_cpus = LLDB_INVALID_ADDRESS;
242 }
243
244 uint32_t long_size_bytes = GetAddressByteSize();
245 uint32_t long_bit = long_size_bytes * 8;
246
247 if (auto type_system_or_err =
248 GetTarget().GetScratchTypeSystemForLanguage(eLanguageTypeC)) {
249 CompilerType long_type =
250 (*type_system_or_err)->GetBasicTypeFromAST(eBasicTypeLong);
251 if (long_type.IsValid())
252 if (auto size = long_type.GetByteSize(nullptr))
253 long_size_bytes = *size;
254 long_bit = long_size_bytes * 8;
255 } else
256 llvm::consumeError(type_system_or_err.takeError());
257
258 // https://cgit.freebsd.org/src/tree/sys/sys/param.h
259 constexpr size_t fbsd_maxcomlen = 19;
260
261 // Iterate through a linked list of all processes. New processes are added
262 // to the head of this list. Which means that earlier PIDs are actually at
263 // the end of the list, so we have to walk it backwards. First collect all
264 // the processes in the list order.
265 std::vector<lldb::addr_t> process_addrs;
266 if (lldb::addr_t allproc_addr = FindSymbol("allproc");
267 allproc_addr != LLDB_INVALID_ADDRESS) {
268 for (lldb::addr_t proc = ReadPointerFromMemory(allproc_addr, error);
269 proc != 0 && proc != LLDB_INVALID_ADDRESS && error.Success();
270 proc = ReadPointerFromMemory(proc + offset_p_list, error))
271 process_addrs.push_back(proc);
272 }
273
274 // Processes are in the linked list in descending PID order, so we must walk
275 // them in reverse to get ascending PID order.
276 for (auto proc_it = process_addrs.rbegin(); proc_it != process_addrs.rend();
277 ++proc_it) {
278 lldb::addr_t proc = *proc_it;
279 int32_t pid =
280 ReadSignedIntegerFromMemory(proc + offset_p_pid, 4, -1, error);
281 // process' command-line string
282 char comm[fbsd_maxcomlen + 1];
283 ReadCStringFromMemory(proc + offset_p_comm, comm, sizeof(comm), error);
284
285 // Iterate through a linked list of all process' threads
286 // the initial thread is found in process' p_threads, subsequent
287 // elements are linked via td_plist field
288 for (lldb::addr_t td =
289 ReadPointerFromMemory(proc + offset_p_threads, error);
290 td != 0; td = ReadPointerFromMemory(td + offset_td_plist, error)) {
291 int32_t tid =
292 ReadSignedIntegerFromMemory(td + offset_td_tid, 4, -1, error);
293 lldb::addr_t pcb_addr =
294 ReadPointerFromMemory(td + offset_td_pcb, error);
295 // whether process was on CPU (-1 if not, otherwise CPU number)
296 int32_t oncpu =
297 ReadSignedIntegerFromMemory(td + offset_td_oncpu, 4, -2, error);
298 // thread name
299 char thread_name[fbsd_maxcomlen + 1];
300 ReadCStringFromMemory(td + offset_td_name, thread_name,
301 sizeof(thread_name), error);
302
303 // If we failed to read TID, ignore this thread.
304 if (tid == -1)
305 continue;
306
307 std::string thread_desc = llvm::formatv("(pid {0}) {1}", pid, comm);
308 if (*thread_name && strcmp(thread_name, comm)) {
309 thread_desc += '/';
310 thread_desc += thread_name;
311 }
312
313 // Roughly:
314 // 1. if the thread crashed, its PCB is going to be at "dumppcb"
315 // 2. if the thread was on CPU, its PCB is going to be on the CPU
316 // 3. otherwise, its PCB is in the thread struct
317 if (tid == dumptid) {
318 // NB: dumppcb can be LLDB_INVALID_ADDRESS if reading it failed
319 pcb_addr = dumppcb;
320 thread_desc += " (crashed)";
321 } else if (oncpu != -1) {
322 // Verify the CPU is actually in the stopped set before using
323 // its stoppcbs entry.
324 bool is_stopped = false;
325 if (oncpu >= 0 && static_cast<uint32_t>(oncpu) <= mp_maxid &&
326 stopped_cpus != LLDB_INVALID_ADDRESS) {
327 uint32_t bit = oncpu % long_bit;
328 uint32_t word = oncpu / long_bit;
329 lldb::addr_t mask_addr = stopped_cpus + word * long_size_bytes;
330 uint64_t mask = ReadUnsignedIntegerFromMemory(
331 mask_addr, long_size_bytes, 0, error);
332 if (error.Success())
333 is_stopped = (mask & (1ULL << bit)) != 0;
334 }
335
336 // If we managed to read stoppcbs and pcb_size and the cpu is marked
337 // as stopped, use them to find the correct PCB.
338 if (is_stopped && stoppcbs != LLDB_INVALID_ADDRESS && pcbsize > 0) {
339 pcb_addr = stoppcbs + oncpu * pcbsize;
340 } else {
341 pcb_addr = LLDB_INVALID_ADDRESS;
342 }
343 thread_desc += llvm::formatv(" (on CPU {0})", oncpu);
344 }
345
346 auto thread =
347 new ThreadFreeBSDKernelCore(*this, tid, pcb_addr, thread_desc);
348
349 if (tid == dumptid)
350 thread->SetIsCrashedThread(true);
351
352 new_thread_list.AddThread(static_cast<ThreadSP>(thread));
353 }
354 }
355 } else {
356 const uint32_t num_threads = old_thread_list.GetSize(false);
357 for (uint32_t i = 0; i < num_threads; ++i)
358 new_thread_list.AddThread(old_thread_list.GetThreadAtIndex(i, false));
359 }
360 return new_thread_list.GetSize(false) > 0;
361}
362
364 size_t size, Status &error) {
365 ssize_t rd = 0;
366 rd = kvm_read2(m_kvm, addr, buf, size);
367 if (rd < 0 || static_cast<size_t>(rd) != size) {
368 error = Status::FromErrorStringWithFormat("Reading memory failed: %s",
369 GetError());
370 return rd > 0 ? rd : 0;
371 }
372 return rd;
373}
374
377 const Symbol *sym = mod_sp->FindFirstSymbolWithNameAndType(ConstString(name));
378 return sym ? sym->GetLoadAddress(&GetTarget()) : LLDB_INVALID_ADDRESS;
379}
380
382 kssize_t displacement = kvm_kerndisp(m_kvm);
383
384 if (displacement == 0)
385 return;
386
387 Target &target = GetTarget();
388 lldb::ModuleSP kernel_module_sp = target.GetExecutableModule();
389 if (!kernel_module_sp)
390 return;
391
392 bool changed = false;
393 kernel_module_sp->SetLoadAddress(target,
394 static_cast<lldb::addr_t>(displacement),
395 /*value_is_offset=*/true, changed);
396
397 if (changed) {
398 ModuleList loaded_module_list;
399 loaded_module_list.Append(kernel_module_sp);
400 target.ModulesDidLoad(loaded_module_list);
401 }
402}
403
405 Target &target = GetTarget();
406 Debugger &debugger = target.GetDebugger();
407
409
410 // Find msgbufp symbol (pointer to message buffer)
411 lldb::addr_t msgbufp_addr = FindSymbol("msgbufp");
412 if (msgbufp_addr == LLDB_INVALID_ADDRESS)
413 return;
414
415 // Read the pointer value
416 lldb::addr_t msgbufp = ReadPointerFromMemory(msgbufp_addr, error);
417 if (!error.Success() || msgbufp == LLDB_INVALID_ADDRESS)
418 return;
419
420 // Get the type information for struct msgbuf from DWARF
421 TypeQuery query("msgbuf");
422 TypeResults results;
423 target.GetImages().FindTypes(nullptr, query, results);
424
425 uint64_t offset_msg_ptr = 0;
426 uint64_t offset_msg_size = 0;
427 uint64_t offset_msg_wseq = 0;
428 uint64_t offset_msg_rseq = 0;
429
430 if (results.GetTypeMap().GetSize() > 0) {
431 // Found type info - use it to get field offsets
432 CompilerType msgbuf_type =
433 results.GetTypeMap().GetTypeAtIndex(0)->GetForwardCompilerType();
434
435 uint32_t num_fields = msgbuf_type.GetNumFields();
436 int field_found = 0;
437 for (uint32_t i = 0; i < num_fields; i++) {
438 std::string field_name;
439 uint64_t field_offset = 0;
440
441 msgbuf_type.GetFieldAtIndex(i, field_name, &field_offset, nullptr,
442 nullptr);
443
444 if (field_name == "msg_ptr") {
445 offset_msg_ptr = field_offset / 8; // Convert bits to bytes
446 field_found++;
447 } else if (field_name == "msg_size") {
448 offset_msg_size = field_offset / 8;
449 field_found++;
450 } else if (field_name == "msg_wseq") {
451 offset_msg_wseq = field_offset / 8;
452 field_found++;
453 } else if (field_name == "msg_rseq") {
454 offset_msg_rseq = field_offset / 8;
455 field_found++;
456 }
457 }
458
459 if (field_found != 4) {
460 LLDB_LOGF(
462 "FreeBSD-Kernel-Core: Could not find all required fields for msgbuf");
463 return;
464 }
465 } else {
466 // Fallback: use hardcoded offsets based on struct layout
467 // struct msgbuf layout (from sys/sys/msgbuf.h):
468 // char *msg_ptr; - offset 0
469 // u_int msg_magic; - offset ptr_size
470 // u_int msg_size; - offset ptr_size + 4
471 // u_int msg_wseq; - offset ptr_size + 8
472 // u_int msg_rseq; - offset ptr_size + 12
473 uint32_t ptr_size = GetAddressByteSize();
474 offset_msg_ptr = 0;
475 offset_msg_size = ptr_size + 4;
476 offset_msg_wseq = ptr_size + 8;
477 offset_msg_rseq = ptr_size + 12;
478 }
479
480 // Read struct msgbuf fields
481 lldb::addr_t bufp = ReadPointerFromMemory(msgbufp + offset_msg_ptr, error);
482 if (!error.Success() || bufp == LLDB_INVALID_ADDRESS)
483 return;
484
485 uint32_t size =
486 ReadUnsignedIntegerFromMemory(msgbufp + offset_msg_size, 4, 0, error);
487 if (!error.Success() || size == 0)
488 return;
489
490 uint32_t wseq =
491 ReadUnsignedIntegerFromMemory(msgbufp + offset_msg_wseq, 4, 0, error);
492 if (!error.Success())
493 return;
494
495 uint32_t rseq =
496 ReadUnsignedIntegerFromMemory(msgbufp + offset_msg_rseq, 4, 0, error);
497 if (!error.Success())
498 return;
499
500 // Convert sequences to positions
501 // MSGBUF_SEQ_TO_POS macro in FreeBSD: ((seq) % (size))
502 uint32_t rseq_pos = rseq % size;
503 uint32_t wseq_pos = wseq % size;
504
505 if (rseq_pos == wseq_pos)
506 return;
507
508 // Print crash info at once using stream
509 lldb::StreamSP stream_sp = debugger.GetAsyncOutputStream();
510 if (!stream_sp)
511 return;
512
513 stream_sp->PutCString("\nUnread portion of the kernel message buffer:\n");
514
515 // Read ring buffer in at most two chunks
516 if (rseq_pos < wseq_pos) {
517 // No wrap: read from rseq_pos to wseq_pos
518 size_t len = wseq_pos - rseq_pos;
519 std::string buf(len, '\0');
520 size_t bytes_read = ReadMemory(bufp + rseq_pos, &buf[0], len, error);
521 if (error.Success() && bytes_read > 0) {
522 buf.resize(bytes_read);
523 *stream_sp << buf;
524 }
525 } else {
526 // Wrap around: read from rseq_pos to end, then from start to wseq_pos
527 size_t len1 = size - rseq_pos;
528 std::string buf1(len1, '\0');
529 size_t bytes_read1 = ReadMemory(bufp + rseq_pos, &buf1[0], len1, error);
530 if (error.Success() && bytes_read1 > 0) {
531 buf1.resize(bytes_read1);
532 *stream_sp << buf1;
533 }
534
535 if (wseq_pos > 0) {
536 std::string buf2(wseq_pos, '\0');
537 size_t bytes_read2 = ReadMemory(bufp, &buf2[0], wseq_pos, error);
538 if (error.Success() && bytes_read2 > 0) {
539 buf2.resize(bytes_read2);
540 *stream_sp << buf2;
541 }
542 }
543 }
544
545 stream_sp->PutChar('\n');
546 stream_sp->Flush();
547}
548
549const char *ProcessFreeBSDKernelCore::GetError() { return kvm_geterr(m_kvm); }
static llvm::raw_ostream & error(Stream &strm)
#define bit
static PluginProperties & GetGlobalPluginProperties()
#define LLDB_LOGF(log,...)
Definition Log.h:378
#define LLDB_PLUGIN_DEFINE(PluginName)
static PluginProperties & GetGlobalPluginProperties()
static llvm::StringRef GetPluginNameStatic()
lldb_private::Status DoDestroy() override
static llvm::StringRef GetPluginNameStatic()
lldb::addr_t FindSymbol(const char *name)
size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override
Actually do the reading of memory from a process.
static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener, const lldb_private::FileSpec *crash_file_path, bool can_connect)
void RefreshStateAfterStop() override
Currently called as part of ShouldStop.
static void DebuggerInitialize(lldb_private::Debugger &debugger)
static llvm::StringRef GetPluginDescriptionStatic()
lldb_private::Status DoLoadCore() override
lldb_private::DynamicLoader * GetDynamicLoader() override
Get the dynamic loader plug-in for this process.
ProcessFreeBSDKernelCore(lldb::TargetSP target_sp, lldb::ListenerSP listener, kvm_t *kvm, const lldb_private::FileSpec &core_file)
size_t DoWriteMemory(lldb::addr_t addr, const void *buf, size_t size, lldb_private::Status &error) override
Actually do the writing of memory to a process.
bool DoUpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list) override
Update the thread list following process plug-in's specific logic.
bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override
Check if a plug-in instance can debug the file in module.
Generic representation of a type in a programming language.
CompilerType GetBasicTypeFromAST(lldb::BasicType basic_type) const
Create related types using the current type's AST.
CompilerType GetFieldAtIndex(size_t idx, std::string &name, uint64_t *bit_offset_ptr, uint32_t *bitfield_bit_size_ptr, bool *is_bitfield_ptr) const
llvm::Expected< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
uint32_t GetNumFields() const
A uniqued constant string class.
Definition ConstString.h:40
lldb::StreamUP GetAsyncOutputStream()
static DynamicLoader * FindPlugin(Process *process, llvm::StringRef plugin_name)
Find a dynamic loader plugin for a given process.
A file utility class.
Definition FileSpec.h:57
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition FileSpec.cpp:374
A collection class for Module objects.
Definition ModuleList.h:125
void FindTypes(Module *search_first, const TypeQuery &query, lldb_private::TypeResults &results) const
Find types using a type-matching object that contains all search parameters.
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool CreateSettingForProcessPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static lldb::OptionValuePropertiesSP GetSettingForProcessPlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool UnregisterPlugin(ABICreateInstance create_callback)
PostMortemProcess(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec &core_file)
int64_t ReadSignedIntegerFromMemory(lldb::addr_t load_addr, size_t byte_size, int64_t fail_value, Status &error)
Definition Process.cpp:2319
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:2189
lldb::DynamicLoaderUP m_dyld_up
Definition Process.h:3399
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:1903
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:2308
lldb::addr_t ReadPointerFromMemory(lldb::addr_t vm_addr, Status &error)
Definition Process.cpp:2330
friend class Target
Definition Process.h:360
uint32_t GetAddressByteSize() const
Definition Process.cpp:3721
virtual void Finalize(bool destructing)
This object is about to be destroyed, do any necessary cleanup.
Definition Process.cpp:535
ThreadList m_thread_list
The threads for this process as the user will see them.
Definition Process.h:3372
friend class DynamicLoader
Definition Process.h:357
friend class Debugger
Definition Process.h:356
friend class ThreadList
Definition Process.h:361
Target & GetTarget()
Get the target object pointer for this module.
Definition Process.h:1250
lldb::OptionValuePropertiesSP GetValueProperties() const
An error handling class.
Definition Status.h:118
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Definition Status.cpp:106
static Status FromErrorString(const char *str)
Definition Status.h:141
lldb::addr_t GetLoadAddress(Target *target) const
Definition Symbol.cpp:504
void ModulesDidLoad(ModuleList &module_list)
This call may preload module symbols, and may do so in parallel depending on the following target set...
Definition Target.cpp:1841
Debugger & GetDebugger() const
Definition Target.h:1240
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
Definition Target.cpp:1525
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1157
void AddThread(const lldb::ThreadSP &thread_sp)
uint32_t GetSize(bool can_update=true)
lldb::ThreadSP GetThreadAtIndex(uint32_t idx, bool can_update=true)
uint32_t GetSize() const
Definition TypeMap.cpp:75
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition TypeMap.cpp:83
A class that contains all state required for type lookups.
Definition Type.h:104
This class tracks the state and results of a TypeQuery.
Definition Type.h:344
TypeMap & GetTypeMap()
Definition Type.h:386
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition Log.h:327
std::shared_ptr< lldb_private::Thread > ThreadSP
@ eLanguageTypeC
Non-standardized C, such as K&R.
std::shared_ptr< lldb_private::Stream > StreamSP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Listener > ListenerSP
uint64_t addr_t
Definition lldb-types.h:80
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::Module > ModuleSP