[lldb] Rewrite Scalar::GetBytes
This function was modifying and returning pointers to static storage, which meant that any two accesses to different Scalar objects could potentially race (depending on which types the objects were storing and the host endianness). In the new version the user is responsible for providing a buffer into which this method will store its binary representation. The main caller (RegisterValue::GetBytes) already has one such buffer handy, so this did not require any major rewrites. To make that work, I've needed to mark the RegisterValue value buffer mutable -- not an ideal solution, but definitely better than modifying global storage. This could be further improved by changing RegisterValue::GetBytes to take a buffer too.
Loading
Please sign in to comment