mirror of
https://github.com/intel/llvm.git
synced 2026-01-15 04:17:17 +08:00
Added a 'jump' command, similar to GDBs.
This allows the PC to be directly changed to a different line. It's similar to the example python script in examples/python/jump.py, except implemented as a builtin. Also this version will track the current function correctly even if the target line resolves to multiple addresses. (e.g. debugging a templated function) llvm-svn: 190572
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user