[PATCH] D39074: [libunwind][MIPS]: Add support for unwinding in N32 processes.

John Baldwin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 18 15:04:34 PDT 2017


bsdjhb created this revision.
Herald added subscribers: JDevlieghere, arichardson, aprantl.

N32 uses the same register context as N64.  However, N32 requires one
change to properly fetch addresses from registers stored in memory.
Since N32 is an ILP32 platform, getP() only fetches the first 32-bits
of a stored register.  For a big-endian platform this fetches the
upper 32-bits which will be zero.  To fix this, add a new
getRegister() method to AddressSpace which is responsible for
extracting the address stored in a register in memory.  This matches
getP() for all current ABIs except for N32 where it reads the 64-bit
register and returns the low 32-bits as an address.  The
DwarfInstructions::getSavedRegister() method uses
AddressSpace::getRegister() instead of AddressSpace::getP().

Possibly, DwarfInstructions::getSavedRegister()'s return type should
be changed from pint_t to uint64_t.


https://reviews.llvm.org/D39074

Files:
  include/__libunwind_config.h
  src/AddressSpace.hpp
  src/DwarfInstructions.hpp
  src/UnwindRegistersRestore.S
  src/UnwindRegistersSave.S
  src/libunwind.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39074.119529.patch
Type: text/x-patch
Size: 4416 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171018/9645d719/attachment-0001.bin>


More information about the cfe-commits mailing list