mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 15:14:31 +00:00
Export the ability to get the start and end addresses for functions
and symbols, and also allow clients to get the prologue size in bytes:
SBAddress
SBFunction::GetStartAddress ();
SBAddress
SBFunction::GetEndAddress ();
uint32_t
SBFunction::GetPrologueByteSize ();
SBAddress
SBSymbol::GetStartAddress ();
SBAddress
SBSymbol::GetEndAddress ();
uint32_t
SBSymbol::GetPrologueByteSize ();
llvm-svn: 126892
This commit is contained in:
1 parent
1a234ff46f
commit
93d00df578
5 files changed
+101
No files matched your search
@@ -156,3 +156,38 @@ SBFunction::reset (lldb_private::Function *lldb_object_ptr)
|
||||
m_opaque_ptr = lldb_object_ptr;
|
||||
}
|
||||
|
||||
SBAddress
|
||||
SBFunction::GetStartAddress ()
|
||||
{
|
||||
SBAddress addr;
|
||||
if (m_opaque_ptr)
|
||||
addr.SetAddress (&m_opaque_ptr->GetAddressRange().GetBaseAddress());
|
||||
return addr;
|
||||
}
|
||||
|
||||
SBAddress
|
||||
SBFunction::GetEndAddress ()
|
||||
{
|
||||
SBAddress addr;
|
||||
if (m_opaque_ptr)
|
||||
{
|
||||
addr_t byte_size = m_opaque_ptr->GetAddressRange().GetByteSize();
|
||||
if (byte_size > 0)
|
||||
{
|
||||
addr.SetAddress (&m_opaque_ptr->GetAddressRange().GetBaseAddress());
|
||||
addr->Slide (byte_size);
|
||||
}
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
|
||||
uint32_t
|
||||
SBFunction::GetPrologueByteSize ()
|
||||
{
|
||||
if (m_opaque_ptr)
|
||||
return m_opaque_ptr->GetPrologueByteSize();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user