summaryrefslogtreecommitdiff
path: root/source/Plugins/LanguageRuntime
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/LanguageRuntime')
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp10
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h2
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h2
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp281
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h21
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp24
6 files changed, 239 insertions, 101 deletions
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
index e99fd74a352f4..105c088b9e913 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
@@ -324,8 +324,6 @@ public:
clang::ASTContext &ast_ctx(interface_decl->getASTContext());
- clang::QualType return_qual_type;
-
const bool isInstance = instance;
const bool isVariadic = false;
const bool isSynthesized = false;
@@ -653,3 +651,11 @@ AppleObjCDeclVendor::FindDecls(const ConstString &name, bool append,
return ret;
}
+
+clang::ExternalASTMerger::ImporterSource
+AppleObjCDeclVendor::GetImporterSource() {
+ return {*m_ast_ctx.getASTContext(),
+ *m_ast_ctx.getFileManager(),
+ m_ast_ctx.GetOriginMap()
+ };
+}
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h
index 26824079d945e..2f087da16bc18 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h
@@ -30,6 +30,8 @@ public:
uint32_t FindDecls(const ConstString &name, bool append, uint32_t max_matches,
std::vector<clang::NamedDecl *> &decls) override;
+ clang::ExternalASTMerger::ImporterSource GetImporterSource() override;
+
friend class AppleObjCExternalASTSource;
private:
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
index 57d98fbd72834..1b22ee4c3be17 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
@@ -95,6 +95,8 @@ public:
virtual void GetValuesForGlobalCFBooleans(lldb::addr_t &cf_true,
lldb::addr_t &cf_false);
+
+ virtual bool IsTaggedPointer (lldb::addr_t addr) { return false; }
protected:
// Call CreateInstance instead.
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 2a7735959a910..bdf79f7b82bd1 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -62,6 +62,11 @@
#include "AppleObjCTrampolineHandler.h"
#include "AppleObjCTypeEncodingParser.h"
+#include "clang/AST/ASTContext.h"
+#include "clang/AST/DeclObjC.h"
+
+#include <vector>
+
using namespace lldb;
using namespace lldb_private;
@@ -394,7 +399,7 @@ AppleObjCRuntimeV2::AppleObjCRuntimeV2(Process *process,
}
bool AppleObjCRuntimeV2::GetDynamicTypeAndAddress(
- ValueObject &in_value, DynamicValueType use_dynamic,
+ ValueObject &in_value, lldb::DynamicValueType use_dynamic,
TypeAndOrName &class_type_or_name, Address &address,
Value::ValueType &value_type) {
// We should never get here with a null process...
@@ -811,85 +816,43 @@ UtilityFunction *AppleObjCRuntimeV2::CreateObjectChecker(const char *name) {
int len = 0;
if (m_has_object_getClass) {
- len = ::snprintf(check_function_code, sizeof(check_function_code),
- "extern \"C\" void *gdb_object_getClass(void *); "
- " \n"
- "extern \"C\" int printf(const char *format, ...); "
- " \n"
- "extern \"C\" void "
- " \n"
- "%s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) "
- " \n"
- "{ "
- " \n"
- " if ($__lldb_arg_obj == (void *)0) "
- " \n"
- " return; // nil is ok "
- " \n"
- " if (!gdb_object_getClass($__lldb_arg_obj)) "
- " \n"
- " *((volatile int *)0) = 'ocgc'; "
- " \n"
- " else if ($__lldb_arg_selector != (void *)0) "
- " \n"
- " { "
- " \n"
- " signed char responds = (signed char) [(id) "
- "$__lldb_arg_obj \n"
- " "
- "respondsToSelector: \n"
- " (struct "
- "objc_selector *) $__lldb_arg_selector]; \n"
- " if (responds == (signed char) 0) "
- " \n"
- " *((volatile int *)0) = 'ocgc'; "
- " \n"
- " } "
- " \n"
- "} "
- " \n",
- name);
+ len = ::snprintf(check_function_code, sizeof(check_function_code), R"(
+ extern "C" void *gdb_object_getClass(void *);
+ extern "C" int printf(const char *format, ...);
+ extern "C" void
+ %s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) {
+ if ($__lldb_arg_obj == (void *)0)
+ return; // nil is ok
+ if (!gdb_object_getClass($__lldb_arg_obj)) {
+ *((volatile int *)0) = 'ocgc';
+ } else if ($__lldb_arg_selector != (void *)0) {
+ signed char $responds = (signed char)
+ [(id)$__lldb_arg_obj respondsToSelector:
+ (void *) $__lldb_arg_selector];
+ if ($responds == (signed char) 0)
+ *((volatile int *)0) = 'ocgc';
+ }
+ })", name);
} else {
- len = ::snprintf(check_function_code, sizeof(check_function_code),
- "extern \"C\" void *gdb_class_getClass(void *); "
- " \n"
- "extern \"C\" int printf(const char *format, ...); "
- " \n"
- "extern \"C\" void "
- " \n"
- "%s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) "
- " \n"
- "{ "
- " \n"
- " if ($__lldb_arg_obj == (void *)0) "
- " \n"
- " return; // nil is ok "
- " \n"
- " void **$isa_ptr = (void **)$__lldb_arg_obj; "
- " \n"
- " if (*$isa_ptr == (void *)0 || "
- "!gdb_class_getClass(*$isa_ptr)) \n"
- " *((volatile int *)0) = 'ocgc'; "
- " \n"
- " else if ($__lldb_arg_selector != (void *)0) "
- " \n"
- " { "
- " \n"
- " signed char responds = (signed char) [(id) "
- "$__lldb_arg_obj \n"
- " "
- "respondsToSelector: \n"
- " (struct "
- "objc_selector *) $__lldb_arg_selector]; \n"
- " if (responds == (signed char) 0) "
- " \n"
- " *((volatile int *)0) = 'ocgc'; "
- " \n"
- " } "
- " \n"
- "} "
- " \n",
- name);
+ len = ::snprintf(check_function_code, sizeof(check_function_code), R"(
+ extern "C" void *gdb_class_getClass(void *);
+ extern "C" int printf(const char *format, ...);
+ extern "C" void
+ %s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) {
+ if ($__lldb_arg_obj == (void *)0)
+ return; // nil is ok
+ void **$isa_ptr = (void **)$__lldb_arg_obj;
+ if (*$isa_ptr == (void *)0 ||
+ !gdb_class_getClass(*$isa_ptr))
+ *((volatile int *)0) = 'ocgc';
+ else if ($__lldb_arg_selector != (void *)0) {
+ signed char $responds = (signed char)
+ [(id)$__lldb_arg_obj respondsToSelector:
+ (void *) $__lldb_arg_selector];
+ if ($responds == (signed char) 0)
+ *((volatile int *)0) = 'ocgc';
+ }
+ })", name);
}
assert(len < (int)sizeof(check_function_code));
@@ -2022,6 +1985,8 @@ AppleObjCRuntimeV2::NonPointerISACache::CreateInstance(
Status error;
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES));
+
auto objc_debug_isa_magic_mask = ExtractRuntimeGlobalSymbol(
process, ConstString("objc_debug_isa_magic_mask"), objc_module_sp, error);
if (error.Fail())
@@ -2038,12 +2003,47 @@ AppleObjCRuntimeV2::NonPointerISACache::CreateInstance(
if (error.Fail())
return NULL;
+ if (log)
+ log->PutCString("AOCRT::NPI: Found all the non-indexed ISA masks");
+
+ bool foundError = false;
+ auto objc_debug_indexed_isa_magic_mask = ExtractRuntimeGlobalSymbol(
+ process, ConstString("objc_debug_indexed_isa_magic_mask"), objc_module_sp,
+ error);
+ foundError |= error.Fail();
+
+ auto objc_debug_indexed_isa_magic_value = ExtractRuntimeGlobalSymbol(
+ process, ConstString("objc_debug_indexed_isa_magic_value"),
+ objc_module_sp, error);
+ foundError |= error.Fail();
+
+ auto objc_debug_indexed_isa_index_mask = ExtractRuntimeGlobalSymbol(
+ process, ConstString("objc_debug_indexed_isa_index_mask"), objc_module_sp,
+ error);
+ foundError |= error.Fail();
+
+ auto objc_debug_indexed_isa_index_shift = ExtractRuntimeGlobalSymbol(
+ process, ConstString("objc_debug_indexed_isa_index_shift"),
+ objc_module_sp, error);
+ foundError |= error.Fail();
+
+ auto objc_indexed_classes =
+ ExtractRuntimeGlobalSymbol(process, ConstString("objc_indexed_classes"),
+ objc_module_sp, error, false);
+ foundError |= error.Fail();
+
+ if (log)
+ log->PutCString("AOCRT::NPI: Found all the indexed ISA masks");
+
// we might want to have some rules to outlaw these other values (e.g if the
// mask is zero but the value is non-zero, ...)
- return new NonPointerISACache(runtime, objc_debug_isa_class_mask,
- objc_debug_isa_magic_mask,
- objc_debug_isa_magic_value);
+ return new NonPointerISACache(
+ runtime, objc_module_sp, objc_debug_isa_class_mask,
+ objc_debug_isa_magic_mask, objc_debug_isa_magic_value,
+ objc_debug_indexed_isa_magic_mask, objc_debug_indexed_isa_magic_value,
+ objc_debug_indexed_isa_index_mask, objc_debug_indexed_isa_index_shift,
+ foundError ? 0 : objc_indexed_classes);
}
AppleObjCRuntimeV2::TaggedPointerVendorV2 *
@@ -2371,12 +2371,23 @@ AppleObjCRuntimeV2::TaggedPointerVendorExtended::GetClassDescriptor(
}
AppleObjCRuntimeV2::NonPointerISACache::NonPointerISACache(
- AppleObjCRuntimeV2 &runtime, uint64_t objc_debug_isa_class_mask,
- uint64_t objc_debug_isa_magic_mask, uint64_t objc_debug_isa_magic_value)
- : m_runtime(runtime), m_cache(),
+ AppleObjCRuntimeV2 &runtime, const ModuleSP &objc_module_sp,
+ uint64_t objc_debug_isa_class_mask, uint64_t objc_debug_isa_magic_mask,
+ uint64_t objc_debug_isa_magic_value,
+ uint64_t objc_debug_indexed_isa_magic_mask,
+ uint64_t objc_debug_indexed_isa_magic_value,
+ uint64_t objc_debug_indexed_isa_index_mask,
+ uint64_t objc_debug_indexed_isa_index_shift,
+ lldb::addr_t objc_indexed_classes)
+ : m_runtime(runtime), m_cache(), m_objc_module_wp(objc_module_sp),
m_objc_debug_isa_class_mask(objc_debug_isa_class_mask),
m_objc_debug_isa_magic_mask(objc_debug_isa_magic_mask),
- m_objc_debug_isa_magic_value(objc_debug_isa_magic_value) {}
+ m_objc_debug_isa_magic_value(objc_debug_isa_magic_value),
+ m_objc_debug_indexed_isa_magic_mask(objc_debug_indexed_isa_magic_mask),
+ m_objc_debug_indexed_isa_magic_value(objc_debug_indexed_isa_magic_value),
+ m_objc_debug_indexed_isa_index_mask(objc_debug_indexed_isa_index_mask),
+ m_objc_debug_indexed_isa_index_shift(objc_debug_indexed_isa_index_shift),
+ m_objc_indexed_classes(objc_indexed_classes), m_indexed_isa_cache() {}
ObjCLanguageRuntime::ClassDescriptorSP
AppleObjCRuntimeV2::NonPointerISACache::GetClassDescriptor(ObjCISA isa) {
@@ -2395,8 +2406,106 @@ AppleObjCRuntimeV2::NonPointerISACache::GetClassDescriptor(ObjCISA isa) {
bool AppleObjCRuntimeV2::NonPointerISACache::EvaluateNonPointerISA(
ObjCISA isa, ObjCISA &ret_isa) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES));
+
+ if (log)
+ log->Printf("AOCRT::NPI Evalulate(isa = 0x%" PRIx64 ")", (uint64_t)isa);
+
if ((isa & ~m_objc_debug_isa_class_mask) == 0)
return false;
+
+ // If all of the indexed ISA variables are set, then its possible that
+ // this ISA is indexed, and we should first try to get its value using
+ // the index.
+ // Note, we check these varaibles first as the ObjC runtime will set at
+ // least one of their values to 0 if they aren't needed.
+ if (m_objc_debug_indexed_isa_magic_mask &&
+ m_objc_debug_indexed_isa_magic_value &&
+ m_objc_debug_indexed_isa_index_mask &&
+ m_objc_debug_indexed_isa_index_shift && m_objc_indexed_classes) {
+ if ((isa & ~m_objc_debug_indexed_isa_index_mask) == 0)
+ return false;
+
+ if ((isa & m_objc_debug_indexed_isa_magic_mask) ==
+ m_objc_debug_indexed_isa_magic_value) {
+ // Magic bits are correct, so try extract the index.
+ uintptr_t index = (isa & m_objc_debug_indexed_isa_index_mask) >>
+ m_objc_debug_indexed_isa_index_shift;
+ // If the index is out of bounds of the length of the array then
+ // check if the array has been updated. If that is the case then
+ // we should try read the count again, and update the cache if the
+ // count has been updated.
+ if (index > m_indexed_isa_cache.size()) {
+ if (log)
+ log->Printf("AOCRT::NPI (index = %" PRIu64
+ ") exceeds cache (size = %" PRIu64 ")",
+ (uint64_t)index, (uint64_t)m_indexed_isa_cache.size());
+
+ Process *process(m_runtime.GetProcess());
+
+ ModuleSP objc_module_sp(m_objc_module_wp.lock());
+ if (!objc_module_sp)
+ return false;
+
+ Status error;
+ auto objc_indexed_classes_count = ExtractRuntimeGlobalSymbol(
+ process, ConstString("objc_indexed_classes_count"), objc_module_sp,
+ error);
+ if (error.Fail())
+ return false;
+
+ if (log)
+ log->Printf("AOCRT::NPI (new class count = %" PRIu64 ")",
+ (uint64_t)objc_indexed_classes_count);
+
+ if (objc_indexed_classes_count > m_indexed_isa_cache.size()) {
+ // Read the class entries we don't have. We should just
+ // read all of them instead of just the one we need as then
+ // we can cache those we may need later.
+ auto num_new_classes =
+ objc_indexed_classes_count - m_indexed_isa_cache.size();
+ const uint32_t addr_size = process->GetAddressByteSize();
+ DataBufferHeap buffer(num_new_classes * addr_size, 0);
+
+ lldb::addr_t last_read_class =
+ m_objc_indexed_classes + (m_indexed_isa_cache.size() * addr_size);
+ size_t bytes_read = process->ReadMemory(
+ last_read_class, buffer.GetBytes(), buffer.GetByteSize(), error);
+ if (error.Fail() || bytes_read != buffer.GetByteSize())
+ return false;
+
+ if (log)
+ log->Printf("AOCRT::NPI (read new classes count = %" PRIu64 ")",
+ (uint64_t)num_new_classes);
+
+ // Append the new entries to the existing cache.
+ DataExtractor data(buffer.GetBytes(), buffer.GetByteSize(),
+ process->GetByteOrder(),
+ process->GetAddressByteSize());
+
+ lldb::offset_t offset = 0;
+ for (unsigned i = 0; i != num_new_classes; ++i)
+ m_indexed_isa_cache.push_back(data.GetPointer(&offset));
+ }
+ }
+
+ // If the index is still out of range then this isn't a pointer.
+ if (index > m_indexed_isa_cache.size())
+ return false;
+
+ if (log)
+ log->Printf("AOCRT::NPI Evalulate(ret_isa = 0x%" PRIx64 ")",
+ (uint64_t)m_indexed_isa_cache[index]);
+
+ ret_isa = m_indexed_isa_cache[index];
+ return (ret_isa != 0); // this is a pointer so 0 is not a valid value
+ }
+
+ return false;
+ }
+
+ // Definately not an indexed ISA, so try to use a mask to extract
+ // the pointer from the ISA.
if ((isa & m_objc_debug_isa_magic_mask) == m_objc_debug_isa_magic_value) {
ret_isa = isa & m_objc_debug_isa_class_mask;
return (ret_isa != 0); // this is a pointer so 0 is not a valid value
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
index 7180730904062..89e81d5b181e1 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
@@ -88,6 +88,8 @@ public:
EncodingToTypeSP GetEncodingToType() override;
+ bool IsTaggedPointer(lldb::addr_t ptr) override;
+
TaggedPointerVendor *GetTaggedPointerVendor() override {
return m_tagged_pointer_vendor_ap.get();
}
@@ -138,18 +140,33 @@ private:
private:
NonPointerISACache(AppleObjCRuntimeV2 &runtime,
+ const lldb::ModuleSP &objc_module_sp,
uint64_t objc_debug_isa_class_mask,
uint64_t objc_debug_isa_magic_mask,
- uint64_t objc_debug_isa_magic_value);
+ uint64_t objc_debug_isa_magic_value,
+ uint64_t objc_debug_indexed_isa_magic_mask,
+ uint64_t objc_debug_indexed_isa_magic_value,
+ uint64_t objc_debug_indexed_isa_index_mask,
+ uint64_t objc_debug_indexed_isa_index_shift,
+ lldb::addr_t objc_indexed_classes);
bool EvaluateNonPointerISA(ObjCISA isa, ObjCISA &ret_isa);
AppleObjCRuntimeV2 &m_runtime;
std::map<ObjCISA, ObjCLanguageRuntime::ClassDescriptorSP> m_cache;
+ lldb::ModuleWP m_objc_module_wp;
uint64_t m_objc_debug_isa_class_mask;
uint64_t m_objc_debug_isa_magic_mask;
uint64_t m_objc_debug_isa_magic_value;
+ uint64_t m_objc_debug_indexed_isa_magic_mask;
+ uint64_t m_objc_debug_indexed_isa_magic_value;
+ uint64_t m_objc_debug_indexed_isa_index_mask;
+ uint64_t m_objc_debug_indexed_isa_index_shift;
+ lldb::addr_t m_objc_indexed_classes;
+
+ std::vector<lldb::addr_t> m_indexed_isa_cache;
+
friend class AppleObjCRuntimeV2;
DISALLOW_COPY_AND_ASSIGN(NonPointerISACache);
@@ -279,8 +296,6 @@ private:
ObjCISA GetPointerISA(ObjCISA isa);
- bool IsTaggedPointer(lldb::addr_t ptr);
-
lldb::addr_t GetISAHashTablePointer();
bool UpdateISAToDescriptorMapFromMemory(RemoteNXMapTable &hash_table);
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
index 7e46afcccdab3..ad1083be02850 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -3615,13 +3615,15 @@ RenderScriptRuntime::CreateKernelBreakpoint(const ConstString &name) {
}
BreakpointResolverSP resolver_sp(new RSBreakpointResolver(nullptr, name));
- BreakpointSP bp = GetProcess()->GetTarget().CreateBreakpoint(
+ Target &target = GetProcess()->GetTarget();
+ BreakpointSP bp = target.CreateBreakpoint(
m_filtersp, resolver_sp, false, false, false);
// Give RS breakpoints a specific name, so the user can manipulate them as a
// group.
Status err;
- if (!bp->AddName("RenderScriptKernel", err))
+ target.AddNameToBreakpoint(bp, "RenderScriptKernel", err);
+ if (err.Fail() && log)
if (log)
log->Printf("%s - error setting break name, '%s'.", __FUNCTION__,
err.AsCString());
@@ -3643,14 +3645,15 @@ RenderScriptRuntime::CreateReductionBreakpoint(const ConstString &name,
BreakpointResolverSP resolver_sp(new RSReduceBreakpointResolver(
nullptr, name, &m_rsmodules, kernel_types));
- BreakpointSP bp = GetProcess()->GetTarget().CreateBreakpoint(
+ Target &target = GetProcess()->GetTarget();
+ BreakpointSP bp = target.CreateBreakpoint(
m_filtersp, resolver_sp, false, false, false);
// Give RS breakpoints a specific name, so the user can manipulate them as a
// group.
Status err;
- if (!bp->AddName("RenderScriptReduction", err))
- if (log)
+ target.AddNameToBreakpoint(bp, "RenderScriptReduction", err);
+ if (err.Fail() && log)
log->Printf("%s - error setting break name, '%s'.", __FUNCTION__,
err.AsCString());
@@ -3885,15 +3888,16 @@ RenderScriptRuntime::CreateScriptGroupBreakpoint(const ConstString &name,
BreakpointResolverSP resolver_sp(new RSScriptGroupBreakpointResolver(
nullptr, name, m_scriptGroups, stop_on_all));
- BreakpointSP bp = GetProcess()->GetTarget().CreateBreakpoint(
+ Target &target = GetProcess()->GetTarget();
+ BreakpointSP bp = target.CreateBreakpoint(
m_filtersp, resolver_sp, false, false, false);
// Give RS breakpoints a specific name, so the user can manipulate them as a
// group.
Status err;
- if (!bp->AddName(name.AsCString(), err))
- if (log)
- log->Printf("%s - error setting break name, '%s'.", __FUNCTION__,
- err.AsCString());
+ target.AddNameToBreakpoint(bp, name.GetCString(), err);
+ if (err.Fail() && log)
+ log->Printf("%s - error setting break name, '%s'.", __FUNCTION__,
+ err.AsCString());
// ask the breakpoint to resolve itself
bp->ResolveBreakpoint();
return bp;