Expose GetAddressingBits() in the Process API.
authorAdrian Prantl <aprantl@apple.com>
Wed, 23 Mar 2022 21:06:18 +0000 (14:06 -0700)
committerAdrian Prantl <aprantl@apple.com>
Wed, 23 Mar 2022 21:22:26 +0000 (14:22 -0700)
This is needed by the Swift Plugin.

See also  https://github.com/apple/llvm-project/pull/4110.

Differential Revision: https://reviews.llvm.org/D122347

lldb/include/lldb/Target/Process.h
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h

index 7d8fbb7797d897c3a38338f20c9e7db7d47c61e3..7c4302342988b51eadf3604551ce98f5aa9d9d23 100644 (file)
@@ -699,6 +699,9 @@ public:
   /// Get the system architecture for this process.
   virtual ArchSpec GetSystemArchitecture() { return {}; }
 
+  /// Return the number of bits in a vmaddr that are used by valid addresses.
+  virtual llvm::Optional<uint32_t> GetAddressingBits() { return {}; }
+
   /// Get the system runtime plug-in for this process.
   ///
   /// \return
index 2e652e11ea1105d6c28841e1baa4cd9e2cab6a74..12747321a2932c90d046bb4d7465b8f9b8df27fc 100644 (file)
@@ -212,6 +212,10 @@ ArchSpec ProcessGDBRemote::GetSystemArchitecture() {
   return m_gdb_comm.GetHostArchitecture();
 }
 
+llvm::Optional<uint32_t> ProcessGDBRemote::GetAddressingBits() {
+  return m_gdb_comm.GetAddressingBits();
+}
+
 bool ProcessGDBRemote::CanDebug(lldb::TargetSP target_sp,
                                 bool plugin_specified_by_name) {
   if (plugin_specified_by_name)
index 50cef8e499dcc97e9bffd918808b024e0495cb04..a227e99b3576811b4557dc0349e4f882425806c4 100644 (file)
@@ -72,6 +72,8 @@ public:
 
   ArchSpec GetSystemArchitecture() override;
 
+  llvm::Optional<uint32_t> GetAddressingBits() override;
+
   // Check if a given Process
   bool CanDebug(lldb::TargetSP target_sp,
                 bool plugin_specified_by_name) override;