[Lldb-commits] [lldb] 7504dd5 - Expose GetAddressingBits() in the Process API.

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 23 14:22:39 PDT 2022


Author: Adrian Prantl
Date: 2022-03-23T14:22:26-07:00
New Revision: 7504dd5e00f514628614db8ee07514c73220e597

URL: https://github.com/llvm/llvm-project/commit/7504dd5e00f514628614db8ee07514c73220e597
DIFF: https://github.com/llvm/llvm-project/commit/7504dd5e00f514628614db8ee07514c73220e597.diff

LOG: Expose GetAddressingBits() in the Process API.

This is needed by the Swift Plugin.

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

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index 7d8fbb7797d89..7c4302342988b 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -699,6 +699,9 @@ class Process : public std::enable_shared_from_this<Process>,
   /// 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

diff  --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 2e652e11ea110..12747321a2932 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -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)

diff  --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
index 50cef8e499dcc..a227e99b35768 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -72,6 +72,8 @@ class ProcessGDBRemote : public Process,
 
   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;


        


More information about the lldb-commits mailing list