[Lldb-commits] [PATCH] D14633: [LLDB][MIPS] Clear bug 25194 - LLDB-Server Assertion raised when single stepping on MIPS

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 18 06:44:03 PST 2015


tberghammer added a comment.

Hi,

I checked out the implementation of RegisterValue and this is my understanding what is happening:

- When we call RegisterValue::SetUInt it will be creating a 32bit unsigned llvm::APInt
- The llvm::APInt will store the data in a uint64_t
- Calling RegisterValue::GetBytes() will return with APInt::getRawData() what will return a pointer to the uint64_t

The problem is that the pointer returned from getRawData isn't pointing to the 32bit data of the underlying storage but it points to the full 64bit storage slot.

I don't know what is the best solution in the current situation but using SetBytes directly and managing the endianness by hand looks like a bad solution for me because then we practically say that SetUInt (and all other similar functions) are not big endian compatible (what should be fixed or they should be removed).

I see 2 option at the moment but none of them is perfect:

- Add a new function to llvm::APInt what returns the pointer to the actual data in case of both endian (possibly the best option)
- Don't use llvm::APInt inside Scalar as we don't need most of it's functionality and just have a big enough byte buffer in RegisterValue

Cheers,
Tamas


Repository:
  rL LLVM

http://reviews.llvm.org/D14633





More information about the lldb-commits mailing list