summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-07-07 01:59:51 +0000
committerGreg Clayton <gclayton@apple.com>2011-07-07 01:59:51 +0000
commit644247c1dc56106a06afbf8ac25fa4e07f46dd88 (patch)
treef318a596a16b71724e40d6ae52564b263b5baa10 /lldb/source/Core/Module.cpp
parenta3c122db7e4883129bb35558becd6fe8c4722295 (diff)
downloadbcm5719-llvm-644247c1dc56106a06afbf8ac25fa4e07f46dd88.tar.gz
bcm5719-llvm-644247c1dc56106a06afbf8ac25fa4e07f46dd88.zip
Added "target variable" command that allows introspection of global
variables prior to running your binary. Zero filled sections now get section data correctly filled with zeroes when Target::ReadMemory reads from the object file section data. Added new option groups and option values for file lists. I still need to hook up all of the options to "target variable" to allow more complete introspection by file and shlib. Added the ability for ValueObjectVariable objects to be created with only the target as the execution context. This allows them to be read from the object files through Target::ReadMemory(...). Added a "virtual Module * GetModule()" function to the ValueObject class. By default it will look to the parent variable object and return its module. The module is needed when we have global variables that have file addresses (virtual addresses that are specific to module object files) and in turn allows global variables to be displayed prior to running. Removed all of the unused proxy object support that bit rotted in lldb_private::Value. Replaced a lot of places that used "FileSpec::Compare (lhs, rhs) == 0" code with the more efficient "FileSpec::Equal (lhs, rhs)". Improved logging in GDB remote plug-in. llvm-svn: 134579
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 026950e03db..8b07a76eead 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -193,16 +193,6 @@ Module::GetCompileUnitAtIndex (uint32_t index)
return cu_sp;
}
-//CompUnitSP
-//Module::FindCompUnit(lldb::user_id_t uid)
-//{
-// CompUnitSP cu_sp;
-// SymbolVendor *symbols = GetSymbolVendor ();
-// if (symbols)
-// cu_sp = symbols->FindCompUnit(uid);
-// return cu_sp;
-//}
-
bool
Module::ResolveFileAddress (lldb::addr_t vm_addr, Address& so_addr)
{
@@ -323,6 +313,28 @@ Module::FindGlobalVariables(const RegularExpression& regex, bool append, uint32_
}
uint32_t
+Module::FindCompileUnits (const FileSpec &path,
+ bool append,
+ SymbolContextList &sc_list)
+{
+ if (!append)
+ sc_list.Clear();
+
+ const uint32_t start_size = sc_list.GetSize();
+ const uint32_t num_compile_units = GetNumCompileUnits();
+ SymbolContext sc;
+ sc.module_sp = GetSP();
+ const bool compare_directory = path.GetDirectory();
+ for (uint32_t i=0; i<num_compile_units; ++i)
+ {
+ sc.comp_unit = GetCompileUnitAtIndex(i).get();
+ if (FileSpec::Equal (*sc.comp_unit, path, compare_directory))
+ sc_list.Append(sc);
+ }
+ return sc_list.GetSize() - start_size;
+}
+
+uint32_t
Module::FindFunctions (const ConstString &name,
uint32_t name_type_mask,
bool include_symbols,
OpenPOWER on IntegriCloud