aboutsummaryrefslogtreecommitdiff
path: root/lldb/include
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2023-03-01 11:03:01 +0000
committerDavid Spickett <david.spickett@linaro.org>2023-06-21 08:48:18 +0000
commitba85f206fe6f2fec9dd5fee55bf2a1e966fc37aa (patch)
tree04f8cc9825008ca4e6db2946aa5b0a7c81ac5439 /lldb/include
parentedc9e2c26779e878874726243bc5d9c3b4ea1210 (diff)
downloadllvm-ba85f206fe6f2fec9dd5fee55bf2a1e966fc37aa.zip
llvm-ba85f206fe6f2fec9dd5fee55bf2a1e966fc37aa.tar.gz
llvm-ba85f206fe6f2fec9dd5fee55bf2a1e966fc37aa.tar.bz2
[lldb] Add "register info" command
This adds a new command that will show all the information lldb knows about a register. ``` (lldb) register info s0 Name: s0 Size: 4 bytes (32 bits) Invalidates: v0, d0 Read from: v0 In sets: Floating Point Registers (index 1) ``` Currently it only allows a single register, and we get the information from the RegisterInfo structure. For those of us who know the architecture well, this information is all pretty obvious. For those who don't, it's nice to have it at a glance without leaving the debugger. I hope to have more in depth information to show here in the future, which will be of wider use. Reviewed By: jasonmolenda Differential Revision: https://reviews.llvm.org/D152916
Diffstat (limited to 'lldb/include')
-rw-r--r--lldb/include/lldb/Core/DumpRegisterInfo.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/lldb/include/lldb/Core/DumpRegisterInfo.h b/lldb/include/lldb/Core/DumpRegisterInfo.h
new file mode 100644
index 0000000..e257581
--- /dev/null
+++ b/lldb/include/lldb/Core/DumpRegisterInfo.h
@@ -0,0 +1,34 @@
+//===-- DumpRegisterInfo.h --------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_CORE_DUMPREGISTERINFO_H
+#define LLDB_CORE_DUMPREGISTERINFO_H
+
+#include <stdint.h>
+#include <utility>
+#include <vector>
+
+namespace lldb_private {
+
+class Stream;
+class RegisterContext;
+struct RegisterInfo;
+
+void DumpRegisterInfo(Stream &strm, RegisterContext &ctx,
+ const RegisterInfo &info);
+
+// For testing only. Use DumpRegisterInfo instead.
+void DoDumpRegisterInfo(
+ Stream &strm, const char *name, const char *alt_name, uint32_t byte_size,
+ const std::vector<const char *> &invalidates,
+ const std::vector<const char *> &read_from,
+ const std::vector<std::pair<const char *, uint32_t>> &in_sets);
+
+} // namespace lldb_private
+
+#endif // LLDB_CORE_DUMPREGISTERINFO_H