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
73
75 lldb::TargetSP target_sp, ListenerSP listener_sp,
76 const FileSpec *crash_file, bool can_connect) {
77 ModuleSP executable = target_sp->GetExecutableModule();
78 if (crash_file && !can_connect && executable) {
79 kvm_t *kvm =
80 kvm_open2(executable->GetFileSpec().GetPath().c_str(),
81 crash_file->GetPath().c_str(), O_RDONLY, nullptr, nullptr);
82 if (kvm)
83 return std::make_shared<ProcessFreeBSDKernelCore>(target_sp, listener_sp,
84 kvm, *crash_file);
85 }
86 return nullptr;
87}
88
94
97 debugger, PluginProperties::GetSettingName())) {
98 const bool is_global_setting = true;
101 "Properties for the freebsd-kernel process plug-in.",
102 is_global_setting);
103 }
104}
105
109
111 bool plugin_specified_by_name) {
112 return true;
113}
114
116 // The core is already loaded by CreateInstance().
118
119 return Status();
120}
121
128
130
137
139 const void *buf, size_t size,
140 Status &error) {
141 if (GetGlobalPluginProperties().GetReadOnly()) {
143 "Memory writes are currently disabled. You can enable them with "
144 "`settings set plugin.process.freebsd-kernel-core.read-only false`.");
145 return 0;
146 }
147
148 ssize_t rd = 0;
149 rd = kvm_write(m_kvm, addr, buf, size);
150 if (rd < 0 || static_cast<size_t>(rd) != size) {
151 error = Status::FromErrorStringWithFormat("Writing memory failed: %s",
152 GetError());
153 return rd > 0 ? rd : 0;
154 }
155 return rd;
156}
157
159 ThreadList &new_thread_list) {
160 if (old_thread_list.GetSize(false) == 0) {
161 // Make up the thread the first time this is called so we can set our one
162 // and only core thread state up.
163
164 // We cannot construct a thread without a register context as that crashes
165 // LLDB but we can construct a process without threads to provide minimal
166 // memory reading support.
167 switch (GetTarget().GetArchitecture().GetMachine()) {
168 case llvm::Triple::arm:
169 case llvm::Triple::aarch64:
170 case llvm::Triple::ppc64le:
171 case llvm::Triple::riscv64:
172 case llvm::Triple::x86:
173 case llvm::Triple::x86_64:
174 break;
175 default:
176 return false;
177 }
178
180
181 // struct field offsets are written as symbols so that we don't have
182 // to figure them out ourselves
183 int32_t offset_p_list = ReadSignedIntegerFromMemory(
184 FindSymbol("proc_off_p_list"), 4, -1, error);
185 int32_t offset_p_pid =
186 ReadSignedIntegerFromMemory(FindSymbol("proc_off_p_pid"), 4, -1, error);
187 int32_t offset_p_threads = ReadSignedIntegerFromMemory(
188 FindSymbol("proc_off_p_threads"), 4, -1, error);
189 int32_t offset_p_comm = ReadSignedIntegerFromMemory(
190 FindSymbol("proc_off_p_comm"), 4, -1, error);
191
192 int32_t offset_td_tid = ReadSignedIntegerFromMemory(
193 FindSymbol("thread_off_td_tid"), 4, -1, error);
194 int32_t offset_td_plist = ReadSignedIntegerFromMemory(
195 FindSymbol("thread_off_td_plist"), 4, -1, error);
196 int32_t offset_td_pcb = ReadSignedIntegerFromMemory(
197 FindSymbol("thread_off_td_pcb"), 4, -1, error);
198 int32_t offset_td_oncpu = ReadSignedIntegerFromMemory(
199 FindSymbol("thread_off_td_oncpu"), 4, -1, error);
200 int32_t offset_td_name = ReadSignedIntegerFromMemory(
201 FindSymbol("thread_off_td_name"), 4, -1, error);
202
203 // Fail if we were not able to read any of the offsets.
204 if (offset_p_list == -1 || offset_p_pid == -1 || offset_p_threads == -1 ||
205 offset_p_comm == -1 || offset_td_tid == -1 || offset_td_plist == -1 ||
206 offset_td_pcb == -1 || offset_td_oncpu == -1 || offset_td_name == -1)
207 return false;
208
209 // dumptid contains the thread-id of the crashing thread
210 // dumppcb contains its PCB
211 int32_t dumptid =
212 ReadSignedIntegerFromMemory(FindSymbol("dumptid"), 4, -1, error);
213 lldb::addr_t dumppcb = FindSymbol("dumppcb");
214
215 // stoppcbs is an array of PCBs on all CPUs.
216 // Each element is of size pcb_size.
217 int32_t pcbsize =
218 ReadSignedIntegerFromMemory(FindSymbol("pcb_size"), 4, -1, error);
219 lldb::addr_t stoppcbs = FindSymbol("stoppcbs");
220
221 // Read stopped_cpus bitmask and mp_maxid for CPU validation.
222 lldb::addr_t stopped_cpus = FindSymbol("stopped_cpus");
223 uint32_t mp_maxid = 0;
224
225 if (stopped_cpus != LLDB_INVALID_ADDRESS) {
226 // https://cgit.freebsd.org/src/tree/sys/kern/subr_smp.c
227 mp_maxid =
228 ReadSignedIntegerFromMemory(FindSymbol("mp_maxid"), 4, 0, error);
229 if (error.Fail())
230 stopped_cpus = LLDB_INVALID_ADDRESS;
231 }
232
233 uint32_t long_size_bytes = GetAddressByteSize();
234 uint32_t long_bit = long_size_bytes * 8;
235
236 if (auto type_system_or_err =
237 GetTarget().GetScratchTypeSystemForLanguage(eLanguageTypeC)) {
238 CompilerType long_type =
239 (*type_system_or_err)->GetBasicTypeFromAST(eBasicTypeLong);
240 if (long_type.IsValid())
241 if (auto size = long_type.GetByteSize(nullptr))
242 long_size_bytes = *size;
243 long_bit = long_size_bytes * 8;
244 } else
245 llvm::consumeError(type_system_or_err.takeError());
246
247 // https://cgit.freebsd.org/src/tree/sys/sys/param.h
248 constexpr size_t fbsd_maxcomlen = 19;
249
250 // Iterate through a linked list of all processes. New processes are added
251 // to the head of this list. Which means that earlier PIDs are actually at
252 // the end of the list, so we have to walk it backwards. First collect all
253 // the processes in the list order.
254 std::vector<lldb::addr_t> process_addrs;
255 if (lldb::addr_t allproc_addr = FindSymbol("allproc");
256 allproc_addr != LLDB_INVALID_ADDRESS) {
257 for (lldb::addr_t proc = ReadPointerFromMemory(allproc_addr, error);
258 proc != 0 && proc != LLDB_INVALID_ADDRESS && error.Success();
259 proc = ReadPointerFromMemory(proc + offset_p_list, error))
260 process_addrs.push_back(proc);
261 }
262
263 // Processes are in the linked list in descending PID order, so we must walk
264 // them in reverse to get ascending PID order.
265 for (auto proc_it = process_addrs.rbegin(); proc_it != process_addrs.rend();
266 ++proc_it) {
267 lldb::addr_t proc = *proc_it;
268 int32_t pid =
269 ReadSignedIntegerFromMemory(proc + offset_p_pid, 4, -1, error);
270 // process' command-line string
271 char comm[fbsd_maxcomlen + 1];
272 ReadCStringFromMemory(proc + offset_p_comm, comm, sizeof(comm), error);
273
274 // Iterate through a linked list of all process' threads
275 // the initial thread is found in process' p_threads, subsequent
276 // elements are linked via td_plist field
277 for (lldb::addr_t td =
278 ReadPointerFromMemory(proc + offset_p_threads, error);
279 td != 0; td = ReadPointerFromMemory(td + offset_td_plist, error)) {
280 int32_t tid =
281 ReadSignedIntegerFromMemory(td + offset_td_tid, 4, -1, error);
282 lldb::addr_t pcb_addr =
283 ReadPointerFromMemory(td + offset_td_pcb, error);
284 // whether process was on CPU (-1 if not, otherwise CPU number)
285 int32_t oncpu =
286 ReadSignedIntegerFromMemory(td + offset_td_oncpu, 4, -2, error);
287 // thread name
288 char thread_name[fbsd_maxcomlen + 1];
289 ReadCStringFromMemory(td + offset_td_name, thread_name,
290 sizeof(thread_name), error);
291
292 // If we failed to read TID, ignore this thread.
293 if (tid == -1)
294 continue;
295
296 std::string thread_desc = llvm::formatv("(pid {0}) {1}", pid, comm);
297 if (*thread_name && strcmp(thread_name, comm)) {
298 thread_desc += '/';
299 thread_desc += thread_name;
300 }
301
302 // Roughly:
303 // 1. if the thread crashed, its PCB is going to be at "dumppcb"
304 // 2. if the thread was on CPU, its PCB is going to be on the CPU
305 // 3. otherwise, its PCB is in the thread struct
306 if (tid == dumptid) {
307 // NB: dumppcb can be LLDB_INVALID_ADDRESS if reading it failed
308 pcb_addr = dumppcb;
309 thread_desc += " (crashed)";
310 } else if (oncpu != -1) {
311 // Verify the CPU is actually in the stopped set before using
312 // its stoppcbs entry.
313 bool is_stopped = false;
314 if (oncpu >= 0 && static_cast<uint32_t>(oncpu) <= mp_maxid &&
315 stopped_cpus != LLDB_INVALID_ADDRESS) {
316 uint32_t bit = oncpu % long_bit;
317 uint32_t word = oncpu / long_bit;
318 lldb::addr_t mask_addr = stopped_cpus + word * long_size_bytes;
319 uint64_t mask = ReadUnsignedIntegerFromMemory(
320 mask_addr, long_size_bytes, 0, error);
321 if (error.Success())
322 is_stopped = (mask & (1ULL << bit)) != 0;
323 }
324
325 // If we managed to read stoppcbs and pcb_size and the cpu is marked
326 // as stopped, use them to find the correct PCB.
327 if (is_stopped && stoppcbs != LLDB_INVALID_ADDRESS && pcbsize > 0) {
328 pcb_addr = stoppcbs + oncpu * pcbsize;
329 } else {
330 pcb_addr = LLDB_INVALID_ADDRESS;
331 }
332 thread_desc += llvm::formatv(" (on CPU {0})", oncpu);
333 }
334
335 auto thread =
336 new ThreadFreeBSDKernelCore(*this, tid, pcb_addr, thread_desc);
337
338 if (tid == dumptid)
339 thread->SetIsCrashedThread(true);
340
341 new_thread_list.AddThread(static_cast<ThreadSP>(thread));
342 }
343 }
344 } else {
345 const uint32_t num_threads = old_thread_list.GetSize(false);
346 for (uint32_t i = 0; i < num_threads; ++i)
347 new_thread_list.AddThread(old_thread_list.GetThreadAtIndex(i, false));
348 }
349 return new_thread_list.GetSize(false) > 0;
350}
351
353 size_t size, Status &error) {
354 ssize_t rd = 0;
355 rd = kvm_read2(m_kvm, addr, buf, size);
356 if (rd < 0 || static_cast<size_t>(rd) != size) {
357 error = Status::FromErrorStringWithFormat("Reading memory failed: %s",
358 GetError());
359 return rd > 0 ? rd : 0;
360 }
361 return rd;
362}
363
366 const Symbol *sym = mod_sp->FindFirstSymbolWithNameAndType(ConstString(name));
367 return sym ? sym->GetLoadAddress(&GetTarget()) : LLDB_INVALID_ADDRESS;
368}
369
371 kssize_t displacement = kvm_kerndisp(m_kvm);
372
373 if (displacement == 0)
374 return;
375
376 Target &target = GetTarget();
377 lldb::ModuleSP kernel_module_sp = target.GetExecutableModule();
378 if (!kernel_module_sp)
379 return;
380
381 bool changed = false;
382 kernel_module_sp->SetLoadAddress(target,
383 static_cast<lldb::addr_t>(displacement),
384 /*value_is_offset=*/true, changed);
385
386 if (changed) {
387 ModuleList loaded_module_list;
388 loaded_module_list.Append(kernel_module_sp);
389 target.ModulesDidLoad(loaded_module_list);
390 }
391}
392
394 Target &target = GetTarget();
395 Debugger &debugger = target.GetDebugger();
396
397 if (!debugger.GetCommandInterpreter().IsInteractive())
398 return;
399
401
402 // Find msgbufp symbol (pointer to message buffer)
403 lldb::addr_t msgbufp_addr = FindSymbol("msgbufp");
404 if (msgbufp_addr == LLDB_INVALID_ADDRESS)
405 return;
406
407 // Read the pointer value
408 lldb::addr_t msgbufp = ReadPointerFromMemory(msgbufp_addr, error);
409 if (!error.Success() || msgbufp == LLDB_INVALID_ADDRESS)
410 return;
411
412 // Get the type information for struct msgbuf from DWARF
413 TypeQuery query("msgbuf");
414 TypeResults results;
415 target.GetImages().FindTypes(nullptr, query, results);
416
417 uint64_t offset_msg_ptr = 0;
418 uint64_t offset_msg_size = 0;
419 uint64_t offset_msg_wseq = 0;
420 uint64_t offset_msg_rseq = 0;
421
422 if (results.GetTypeMap().GetSize() > 0) {
423 // Found type info - use it to get field offsets
424 CompilerType msgbuf_type =
425 results.GetTypeMap().GetTypeAtIndex(0)->GetForwardCompilerType();
426
427 uint32_t num_fields = msgbuf_type.GetNumFields();
428 int field_found = 0;
429 for (uint32_t i = 0; i < num_fields; i++) {
430 std::string field_name;
431 uint64_t field_offset = 0;
432
433 msgbuf_type.GetFieldAtIndex(i, field_name, &field_offset, nullptr,
434 nullptr);
435
436 if (field_name == "msg_ptr") {
437 offset_msg_ptr = field_offset / 8; // Convert bits to bytes
438 field_found++;
439 } else if (field_name == "msg_size") {
440 offset_msg_size = field_offset / 8;
441 field_found++;
442 } else if (field_name == "msg_wseq") {
443 offset_msg_wseq = field_offset / 8;
444 field_found++;
445 } else if (field_name == "msg_rseq") {
446 offset_msg_rseq = field_offset / 8;
447 field_found++;
448 }
449 }
450
451 if (field_found != 4) {
452 LLDB_LOGF(
454 "FreeBSD-Kernel-Core: Could not find all required fields for msgbuf");
455 return;
456 }
457 } else {
458 // Fallback: use hardcoded offsets based on struct layout
459 // struct msgbuf layout (from sys/sys/msgbuf.h):
460 // char *msg_ptr; - offset 0
461 // u_int msg_magic; - offset ptr_size
462 // u_int msg_size; - offset ptr_size + 4
463 // u_int msg_wseq; - offset ptr_size + 8
464 // u_int msg_rseq; - offset ptr_size + 12
465 uint32_t ptr_size = GetAddressByteSize();
466 offset_msg_ptr = 0;
467 offset_msg_size = ptr_size + 4;
468 offset_msg_wseq = ptr_size + 8;
469 offset_msg_rseq = ptr_size + 12;
470 }
471
472 // Read struct msgbuf fields
473 lldb::addr_t bufp = ReadPointerFromMemory(msgbufp + offset_msg_ptr, error);
474 if (!error.Success() || bufp == LLDB_INVALID_ADDRESS)
475 return;
476
477 uint32_t size =
478 ReadUnsignedIntegerFromMemory(msgbufp + offset_msg_size, 4, 0, error);
479 if (!error.Success() || size == 0)
480 return;
481
482 uint32_t wseq =
483 ReadUnsignedIntegerFromMemory(msgbufp + offset_msg_wseq, 4, 0, error);
484 if (!error.Success())
485 return;
486
487 uint32_t rseq =
488 ReadUnsignedIntegerFromMemory(msgbufp + offset_msg_rseq, 4, 0, error);
489 if (!error.Success())
490 return;
491
492 // Convert sequences to positions
493 // MSGBUF_SEQ_TO_POS macro in FreeBSD: ((seq) % (size))
494 uint32_t rseq_pos = rseq % size;
495 uint32_t wseq_pos = wseq % size;
496
497 if (rseq_pos == wseq_pos)
498 return;
499
500 // Print crash info at once using stream
501 lldb::StreamSP stream_sp = debugger.GetAsyncOutputStream();
502 if (!stream_sp)
503 return;
504
505 stream_sp->PutCString("\nUnread portion of the kernel message buffer:\n");
506
507 // Read ring buffer in at most two chunks
508 if (rseq_pos < wseq_pos) {
509 // No wrap: read from rseq_pos to wseq_pos
510 size_t len = wseq_pos - rseq_pos;
511 std::string buf(len, '\0');
512 size_t bytes_read = ReadMemory(bufp + rseq_pos, &buf[0], len, error);
513 if (error.Success() && bytes_read > 0) {
514 buf.resize(bytes_read);
515 *stream_sp << buf;
516 }
517 } else {
518 // Wrap around: read from rseq_pos to end, then from start to wseq_pos
519 size_t len1 = size - rseq_pos;
520 std::string buf1(len1, '\0');
521 size_t bytes_read1 = ReadMemory(bufp + rseq_pos, &buf1[0], len1, error);
522 if (error.Success() && bytes_read1 > 0) {
523 buf1.resize(bytes_read1);
524 *stream_sp << buf1;
525 }
526
527 if (wseq_pos > 0) {
528 std::string buf2(wseq_pos, '\0');
529 size_t bytes_read2 = ReadMemory(bufp, &buf2[0], wseq_pos, error);
530 if (error.Success() && bytes_read2 > 0) {
531 buf2.resize(bytes_read2);
532 *stream_sp << buf2;
533 }
534 }
535 }
536
537 stream_sp->PutChar('\n');
538 stream_sp->Flush();
539}
540
541const 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:376
#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
CommandInterpreter & GetCommandInterpreter()
Definition Debugger.h:169
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:2323
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:2193
lldb::DynamicLoaderUP m_dyld_up
Definition Process.h:3407
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:1907
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:2312
lldb::addr_t ReadPointerFromMemory(lldb::addr_t vm_addr, Status &error)
Definition Process.cpp:2334
friend class Target
Definition Process.h:360
uint32_t GetAddressByteSize() const
Definition Process.cpp:3725
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:1854
Debugger & GetDebugger() const
Definition Target.h:1223
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:1140
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:332
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