git: 0f2bb40bc7dd - main - lldb: dereference stoppcbs based on target kernel version
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 26 May 2023 01:49:51 UTC
The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0f2bb40bc7ddee7ba329d9b344623e2a186b4046 commit 0f2bb40bc7ddee7ba329d9b344623e2a186b4046 Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2023-05-02 20:24:46 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2023-05-26 01:45:52 +0000 lldb: dereference stoppcbs based on target kernel version As of 9fb6718d1b18 / __FreeBSD_version 1400089 stoppcbs is a pointer to the pcbs array. Dereference stoppcbs on sufficiently new kernels. Reviewed by: markj (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39939 --- .../source/Plugins/Process/FreeBSDKernel/ProcessFreeBSDKernel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSDKernel/ProcessFreeBSDKernel.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSDKernel/ProcessFreeBSDKernel.cpp index e3707365a9c3..30eace1ba94f 100644 --- a/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSDKernel/ProcessFreeBSDKernel.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSDKernel/ProcessFreeBSDKernel.cpp @@ -178,6 +178,11 @@ bool ProcessFreeBSDKernel::DoUpdateThreadList(ThreadList &old_thread_list, int32_t pcbsize = ReadSignedIntegerFromMemory(FindSymbol("pcb_size"), 4, -1, error); lldb::addr_t stoppcbs = FindSymbol("stoppcbs"); + // In later FreeBSD versions stoppcbs is a pointer to the array. + int32_t osreldate = + ReadSignedIntegerFromMemory(FindSymbol("osreldate"), 4, -1, error); + if (stoppcbs != LLDB_INVALID_ADDRESS && osreldate >= 1400089) + stoppcbs = ReadPointerFromMemory(stoppcbs, error); // from FreeBSD sys/param.h constexpr size_t fbsd_maxcomlen = 19;