summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/Error.cpp8
-rw-r--r--lldb/source/Core/Module.cpp24
-rw-r--r--lldb/source/Core/ModuleList.cpp14
3 files changed, 42 insertions, 4 deletions
diff --git a/lldb/source/Core/Error.cpp b/lldb/source/Core/Error.cpp
index bca30be6813..7aabe5b386d 100644
--- a/lldb/source/Core/Error.cpp
+++ b/lldb/source/Core/Error.cpp
@@ -52,12 +52,16 @@ Error::Error (const Error &rhs) :
{
}
-Error::Error (const char* err_str):
+Error::Error (const char* format, ...):
m_code (0),
m_type (eErrorTypeInvalid),
m_string ()
{
- SetErrorString(err_str);
+ va_list args;
+ va_start (args, format);
+ SetErrorToGenericError ();
+ SetErrorStringWithVarArg (format, args);
+ va_end (args);
}
//----------------------------------------------------------------------
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 4252ed4cb6c..859ec866ac0 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -9,6 +9,7 @@
#include "lldb/lldb-python.h"
+#include "lldb/Core/AddressResolverFileLine.h"
#include "lldb/Core/Error.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/DataBuffer.h"
@@ -752,6 +753,27 @@ Module::FindFunctions (const RegularExpression& regex,
return sc_list.GetSize() - start_size;
}
+void
+Module::FindAddressesForLine (const lldb::TargetSP target_sp,
+ const FileSpec &file, uint32_t line,
+ Function *function,
+ std::vector<Address> &output_local, std::vector<Address> &output_extern)
+{
+ SearchFilterByModule filter(target_sp, m_file);
+ AddressResolverFileLine resolver(file, line, true);
+ resolver.ResolveAddress (filter);
+
+ for (size_t n=0;n<resolver.GetNumberOfAddresses();n++)
+ {
+ Address addr = resolver.GetAddressRangeAtIndex(n).GetBaseAddress();
+ Function *f = addr.CalculateSymbolContextFunction();
+ if (f && f == function)
+ output_local.push_back (addr);
+ else
+ output_extern.push_back (addr);
+ }
+}
+
size_t
Module::FindTypes_Impl (const SymbolContext& sc,
const ConstString &name,
@@ -1606,4 +1628,4 @@ Module::PrepareForFunctionNameLookup (const ConstString &name,
lookup_name = name;
match_name_after_lookup = false;
}
-} \ No newline at end of file
+}
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index ebc6702d3a9..215611e4242 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -663,7 +663,19 @@ ModuleList::FindSourceFile (const FileSpec &orig_spec, FileSpec &new_spec) const
return false;
}
-
+void
+ModuleList::FindAddressesForLine (const lldb::TargetSP target_sp,
+ const FileSpec &file, uint32_t line,
+ Function *function,
+ std::vector<Address> &output_local, std::vector<Address> &output_extern)
+{
+ Mutex::Locker locker(m_modules_mutex);
+ collection::const_iterator pos, end = m_modules.end();
+ for (pos = m_modules.begin(); pos != end; ++pos)
+ {
+ (*pos)->FindAddressesForLine(target_sp, file, line, function, output_local, output_extern);
+ }
+}
ModuleSP
ModuleList::FindFirstModule (const ModuleSpec &module_spec) const
OpenPOWER on IntegriCloud