[Lldb-commits] [PATCH] D155256: [lldb][x86_64] Add fs_base/gs_base support for Linux

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 19 02:49:34 PDT 2023


DavidSpickett added inline comments.


================
Comment at: lldb/test/API/commands/register/register/register_command/TestRegisters.py:613
+    def test_fs_gs_base(self):
+        """Tests fs_base register can be read and equals to pthread_self() return value."""
+        self.build()
----------------
Update this comment.


================
Comment at: lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py:635
+        error = lldb.SBError()
+        bytesread = process.ReadMemory(0x400FF0, 20, error)
+
----------------
Stray line?


================
Comment at: lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py:647
+        self.assertTrue(reg_gs_base.IsValid(), "gs_base is not available")
+        # The fs_base/gs_base registers in linux-x86_64.core are both zero.
+        # Use "eu-readelf -n linux-x86_64.core" to verify.
----------------
Is it possible to make them non-zero? Looks like gs_base is often 0 anyway, so making fs_base non-zero would at least prove that we don't just always return 0, and that we don't get fs_base and gs_base mixed up.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155256/new/

https://reviews.llvm.org/D155256



More information about the lldb-commits mailing list