75#include "llvm/Support/PrettyStackTrace.h"
76#include "llvm/Support/Regex.h"
81#define DEFAULT_DISASM_BYTE_SIZE 32
84 std::lock_guard<std::recursive_mutex> guard(target.
GetAPIMutex());
88 const auto state = process_sp->GetState();
95 "process is connected and already has a listener, pass "
100 return target.
Attach(attach_info,
nullptr);
168 return this->
operator bool();
170SBTarget::operator
bool()
const {
182 process_sp = target_sp->GetProcessSP();
183 sb_process.
SetSP(process_sp);
205 debugger.
reset(target_sp->GetDebugger().shared_from_this());
220 std::string json_str =
222 target_sp->GetDebugger(), target_sp.get(),
267 ProcessSP process_sp(target_sp->CreateProcess(
268 target_sp->GetDebugger().GetListener(),
"", &filespec,
false));
270 ElapsedTime load_core_time(target_sp->GetStatistics().GetLoadCoreTime());
271 error.SetError(process_sp->LoadCore());
273 sb_process.
SetSP(process_sp);
275 error.SetErrorString(
"Failed to create the process");
278 error.SetErrorString(
"SBTarget is invalid");
284 const char *working_directory) {
293 if (
Module *exe_module = target_sp->GetExecutableModulePointer())
300 if (working_directory)
312 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
313 sb_error.
ref() = target_sp->Install(
nullptr);
319 char const **envp,
const char *stdin_path,
320 const char *stdout_path,
const char *stderr_path,
321 const char *working_directory,
322 uint32_t launch_flags,
325 stderr_path, working_directory, launch_flags,
326 stop_at_entry,
error);
331 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
334 launch_flags |= eLaunchFlagStopAtEntry;
336 if (getenv(
"LLDB_LAUNCH_FLAG_DISABLE_ASLR"))
337 launch_flags |= eLaunchFlagDisableASLR;
339 if (getenv(
"LLDB_LAUNCH_FLAG_USE_PIPES"))
340 launch_flags |= eLaunchFlagUsePipes;
343 process_sp = target_sp->GetProcessSP();
345 state = process_sp->GetState();
349 error.SetErrorString(
"process attach is in progress");
351 error.SetErrorString(
"a process is already being debugged");
361 error.SetErrorString(
"process is connected and already has a listener, "
362 "pass empty listener");
367 if (getenv(
"LLDB_LAUNCH_FLAG_DISABLE_STDIO"))
368 launch_flags |= eLaunchFlagDisableSTDIO;
372 FileSpec(working_directory), launch_flags);
374 Module *exe_module = target_sp->GetExecutableModulePointer();
380 auto default_launch_info = target_sp->GetProcessLaunchInfo();
382 default_launch_info.GetArguments());
387 auto default_launch_info = target_sp->GetProcessLaunchInfo();
388 launch_info.
GetEnvironment() = default_launch_info.GetEnvironment();
394 error.SetError(target_sp->Launch(launch_info,
nullptr));
396 sb_process.
SetSP(target_sp->GetProcessSP());
398 error.SetErrorString(
"SBTarget is invalid");
409 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
412 ProcessSP process_sp = target_sp->GetProcessSP();
414 state = process_sp->GetState();
418 error.SetErrorString(
"process attach is in progress");
420 error.SetErrorString(
"a process is already being debugged");
429 Module *exe_module = target_sp->GetExecutableModulePointer();
434 const ArchSpec &arch_spec = target_sp->GetArchitecture();
438 error.SetError(target_sp->Launch(launch_info,
nullptr));
439 sb_launch_info.
set_ref(launch_info);
440 sb_process.
SetSP(target_sp->GetProcessSP());
442 error.SetErrorString(
"SBTarget is invalid");
456 PlatformSP platform_sp = target_sp->GetPlatform();
458 if (platform_sp && platform_sp->IsConnected()) {
461 if (platform_sp->GetProcessInfo(attach_pid, instance_info)) {
465 "no process found with process ID %" PRIu64, attach_pid);
472 sb_process.
SetSP(target_sp->GetProcessSP());
474 error.SetErrorString(
"SBTarget is invalid");
495 if (target_sp->GetPlatform()->GetProcessInfo(pid, instance_info))
500 sb_process.
SetSP(target_sp->GetProcessSP());
502 error.SetErrorString(
"SBTarget is invalid");
518 error.SetErrorString(
"invalid name");
531 sb_process.
SetSP(target_sp->GetProcessSP());
533 error.SetErrorString(
"SBTarget is invalid");
540 const char *plugin_name,
547 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
550 target_sp->CreateProcess(listener.
m_opaque_sp, plugin_name,
nullptr,
553 process_sp = target_sp->CreateProcess(
554 target_sp->GetDebugger().GetListener(), plugin_name,
nullptr,
true);
557 sb_process.
SetSP(process_sp);
558 error.SetError(process_sp->ConnectRemote(url));
560 error.SetErrorString(
"unable to create lldb_private::Process");
563 error.SetErrorString(
"SBTarget is invalid");
574 Module *exe_module = target_sp->GetExecutableModulePointer();
579 return exe_file_spec;
606 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
607 if (target_sp->ResolveLoadAddress(vm_addr, addr))
623 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
624 if (target_sp->ResolveFileAddress(file_addr, addr))
639 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
640 if (target_sp->ResolveLoadAddress(vm_addr, addr))
652 uint32_t resolve_scope) {
656 SymbolContextItem scope =
static_cast<SymbolContextItem
>(resolve_scope);
661 target_sp->GetImages().ResolveSymbolContextForAddress(addr.
ref(), scope,
672 size_t bytes_read = 0;
674 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
676 target_sp->ReadMemory(addr.
ref(), buf, size,
error.ref(),
true);
678 error.SetErrorString(
"invalid target");
685 const char *description,
688 if (!class_name || class_name[0] ==
'\0') {
689 error.SetErrorString(
"empty class name");
699 if (!args_dict->IsValid()) {
700 error.SetErrorString(
"args data is not a dictionary");
704 llvm::Expected<lldb::user_id_t> id_or_err =
705 target_sp->AddBreakpointResolverOverride(
706 class_name, args_dict,
707 description ? description :
"<No Description>");
710 error.SetErrorString(llvm::toString(id_or_err.takeError()).c_str());
714 error.SetErrorString(
"invalid SBTarget.");
721 return target_sp->RemoveBreakpointResolverOverride(
id);
762 const SBFileSpec &sb_file_spec, uint32_t line, uint32_t column,
768 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
772 const bool internal =
false;
773 const bool hardware =
false;
776 if (sb_module_list.
GetSize() > 0) {
777 module_list = sb_module_list.
get();
779 sb_bp = target_sp->CreateBreakpoint(
780 module_list, *sb_file_spec, line, column, offset, check_inlines,
781 skip_prologue, internal, hardware, move_to_nearest_code);
788 const SBFileSpec &sb_file_spec, uint32_t line, uint32_t column,
790 bool move_to_nearest_code) {
792 move_to_nearest_code);
796 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
800 const bool internal =
false;
801 const bool hardware =
false;
803 if (sb_module_list.
GetSize() > 0) {
804 module_list = sb_module_list.
get();
806 sb_bp = target_sp->CreateBreakpoint(
807 module_list, *sb_file_spec, line, column, offset, check_inlines,
808 skip_prologue, internal, hardware,
816 const char *module_name) {
821 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
823 const bool internal =
false;
824 const bool hardware =
false;
827 const bool offset_is_insn_count =
false;
828 if (module_name && module_name[0]) {
831 sb_bp = target_sp->CreateBreakpoint(
832 &module_spec_list,
nullptr, symbol_name, eFunctionNameTypeAuto,
836 sb_bp = target_sp->CreateBreakpoint(
837 nullptr,
nullptr, symbol_name, eFunctionNameTypeAuto,
852 lldb::FunctionNameType name_type_mask = eFunctionNameTypeAuto;
859 const char *symbol_name, uint32_t name_type_mask,
870 const char *symbol_name, uint32_t name_type_mask,
874 module_list, comp_unit_list);
876 false, module_list, comp_unit_list);
880 const char *symbol_name, uint32_t name_type_mask,
885 offset_is_insn_count, module_list, comp_unit_list);
889 target_sp && symbol_name && symbol_name[0]) {
890 const bool internal =
false;
891 const bool hardware =
false;
893 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
894 FunctionNameType mask =
static_cast<FunctionNameType
>(name_type_mask);
895 sb_bp = target_sp->CreateBreakpoint(module_list.
get(), comp_unit_list.
get(),
896 symbol_name, mask, symbol_language,
897 offset, offset_is_insn_count,
898 skip_prologue, internal, hardware);
905 const char *symbol_names[], uint32_t num_names, uint32_t name_type_mask,
916 const char *symbol_names[], uint32_t num_names, uint32_t name_type_mask,
920 symbol_language, module_list, comp_unit_list);
928 const char *symbol_names[], uint32_t num_names, uint32_t name_type_mask,
932 symbol_language, offset, module_list, comp_unit_list);
935 if (
TargetSP target_sp =
GetSP(); target_sp && num_names > 0) {
936 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
937 const bool internal =
false;
938 const bool hardware =
false;
939 FunctionNameType mask =
static_cast<FunctionNameType
>(name_type_mask);
941 sb_bp = target_sp->CreateBreakpoint(
942 module_list.
get(), comp_unit_list.
get(), symbol_names, num_names, mask,
943 symbol_language, offset, skip_prologue, internal, hardware);
950 const char *module_name) {
955 if (module_name && module_name[0]) {
959 module_spec_list, comp_unit_list);
969 module_list, comp_unit_list);
973 const char *symbol_name_regex,
LanguageType symbol_language,
980 target_sp && symbol_name_regex && symbol_name_regex[0]) {
981 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
983 const bool internal =
false;
984 const bool hardware =
false;
987 sb_bp = target_sp->CreateFuncRegexBreakpoint(
988 module_list.
get(), comp_unit_list.
get(), std::move(regexp),
989 symbol_language, skip_prologue, internal, hardware);
1000 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1001 const bool hardware =
false;
1002 sb_bp = target_sp->CreateBreakpoint(address,
false, hardware);
1017 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1018 const bool hardware =
false;
1019 sb_bp = target_sp->CreateBreakpoint(sb_address.
ref(),
false, hardware);
1028 const char *module_name) {
1033 if (module_name && module_name[0]) {
1039 source_file_list.
Append(source_file);
1064 target_sp && source_regex && source_regex[0]) {
1065 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1066 const bool hardware =
false;
1069 std::unordered_set<std::string> func_names_set;
1070 for (
size_t i = 0; i < func_names.
GetSize(); i++) {
1074 sb_bp = target_sp->CreateSourceRegexBreakpoint(
1075 module_list.
get(), source_file_list.
get(), func_names_set,
1076 std::move(regexp),
false, hardware, move_to_nearest_code);
1084 bool catch_bp,
bool throw_bp) {
1089 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1090 const bool hardware =
false;
1091 sb_bp = target_sp->CreateExceptionBreakpoint(language, catch_bp, throw_bp,
1101 bool request_hardware) {
1107 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1112 target_sp->CreateScriptedBreakpoint(class_name,
1129 return target_sp->GetBreakpointList().GetSize();
1140 sb_breakpoint = target_sp->GetBreakpointList().GetBreakpointAtIndex(idx);
1142 return sb_breakpoint;
1148 bool result =
false;
1150 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1151 result = target_sp->RemoveBreakpointByID(bp_id);
1163 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1164 sb_breakpoint = target_sp->GetBreakpointByID(bp_id);
1167 return sb_breakpoint;
1175 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1176 llvm::Expected<std::vector<BreakpointSP>> expected_vector =
1177 target_sp->GetBreakpointList().FindBreakpointsByName(name);
1178 if (!expected_vector) {
1180 "invalid breakpoint name: {0}");
1196 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1198 std::vector<std::string> name_vec;
1199 target_sp->GetBreakpointNames(name_vec);
1200 for (
const auto &name : name_vec)
1209 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1210 target_sp->DeleteBreakpointName(
ConstString(name));
1218 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1219 target_sp->EnableAllowedBreakpoints();
1229 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1230 target_sp->DisableAllowedBreakpoints();
1240 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1241 target_sp->RemoveAllowedBreakpoints();
1262 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1266 std::vector<std::string> name_vector;
1267 size_t num_names = matching_names.
GetSize();
1268 for (
size_t i = 0; i < num_names; i++)
1271 sberr.
ref() = target_sp->CreateBreakpointsFromFile(source_file.
ref(),
1272 name_vector, bp_ids);
1276 size_t num_bkpts = bp_ids.
GetSize();
1277 for (
size_t i = 0; i < num_bkpts; i++) {
1283 "BreakpointCreateFromFile called with invalid target.");
1296 sberr.
SetErrorString(
"BreakpointWriteToFile called with invalid target.");
1307 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1310 sberr.
ref() = target_sp->SerializeBreakpointsToFile(dest_file.
ref(),
1311 bp_id_list, append);
1313 sberr.
SetErrorString(
"BreakpointWriteToFile called with invalid target.");
1323 return target_sp->GetWatchpointList().GetSize();
1334 sb_watchpoint.
SetSP(target_sp->GetWatchpointList().GetByIndex(idx));
1336 return sb_watchpoint;
1342 bool result =
false;
1344 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1345 std::unique_lock<std::recursive_mutex> lock;
1346 target_sp->GetWatchpointList().GetListMutex(lock);
1347 result = target_sp->RemoveWatchpointByID(wp_id);
1360 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1361 std::unique_lock<std::recursive_mutex> lock;
1362 target_sp->GetWatchpointList().GetListMutex(lock);
1363 watchpoint_sp = target_sp->GetWatchpointList().FindByID(wp_id);
1364 sb_watchpoint.
SetSP(watchpoint_sp);
1367 return sb_watchpoint;
1371 bool read,
bool modify,
1390 uint32_t watch_type = 0;
1397 if (watch_type == 0) {
1398 error.SetErrorString(
"Can't create a watchpoint that is neither read nor "
1399 "write nor modify.");
1400 return sb_watchpoint;
1405 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1411 target_sp->CreateWatchpoint(addr, size, type, watch_type, cw_error);
1412 error.SetError(std::move(cw_error));
1413 sb_watchpoint.
SetSP(watchpoint_sp);
1416 return sb_watchpoint;
1423 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1424 std::unique_lock<std::recursive_mutex> lock;
1425 target_sp->GetWatchpointList().GetListMutex(lock);
1426 target_sp->EnableAllWatchpoints();
1436 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1437 std::unique_lock<std::recursive_mutex> lock;
1438 target_sp->GetWatchpointList().GetListMutex(lock);
1439 target_sp->DisableAllWatchpoints();
1459 sb_value.
SetSP(new_value_sp);
1477 sb_value.
SetSP(new_value_sp);
1487 if (
IsValid() && name && *name && expr && *expr) {
1493 sb_value.
SetSP(new_value_sp);
1501 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1502 std::unique_lock<std::recursive_mutex> lock;
1503 target_sp->GetWatchpointList().GetListMutex(lock);
1504 target_sp->RemoveAllWatchpoints();
1515 llvm::StringRef srFrom = from, srTo = to;
1517 return error.SetErrorString(
"<from> path can't be empty");
1519 return error.SetErrorString(
"<to> path can't be empty");
1521 target_sp->GetImageSearchPathList().Append(srFrom, srTo,
true);
1523 error.SetErrorString(
"invalid target");
1528 const char *uuid_cstr) {
1531 return AddModule(path, triple, uuid_cstr,
nullptr);
1535 const char *uuid_cstr,
const char *symfile) {
1548 target_sp->GetPlatform().get(), triple);
1584 if (sb_module.
IsValid() && !target_sp->GetArchitecture().IsValid() &&
1585 sb_module.
GetSP()->GetArchitecture().IsValid())
1586 target_sp->SetArchitecture(sb_module.
GetSP()->GetArchitecture());
1595 target_sp->GetImages().AppendIfNeeded(module.
GetSP());
1607 num = target_sp->GetImages().GetSize();
1626 sb_module.
SetSP(target_sp->GetImages().FindFirstModule(module_spec));
1638 target_sp->GetImages().FindFirstModule(*sb_module_spec.
m_opaque_up));
1648 target_sp->GetImages().FindCompileUnits(*sb_file_spec, *sb_sc_list);
1656 return target_sp->GetArchitecture().GetByteOrder();
1664 const std::string &triple = target_sp->GetArchitecture().GetTriple().str();
1678 llvm::StringRef arch_name =
1679 target_sp->GetArchitecture().GetTriple().getArchName();
1709 return target_sp->GetGloballyUniqueID();
1733 return target_sp->GetArchitecture().GetMinimumOpcodeByteSize();
1742 return target_sp->GetArchitecture().GetMaximumOpcodeByteSize();
1763 return target_sp->GetMaximumNumberOfChildrenToDisplay();
1771 return target_sp->GetArchitecture().GetAddressByteSize();
1772 return sizeof(
void *);
1782 module_sp = target_sp->GetImages().GetModuleAtIndex(idx);
1783 sb_module.
SetSP(module_sp);
1793 return target_sp->GetImages().Remove(module.
GetSP());
1814 target_sp->Dump(&strm, description_level);
1822 uint32_t name_type_mask) {
1826 if (!name || !name[0])
1834 FunctionNameType mask =
static_cast<FunctionNameType
>(name_type_mask);
1835 target_sp->GetImages().FindFunctions(
ConstString(name), mask,
1836 function_options, *sb_sc_list);
1842 uint32_t max_matches,
1847 if (name && name[0]) {
1848 llvm::StringRef name_ref(name);
1854 std::string regexstr;
1855 switch (matchtype) {
1858 function_options, *sb_sc_list);
1861 target_sp->GetImages().FindFunctions(
1863 function_options, *sb_sc_list);
1866 regexstr = llvm::Regex::escape(name) +
".*";
1868 function_options, *sb_sc_list);
1871 target_sp->GetImages().FindFunctions(
ConstString(name),
1872 eFunctionNameTypeAny,
1873 function_options, *sb_sc_list);
1885 target_sp && typename_cstr && typename_cstr[0]) {
1888 TypeQueryOptions::e_find_one);
1890 target_sp->GetImages().FindTypes(
nullptr, query, results);
1894 if (
auto process_sp = target_sp->GetProcessSP()) {
1895 for (
auto *runtime : process_sp->GetLanguageRuntimes()) {
1896 if (
auto vendor = runtime->GetDeclVendor()) {
1897 auto types = vendor->FindTypes(const_typename, 1);
1899 return SBType(types.front());
1905 for (
auto type_system_sp : target_sp->GetScratchTypeSystems())
1906 if (
auto type = type_system_sp->GetBuiltinTypeByName(const_typename))
1917 for (
auto type_system_sp : target_sp->GetScratchTypeSystems())
1918 if (
auto compiler_type = type_system_sp->GetBasicTypeFromAST(type))
1919 return SBType(compiler_type);
1929 target_sp && typename_cstr && typename_cstr[0]) {
1934 images.
FindTypes(
nullptr, query, results);
1939 if (
ProcessSP process_sp = target_sp->GetProcessSP()) {
1940 for (
auto *runtime : process_sp->GetLanguageRuntimes()) {
1941 if (
auto *vendor = runtime->GetDeclVendor()) {
1943 vendor->FindTypes(const_typename,
UINT32_MAX);
1944 for (
auto type : types)
1950 if (sb_type_list.
GetSize() == 0) {
1952 for (
auto type_system_sp : target_sp->GetScratchTypeSystems())
1953 if (
auto compiler_type =
1954 type_system_sp->GetBuiltinTypeByName(const_typename))
1958 return sb_type_list;
1962 uint32_t max_matches) {
1969 target_sp->GetImages().FindGlobalVariables(
ConstString(name), max_matches,
1971 if (!variable_list.
Empty()) {
1973 if (exe_scope ==
nullptr)
1974 exe_scope = target_sp.get();
1975 for (
const VariableSP &var_sp : variable_list) {
1984 return sb_value_list;
1988 uint32_t max_matches,
1995 llvm::StringRef name_ref(name);
1998 std::string regexstr;
1999 switch (matchtype) {
2001 target_sp->GetImages().FindGlobalVariables(
ConstString(name), max_matches,
2006 max_matches, variable_list);
2009 target_sp->GetImages().FindGlobalVariables(
2014 regexstr =
"^" + llvm::Regex::escape(name) +
".*";
2016 max_matches, variable_list);
2019 if (!variable_list.
Empty()) {
2021 if (exe_scope ==
nullptr)
2022 exe_scope = target_sp.get();
2023 for (
const VariableSP &var_sp : variable_list) {
2032 return sb_value_list;
2048 return source_manager;
2060 const char *flavor_string) {
2067 if (llvm::Expected<DisassemblerSP> disassembler =
2068 target_sp->ReadInstructions(*addr_ptr, count, flavor_string)) {
2074 return sb_instructions;
2079 const char *flavor_string) {
2087 if (end_load_addr > start_load_addr) {
2091 const bool force_live_memory =
true;
2093 target_sp->GetArchitecture(),
nullptr, flavor_string,
2094 target_sp->GetDisassemblyCPU(), target_sp->GetDisassemblyFeatures(),
2095 *target_sp, range, force_live_memory));
2098 return sb_instructions;
2111 const char *flavor_string,
const void *buf,
2120 if (base_addr.
get())
2121 addr = *base_addr.
get();
2123 constexpr bool data_from_file =
true;
2124 if (!flavor_string || flavor_string[0] ==
'\0') {
2128 const llvm::Triple::ArchType arch =
2129 target_sp->GetArchitecture().GetTriple().getArch();
2130 if (arch == llvm::Triple::x86 || arch == llvm::Triple::x86_64)
2131 flavor_string = target_sp->GetDisassemblyFlavor();
2135 target_sp->GetArchitecture(),
nullptr, flavor_string,
2136 target_sp->GetDisassemblyCPU(), target_sp->GetDisassemblyFeatures(),
2137 addr, buf, size,
UINT32_MAX, data_from_file));
2140 return sb_instructions;
2154 const char *flavor_string,
const void *buf,
2169 sb_error.SetErrorStringWithFormat(
"invalid section");
2173 if (section_sp->IsThreadSpecific()) {
2175 "thread specific sections are not yet supported");
2177 ProcessSP process_sp(target_sp->GetProcessSP());
2178 if (target_sp->SetSectionLoadAddress(section_sp, section_base_addr)) {
2179 ModuleSP module_sp(section_sp->GetModule());
2182 module_list.
Append(module_sp);
2183 target_sp->ModulesDidLoad(module_list);
2187 process_sp->Flush();
2205 sb_error.SetErrorStringWithFormat(
"invalid section");
2209 ProcessSP process_sp(target_sp->GetProcessSP());
2210 if (target_sp->SetSectionUnloaded(section_sp)) {
2211 ModuleSP module_sp(section_sp->GetModule());
2214 module_list.
Append(module_sp);
2215 target_sp->ModulesDidUnload(module_list,
false);
2219 process_sp->Flush();
2222 sb_error.SetErrorStringWithFormat(
"invalid section");
2226 sb_error.SetErrorStringWithFormat(
"invalid target");
2232 int64_t slide_offset) {
2235 if (slide_offset < 0) {
2237 sb_error.SetErrorStringWithFormat(
"slide must be positive");
2245 uint64_t slide_offset) {
2252 bool changed =
false;
2253 if (module_sp->SetLoadAddress(*target_sp, slide_offset,
true, changed)) {
2258 module_list.
Append(module_sp);
2259 target_sp->ModulesDidLoad(module_list);
2261 ProcessSP process_sp(target_sp->GetProcessSP());
2263 process_sp->Flush();
2267 sb_error.SetErrorStringWithFormat(
"invalid module");
2271 sb_error.SetErrorStringWithFormat(
"invalid target");
2285 ObjectFile *objfile = module_sp->GetObjectFile();
2289 ProcessSP process_sp(target_sp->GetProcessSP());
2291 bool changed =
false;
2292 const size_t num_sections = section_list->
GetSize();
2293 for (
size_t sect_idx = 0; sect_idx < num_sections; ++sect_idx) {
2296 changed |= target_sp->SetSectionUnloaded(section_sp);
2300 module_list.
Append(module_sp);
2301 target_sp->ModulesDidUnload(module_list,
false);
2303 ProcessSP process_sp(target_sp->GetProcessSP());
2305 process_sp->Flush();
2308 module_sp->GetFileSpec().GetPath(path,
sizeof(path));
2309 sb_error.SetErrorStringWithFormat(
"no sections in object file '%s'",
2313 module_sp->GetFileSpec().GetPath(path,
sizeof(path));
2314 sb_error.SetErrorStringWithFormat(
"no object file for module '%s'",
2318 sb_error.SetErrorStringWithFormat(
"invalid module");
2321 sb_error.SetErrorStringWithFormat(
"invalid target");
2331 if (name && name[0]) {
2333 target_sp->GetImages().FindSymbolsWithNameAndType(
2346 target_sp->GetPreferDynamicValue();
2363 if (expr ==
nullptr || expr[0] ==
'\0')
2366 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
2382 "process is running.");
2394 "** [SBTarget::EvaluateExpression] Expression result is "
2395 "%s, summary %s **",
2405 ProcessSP process_sp(target_sp->GetProcessSP());
2407 abi_sp = process_sp->GetABI();
2411 return abi_sp->GetRedZoneSize();
2422 return module_sp->IsLoadedInTarget(target_sp.get());
2456 return SBTrace(target_sp->GetTrace());
2466 if (llvm::Expected<lldb::TraceSP> trace_sp = target_sp->CreateTrace()) {
2469 error.SetErrorString(llvm::toString(trace_sp.takeError()).c_str());
2472 error.SetErrorString(
"missing target");
2493 error.SetErrorString(
"invalid target");
2497 if (!class_name || !class_name[0]) {
2498 error.SetErrorString(
"invalid class name");
2507 error.SetErrorString(
"SBStructuredData argument isn't a dictionary");
2510 dict_sp = std::make_shared<StructuredData::Dictionary>(obj_sp);
2515 std::make_shared<ScriptedMetadata>(class_name, dict_sp);
2519 target_sp->GetDebugger()
2520 .GetScriptInterpreter()
2521 ->CreateScriptedFrameProviderInterface();
2527 llvm::Expected<uint32_t> descriptor_id_or_err =
2528 target_sp->AddScriptedFrameProviderDescriptor(descriptor);
2529 if (!descriptor_id_or_err) {
2530 error.SetErrorString(
2531 llvm::toString(descriptor_id_or_err.takeError()).c_str());
2536 return *descriptor_id_or_err;
2545 error.SetErrorString(
"invalid target");
2550 error.SetErrorString(
"invalid provider id");
2554 if (!target_sp->RemoveScriptedFrameProviderDescriptor(provider_id)) {
2555 error.SetErrorStringWithFormat(
"no frame provider named '%u' found",
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_INSTRUMENT()
#define LLDB_INSTRUMENT_VA(...)
#define LLDB_LOGF(log,...)
#define LLDB_LOG_ERROR(log, error,...)
static Status AttachToProcess(ProcessAttachInfo &attach_info, Target &target)
lldb_private::Address * get()
addr_t GetLoadAddress(const lldb::SBTarget &target) const
lldb_private::Address & ref()
lldb_private::ProcessAttachInfo & ref()
void CopyToBreakpointIDList(lldb_private::BreakpointIDList &bp_id_list)
void AppendByID(lldb::break_id_t id)
void reset(const lldb::DebuggerSP &debugger_sp)
void SetErrorString(const char *err_str)
lldb_private::Status & ref()
lldb_private::Event * get() const
void SetFetchDynamicValue(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
lldb_private::EvaluateExpressionOptions & ref() const
void SetUnwindOnError(bool unwind=true)
lldb::DynamicValueType GetFetchDynamicValue() const
const lldb_private::FileSpecList * get() const
void Append(const SBFileSpec &sb_file)
void SetFileSpec(const lldb_private::FileSpec &fspec)
const lldb_private::FileSpec & ref() const
void SetDisassembler(const lldb::DisassemblerSP &opaque_sp)
void SetWorkingDirectory(const char *working_dir)
void SetExecutableFile(SBFileSpec exe_file, bool add_as_first_arg)
Set the executable file that will be used to launch the process and optionally set it as the first ar...
void set_ref(const lldb_private::ProcessLaunchInfo &info)
void SetEnvironmentEntries(const char **envp, bool append)
Update this object with the given environment variables.
const lldb_private::ProcessLaunchInfo & ref() const
void SetArguments(const char **argv, bool append)
lldb::ListenerSP m_opaque_sp
std::unique_ptr< lldb_private::ModuleSpec > m_opaque_up
void SetSP(const ModuleSP &module_sp)
void SetSP(const lldb::ProcessSP &process_sp)
lldb::SectionSP GetSP() const
This class handles the verbosity when dumping statistics.
const lldb_private::StatisticsOptions & ref() const
lldb_private::Stream & ref()
void AppendString(const char *str)
const char * GetStringAtIndex(size_t idx)
StructuredDataImplUP m_impl_up
void CopyImpl(lldb_private::StructuredDataImpl &new_impl)
lldb_private::SymbolContext & ref()
SBSourceManager GetSourceManager()
const char * GetTargetSessionName() const
Get the target session name for this target.
bool AddModule(lldb::SBModule &module)
bool DisableAllBreakpoints()
uint32_t GetNumWatchpoints() const
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
lldb::SBError ClearSectionLoadAddress(lldb::SBSection section)
Clear the base load address for a module section.
bool DeleteWatchpoint(lldb::watch_id_t watch_id)
lldb::ByteOrder GetByteOrder()
uint32_t GetNumBreakpoints() const
lldb::SBInstructionList GetInstructionsWithFlavor(lldb::SBAddress base_addr, const char *flavor_string, const void *buf, size_t size)
void SetCollectingStats(bool v)
Sets whether we should collect statistics on lldb or not.
bool BreakpointDelete(break_id_t break_id)
void SetSP(const lldb::TargetSP &target_sp)
bool IsLoaded(const lldb::SBModule &module) const
static lldb::SBModule GetModuleAtIndexFromEvent(const uint32_t idx, const lldb::SBEvent &event)
bool GetCollectingStats()
Returns whether statistics collection are enabled.
lldb::SBBreakpoint BreakpointCreateByAddress(addr_t address)
lldb::SBValue CreateValueFromExpression(const char *name, const char *expr)
lldb::SBSymbolContextList FindGlobalFunctions(const char *name, uint32_t max_matches, MatchType matchtype)
Find global functions by their name with pattern matching.
lldb::SBBreakpoint BreakpointCreateByRegex(const char *symbol_name_regex, const char *module_name=nullptr)
lldb::SBTrace GetTrace()
Get a SBTrace object the can manage the processor trace information of this target.
const lldb::SBTarget & operator=(const lldb::SBTarget &rhs)
const char * GetLabel() const
static bool EventIsTargetEvent(const lldb::SBEvent &event)
lldb::SBAddress ResolvePastLoadAddress(uint32_t stop_id, lldb::addr_t vm_addr)
Resolve a current load address into a section offset address using the process stop ID to identify a ...
bool DisableAllWatchpoints()
lldb::addr_t GetStackRedZoneSize()
lldb::SBBreakpoint GetBreakpointAtIndex(uint32_t idx) const
SBError Install()
Install any binaries that need to be installed.
lldb::SBSymbolContextList FindCompileUnits(const lldb::SBFileSpec &sb_file_spec)
Find compile units related to *this target and passed source file.
lldb::SBAddress ResolveLoadAddress(lldb::addr_t vm_addr)
Resolve a current load address into a section offset address.
lldb::SBWatchpoint WatchpointCreateByAddress(lldb::addr_t addr, size_t size, lldb::SBWatchpointOptions options, SBError &error)
lldb::SBMutex GetAPIMutex() const
lldb::SBStructuredData GetStatistics()
Returns a dump of the collected statistics.
lldb::SBModule GetModuleAtIndex(uint32_t idx)
SBError SetLabel(const char *label)
lldb::SBValueList FindGlobalVariables(const char *name, uint32_t max_matches)
Find global and static variables by name.
lldb::SBType GetBasicType(lldb::BasicType type)
uint64_t AddBreakpointOverride(const char *class_name, const char *description, SBStructuredData &args_data, SBError &status)
Adds a breakpoint override implemented by class_name.
lldb::SBFileSpec GetExecutable()
const char * GetABIName()
lldb::SBError SetSectionLoadAddress(lldb::SBSection section, lldb::addr_t section_base_addr)
Set the base load address for a module section.
lldb::SBProcess ConnectRemote(SBListener &listener, const char *url, const char *plugin_name, SBError &error)
Connect to a remote debug server with url.
friend class SBBreakpoint
lldb::SBBreakpoint BreakpointCreateByName(const char *symbol_name, const char *module_name=nullptr)
void DeleteBreakpointName(const char *name)
lldb::SBWatchpoint WatchAddress(lldb::addr_t addr, size_t size, bool read, bool modify, SBError &error)
SBProcess Attach(SBAttachInfo &attach_info, SBError &error)
bool EnableAllWatchpoints()
lldb::SBBreakpoint BreakpointCreateBySBAddress(SBAddress &address)
LLDB_DEPRECATED_FIXME("Use SetModuleLoadAddress(lldb::SBModule, uint64_t)", "SetModuleLoadAddress(lldb::SBModule, uint64_t)") lldb lldb::SBError SetModuleLoadAddress(lldb::SBModule module, uint64_t sections_offset)
Slide all file addresses for all module sections so that module appears to loaded at these slide addr...
lldb::SBProcess GetProcess()
uint32_t RegisterScriptedFrameProvider(const char *class_name, lldb::SBStructuredData args_dict, lldb::SBError &error)
Register a scripted frame provider for this target.
SBSymbolContext ResolveSymbolContextForAddress(const SBAddress &addr, uint32_t resolve_scope)
lldb::SBProcess AttachToProcessWithID(SBListener &listener, lldb::pid_t pid, lldb::SBError &error)
Attach to process with pid.
lldb::SBPlatform GetPlatform()
Return the platform object associated with the target.
bool RemoveBreakpointOverride(uint64_t id)
lldb::SBBreakpoint BreakpointCreateByLocation(const char *file, uint32_t line)
lldb::SBBreakpoint BreakpointCreateForException(lldb::LanguageType language, bool catch_bp, bool throw_bp)
uint32_t GetNumModules() const
lldb::TargetSP GetSP() const
uint32_t GetDataByteSize()
uint32_t GetMaximumNumberOfChildrenToDisplay() const
Gets the target.max-children-count value It should be used to limit the number of children of large d...
bool DeleteAllWatchpoints()
lldb::SBInstructionList GetInstructions(lldb::SBAddress base_addr, const void *buf, size_t size)
friend class SBModuleSpec
lldb::SBProcess Launch(SBListener &listener, 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)
Launch a new process.
bool RemoveModule(lldb::SBModule module)
lldb::SBSymbolContextList FindFunctions(const char *name, uint32_t name_type_mask=lldb::eFunctionNameTypeAny)
Find functions by name.
lldb::SBValue FindFirstGlobalVariable(const char *name)
Find the first global (or static) variable by name.
lldb::SBValue EvaluateExpression(const char *expr)
lldb::SBBreakpoint BreakpointCreateFromScript(const char *class_name, SBStructuredData &extra_args, const SBFileSpecList &module_list, const SBFileSpecList &file_list, bool request_hardware=false)
Create a breakpoint using a scripted resolver.
static const char * GetBroadcasterClassName()
SBEnvironment GetEnvironment()
Return the environment variables that would be used to launch a new process.
lldb::SBTypeList FindTypes(const char *type)
static lldb::SBTarget GetCreatedTargetFromEvent(const lldb::SBEvent &event)
For eBroadcastBitNewTargetCreated events, returns the newly created target.
lldb::SBValue CreateValueFromAddress(const char *name, lldb::SBAddress addr, lldb::SBType type)
static lldb::SBTarget GetTargetFromEvent(const lldb::SBEvent &event)
lldb::SBError BreakpointsCreateFromFile(SBFileSpec &source_file, SBBreakpointList &new_bps)
Read breakpoints from source_file and return the newly created breakpoints in bkpt_list.
uint32_t GetAddressByteSize()
bool operator==(const lldb::SBTarget &rhs) const
bool operator!=(const lldb::SBTarget &rhs) const
const char * GetArchName() const
lldb::TargetSP m_opaque_sp
lldb::SBWatchpoint GetWatchpointAtIndex(uint32_t idx) const
lldb::SBLaunchInfo GetLaunchInfo() const
lldb::SBSymbolContextList FindSymbols(const char *name, lldb::SymbolType type=eSymbolTypeAny)
lldb::user_id_t GetGloballyUniqueID() const
Get the globally unique ID for this target.
void AppendImageSearchPath(const char *from, const char *to, lldb::SBError &error)
lldb::SBError RemoveScriptedFrameProvider(uint32_t provider_id)
Remove a scripted frame provider from this target by name.
friend class SBBreakpointList
lldb::SBTrace CreateTrace(SBError &error)
Create a Trace object for the current target using the using the default supported tracing technology...
lldb::SBBreakpoint BreakpointCreateBySourceRegex(const char *source_regex, const SBFileSpec &source_file, const char *module_name=nullptr)
bool DeleteAllBreakpoints()
lldb::SBValue CreateValueFromData(const char *name, lldb::SBData data, lldb::SBType type)
void ResetStatistics()
Reset the statistics collected for this target.
lldb::SBBroadcaster GetBroadcaster() const
uint32_t GetMinimumOpcodeByteSize() const
Architecture opcode byte size width accessor.
bool FindBreakpointsByName(const char *name, SBBreakpointList &bkpt_list)
size_t ReadMemory(const SBAddress addr, void *buf, size_t size, lldb::SBError &error)
Read target memory.
lldb::SBBreakpoint BreakpointCreateByNames(const char *symbol_name[], uint32_t num_names, uint32_t name_type_mask, const SBFileSpecList &module_list, const SBFileSpecList &comp_unit_list)
uint32_t GetMaximumOpcodeByteSize() const
Architecture opcode byte size width accessor.
SBProcess LaunchSimple(const char **argv, const char **envp, const char *working_directory)
Launch a new process with sensible defaults.
lldb::SBModule FindModule(const lldb::SBFileSpec &file_spec)
friend class SBSourceManager
lldb::SBBreakpoint FindBreakpointByID(break_id_t break_id)
lldb::SBInstructionList ReadInstructions(lldb::SBAddress base_addr, uint32_t count)
void GetBreakpointNames(SBStringList &names)
lldb::SBDebugger GetDebugger() const
lldb::SBError BreakpointsWriteToFile(SBFileSpec &dest_file)
Write breakpoints to dest_file.
lldb::SBWatchpoint FindWatchpointByID(lldb::watch_id_t watch_id)
lldb::SBAddress ResolveFileAddress(lldb::addr_t file_addr)
Resolve a current file address into a section offset address.
void SetLaunchInfo(const lldb::SBLaunchInfo &launch_info)
lldb::SBError ClearModuleLoadAddress(lldb::SBModule module)
Clear the section base load addresses for all sections in a module.
lldb::SBType FindFirstType(const char *type)
uint32_t GetCodeByteSize()
lldb::SBProcess AttachToProcessWithName(SBListener &listener, const char *name, bool wait_for, lldb::SBError &error)
Attach to process with name.
SBProcess LoadCore(const char *core_file)
static uint32_t GetNumModulesFromEvent(const lldb::SBEvent &event)
bool EnableAllBreakpoints()
void Append(lldb::SBType type)
void Append(const lldb::SBValue &val_obj)
lldb::SBValue GetValueAtIndex(uint32_t idx) const
void SetSP(const lldb::ValueObjectSP &sp)
const char * GetSummary()
void SetWatchpointTypeWrite(lldb::WatchpointWriteType write_type)
Stop when the watched memory region is written to/modified.
lldb::WatchpointWriteType GetWatchpointTypeWrite() const
void SetWatchpointTypeRead(bool read)
Stop when the watched memory region is read.
bool GetWatchpointTypeRead() const
void SetSP(const lldb::WatchpointSP &sp)
static lldb::ABISP FindPlugin(lldb::ProcessSP process_sp, const ArchSpec &arch)
A section + offset based address range class.
A section + offset based address class.
void SetRawAddress(lldb::addr_t addr)
An architecture specification class.
bool IsValid() const
Tests if this ArchSpec is valid.
void AppendArguments(const Args &rhs)
BreakpointID GetBreakpointIDAtIndex(size_t index) const
lldb::break_id_t GetBreakpointID() const
Generic representation of a type in a programming language.
A uniqued constant string class.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
const char * GetCString() const
Get the string value as a C string.
const char * AsCString(const char *value_if_empty) const
Get the string value as a C string.
static void SetCollectingStats(bool enable)
static bool GetCollectingStats()
static void ResetStatistics(Debugger &debugger, Target *target)
Reset metrics associated with one or all targets in a debugger.
static llvm::json::Value ReportStatistics(Debugger &debugger, Target *target, const lldb_private::StatisticsOptions &options)
Get metrics associated with one or all targets in a debugger in JSON format.
static lldb::DisassemblerSP DisassembleRange(const ArchSpec &arch, const char *plugin_name, const char *flavor, const char *cpu, const char *features, Target &target, llvm::ArrayRef< AddressRange > disasm_ranges, bool force_live_memory=false)
static lldb::DisassemblerSP DisassembleBytes(const ArchSpec &arch, const char *plugin_name, const char *flavor, const char *cpu, const char *features, const Address &start, const void *bytes, size_t length, uint32_t max_num_instructions, bool data_from_file)
A class that measures elapsed time in an exception safe way.
Execution context objects refer to objects in the execution of the program that is being debugged.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
Target * GetTargetPtr() const
Returns a pointer to the target object.
Process * GetProcessPtr() const
Returns a pointer to the process object.
void Append(const FileSpec &file)
Append a FileSpec object to the list.
void SetFile(llvm::StringRef path, Style style)
Change the file specified with a new path.
static FileSystem & Instance()
void Resolve(llvm::SmallVectorImpl< char > &path, bool force_make_absolute=false)
Resolve path to make it canonical.
A collection class for Module objects.
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.
lldb::ModuleSP GetModuleAtIndex(size_t idx) const
Get the module shared pointer for the module at index idx.
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
size_t GetSize() const
Gets the size of the module list.
ArchSpec & GetArchitecture()
FileSpec & GetSymbolFileSpec()
A class that describes an executable image and its associated object and symbol files.
const FileSpec & GetPlatformFileSpec() const
Get accessor for the module platform file specification.
const FileSpec & GetFileSpec() const
Get const accessor for the module file specification.
A plug-in interface definition class for object file parsers.
virtual SectionList * GetSectionList(bool update_module_section_list=true)
Gets the section list for the currently selected architecture (and object for archives).
static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec, Status &error, bool force_lookup=true, bool copy_executable=true)
void SetWaitForLaunch(bool b)
void SetExecutableFile(const FileSpec &exe_file, bool add_exe_file_as_first_arg)
bool ProcessIDIsValid() const
lldb::pid_t GetProcessID() const
void SetProcessID(lldb::pid_t pid)
FileSpec & GetExecutableFile()
void SetListener(const lldb::ListenerSP &listener_sp)
lldb::ListenerSP GetListener() const
bool UserIDIsValid() const
Environment & GetEnvironment()
bool IsScriptedProcess() const
void SetUserID(uint32_t uid)
ArchSpec & GetArchitecture()
uint32_t GetEffectiveUserID() const
bool TryLock(ProcessRunLock *lock)
A plug-in interface definition class for debugging a process.
ProcessRunLock::ProcessRunLocker StopLocker
ProcessRunLock & GetRunLock()
lldb::SectionSP GetSectionAtIndex(size_t idx) const
This base class provides an interface to stack frames.
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
A stream class that can stream formatted output to a file.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
StructuredData::ObjectSP GetObjectSP()
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
static ObjectSP ParseJSON(llvm::StringRef json_text)
Defines a symbol context baton that can be handed other debug core functions.
lldb::TargetSP target_sp
The Target for a given query.
static lldb::TargetSP GetCreatedTargetFromEvent(const Event *event_ptr)
static ModuleList GetModuleListFromEvent(const Event *event_ptr)
static const TargetEventData * GetEventDataFromEvent(const Event *event_ptr)
static lldb::TargetSP GetTargetFromEvent(const Event *event_ptr)
const lldb::ProcessSP & GetProcessSP() const
std::recursive_mutex & GetAPIMutex()
static llvm::StringRef GetStaticBroadcasterClass()
Status Attach(ProcessAttachInfo &attach_info, Stream *stream)
lldb::ExpressionResults EvaluateExpression(llvm::StringRef expression, ExecutionContextScope *exe_scope, lldb::ValueObjectSP &result_valobj_sp, const EvaluateExpressionOptions &options=EvaluateExpressionOptions(), std::string *fixed_expression=nullptr, ValueObject *ctx_obj=nullptr)
TypeIterable Types() const
A class that contains all state required for type lookups.
This class tracks the state and results of a TypeQuery.
lldb::TypeSP GetFirstType() const
bool SetFromStringRef(llvm::StringRef str)
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS, ValueObjectManager *manager=nullptr)
These routines create ValueObjectConstResult ValueObjects from various data sources.
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp)
static lldb::ValueObjectSP CreateValueObjectFromExpression(llvm::StringRef name, llvm::StringRef expression, const ExecutionContext &exe_ctx, ValueObject *parent=nullptr)
The following static routines create "Root" ValueObjects if parent is null.
static lldb::ValueObjectSP CreateValueObjectFromData(llvm::StringRef name, const DataExtractor &data, const ExecutionContext &exe_ctx, CompilerType type, ValueObject *parent=nullptr)
static lldb::ValueObjectSP CreateValueObjectFromAddress(llvm::StringRef name, uint64_t address, const ExecutionContext &exe_ctx, CompilerType type, bool do_deref=true, ValueObject *parent=nullptr)
Given an address either create a value object containing the value at that address,...
#define LLDB_INVALID_GLOBALLY_UNIQUE_TARGET_ID
#define LLDB_WATCH_TYPE_WRITE
#define LLDB_INVALID_BREAK_ID
#define LLDB_INVALID_WATCH_ID
#define LLDB_WATCH_TYPE_MODIFY
#define LLDB_WATCH_TYPE_READ
#define LLDB_INVALID_ADDRESS
#define LLDB_INVALID_INDEX64
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.
MatchType
String matching algorithm used by SBTarget.
@ eMatchTypeRegexInsensitive
class LLDB_API SBBroadcaster
std::shared_ptr< lldb_private::ABI > ABISP
class LLDB_API SBFileSpec
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
BasicType
Basic types enumeration for the public API SBType::GetBasicType().
@ eWatchpointWriteTypeOnModify
Stop on a write to the memory region that changes its value.
@ eWatchpointWriteTypeAlways
Stop on any write access to the memory region, even if the value doesn't change.
std::shared_ptr< lldb_private::ScriptedMetadata > ScriptedMetadataSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::Platform > PlatformSP
StateType
Process and Thread States.
@ eStateConnected
Process is connected to remote debug services, but not launched or attached to anything yet.
@ eStateAttaching
Process is currently trying to attach.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
std::shared_ptr< lldb_private::Type > TypeSP
std::shared_ptr< lldb_private::Process > ProcessSP
ByteOrder
Byte ordering definitions.
class LLDB_API SBEnvironment
std::shared_ptr< lldb_private::Watchpoint > WatchpointSP
std::shared_ptr< lldb_private::Variable > VariableSP
std::shared_ptr< lldb_private::ScriptedFrameProviderInterface > ScriptedFrameProviderInterfaceSP
class LLDB_API SBStringList
std::shared_ptr< lldb_private::Section > SectionSP
std::shared_ptr< lldb_private::Target > TargetSP
@ eStructuredDataTypeDictionary
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP
std::shared_ptr< lldb_private::Module > ModuleSP
Options used by Module::FindFunctions.
bool include_inlines
Include inlined functions.
bool include_symbols
Include the symbol table.
This struct contains the metadata needed to instantiate a frame provider and optional filters to cont...
lldb::ScriptedFrameProviderInterfaceSP interface_sp
Interface for calling static methods on the provider class.