2010-09-10 15:49:16 +08:00
|
|
|
//===-- UnwindPlan.cpp ----------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "lldb/Symbol/UnwindPlan.h"
|
2011-04-27 07:48:45 +08:00
|
|
|
|
|
|
|
#include "lldb/Core/ConstString.h"
|
2010-09-15 07:36:40 +08:00
|
|
|
#include "lldb/Target/Process.h"
|
2010-09-10 15:49:16 +08:00
|
|
|
#include "lldb/Target/RegisterContext.h"
|
2010-09-15 07:36:40 +08:00
|
|
|
#include "lldb/Target/Thread.h"
|
2010-09-10 15:49:16 +08:00
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
|
|
|
bool
|
|
|
|
UnwindPlan::Row::RegisterLocation::operator == (const UnwindPlan::Row::RegisterLocation& rhs) const
|
|
|
|
{
|
2011-05-12 02:39:18 +08:00
|
|
|
if (m_type == rhs.m_type)
|
|
|
|
{
|
|
|
|
switch (m_type)
|
|
|
|
{
|
|
|
|
case unspecified:
|
|
|
|
case undefined:
|
|
|
|
case same:
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case atCFAPlusOffset:
|
|
|
|
case isCFAPlusOffset:
|
|
|
|
return m_location.offset == rhs.m_location.offset;
|
|
|
|
|
|
|
|
case inOtherRegister:
|
|
|
|
return m_location.reg_num == rhs.m_location.reg_num;
|
|
|
|
|
|
|
|
case atDWARFExpression:
|
|
|
|
case isDWARFExpression:
|
|
|
|
if (m_location.expr.length == rhs.m_location.expr.length)
|
|
|
|
return !memcmp (m_location.expr.opcodes, rhs.m_location.expr.opcodes, m_location.expr.length);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2010-09-10 15:49:16 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This function doesn't copy the dwarf expression bytes; they must remain in allocated
|
|
|
|
// memory for the lifespan of this UnwindPlan object.
|
|
|
|
void
|
|
|
|
UnwindPlan::Row::RegisterLocation::SetAtDWARFExpression (const uint8_t *opcodes, uint32_t len)
|
|
|
|
{
|
|
|
|
m_type = atDWARFExpression;
|
|
|
|
m_location.expr.opcodes = opcodes;
|
|
|
|
m_location.expr.length = len;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This function doesn't copy the dwarf expression bytes; they must remain in allocated
|
|
|
|
// memory for the lifespan of this UnwindPlan object.
|
|
|
|
void
|
|
|
|
UnwindPlan::Row::RegisterLocation::SetIsDWARFExpression (const uint8_t *opcodes, uint32_t len)
|
|
|
|
{
|
|
|
|
m_type = isDWARFExpression;
|
|
|
|
m_location.expr.opcodes = opcodes;
|
|
|
|
m_location.expr.length = len;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2011-05-12 02:39:18 +08:00
|
|
|
UnwindPlan::Row::RegisterLocation::Dump (Stream &s, const UnwindPlan* unwind_plan, const UnwindPlan::Row* row, Thread* thread, bool verbose) const
|
2010-09-10 15:49:16 +08:00
|
|
|
{
|
|
|
|
switch (m_type)
|
|
|
|
{
|
|
|
|
case unspecified:
|
2011-05-12 02:39:18 +08:00
|
|
|
if (verbose)
|
|
|
|
s.PutCString ("=<unspec>");
|
|
|
|
else
|
|
|
|
s.PutCString ("=!");
|
2010-09-10 15:49:16 +08:00
|
|
|
break;
|
2011-05-12 02:39:18 +08:00
|
|
|
case undefined:
|
|
|
|
if (verbose)
|
|
|
|
s.PutCString ("=<undef>");
|
|
|
|
else
|
|
|
|
s.PutCString ("=?");
|
2010-09-10 15:49:16 +08:00
|
|
|
break;
|
2011-05-12 02:39:18 +08:00
|
|
|
case same:
|
|
|
|
s.PutCString ("= <same>");
|
2010-09-10 15:49:16 +08:00
|
|
|
break;
|
2011-05-12 02:39:18 +08:00
|
|
|
|
2010-09-10 15:49:16 +08:00
|
|
|
case atCFAPlusOffset:
|
|
|
|
case isCFAPlusOffset:
|
2011-05-12 02:39:18 +08:00
|
|
|
{
|
|
|
|
s.PutChar('=');
|
|
|
|
if (m_type == atCFAPlusOffset)
|
|
|
|
s.PutChar('[');
|
|
|
|
if (verbose)
|
|
|
|
s.Printf ("CFA%+d", m_location.offset);
|
|
|
|
|
|
|
|
if (unwind_plan && row)
|
|
|
|
{
|
|
|
|
const uint32_t cfa_reg = row->GetCFARegister();
|
|
|
|
const RegisterInfo *cfa_reg_info = unwind_plan->GetRegisterInfo (thread, cfa_reg);
|
|
|
|
const int32_t offset = row->GetCFAOffset() + m_location.offset;
|
|
|
|
if (verbose)
|
|
|
|
{
|
|
|
|
if (cfa_reg_info)
|
|
|
|
s.Printf (" (%s%+d)", cfa_reg_info->name, offset);
|
|
|
|
else
|
2011-08-12 08:02:24 +08:00
|
|
|
s.Printf (" (reg(%u)%+d)", cfa_reg, offset);
|
2011-05-12 02:39:18 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (cfa_reg_info)
|
|
|
|
s.Printf ("%s", cfa_reg_info->name);
|
|
|
|
else
|
2011-08-12 08:02:24 +08:00
|
|
|
s.Printf ("reg(%u)", cfa_reg);
|
2011-05-12 02:39:18 +08:00
|
|
|
if (offset != 0)
|
|
|
|
s.Printf ("%+d", offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (m_type == atCFAPlusOffset)
|
|
|
|
s.PutChar(']');
|
|
|
|
}
|
2010-09-10 15:49:16 +08:00
|
|
|
break;
|
2011-05-12 02:39:18 +08:00
|
|
|
|
2010-09-10 15:49:16 +08:00
|
|
|
case inOtherRegister:
|
2011-05-12 02:39:18 +08:00
|
|
|
{
|
|
|
|
const RegisterInfo *other_reg_info = NULL;
|
|
|
|
if (unwind_plan)
|
|
|
|
other_reg_info = unwind_plan->GetRegisterInfo (thread, m_location.reg_num);
|
|
|
|
if (other_reg_info)
|
|
|
|
s.Printf ("=%s", other_reg_info->name);
|
|
|
|
else
|
|
|
|
s.Printf ("=reg(%u)", m_location.reg_num);
|
|
|
|
}
|
2010-09-10 15:49:16 +08:00
|
|
|
break;
|
2011-05-12 02:39:18 +08:00
|
|
|
|
2010-09-10 15:49:16 +08:00
|
|
|
case atDWARFExpression:
|
|
|
|
case isDWARFExpression:
|
2011-05-12 02:39:18 +08:00
|
|
|
{
|
|
|
|
s.PutChar('=');
|
|
|
|
if (m_type == atDWARFExpression)
|
|
|
|
s.PutCString("[dwarf-expr]");
|
|
|
|
else
|
|
|
|
s.PutCString("dwarf-expr");
|
|
|
|
}
|
2010-09-10 15:49:16 +08:00
|
|
|
break;
|
2011-05-12 02:39:18 +08:00
|
|
|
|
2010-09-10 15:49:16 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
UnwindPlan::Row::Clear ()
|
|
|
|
{
|
|
|
|
m_offset = 0;
|
|
|
|
m_cfa_reg_num = 0;
|
|
|
|
m_cfa_offset = 0;
|
|
|
|
m_register_locations.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2011-05-12 02:39:18 +08:00
|
|
|
UnwindPlan::Row::Dump (Stream& s, const UnwindPlan* unwind_plan, Thread* thread, addr_t base_addr) const
|
2010-09-10 15:49:16 +08:00
|
|
|
{
|
2011-05-12 02:39:18 +08:00
|
|
|
const RegisterInfo *reg_info = unwind_plan->GetRegisterInfo (thread, GetCFARegister());
|
|
|
|
|
|
|
|
if (base_addr != LLDB_INVALID_ADDRESS)
|
|
|
|
s.Printf ("0x%16.16llx: CFA=", base_addr + GetOffset());
|
2010-09-10 15:49:16 +08:00
|
|
|
else
|
2011-09-21 05:44:10 +08:00
|
|
|
s.Printf ("0x%8.8llx: CFA=", GetOffset());
|
2011-05-12 02:39:18 +08:00
|
|
|
|
|
|
|
if (reg_info)
|
|
|
|
s.Printf ("%s", reg_info->name);
|
|
|
|
else
|
|
|
|
s.Printf ("reg(%u)", GetCFARegister());
|
2012-08-11 04:52:59 +08:00
|
|
|
s.Printf ("%+3d => ", GetCFAOffset ());
|
2010-09-10 15:49:16 +08:00
|
|
|
for (collection::const_iterator idx = m_register_locations.begin (); idx != m_register_locations.end (); ++idx)
|
|
|
|
{
|
2011-05-12 02:39:18 +08:00
|
|
|
reg_info = unwind_plan->GetRegisterInfo (thread, idx->first);
|
|
|
|
if (reg_info)
|
|
|
|
s.Printf ("%s", reg_info->name);
|
|
|
|
else
|
|
|
|
s.Printf ("reg(%u)", idx->first);
|
|
|
|
const bool verbose = false;
|
|
|
|
idx->second.Dump(s, unwind_plan, this, thread, verbose);
|
|
|
|
s.PutChar (' ');
|
2010-09-10 15:49:16 +08:00
|
|
|
}
|
2011-01-09 05:19:00 +08:00
|
|
|
s.EOL();
|
2010-09-10 15:49:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
UnwindPlan::Row::Row() :
|
|
|
|
m_offset(0),
|
|
|
|
m_cfa_reg_num(0),
|
|
|
|
m_cfa_offset(0),
|
|
|
|
m_register_locations()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
UnwindPlan::Row::GetRegisterInfo (uint32_t reg_num, UnwindPlan::Row::RegisterLocation& register_location) const
|
|
|
|
{
|
|
|
|
collection::const_iterator pos = m_register_locations.find(reg_num);
|
|
|
|
if (pos != m_register_locations.end())
|
|
|
|
{
|
|
|
|
register_location = pos->second;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
UnwindPlan::Row::SetRegisterInfo (uint32_t reg_num, const UnwindPlan::Row::RegisterLocation register_location)
|
|
|
|
{
|
|
|
|
m_register_locations[reg_num] = register_location;
|
|
|
|
}
|
|
|
|
|
2011-05-12 02:39:18 +08:00
|
|
|
bool
|
|
|
|
UnwindPlan::Row::SetRegisterLocationToAtCFAPlusOffset (uint32_t reg_num, int32_t offset, bool can_replace)
|
|
|
|
{
|
|
|
|
if (!can_replace && m_register_locations.find(reg_num) != m_register_locations.end())
|
|
|
|
return false;
|
|
|
|
RegisterLocation reg_loc;
|
|
|
|
reg_loc.SetAtCFAPlusOffset(offset);
|
|
|
|
m_register_locations[reg_num] = reg_loc;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
UnwindPlan::Row::SetRegisterLocationToIsCFAPlusOffset (uint32_t reg_num, int32_t offset, bool can_replace)
|
|
|
|
{
|
|
|
|
if (!can_replace && m_register_locations.find(reg_num) != m_register_locations.end())
|
|
|
|
return false;
|
|
|
|
RegisterLocation reg_loc;
|
|
|
|
reg_loc.SetIsCFAPlusOffset(offset);
|
|
|
|
m_register_locations[reg_num] = reg_loc;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
UnwindPlan::Row::SetRegisterLocationToUndefined (uint32_t reg_num, bool can_replace, bool can_replace_only_if_unspecified)
|
|
|
|
{
|
|
|
|
collection::iterator pos = m_register_locations.find(reg_num);
|
|
|
|
collection::iterator end = m_register_locations.end();
|
|
|
|
|
|
|
|
if (pos != end)
|
|
|
|
{
|
|
|
|
if (!can_replace)
|
|
|
|
return false;
|
|
|
|
if (can_replace_only_if_unspecified && !pos->second.IsUnspecified())
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
RegisterLocation reg_loc;
|
|
|
|
reg_loc.SetUndefined();
|
|
|
|
m_register_locations[reg_num] = reg_loc;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
UnwindPlan::Row::SetRegisterLocationToUnspecified (uint32_t reg_num, bool can_replace)
|
|
|
|
{
|
|
|
|
if (!can_replace && m_register_locations.find(reg_num) != m_register_locations.end())
|
|
|
|
return false;
|
|
|
|
RegisterLocation reg_loc;
|
|
|
|
reg_loc.SetUnspecified();
|
|
|
|
m_register_locations[reg_num] = reg_loc;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
UnwindPlan::Row::SetRegisterLocationToRegister (uint32_t reg_num,
|
|
|
|
uint32_t other_reg_num,
|
|
|
|
bool can_replace)
|
|
|
|
{
|
|
|
|
if (!can_replace && m_register_locations.find(reg_num) != m_register_locations.end())
|
|
|
|
return false;
|
|
|
|
RegisterLocation reg_loc;
|
|
|
|
reg_loc.SetInRegister(other_reg_num);
|
|
|
|
m_register_locations[reg_num] = reg_loc;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
UnwindPlan::Row::SetRegisterLocationToSame (uint32_t reg_num, bool must_replace)
|
|
|
|
{
|
|
|
|
if (must_replace && m_register_locations.find(reg_num) == m_register_locations.end())
|
|
|
|
return false;
|
|
|
|
RegisterLocation reg_loc;
|
|
|
|
reg_loc.SetSame();
|
|
|
|
m_register_locations[reg_num] = reg_loc;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
UnwindPlan::Row::SetCFARegister (uint32_t reg_num)
|
|
|
|
{
|
|
|
|
m_cfa_reg_num = reg_num;
|
|
|
|
}
|
2010-09-10 15:49:16 +08:00
|
|
|
|
2012-07-17 09:57:24 +08:00
|
|
|
bool
|
|
|
|
UnwindPlan::Row::operator == (const UnwindPlan::Row& rhs) const
|
|
|
|
{
|
|
|
|
if (m_offset != rhs.m_offset || m_cfa_reg_num != rhs.m_cfa_reg_num || m_cfa_offset != rhs.m_cfa_offset)
|
|
|
|
return false;
|
2012-07-19 04:37:53 +08:00
|
|
|
return m_register_locations == rhs.m_register_locations;
|
2012-07-17 09:57:24 +08:00
|
|
|
}
|
|
|
|
|
2010-09-10 15:49:16 +08:00
|
|
|
void
|
2012-07-19 04:37:53 +08:00
|
|
|
UnwindPlan::AppendRow (const UnwindPlan::RowSP &row_sp)
|
2010-09-10 15:49:16 +08:00
|
|
|
{
|
2012-07-19 04:37:53 +08:00
|
|
|
if (m_row_list.empty() || m_row_list.back()->GetOffset() != row_sp->GetOffset())
|
|
|
|
m_row_list.push_back(row_sp);
|
2010-09-10 15:49:16 +08:00
|
|
|
else
|
2012-07-19 04:37:53 +08:00
|
|
|
m_row_list.back() = row_sp;
|
2010-09-10 15:49:16 +08:00
|
|
|
}
|
|
|
|
|
2012-07-14 12:52:53 +08:00
|
|
|
UnwindPlan::RowSP
|
2010-09-10 15:49:16 +08:00
|
|
|
UnwindPlan::GetRowForFunctionOffset (int offset) const
|
|
|
|
{
|
2012-07-14 12:52:53 +08:00
|
|
|
RowSP row;
|
2011-01-09 05:19:00 +08:00
|
|
|
if (!m_row_list.empty())
|
2010-10-25 19:12:07 +08:00
|
|
|
{
|
2011-01-09 05:19:00 +08:00
|
|
|
if (offset == -1)
|
2012-07-14 12:52:53 +08:00
|
|
|
row = m_row_list.back();
|
2010-09-10 15:49:16 +08:00
|
|
|
else
|
|
|
|
{
|
2011-01-09 05:19:00 +08:00
|
|
|
collection::const_iterator pos, end = m_row_list.end();
|
|
|
|
for (pos = m_row_list.begin(); pos != end; ++pos)
|
|
|
|
{
|
2012-07-14 12:52:53 +08:00
|
|
|
if ((*pos)->GetOffset() <= offset)
|
|
|
|
row = *pos;
|
2011-01-09 05:19:00 +08:00
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
2010-09-10 15:49:16 +08:00
|
|
|
}
|
|
|
|
}
|
2012-07-14 12:52:53 +08:00
|
|
|
return row;
|
2010-09-10 15:49:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
UnwindPlan::IsValidRowIndex (uint32_t idx) const
|
|
|
|
{
|
|
|
|
return idx < m_row_list.size();
|
|
|
|
}
|
|
|
|
|
2012-07-14 12:52:53 +08:00
|
|
|
const UnwindPlan::RowSP
|
2010-09-10 15:49:16 +08:00
|
|
|
UnwindPlan::GetRowAtIndex (uint32_t idx) const
|
|
|
|
{
|
|
|
|
// You must call IsValidRowIndex(idx) first before calling this!!!
|
2011-01-09 05:19:00 +08:00
|
|
|
assert (idx < m_row_list.size());
|
2010-09-10 15:49:16 +08:00
|
|
|
return m_row_list[idx];
|
|
|
|
}
|
|
|
|
|
2012-07-14 12:52:53 +08:00
|
|
|
const UnwindPlan::RowSP
|
2011-05-12 02:39:18 +08:00
|
|
|
UnwindPlan::GetLastRow () const
|
2010-09-10 15:49:16 +08:00
|
|
|
{
|
2011-05-12 02:39:18 +08:00
|
|
|
// You must call GetRowCount() first to make sure there is at least one row
|
|
|
|
assert (!m_row_list.empty());
|
|
|
|
return m_row_list.back();
|
2010-09-10 15:49:16 +08:00
|
|
|
}
|
|
|
|
|
2011-05-12 02:39:18 +08:00
|
|
|
int
|
|
|
|
UnwindPlan::GetRowCount () const
|
2010-09-10 15:49:16 +08:00
|
|
|
{
|
2011-05-12 02:39:18 +08:00
|
|
|
return m_row_list.size ();
|
2010-09-10 15:49:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
UnwindPlan::SetPlanValidAddressRange (const AddressRange& range)
|
|
|
|
{
|
2010-10-25 19:12:07 +08:00
|
|
|
if (range.GetBaseAddress().IsValid() && range.GetByteSize() != 0)
|
|
|
|
m_plan_valid_address_range = range;
|
2010-09-10 15:49:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
UnwindPlan::PlanValidAtAddress (Address addr)
|
|
|
|
{
|
2010-10-25 19:12:07 +08:00
|
|
|
if (!m_plan_valid_address_range.GetBaseAddress().IsValid() || m_plan_valid_address_range.GetByteSize() == 0)
|
2010-09-10 15:49:16 +08:00
|
|
|
return true;
|
|
|
|
|
2010-11-04 08:53:20 +08:00
|
|
|
if (!addr.IsValid())
|
|
|
|
return true;
|
|
|
|
|
2010-09-10 15:49:16 +08:00
|
|
|
if (m_plan_valid_address_range.ContainsFileAddress (addr))
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2011-05-12 02:39:18 +08:00
|
|
|
UnwindPlan::Dump (Stream& s, Thread *thread, lldb::addr_t base_addr) const
|
2010-09-10 15:49:16 +08:00
|
|
|
{
|
2010-10-25 19:12:07 +08:00
|
|
|
if (!m_source_name.IsEmpty())
|
|
|
|
{
|
|
|
|
s.Printf ("This UnwindPlan originally sourced from %s\n", m_source_name.GetCString());
|
|
|
|
}
|
|
|
|
if (m_plan_valid_address_range.GetBaseAddress().IsValid() && m_plan_valid_address_range.GetByteSize() > 0)
|
|
|
|
{
|
2011-01-09 05:19:00 +08:00
|
|
|
s.PutCString ("Address range of this UnwindPlan: ");
|
2012-02-21 08:09:25 +08:00
|
|
|
TargetSP target_sp(thread->CalculateTarget());
|
|
|
|
m_plan_valid_address_range.Dump (&s, target_sp.get(), Address::DumpStyleSectionNameOffset);
|
2011-01-09 05:19:00 +08:00
|
|
|
s.EOL();
|
2010-10-25 19:12:07 +08:00
|
|
|
}
|
2011-05-12 02:39:18 +08:00
|
|
|
collection::const_iterator pos, begin = m_row_list.begin(), end = m_row_list.end();
|
|
|
|
for (pos = begin; pos != end; ++pos)
|
2010-09-10 15:49:16 +08:00
|
|
|
{
|
2011-05-12 02:39:18 +08:00
|
|
|
s.Printf ("row[%u]: ", (uint32_t)std::distance (begin, pos));
|
2012-07-14 12:52:53 +08:00
|
|
|
(*pos)->Dump(s, this, thread, base_addr);
|
2010-09-10 15:49:16 +08:00
|
|
|
}
|
|
|
|
}
|
2010-10-25 19:12:07 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
UnwindPlan::SetSourceName (const char *source)
|
|
|
|
{
|
|
|
|
m_source_name = ConstString (source);
|
|
|
|
}
|
|
|
|
|
|
|
|
ConstString
|
|
|
|
UnwindPlan::GetSourceName () const
|
|
|
|
{
|
|
|
|
return m_source_name;
|
|
|
|
}
|
2011-05-12 02:39:18 +08:00
|
|
|
|
|
|
|
const RegisterInfo *
|
|
|
|
UnwindPlan::GetRegisterInfo (Thread* thread, uint32_t unwind_reg) const
|
|
|
|
{
|
|
|
|
if (thread)
|
|
|
|
{
|
|
|
|
RegisterContext *reg_ctx = thread->GetRegisterContext().get();
|
|
|
|
if (reg_ctx)
|
|
|
|
{
|
|
|
|
uint32_t reg;
|
|
|
|
if (m_register_kind == eRegisterKindLLDB)
|
|
|
|
reg = unwind_reg;
|
|
|
|
else
|
|
|
|
reg = reg_ctx->ConvertRegisterKindToRegisterNumber (m_register_kind, unwind_reg);
|
|
|
|
if (reg != LLDB_INVALID_REGNUM)
|
|
|
|
return reg_ctx->GetRegisterInfoAtIndex (reg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|