[Lldb-commits] [lldb] r156877 - in /lldb/branches/lldb-platform-work: ./ include/lldb/Symbol/ include/lldb/Utility/ source/Commands/ source/Core/ source/Interpreter/ source/Plugins/Process/gdb-remote/ source/Symbol/ source/Target/ test/lang/objc/foundation/ test/lang/objc/objc-class-method/ test/lang/objc/objc-new-syntax/
Johnny Chen
johnny.chen at apple.com
Tue May 15 16:30:04 PDT 2012
Author: johnny
Date: Tue May 15 18:30:03 2012
New Revision: 156877
URL: http://llvm.org/viewvc/llvm-project?rev=156877&view=rev
Log:
Merge changes from ToT, plus fix compie errors: Platform.cpp and CommandObjectPlatform.cpp.
Modified:
lldb/branches/lldb-platform-work/ (props changed)
lldb/branches/lldb-platform-work/include/lldb/Symbol/Type.h
lldb/branches/lldb-platform-work/include/lldb/Utility/Utils.h
lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp
lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp
lldb/branches/lldb-platform-work/source/Core/Address.cpp
lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupArchitecture.cpp
lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupOutputFile.cpp
lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupPlatform.cpp
lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupUUID.cpp
lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupValueObjectDisplay.cpp
lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupVariable.cpp
lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupWatchpoint.cpp
lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
lldb/branches/lldb-platform-work/source/Symbol/Symbol.cpp
lldb/branches/lldb-platform-work/source/Symbol/Type.cpp
lldb/branches/lldb-platform-work/source/Target/Platform.cpp
lldb/branches/lldb-platform-work/test/lang/objc/foundation/TestObjCMethods2.py
lldb/branches/lldb-platform-work/test/lang/objc/objc-class-method/TestObjCClassMethod.py
lldb/branches/lldb-platform-work/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
Propchange: lldb/branches/lldb-platform-work/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 15 18:30:03 2012
@@ -1 +1 @@
-/lldb/trunk:154223-156797
+/lldb/trunk:154223-156876
Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/Type.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/Type.h?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/Type.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/Type.h Tue May 15 18:30:03 2012
@@ -138,6 +138,15 @@
return m_encoding_uid_type != eEncodingInvalid;
}
+ bool
+ IsTypedef ()
+ {
+ return m_encoding_uid_type == eEncodingIsTypedefUID;
+ }
+
+ lldb::TypeSP
+ GetTypedefType();
+
void
SetByteSize(uint32_t byte_size);
Modified: lldb/branches/lldb-platform-work/include/lldb/Utility/Utils.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Utility/Utils.h?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Utility/Utils.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Utility/Utils.h Tue May 15 18:30:03 2012
@@ -10,11 +10,13 @@
#ifndef utility_Utils_h_
#define utility_Utils_h_
+// These utilities have llvm namespace.
+#include "llvm/ADT/STLExtras.h"
+
namespace lldb_private {
-// Return the number of elements of a static array.
-template <typename T, unsigned size>
-inline unsigned arraysize(T (&v)[size]) { return size; }
+// Add lldb utilities here.
} // namespace lldb_private
+
#endif // utility_Utils
Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectPlatform.cpp Tue May 15 18:30:03 2012
@@ -160,7 +160,7 @@
virtual uint32_t
GetNumDefinitions ()
{
- return arraysize(g_permissions_options);
+ return llvm::array_lengthof(g_permissions_options);
}
const lldb_private::OptionDefinition*
Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp Tue May 15 18:30:03 2012
@@ -1425,6 +1425,29 @@
return false;
}
+static void
+DumpAddress (ExecutionContextScope *exe_scope, const Address &so_addr, bool verbose, Stream &strm)
+{
+ strm.IndentMore();
+ strm.Indent (" Address: ");
+ so_addr.Dump (&strm, exe_scope, Address::DumpStyleModuleWithFileAddress);
+ strm.PutCString (" (");
+ so_addr.Dump (&strm, exe_scope, Address::DumpStyleSectionNameOffset);
+ strm.PutCString (")\n");
+ strm.Indent (" Summary: ");
+ const uint32_t save_indent = strm.GetIndentLevel ();
+ strm.SetIndentLevel (save_indent + 13);
+ so_addr.Dump (&strm, exe_scope, Address::DumpStyleResolvedDescription);
+ strm.SetIndentLevel (save_indent);
+ // Print out detailed address information when verbose is enabled
+ if (verbose)
+ {
+ strm.EOL();
+ so_addr.Dump (&strm, exe_scope, Address::DumpStyleDetailedSymbolContext);
+ }
+ strm.IndentLess();
+}
+
static bool
LookupAddressInModule (CommandInterpreter &interpreter,
Stream &strm,
@@ -1454,24 +1477,25 @@
}
ExecutionContextScope *exe_scope = interpreter.GetExecutionContext().GetBestExecutionContextScope();
- strm.IndentMore();
- strm.Indent (" Address: ");
- so_addr.Dump (&strm, exe_scope, Address::DumpStyleModuleWithFileAddress);
- strm.PutCString (" (");
- so_addr.Dump (&strm, exe_scope, Address::DumpStyleSectionNameOffset);
- strm.PutCString (")\n");
- strm.Indent (" Summary: ");
- const uint32_t save_indent = strm.GetIndentLevel ();
- strm.SetIndentLevel (save_indent + 13);
- so_addr.Dump (&strm, exe_scope, Address::DumpStyleResolvedDescription);
- strm.SetIndentLevel (save_indent);
- // Print out detailed address information when verbose is enabled
- if (verbose)
- {
- strm.EOL();
- so_addr.Dump (&strm, exe_scope, Address::DumpStyleDetailedSymbolContext);
- }
- strm.IndentLess();
+ DumpAddress (exe_scope, so_addr, verbose, strm);
+// strm.IndentMore();
+// strm.Indent (" Address: ");
+// so_addr.Dump (&strm, exe_scope, Address::DumpStyleModuleWithFileAddress);
+// strm.PutCString (" (");
+// so_addr.Dump (&strm, exe_scope, Address::DumpStyleSectionNameOffset);
+// strm.PutCString (")\n");
+// strm.Indent (" Summary: ");
+// const uint32_t save_indent = strm.GetIndentLevel ();
+// strm.SetIndentLevel (save_indent + 13);
+// so_addr.Dump (&strm, exe_scope, Address::DumpStyleResolvedDescription);
+// strm.SetIndentLevel (save_indent);
+// // Print out detailed address information when verbose is enabled
+// if (verbose)
+// {
+// strm.EOL();
+// so_addr.Dump (&strm, exe_scope, Address::DumpStyleDetailedSymbolContext);
+// }
+// strm.IndentLess();
return true;
}
@@ -1479,7 +1503,7 @@
}
static uint32_t
-LookupSymbolInModule (CommandInterpreter &interpreter, Stream &strm, Module *module, const char *name, bool name_is_regex)
+LookupSymbolInModule (CommandInterpreter &interpreter, Stream &strm, Module *module, const char *name, bool name_is_regex, bool verbose)
{
if (module)
{
@@ -1516,12 +1540,17 @@
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
strm.IndentMore ();
- Symtab::DumpSymbolHeader (&strm);
+ //Symtab::DumpSymbolHeader (&strm);
for (i=0; i < num_matches; ++i)
{
Symbol *symbol = symtab->SymbolAtIndex(match_indexes[i]);
- strm.Indent ();
- symbol->Dump (&strm, interpreter.GetExecutionContext().GetTargetPtr(), i);
+ DumpAddress (interpreter.GetExecutionContext().GetBestExecutionContextScope(),
+ symbol->GetAddress(),
+ verbose,
+ strm);
+
+// strm.Indent ();
+// symbol->Dump (&strm, interpreter.GetExecutionContext().GetTargetPtr(), i);
}
strm.IndentLess ();
return num_matches;
@@ -1534,7 +1563,7 @@
static void
-DumpSymbolContextList (CommandInterpreter &interpreter, Stream &strm, SymbolContextList &sc_list, bool prepend_addr, bool verbose)
+DumpSymbolContextList (ExecutionContextScope *exe_scope, Stream &strm, SymbolContextList &sc_list, bool verbose)
{
strm.IndentMore ();
uint32_t i;
@@ -1545,21 +1574,6 @@
SymbolContext sc;
if (sc_list.GetContextAtIndex(i, sc))
{
- strm.Indent();
- ExecutionContextScope *exe_scope = interpreter.GetExecutionContext().GetBestExecutionContextScope ();
-
- if (prepend_addr)
- {
- if (sc.line_entry.range.GetBaseAddress().IsValid())
- {
- sc.line_entry.range.GetBaseAddress().Dump (&strm,
- exe_scope,
- Address::DumpStyleLoadAddress,
- Address::DumpStyleModuleWithFileAddress);
- strm.PutCString(" in ");
- }
- }
-
AddressRange range;
sc.GetAddressRange(eSymbolContextEverything,
@@ -1567,43 +1581,25 @@
true,
range);
- sc.DumpStopContext(&strm,
- exe_scope,
- range.GetBaseAddress(),
- true,
- true,
- false);
-
- strm.EOL();
- if (verbose)
- {
- if (sc.line_entry.range.GetBaseAddress().IsValid())
- {
- if (sc.line_entry.range.GetBaseAddress().Dump (&strm,
- exe_scope,
- Address::DumpStyleDetailedSymbolContext))
- strm.PutCString("\n\n");
- }
- else if (sc.function->GetAddressRange().GetBaseAddress().IsValid())
- {
- if (sc.function->GetAddressRange().GetBaseAddress().Dump (&strm,
- exe_scope,
- Address::DumpStyleDetailedSymbolContext))
- strm.PutCString("\n\n");
- }
- }
+ DumpAddress (exe_scope, range.GetBaseAddress(), verbose, strm);
}
}
strm.IndentLess ();
}
static uint32_t
-LookupFunctionInModule (CommandInterpreter &interpreter, Stream &strm, Module *module, const char *name, bool name_is_regex, bool include_inlines, bool verbose)
+LookupFunctionInModule (CommandInterpreter &interpreter,
+ Stream &strm,
+ Module *module,
+ const char *name,
+ bool name_is_regex,
+ bool include_inlines,
+ bool include_symbols,
+ bool verbose)
{
if (module && name && name[0])
{
SymbolContextList sc_list;
- const bool include_symbols = false;
const bool append = true;
uint32_t num_matches = 0;
if (name_is_regex)
@@ -1633,7 +1629,7 @@
strm.Printf("%u match%s found in ", num_matches, num_matches > 1 ? "es" : "");
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
- DumpSymbolContextList (interpreter, strm, sc_list, true, verbose);
+ DumpSymbolContextList (interpreter.GetExecutionContext().GetBestExecutionContextScope(), strm, sc_list, verbose);
}
return num_matches;
}
@@ -1641,7 +1637,7 @@
}
static uint32_t
-LookupTypeInModule (CommandInterpreter &interpreter,
+LookupTypeInModule (CommandInterpreter &interpreter,
Stream &strm,
Module *module,
const char *name_cstr,
@@ -1674,6 +1670,18 @@
// to types that haven't yet been parsed will get parsed.
type_sp->GetClangFullType ();
type_sp->GetDescription (&strm, eDescriptionLevelFull, true);
+ // Print all typedef chains
+ TypeSP typedef_type_sp (type_sp);
+ TypeSP typedefed_type_sp (typedef_type_sp->GetTypedefType());
+ while (typedefed_type_sp)
+ {
+ strm.EOL();
+ strm.Printf(" typedef '%s': ", typedef_type_sp->GetName().GetCString());
+ typedefed_type_sp->GetClangFullType ();
+ typedefed_type_sp->GetDescription (&strm, eDescriptionLevelFull, true);
+ typedef_type_sp = typedefed_type_sp;
+ typedefed_type_sp = typedef_type_sp->GetTypedefType();
+ }
}
strm.EOL();
}
@@ -1707,7 +1715,7 @@
strm << " in ";
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
- DumpSymbolContextList (interpreter, strm, sc_list, true, verbose);
+ DumpSymbolContextList (interpreter.GetExecutionContext().GetBestExecutionContextScope(), strm, sc_list, verbose);
return num_matches;
}
}
@@ -2901,13 +2909,43 @@
return result.Succeeded();
}
- if (use_global_module_list)
+ ModuleList module_list;
+ ModuleList *module_list_ptr = NULL;
+ const size_t argc = command.GetArgumentCount();
+ if (argc == 0)
{
- locker.Lock (Module::GetAllocationModuleCollectionMutex());
- num_modules = Module::GetNumberAllocatedModules();
+ if (use_global_module_list)
+ {
+ locker.Lock (Module::GetAllocationModuleCollectionMutex());
+ num_modules = Module::GetNumberAllocatedModules();
+ }
+ else
+ {
+ module_list_ptr = &target->GetImages();
+ num_modules = target->GetImages().GetSize();
+ }
}
else
- num_modules = target->GetImages().GetSize();
+ {
+ for (size_t i=0; i<argc; ++i)
+ {
+ // Dump specified images (by basename or fullpath)
+ const char *arg_cstr = command.GetArgumentAtIndex(i);
+ const size_t num_matches = FindModulesByName (target, arg_cstr, module_list, use_global_module_list);
+ if (num_matches == 0)
+ {
+ if (argc == 1)
+ {
+ result.AppendErrorWithFormat ("no modules found that match '%s'", arg_cstr);
+ result.SetStatus (eReturnStatusFailed);
+ return false;
+ }
+ }
+ }
+
+ num_modules = module_list.GetSize();
+ module_list_ptr = &module_list;
+ }
if (num_modules > 0)
{
@@ -2915,15 +2953,15 @@
{
ModuleSP module_sp;
Module *module;
- if (use_global_module_list)
+ if (module_list_ptr)
{
- module = Module::GetAllocatedModuleAtIndex(image_idx);
- module_sp = module->shared_from_this();
+ module_sp = module_list_ptr->GetModuleAtIndex(image_idx);
+ module = module_sp.get();
}
else
{
- module_sp = target->GetImages().GetModuleAtIndex(image_idx);
- module = module_sp.get();
+ module = Module::GetAllocatedModuleAtIndex(image_idx);
+ module_sp = module->shared_from_this();
}
int indent = strm.Printf("[%3u] ", image_idx);
@@ -2934,10 +2972,20 @@
}
else
{
- if (use_global_module_list)
- result.AppendError ("the global module list is empty");
+ if (argc)
+ {
+ if (use_global_module_list)
+ result.AppendError ("the global module list has no matching modules");
+ else
+ result.AppendError ("the target has no matching modules");
+ }
else
- result.AppendError ("the target has no associated executable images");
+ {
+ if (use_global_module_list)
+ result.AppendError ("the global module list is empty");
+ else
+ result.AppendError ("the target has no associated executable images");
+ }
result.SetStatus (eReturnStatusFailed);
return false;
}
@@ -3145,6 +3193,7 @@
eLookupTypeSymbol,
eLookupTypeFileLine, // Line is optional
eLookupTypeFunction,
+ eLookupTypeFunctionOrSymbol,
eLookupTypeType,
kNumLookupTypes
};
@@ -3209,11 +3258,16 @@
m_type = eLookupTypeFileLine;
break;
- case 'n':
+ case 'F':
m_str = option_arg;
m_type = eLookupTypeFunction;
break;
-
+
+ case 'n':
+ m_str = option_arg;
+ m_type = eLookupTypeFunctionOrSymbol;
+ break;
+
case 't':
m_str = option_arg;
m_type = eLookupTypeType;
@@ -3324,7 +3378,12 @@
case eLookupTypeSymbol:
if (!m_options.m_str.empty())
{
- if (LookupSymbolInModule (m_interpreter, result.GetOutputStream(), module, m_options.m_str.c_str(), m_options.m_use_regex))
+ if (LookupSymbolInModule (m_interpreter,
+ result.GetOutputStream(),
+ module,
+ m_options.m_str.c_str(),
+ m_options.m_use_regex,
+ m_options.m_verbose))
{
result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
@@ -3349,7 +3408,8 @@
}
}
break;
-
+
+ case eLookupTypeFunctionOrSymbol:
case eLookupTypeFunction:
if (!m_options.m_str.empty())
{
@@ -3359,6 +3419,7 @@
m_options.m_str.c_str(),
m_options.m_use_regex,
m_options.m_include_inlines,
+ m_options.m_type == eLookupTypeFunctionOrSymbol, // include symbols
m_options.m_verbose))
{
result.SetStatus(eReturnStatusSuccessFinishResult);
@@ -3367,6 +3428,7 @@
}
break;
+
case eLookupTypeType:
if (!m_options.m_str.empty())
{
@@ -3480,18 +3542,19 @@
{
{ LLDB_OPT_SET_1, true, "address", 'a', required_argument, NULL, 0, eArgTypeAddress, "Lookup an address in one or more target modules."},
{ LLDB_OPT_SET_1, false, "offset", 'o', required_argument, NULL, 0, eArgTypeOffset, "When looking up an address subtract <offset> from any addresses before doing the lookup."},
- { LLDB_OPT_SET_2| LLDB_OPT_SET_4
- /* FIXME: re-enable this for types when the LookupTypeInModule actually uses the regex option: | LLDB_OPT_SET_5 */ ,
+ { LLDB_OPT_SET_2| LLDB_OPT_SET_4 | LLDB_OPT_SET_5
+ /* FIXME: re-enable this for types when the LookupTypeInModule actually uses the regex option: | LLDB_OPT_SET_6 */ ,
false, "regex", 'r', no_argument, NULL, 0, eArgTypeNone, "The <name> argument for name lookups are regular expressions."},
{ LLDB_OPT_SET_2, true, "symbol", 's', required_argument, NULL, 0, eArgTypeSymbol, "Lookup a symbol by name in the symbol tables in one or more target modules."},
{ LLDB_OPT_SET_3, true, "file", 'f', required_argument, NULL, 0, eArgTypeFilename, "Lookup a file by fullpath or basename in one or more target modules."},
{ LLDB_OPT_SET_3, false, "line", 'l', required_argument, NULL, 0, eArgTypeLineNum, "Lookup a line number in a file (must be used in conjunction with --file)."},
{ LLDB_OPT_SET_3|
LLDB_OPT_SET_4, false, "no-inlines", 'i', no_argument, NULL, 0, eArgTypeNone, "Ignore inline entries (must be used in conjunction with --file or --function)."},
- { LLDB_OPT_SET_4, true, "function", 'n', required_argument, NULL, 0, eArgTypeFunctionName, "Lookup a function by name in the debug symbols in one or more target modules."},
- { LLDB_OPT_SET_5, true, "type", 't', required_argument, NULL, 0, eArgTypeName, "Lookup a type by name in the debug symbols in one or more target modules."},
+ { LLDB_OPT_SET_4, true, "function", 'F', required_argument, NULL, 0, eArgTypeFunctionName, "Lookup a function by name in the debug symbols in one or more target modules."},
+ { LLDB_OPT_SET_5, true, "name", 'n', required_argument, NULL, 0, eArgTypeFunctionName, "Lookup a function or symbol by name in one or more target modules."},
+ { LLDB_OPT_SET_6, true, "type", 't', required_argument, NULL, 0, eArgTypeName, "Lookup a type by name in the debug symbols in one or more target modules."},
{ LLDB_OPT_SET_ALL, false, "verbose", 'v', no_argument, NULL, 0, eArgTypeNone, "Enable verbose lookup information."},
- { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
+ { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
};
Modified: lldb/branches/lldb-platform-work/source/Core/Address.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/Address.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/Address.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/Address.cpp Tue May 15 18:30:03 2012
@@ -707,7 +707,8 @@
Variable *var = variable_list.GetVariableAtIndex (var_idx).get();
if (var && var->LocationIsValidForAddress (*this))
{
- s->Printf (" Variable: id = {0x%8.8llx}, name = \"%s\", type= \"%s\", location =",
+ s->Indent();
+ s->Printf (" Variable: id = {0x%8.8llx}, name = \"%s\", type= \"%s\", location =",
var->GetID(),
var->GetName().GetCString(),
var->GetType()->GetName().GetCString());
Modified: lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupArchitecture.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupArchitecture.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupArchitecture.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupArchitecture.cpp Tue May 15 18:30:03 2012
@@ -36,7 +36,7 @@
uint32_t
OptionGroupArchitecture::GetNumDefinitions ()
{
- return arraysize(g_option_table);
+ return llvm::array_lengthof(g_option_table);
}
const OptionDefinition *
Modified: lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupOutputFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupOutputFile.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupOutputFile.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupOutputFile.cpp Tue May 15 18:30:03 2012
@@ -38,7 +38,7 @@
uint32_t
OptionGroupOutputFile::GetNumDefinitions ()
{
- return arraysize(g_option_table);
+ return llvm::array_lengthof(g_option_table);
}
const OptionDefinition *
Modified: lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupPlatform.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupPlatform.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupPlatform.cpp Tue May 15 18:30:03 2012
@@ -99,8 +99,8 @@
OptionGroupPlatform::GetNumDefinitions ()
{
if (m_include_platform_option)
- return arraysize(g_option_table);
- return arraysize(g_option_table) - 1;
+ return llvm::array_lengthof(g_option_table);
+ return llvm::array_lengthof(g_option_table) - 1;
}
Modified: lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupUUID.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupUUID.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupUUID.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupUUID.cpp Tue May 15 18:30:03 2012
@@ -36,7 +36,7 @@
uint32_t
OptionGroupUUID::GetNumDefinitions ()
{
- return arraysize(g_option_table);
+ return llvm::array_lengthof(g_option_table);
}
const OptionDefinition *
Modified: lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupValueObjectDisplay.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupValueObjectDisplay.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupValueObjectDisplay.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupValueObjectDisplay.cpp Tue May 15 18:30:03 2012
@@ -49,7 +49,7 @@
uint32_t
OptionGroupValueObjectDisplay::GetNumDefinitions ()
{
- return arraysize(g_option_table);
+ return llvm::array_lengthof(g_option_table);
}
const OptionDefinition *
Modified: lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupVariable.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupVariable.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupVariable.cpp Tue May 15 18:30:03 2012
@@ -107,9 +107,9 @@
// Count the "--no-args", "--no-locals" and "--show-globals"
// options if we are showing frame specific options.
if (include_frame_options)
- return arraysize(g_option_table);
+ return llvm::array_lengthof(g_option_table);
else
- return arraysize(g_option_table) - NUM_FRAME_OPTS;
+ return llvm::array_lengthof(g_option_table) - NUM_FRAME_OPTS;
}
Modified: lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupWatchpoint.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupWatchpoint.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupWatchpoint.cpp Tue May 15 18:30:03 2012
@@ -99,5 +99,5 @@
uint32_t
OptionGroupWatchpoint::GetNumDefinitions ()
{
- return arraysize(g_option_table);
+ return llvm::array_lengthof(g_option_table);
}
Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Tue May 15 18:30:03 2012
@@ -848,7 +848,7 @@
{ "q15", NULL, 16, 0, eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q15, LLDB_INVALID_REGNUM, 106, 106 }, g_q15_regs, NULL}
};
- static const uint32_t num_registers = arraysize(g_register_infos);
+ static const uint32_t num_registers = llvm::array_lengthof(g_register_infos);
static ConstString gpr_reg_set ("General Purpose Registers");
static ConstString sfp_reg_set ("Software Floating Point Registers");
static ConstString vfp_reg_set ("Floating Point Registers");
@@ -900,7 +900,7 @@
else
{
// Add composite registers to our primordial registers, then.
- const uint32_t num_composites = arraysize(g_composites);
+ const uint32_t num_composites = llvm::array_lengthof(g_composites);
const uint32_t num_primordials = GetNumRegisters();
RegisterInfo *g_comp_register_infos = g_register_infos + (num_registers - num_composites);
for (i=0; i<num_composites; ++i)
Modified: lldb/branches/lldb-platform-work/source/Symbol/Symbol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/Symbol.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/Symbol.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/Symbol.cpp Tue May 15 18:30:03 2012
@@ -179,7 +179,7 @@
void
Symbol::GetDescription (Stream *s, lldb::DescriptionLevel level, Target *target) const
{
- s->Printf("uid={%6u}", m_uid);
+ s->Printf("id = {0x%8.8x}", m_uid);
if (m_addr_range.GetBaseAddress().GetSection())
{
Modified: lldb/branches/lldb-platform-work/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/Type.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/Type.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/Type.cpp Tue May 15 18:30:03 2012
@@ -346,6 +346,21 @@
return false;
}
+lldb::TypeSP
+Type::GetTypedefType()
+{
+ lldb::TypeSP type_sp;
+ if (IsTypedef())
+ {
+ Type *typedef_type = m_symbol_file->ResolveTypeUID(m_encoding_uid);
+ if (typedef_type)
+ type_sp = typedef_type->shared_from_this();
+ }
+ return type_sp;
+}
+
+
+
lldb::Format
Type::GetFormat ()
{
Modified: lldb/branches/lldb-platform-work/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Platform.cpp?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Platform.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Platform.cpp Tue May 15 18:30:03 2012
@@ -840,7 +840,7 @@
uint32_t
OptionGroupPlatformRSync::GetNumDefinitions ()
{
- return arraysize(g_rsync_option_table);
+ return llvm::array_lengthof(g_rsync_option_table);
}
lldb::BreakpointSP
@@ -898,7 +898,7 @@
uint32_t
OptionGroupPlatformSSH::GetNumDefinitions ()
{
- return arraysize(g_ssh_option_table);
+ return llvm::array_lengthof(g_ssh_option_table);
}
OptionGroupPlatformCaching::OptionGroupPlatformCaching ()
@@ -945,5 +945,5 @@
uint32_t
OptionGroupPlatformCaching::GetNumDefinitions ()
{
- return arraysize(g_caching_option_table);
+ return llvm::array_lengthof(g_caching_option_table);
}
Modified: lldb/branches/lldb-platform-work/test/lang/objc/foundation/TestObjCMethods2.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lang/objc/foundation/TestObjCMethods2.py?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lang/objc/foundation/TestObjCMethods2.py (original)
+++ lldb/branches/lldb-platform-work/test/lang/objc/foundation/TestObjCMethods2.py Tue May 15 18:30:03 2012
@@ -60,12 +60,14 @@
self.buildDwarf()
self.MyString_dump()
+ @expectedFailurei386
@dsym_test
def test_NSError_po_with_dsym(self):
"""Test that po of the result of an unknown method doesn't require a cast."""
self.buildDsym()
self.NSError_po()
+ @expectedFailurei386
@dwarf_test
def test_NSError_po_with_dwarf(self):
"""Test that po of the result of an unknown method doesn't require a cast."""
Modified: lldb/branches/lldb-platform-work/test/lang/objc/objc-class-method/TestObjCClassMethod.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lang/objc/objc-class-method/TestObjCClassMethod.py?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lang/objc/objc-class-method/TestObjCClassMethod.py (original)
+++ lldb/branches/lldb-platform-work/test/lang/objc/objc-class-method/TestObjCClassMethod.py Tue May 15 18:30:03 2012
@@ -13,12 +13,14 @@
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@python_api_test
+ @expectedFailurei386
@dsym_test
def test_with_dsym_and_python_api(self):
"""Test calling functions in class methods."""
self.buildDsym()
self.objc_class_method()
+ @expectedFailurei386
@python_api_test
@dwarf_test
def test_with_dwarf_and_python_api(self):
Modified: lldb/branches/lldb-platform-work/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py?rev=156877&r1=156876&r2=156877&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py (original)
+++ lldb/branches/lldb-platform-work/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Tue May 15 18:30:03 2012
@@ -13,11 +13,13 @@
mydir = os.path.join("lang", "objc", "objc-new-syntax")
+ @expectedFailurei386
@dsym_test
def test_expr_with_dsym(self):
self.buildDsym()
self.expr()
+ @expectedFailurei386
@dwarf_test
def test_expr_with_dwarf(self):
self.buildDwarf()
More information about the lldb-commits
mailing list