aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectRegister.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2022-07-14 12:49:35 +0200
committerPavel Labath <pavel@labath.sk>2022-07-27 14:30:35 +0200
commit1400a3cb8d53c8c10e23ecdd4f241ea9cff404b5 (patch)
tree101bc938c7a464ab047e3130f32f131503a8320a /lldb/source/Commands/CommandObjectRegister.cpp
parentdde3cf2e83d2a2aec5b46bdac64efbc28a3b2b20 (diff)
downloadllvm-1400a3cb8d53c8c10e23ecdd4f241ea9cff404b5.zip
llvm-1400a3cb8d53c8c10e23ecdd4f241ea9cff404b5.tar.gz
llvm-1400a3cb8d53c8c10e23ecdd4f241ea9cff404b5.tar.bz2
[lldb] Always use APFloat for FP dumping
The DumpDataExtractor function had two branches for printing floating point values. One branch (APFloat) was used if we had a Target object around and could query it for the appropriate semantics. If we didn't have a Target, we used host operations to read and format the value. This patch changes second path to use APFloat as well. To make it work, I pick reasonable defaults for different byte size. Notably, I did not include x87 long double in that list (as it is ambibuous and architecture-specific). This exposed a bug where we were printing register values using the target-less branch, even though the registers definitely belong to a target, and we had it available. Fixing this prompted the update of several tests for register values due to slightly different floating point outputs. The most dubious aspect of this patch is the change in TypeSystemClang::GetFloatTypeSemantics to recognize `10` as a valid size for x87 long double. This was necessary because because sizeof(long double) on x86_64 is 16 even though it only holds 10 bytes of useful data. This generalizes the hackaround present in the target-free branch of the dumping function. Differential Revision: https://reviews.llvm.org/D129750
Diffstat (limited to 'lldb/source/Commands/CommandObjectRegister.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectRegister.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp
index 56cbacb..12f8971 100644
--- a/lldb/source/Commands/CommandObjectRegister.cpp
+++ b/lldb/source/Commands/CommandObjectRegister.cpp
@@ -94,7 +94,8 @@ public:
bool prefix_with_altname = (bool)m_command_options.alternate_name;
bool prefix_with_name = !prefix_with_altname;
DumpRegisterValue(reg_value, &strm, reg_info, prefix_with_name,
- prefix_with_altname, m_format_options.GetFormat(), 8);
+ prefix_with_altname, m_format_options.GetFormat(), 8,
+ exe_ctx.GetBestExecutionContextScope());
if ((reg_info->encoding == eEncodingUint) ||
(reg_info->encoding == eEncodingSint)) {
Process *process = exe_ctx.GetProcessPtr();