diff options
author | Greg Clayton <gclayton@apple.com> | 2013-01-30 00:18:29 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-01-30 00:18:29 +0000 |
commit | 1b3815cbf483fa1cc5c5b6d7b567722b3c802bf6 (patch) | |
tree | 2be6a86d11bf5507a38fa2a457351df356ff982b /lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp | |
parent | a4db5d08393c16cb0de83f96c49fc5911fd5f5ed (diff) | |
download | bcm5719-llvm-1b3815cbf483fa1cc5c5b6d7b567722b3c802bf6.tar.gz bcm5719-llvm-1b3815cbf483fa1cc5c5b6d7b567722b3c802bf6.zip |
<rdar://problem/9141269>
Cleaned up the objective C name parsing code to use a class.
Now breakpoints that are set by name that are objective C methods without the leading '+' or '-' will resolve. We do this by expanding all the objective C names for a given string. For example:
(lldb) b [MyString cStringUsingEncoding:]
Will set a breakpoint with multiple possible names:
-[MyString cStringUsingEncoding:]
+[MyString cStringUsingEncoding:]
Also if you have a category, it will strip the category and set a breakpoint in all variants:
(lldb) [MyString(my_category) cStringUsingEncoding:]
Will resolve to the following names:
-[MyString(my_category) cStringUsingEncoding:]
+[MyString(my_category) cStringUsingEncoding:]
-[MyString cStringUsingEncoding:]
+[MyString cStringUsingEncoding:]
Likewise when we have:
(lldb) b -[MyString(my_category) cStringUsingEncoding:]
It will resolve to two names:
-[MyString(my_category) cStringUsingEncoding:]
-[MyString cStringUsingEncoding:]
llvm-svn: 173858
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp index 5d93d194056..c4f87d98e74 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -764,28 +764,22 @@ DWARFCompileUnit::Index (const uint32_t cu_idx, { // Note, this check is also done in ParseMethodName, but since this is a hot loop, we do the // simple inlined check outside the call. - if (ObjCLanguageRuntime::IsPossibleObjCMethodName(name)) + ObjCLanguageRuntime::MethodName objc_method(name, true); + if (objc_method.IsValid(true)) { - ConstString objc_class_name; - ConstString objc_selector_name; - ConstString objc_fullname_no_category_name; - ConstString objc_class_name_no_category; - if (ObjCLanguageRuntime::ParseMethodName (name, - &objc_class_name, - &objc_selector_name, - &objc_fullname_no_category_name, - &objc_class_name_no_category)) - { - func_fullnames.Insert (ConstString(name), die.GetOffset()); - if (objc_class_name) - objc_class_selectors.Insert(objc_class_name, die.GetOffset()); - if (objc_class_name_no_category) - objc_class_selectors.Insert(objc_class_name_no_category, die.GetOffset()); - if (objc_selector_name) - func_selectors.Insert (objc_selector_name, die.GetOffset()); - if (objc_fullname_no_category_name) - func_fullnames.Insert (objc_fullname_no_category_name, die.GetOffset()); - } + ConstString objc_class_name_with_category (objc_method.GetClassNameWithCategory()); + ConstString objc_selector_name (objc_method.GetSelector()); + ConstString objc_fullname_no_category_name (objc_method.GetFullNameWithoutCategory(true)); + ConstString objc_class_name_no_category (objc_method.GetClassName()); + func_fullnames.Insert (ConstString(name), die.GetOffset()); + if (objc_class_name_with_category) + objc_class_selectors.Insert(objc_class_name_with_category, die.GetOffset()); + if (objc_class_name_no_category && objc_class_name_no_category != objc_class_name_with_category) + objc_class_selectors.Insert(objc_class_name_no_category, die.GetOffset()); + if (objc_selector_name) + func_selectors.Insert (objc_selector_name, die.GetOffset()); + if (objc_fullname_no_category_name) + func_fullnames.Insert (objc_fullname_no_category_name, die.GetOffset()); } // If we have a mangled name, then the DW_AT_name attribute // is usually the method name without the class or any parameters |