[Lldb-commits] [lldb] [lldb] [Mach-O] ProcessMachCore needs to strip TBI data from addrs (PR #84998)
@@ -0,0 +1,49 @@ +"""Test that lldb on Darwin ignores metadata in the top byte of addresses.""" DavidSpickett wrote: addresses in core files. Also the filename should have core somewhere in it. https://github.com/llvm/llvm-project/pull/84998 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] [Mach-O] ProcessMachCore needs to strip TBI data from addrs (PR #84998)
@@ -0,0 +1,49 @@ +"""Test that lldb on Darwin ignores metadata in the top byte of addresses.""" + +import os +import re +import subprocess + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestTBIHonored(TestBase): +@no_debug_info_test +@skipUnlessDarwin +@skipIf(archs=no_match(["arm64", "arm64e"])) DavidSpickett wrote: This isn't a live process, do we need to be on Darwin arm64? https://github.com/llvm/llvm-project/pull/84998 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] [Mach-O] ProcessMachCore needs to strip TBI data from addrs (PR #84998)
@@ -0,0 +1,49 @@ +"""Test that lldb on Darwin ignores metadata in the top byte of addresses.""" + +import os +import re +import subprocess + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestTBIHonored(TestBase): +@no_debug_info_test +@skipUnlessDarwin +@skipIf(archs=no_match(["arm64", "arm64e"])) +@skipIfRemote +def do_variable_access_tests(self, frame): +self.assertEqual( +frame.variables["pb"][0] +.GetChildMemberWithName("p") +.Dereference() +.GetValueAsUnsigned(), +15, +) +addr = frame.variables["pb"][0].GetChildMemberWithName("p").GetValueAsUnsigned() +self.expect("expr -- *pb.p", substrs=["15"]) +self.expect("frame variable *pb.p", substrs=["15"]) +self.expect("expr -- *(int*)0x%x" % addr, substrs=["15"]) + +def test(self): DavidSpickett wrote: I think the test framework is going to run this method as the test case, so put the decorators on this instead. https://github.com/llvm/llvm-project/pull/84998 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] [Mach-O] ProcessMachCore needs to strip TBI data from addrs (PR #84998)
@@ -0,0 +1,49 @@ +"""Test that lldb on Darwin ignores metadata in the top byte of addresses.""" DavidSpickett wrote: Oh I get it, you're running a process first then making a core file and expecting to get the same output. This needs to be made clear at the top of the file at least, with some extra comments later too. https://github.com/llvm/llvm-project/pull/84998 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] [Mach-O] ProcessMachCore needs to strip TBI data from addrs (PR #84998)
@@ -0,0 +1,49 @@ +"""Test that lldb on Darwin ignores metadata in the top byte of addresses.""" + +import os +import re +import subprocess + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestTBIHonored(TestBase): +@no_debug_info_test +@skipUnlessDarwin +@skipIf(archs=no_match(["arm64", "arm64e"])) +@skipIfRemote +def do_variable_access_tests(self, frame): DavidSpickett wrote: Just in case we mess up really badly, it is worth checking that pb.bytes[7] is in fact 0xfe first. That would also functions as documentation implying "despite this being 0xfe we can... ". https://github.com/llvm/llvm-project/pull/84998 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] [Mach-O] ProcessMachCore needs to strip TBI data from addrs (PR #84998)
@@ -0,0 +1,13 @@ +#include +#include +union ptrbytes { + int *p; + uint8_t bytes[8]; +}; DavidSpickett wrote: I like this way of avoiding shifts. https://github.com/llvm/llvm-project/pull/84998 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] clang-format AuxVector.h (PR #85057)
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/85057 Doing this in its own commit so the intent of the previous change is clearer. >From a251b494614a0700f424c2bedebcabd2e053a653 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 6 Mar 2024 09:08:25 + Subject: [PATCH 1/2] [lldb][FreeBSD] Add FreeBSD specific AT_HWCAP2 value While adding register fields I realised that the AUXV values for Linux and FreeBSD disagree here. So I've added a FreeBSD specific HWCAP2 value that I can use from FreeBSD specific code. The alternative is translating GetAuxValue calls depending on platform, which requires that we know what we are at all times. Another way would be to convert the entries' values when we construct the AuxVector but the platform specific call that reads the data just returns a raw array. So adding another layer here is more disruption. --- lldb/source/Plugins/Process/Utility/AuxVector.h | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lldb/source/Plugins/Process/Utility/AuxVector.h b/lldb/source/Plugins/Process/Utility/AuxVector.h index 3b0f55d35e5d11..237c120a426941 100644 --- a/lldb/source/Plugins/Process/Utility/AuxVector.h +++ b/lldb/source/Plugins/Process/Utility/AuxVector.h @@ -20,9 +20,13 @@ class AuxVector { AuxVector(const lldb_private::DataExtractor &data); /// Constants describing the type of entry. - /// On Linux, running "LD_SHOW_AUXV=1 ./executable" will spew AUX + /// On Linux and FreeBSD, running "LD_SHOW_AUXV=1 ./executable" will spew AUX /// information. Added AUXV prefix to avoid potential conflicts with system- - /// defined macros + /// defined macros. For FreeBSD, the numbers can be found in sys/elf_common.h. + /// + /// Linux and FreeBSD values diverge, so the FreeBSD classes will convert + /// some entries to the Linux AT_ value so that LLDB only has to use + /// the constants listed here when asking the AuxVector for a value. enum EntryType { AUXV_AT_NULL = 0, ///< End of auxv. AUXV_AT_IGNORE = 1,///< Ignore entry. @@ -39,6 +43,11 @@ class AuxVector { AUXV_AT_EUID = 12, ///< Effective UID. AUXV_AT_GID = 13, ///< GID. AUXV_AT_EGID = 14, ///< Effective GID. + +// At this point Linux and FreeBSD diverge and many of the following values +// are Linux specific. If you use them make sure you are in Linux specific +// code or they have the same value on other platforms. + AUXV_AT_CLKTCK = 17, ///< Clock frequency (e.g. times(2)). AUXV_AT_PLATFORM = 15, ///< String identifying platform. AUXV_AT_HWCAP = @@ -60,6 +69,10 @@ class AuxVector { AUXV_AT_L1D_CACHESHAPE = 35, AUXV_AT_L2_CACHESHAPE = 36, AUXV_AT_L3_CACHESHAPE = 37, + +// Platform specific values which may overlap the Linux values. + +AUXV_FREEBSD_AT_HWCAP = 25, ///< FreeBSD specific AT_HWCAP value. }; std::optional GetAuxValue(enum EntryType entry_type) const; >From 546c7a728041db2e6f55bc6bce7231640da85bee Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 6 Mar 2024 09:13:37 + Subject: [PATCH 2/2] [lldb] clang-format AuxVector.h Doing this in its own commit so the intent of the previous change is clearer. --- .../Plugins/Process/Utility/AuxVector.h | 30 +-- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lldb/source/Plugins/Process/Utility/AuxVector.h b/lldb/source/Plugins/Process/Utility/AuxVector.h index 237c120a426941..9e489b05ab5ee6 100644 --- a/lldb/source/Plugins/Process/Utility/AuxVector.h +++ b/lldb/source/Plugins/Process/Utility/AuxVector.h @@ -28,21 +28,21 @@ class AuxVector { /// some entries to the Linux AT_ value so that LLDB only has to use /// the constants listed here when asking the AuxVector for a value. enum EntryType { -AUXV_AT_NULL = 0, ///< End of auxv. -AUXV_AT_IGNORE = 1,///< Ignore entry. -AUXV_AT_EXECFD = 2,///< File descriptor of program. -AUXV_AT_PHDR = 3, ///< Program headers. -AUXV_AT_PHENT = 4, ///< Size of program header. -AUXV_AT_PHNUM = 5, ///< Number of program headers. -AUXV_AT_PAGESZ = 6,///< Page size. -AUXV_AT_BASE = 7, ///< Interpreter base address. -AUXV_AT_FLAGS = 8, ///< Flags. -AUXV_AT_ENTRY = 9, ///< Program entry point. -AUXV_AT_NOTELF = 10, ///< Set if program is not an ELF. -AUXV_AT_UID = 11, ///< UID. -AUXV_AT_EUID = 12, ///< Effective UID. -AUXV_AT_GID = 13, ///< GID. -AUXV_AT_EGID = 14, ///< Effective GID. +AUXV_AT_NULL = 0,///< End of auxv. +AUXV_AT_IGNORE = 1, ///< Ignore entry. +AUXV_AT_EXECFD = 2, ///< File descriptor of program. +AUXV_AT_PHDR = 3,///< Program headers. +AUXV_AT_PHENT = 4, ///< Size of program header. +AUXV_AT_PHNUM = 5, ///< Number of program headers. +AUXV_AT_PAGESZ = 6, ///< Page size. +AUXV_AT_BASE = 7,//
[Lldb-commits] [lldb] [lldb] clang-format AuxVector.h (PR #85057)
DavidSpickett wrote: This is a stacked PR, first commit here is https://github.com/llvm/llvm-project/pull/84147. https://github.com/llvm/llvm-project/pull/85057 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] clang-format AuxVector.h (PR #85057)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: David Spickett (DavidSpickett) Changes Doing this in its own commit so the intent of the previous change is clearer. --- Full diff: https://github.com/llvm/llvm-project/pull/85057.diff 1 Files Affected: - (modified) lldb/source/Plugins/Process/Utility/AuxVector.h (+30-17) ``diff diff --git a/lldb/source/Plugins/Process/Utility/AuxVector.h b/lldb/source/Plugins/Process/Utility/AuxVector.h index 3b0f55d35e5d11..9e489b05ab5ee6 100644 --- a/lldb/source/Plugins/Process/Utility/AuxVector.h +++ b/lldb/source/Plugins/Process/Utility/AuxVector.h @@ -20,25 +20,34 @@ class AuxVector { AuxVector(const lldb_private::DataExtractor &data); /// Constants describing the type of entry. - /// On Linux, running "LD_SHOW_AUXV=1 ./executable" will spew AUX + /// On Linux and FreeBSD, running "LD_SHOW_AUXV=1 ./executable" will spew AUX /// information. Added AUXV prefix to avoid potential conflicts with system- - /// defined macros + /// defined macros. For FreeBSD, the numbers can be found in sys/elf_common.h. + /// + /// Linux and FreeBSD values diverge, so the FreeBSD classes will convert + /// some entries to the Linux AT_ value so that LLDB only has to use + /// the constants listed here when asking the AuxVector for a value. enum EntryType { -AUXV_AT_NULL = 0, ///< End of auxv. -AUXV_AT_IGNORE = 1,///< Ignore entry. -AUXV_AT_EXECFD = 2,///< File descriptor of program. -AUXV_AT_PHDR = 3, ///< Program headers. -AUXV_AT_PHENT = 4, ///< Size of program header. -AUXV_AT_PHNUM = 5, ///< Number of program headers. -AUXV_AT_PAGESZ = 6,///< Page size. -AUXV_AT_BASE = 7, ///< Interpreter base address. -AUXV_AT_FLAGS = 8, ///< Flags. -AUXV_AT_ENTRY = 9, ///< Program entry point. -AUXV_AT_NOTELF = 10, ///< Set if program is not an ELF. -AUXV_AT_UID = 11, ///< UID. -AUXV_AT_EUID = 12, ///< Effective UID. -AUXV_AT_GID = 13, ///< GID. -AUXV_AT_EGID = 14, ///< Effective GID. +AUXV_AT_NULL = 0,///< End of auxv. +AUXV_AT_IGNORE = 1, ///< Ignore entry. +AUXV_AT_EXECFD = 2, ///< File descriptor of program. +AUXV_AT_PHDR = 3,///< Program headers. +AUXV_AT_PHENT = 4, ///< Size of program header. +AUXV_AT_PHNUM = 5, ///< Number of program headers. +AUXV_AT_PAGESZ = 6, ///< Page size. +AUXV_AT_BASE = 7,///< Interpreter base address. +AUXV_AT_FLAGS = 8, ///< Flags. +AUXV_AT_ENTRY = 9, ///< Program entry point. +AUXV_AT_NOTELF = 10, ///< Set if program is not an ELF. +AUXV_AT_UID = 11,///< UID. +AUXV_AT_EUID = 12, ///< Effective UID. +AUXV_AT_GID = 13,///< GID. +AUXV_AT_EGID = 14, ///< Effective GID. + +// At this point Linux and FreeBSD diverge and many of the following values +// are Linux specific. If you use them make sure you are in Linux specific +// code or they have the same value on other platforms. + AUXV_AT_CLKTCK = 17, ///< Clock frequency (e.g. times(2)). AUXV_AT_PLATFORM = 15, ///< String identifying platform. AUXV_AT_HWCAP = @@ -60,6 +69,10 @@ class AuxVector { AUXV_AT_L1D_CACHESHAPE = 35, AUXV_AT_L2_CACHESHAPE = 36, AUXV_AT_L3_CACHESHAPE = 37, + +// Platform specific values which may overlap the Linux values. + +AUXV_FREEBSD_AT_HWCAP = 25, ///< FreeBSD specific AT_HWCAP value. }; std::optional GetAuxValue(enum EntryType entry_type) const; `` https://github.com/llvm/llvm-project/pull/85057 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] [lldb][FreeBSD][AArch64] Enable register field detection (PR #85058)
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/85058 This extends the existing register fields support from AArch64 Linux to AArch64 FreeBSD. So you will now see output like this: ``` (lldb) register read cpsr cpsr = 0x6200 = (N = 0, Z = 1, C = 1, V = 0, DIT = 0, SS = 0, IL = 0, SSBS = 0, D = 1, A = 0, I = 0, F = 0, nRW = 0, EL = 0, SP = 0) ``` Linux and FreeBSD both have HWCAP/HWCAP2 so the detection mechanism is the same and I've renamed the detector class to reflect that. I have confirmed that FreeBSD's treatment of CPSR (spsr as the kernel calls it) is similair enough that we can use the same field information. (see `sys/arm64/include/armreg.h` and `PSR_SETTABLE_64`) For testing I've enabled the same live process test as Linux and added a shell test using an existing FreeBSD core file. Note that the latter does not need XML support because when reading a core file we are not sending the information via target.xml, it's just internal to LLDB. The `svcr` and `mte_ctrl` registers will not appear on FreeBSD at all so I've not made their information conditional, it'll just never be used. >From a251b494614a0700f424c2bedebcabd2e053a653 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 6 Mar 2024 09:08:25 + Subject: [PATCH 1/3] [lldb][FreeBSD] Add FreeBSD specific AT_HWCAP2 value While adding register fields I realised that the AUXV values for Linux and FreeBSD disagree here. So I've added a FreeBSD specific HWCAP2 value that I can use from FreeBSD specific code. The alternative is translating GetAuxValue calls depending on platform, which requires that we know what we are at all times. Another way would be to convert the entries' values when we construct the AuxVector but the platform specific call that reads the data just returns a raw array. So adding another layer here is more disruption. --- lldb/source/Plugins/Process/Utility/AuxVector.h | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lldb/source/Plugins/Process/Utility/AuxVector.h b/lldb/source/Plugins/Process/Utility/AuxVector.h index 3b0f55d35e5d11..237c120a426941 100644 --- a/lldb/source/Plugins/Process/Utility/AuxVector.h +++ b/lldb/source/Plugins/Process/Utility/AuxVector.h @@ -20,9 +20,13 @@ class AuxVector { AuxVector(const lldb_private::DataExtractor &data); /// Constants describing the type of entry. - /// On Linux, running "LD_SHOW_AUXV=1 ./executable" will spew AUX + /// On Linux and FreeBSD, running "LD_SHOW_AUXV=1 ./executable" will spew AUX /// information. Added AUXV prefix to avoid potential conflicts with system- - /// defined macros + /// defined macros. For FreeBSD, the numbers can be found in sys/elf_common.h. + /// + /// Linux and FreeBSD values diverge, so the FreeBSD classes will convert + /// some entries to the Linux AT_ value so that LLDB only has to use + /// the constants listed here when asking the AuxVector for a value. enum EntryType { AUXV_AT_NULL = 0, ///< End of auxv. AUXV_AT_IGNORE = 1,///< Ignore entry. @@ -39,6 +43,11 @@ class AuxVector { AUXV_AT_EUID = 12, ///< Effective UID. AUXV_AT_GID = 13, ///< GID. AUXV_AT_EGID = 14, ///< Effective GID. + +// At this point Linux and FreeBSD diverge and many of the following values +// are Linux specific. If you use them make sure you are in Linux specific +// code or they have the same value on other platforms. + AUXV_AT_CLKTCK = 17, ///< Clock frequency (e.g. times(2)). AUXV_AT_PLATFORM = 15, ///< String identifying platform. AUXV_AT_HWCAP = @@ -60,6 +69,10 @@ class AuxVector { AUXV_AT_L1D_CACHESHAPE = 35, AUXV_AT_L2_CACHESHAPE = 36, AUXV_AT_L3_CACHESHAPE = 37, + +// Platform specific values which may overlap the Linux values. + +AUXV_FREEBSD_AT_HWCAP = 25, ///< FreeBSD specific AT_HWCAP value. }; std::optional GetAuxValue(enum EntryType entry_type) const; >From 546c7a728041db2e6f55bc6bce7231640da85bee Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 6 Mar 2024 09:13:37 + Subject: [PATCH 2/3] [lldb] clang-format AuxVector.h Doing this in its own commit so the intent of the previous change is clearer. --- .../Plugins/Process/Utility/AuxVector.h | 30 +-- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lldb/source/Plugins/Process/Utility/AuxVector.h b/lldb/source/Plugins/Process/Utility/AuxVector.h index 237c120a426941..9e489b05ab5ee6 100644 --- a/lldb/source/Plugins/Process/Utility/AuxVector.h +++ b/lldb/source/Plugins/Process/Utility/AuxVector.h @@ -28,21 +28,21 @@ class AuxVector { /// some entries to the Linux AT_ value so that LLDB only has to use /// the constants listed here when asking the AuxVector for a value. enum EntryType { -AUXV_AT_NULL = 0, ///< End of auxv. -AUXV_AT_IGNORE = 1,///< Ignore entry. -AUXV_AT_EXECFD = 2,///< File des
[Lldb-commits] [lldb] [llvm] [lldb][FreeBSD][AArch64] Enable register field detection (PR #85058)
DavidSpickett wrote: This is a stacked PR, the first two commits are https://github.com/llvm/llvm-project/pull/84147 and https://github.com/llvm/llvm-project/pull/85057. https://github.com/llvm/llvm-project/pull/85058 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [llvm] [lldb][FreeBSD][AArch64] Enable register field detection (PR #85058)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: David Spickett (DavidSpickett) Changes This extends the existing register fields support from AArch64 Linux to AArch64 FreeBSD. So you will now see output like this: ``` (lldb) register read cpsr cpsr = 0x6200 = (N = 0, Z = 1, C = 1, V = 0, DIT = 0, SS = 0, IL = 0, SSBS = 0, D = 1, A = 0, I = 0, F = 0, nRW = 0, EL = 0, SP = 0) ``` Linux and FreeBSD both have HWCAP/HWCAP2 so the detection mechanism is the same and I've renamed the detector class to reflect that. I have confirmed that FreeBSD's treatment of CPSR (spsr as the kernel calls it) is similair enough that we can use the same field information. (see `sys/arm64/include/armreg.h` and `PSR_SETTABLE_64`) For testing I've enabled the same live process test as Linux and added a shell test using an existing FreeBSD core file. Note that the latter does not need XML support because when reading a core file we are not sending the information via target.xml, it's just internal to LLDB. The `svcr` and `mte_ctrl` registers will not appear on FreeBSD at all so I've not made their information conditional, it'll just never be used. --- Patch is 31.18 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/85058.diff 20 Files Affected: - (modified) lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h (+2-3) - (modified) lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp (+2-2) - (modified) lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp (+22-2) - (modified) lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h (+1-1) - (modified) lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_mips64.cpp (+2-2) - (modified) lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.cpp (+2-2) - (modified) lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86_64.cpp (+2-2) - (modified) lldb/source/Plugins/Process/FreeBSD/NativeThreadFreeBSD.cpp (+4) - (modified) lldb/source/Plugins/Process/FreeBSD/NativeThreadFreeBSD.h (+2) - (modified) lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp (+8-8) - (modified) lldb/source/Plugins/Process/Utility/AuxVector.h (+30-17) - (modified) lldb/source/Plugins/Process/Utility/CMakeLists.txt (+1-1) - (renamed) lldb/source/Plugins/Process/Utility/RegisterFlagsDetector_arm64.cpp (+24-22) - (renamed) lldb/source/Plugins/Process/Utility/RegisterFlagsDetector_arm64.h (+10-8) - (modified) lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp (+10-8) - (modified) lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h (+2-2) - (modified) lldb/test/API/commands/register/register/register_command/TestRegisters.py (+1-1) - (added) lldb/test/Shell/Register/Core/aarch64-freebsd-register-fields.test (+15) - (modified) llvm/docs/ReleaseNotes.rst (+3) - (modified) llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn (+1-1) ``diff diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h index 484beac999..b7f659ef24de2c 100644 --- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h +++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h @@ -9,14 +9,13 @@ #ifndef lldb_NativeRegisterContextFreeBSD_h #define lldb_NativeRegisterContextFreeBSD_h -#include "lldb/Host/common/NativeThreadProtocol.h" - #include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h" namespace lldb_private { namespace process_freebsd { class NativeProcessFreeBSD; +class NativeThreadFreeBSD; class NativeRegisterContextFreeBSD : public virtual NativeRegisterContextRegisterInfo { @@ -28,7 +27,7 @@ class NativeRegisterContextFreeBSD // executable. static NativeRegisterContextFreeBSD * CreateHostNativeRegisterContextFreeBSD(const ArchSpec &target_arch, - NativeThreadProtocol &native_thread); + NativeThreadFreeBSD &native_thread); virtual llvm::Error CopyHardwareWatchpointsFrom(NativeRegisterContextFreeBSD &source) = 0; diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp index 2c50176643878d..f19085600d6c93 100644 --- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp @@ -29,12 +29,12 @@ using namespace lldb_private::process_freebsd; NativeRegisterContextFreeBSD * NativeRegisterContextFreeBSD::CreateHostNativeRegisterContextFreeBSD( -const ArchSpec &target_arch, NativeThreadProtocol &native_thread) { +const ArchSpec &target_arch, NativeThreadFreeBSD &native_thread)
[Lldb-commits] [lldb] [LLDB] Add lldb-python-scripts to the things installed on Linux. (PR #85080)
https://github.com/al45tair created https://github.com/llvm/llvm-project/pull/85080 We should be installing the python scripts here. rdar://123436512 >From 87d1f8011683499d6c225c1b855cec4c10dbb70e Mon Sep 17 00:00:00 2001 From: Alastair Houghton Date: Thu, 22 Feb 2024 11:49:30 + Subject: [PATCH] [LLDB] Add lldb-python-scripts to the things installed on Linux. We should be installing the python scripts here. rdar://123436512 --- lldb/cmake/caches/Apple-lldb-Linux.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/lldb/cmake/caches/Apple-lldb-Linux.cmake b/lldb/cmake/caches/Apple-lldb-Linux.cmake index 13d3839f852f61..b2d3cf595fe18d 100644 --- a/lldb/cmake/caches/Apple-lldb-Linux.cmake +++ b/lldb/cmake/caches/Apple-lldb-Linux.cmake @@ -5,4 +5,5 @@ set(LLVM_DISTRIBUTION_COMPONENTS liblldb lldb-argdumper lldb-server + lldb-python-scripts CACHE STRING "") ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add lldb-python-scripts to the things installed on Linux. (PR #85080)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Alastair Houghton (al45tair) Changes We should be installing the python scripts here. rdar://123436512 --- Full diff: https://github.com/llvm/llvm-project/pull/85080.diff 1 Files Affected: - (modified) lldb/cmake/caches/Apple-lldb-Linux.cmake (+1) ``diff diff --git a/lldb/cmake/caches/Apple-lldb-Linux.cmake b/lldb/cmake/caches/Apple-lldb-Linux.cmake index 13d3839f852f61..b2d3cf595fe18d 100644 --- a/lldb/cmake/caches/Apple-lldb-Linux.cmake +++ b/lldb/cmake/caches/Apple-lldb-Linux.cmake @@ -5,4 +5,5 @@ set(LLVM_DISTRIBUTION_COMPONENTS liblldb lldb-argdumper lldb-server + lldb-python-scripts CACHE STRING "") `` https://github.com/llvm/llvm-project/pull/85080 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add lldb-python-scripts to the things installed on Linux. (PR #85080)
al45tair wrote: This is a cherry pick of https://github.com/apple/llvm-project/pull/8257. https://github.com/llvm/llvm-project/pull/85080 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] eb21ee4 - [lldb][test] Disable other runlocker test on AArch64 Linux
Author: David Spickett Date: 2024-03-13T14:15:30Z New Revision: eb21ee49cff081911d99d29ba887c1715fc2b8fc URL: https://github.com/llvm/llvm-project/commit/eb21ee49cff081911d99d29ba887c1715fc2b8fc DIFF: https://github.com/llvm/llvm-project/commit/eb21ee49cff081911d99d29ba887c1715fc2b8fc.diff LOG: [lldb][test] Disable other runlocker test on AArch64 Linux Flaky on the bot: https://lab.llvm.org/buildbot/#/builders/96/builds/54435 Added: Modified: lldb/test/API/python_api/run_locker/TestRunLocker.py Removed: diff --git a/lldb/test/API/python_api/run_locker/TestRunLocker.py b/lldb/test/API/python_api/run_locker/TestRunLocker.py index 10832840ac0955..4e0dd26bff70d2 100644 --- a/lldb/test/API/python_api/run_locker/TestRunLocker.py +++ b/lldb/test/API/python_api/run_locker/TestRunLocker.py @@ -15,6 +15,8 @@ class TestRunLocker(TestBase): NO_DEBUG_INFO_TESTCASE = True @expectedFailureAll(oslist=["windows"]) +# Is flaky on Linux AArch64 buildbot. +@skipIf(oslist=["linux"], archs=["aarch64"]) def test_run_locker(self): """Test that the run locker is set correctly when we launch""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 4e49ee5 - [lldb][Test] Disable ConcurrentVFork tests on Arm/AArch64 Linux
Author: David Spickett Date: 2024-03-13T14:30:40Z New Revision: 4e49ee55c587637e17dec7a72b9ce86d85f8f241 URL: https://github.com/llvm/llvm-project/commit/4e49ee55c587637e17dec7a72b9ce86d85f8f241 DIFF: https://github.com/llvm/llvm-project/commit/4e49ee55c587637e17dec7a72b9ce86d85f8f241.diff LOG: [lldb][Test] Disable ConcurrentVFork tests on Arm/AArch64 Linux They are either flaky, or not cleaning up after themselves. See https://github.com/llvm/llvm-project/issues/85084. Added: Modified: lldb/test/API/functionalities/fork/concurrent_vfork/TestConcurrentVFork.py Removed: diff --git a/lldb/test/API/functionalities/fork/concurrent_vfork/TestConcurrentVFork.py b/lldb/test/API/functionalities/fork/concurrent_vfork/TestConcurrentVFork.py index 2dcbb728549fb4..1790bd497f4e6b 100644 --- a/lldb/test/API/functionalities/fork/concurrent_vfork/TestConcurrentVFork.py +++ b/lldb/test/API/functionalities/fork/concurrent_vfork/TestConcurrentVFork.py @@ -48,6 +48,8 @@ def follow_child_helper(self, use_fork, call_exec): self.expect("continue", patterns=[r"exited with status = 1[0-4]"]) @skipUnlessPlatform(["linux"]) +# See https://github.com/llvm/llvm-project/issues/85084. +@skipIf(oslist=["linux"], archs=["aarch64", "arm"]) def test_follow_parent_vfork_no_exec(self): """ Make sure that debugging concurrent vfork() from multiple threads won't crash lldb during follow-parent. @@ -56,6 +58,8 @@ def test_follow_parent_vfork_no_exec(self): self.follow_parent_helper(use_fork=False, call_exec=False) @skipUnlessPlatform(["linux"]) +# See https://github.com/llvm/llvm-project/issues/85084. +@skipIf(oslist=["linux"], archs=["aarch64", "arm"]) def test_follow_parent_fork_no_exec(self): """ Make sure that debugging concurrent fork() from multiple threads won't crash lldb during follow-parent. @@ -64,6 +68,8 @@ def test_follow_parent_fork_no_exec(self): self.follow_parent_helper(use_fork=True, call_exec=False) @skipUnlessPlatform(["linux"]) +# See https://github.com/llvm/llvm-project/issues/85084. +@skipIf(oslist=["linux"], archs=["aarch64", "arm"]) def test_follow_parent_vfork_call_exec(self): """ Make sure that debugging concurrent vfork() from multiple threads won't crash lldb during follow-parent. @@ -72,6 +78,8 @@ def test_follow_parent_vfork_call_exec(self): self.follow_parent_helper(use_fork=False, call_exec=True) @skipUnlessPlatform(["linux"]) +# See https://github.com/llvm/llvm-project/issues/85084. +@skipIf(oslist=["linux"], archs=["aarch64", "arm"]) def test_follow_parent_fork_call_exec(self): """ Make sure that debugging concurrent vfork() from multiple threads won't crash lldb during follow-parent. @@ -80,6 +88,8 @@ def test_follow_parent_fork_call_exec(self): self.follow_parent_helper(use_fork=True, call_exec=True) @skipUnlessPlatform(["linux"]) +# See https://github.com/llvm/llvm-project/issues/85084. +@skipIf(oslist=["linux"], archs=["aarch64", "arm"]) def test_follow_child_vfork_no_exec(self): """ Make sure that debugging concurrent vfork() from multiple threads won't crash lldb during follow-child. @@ -88,6 +98,8 @@ def test_follow_child_vfork_no_exec(self): self.follow_child_helper(use_fork=False, call_exec=False) @skipUnlessPlatform(["linux"]) +# See https://github.com/llvm/llvm-project/issues/85084. +@skipIf(oslist=["linux"], archs=["aarch64", "arm"]) def test_follow_child_fork_no_exec(self): """ Make sure that debugging concurrent fork() from multiple threads won't crash lldb during follow-child. @@ -96,6 +108,8 @@ def test_follow_child_fork_no_exec(self): self.follow_child_helper(use_fork=True, call_exec=False) @skipUnlessPlatform(["linux"]) +# See https://github.com/llvm/llvm-project/issues/85084. +@skipIf(oslist=["linux"], archs=["aarch64", "arm"]) def test_follow_child_vfork_call_exec(self): """ Make sure that debugging concurrent vfork() from multiple threads won't crash lldb during follow-child. @@ -104,6 +118,8 @@ def test_follow_child_vfork_call_exec(self): self.follow_child_helper(use_fork=False, call_exec=True) @skipUnlessPlatform(["linux"]) +# See https://github.com/llvm/llvm-project/issues/85084. +@skipIf(oslist=["linux"], archs=["aarch64", "arm"]) def test_follow_child_fork_call_exec(self): """ Make sure that debugging concurrent fork() from multiple threads won't crash lldb during follow-child. ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add lldb-python-scripts to the things installed on Linux. (PR #85080)
https://github.com/JDevlieghere approved this pull request. https://github.com/llvm/llvm-project/pull/85080 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] c3eccf0 - Avoid a potential exit(1) in LLVMContext::diagnose() (#84992)
Author: Adrian Prantl Date: 2024-03-13T08:53:13-07:00 New Revision: c3eccf03b365a705bc8dc043217478a82bc37a4d URL: https://github.com/llvm/llvm-project/commit/c3eccf03b365a705bc8dc043217478a82bc37a4d DIFF: https://github.com/llvm/llvm-project/commit/c3eccf03b365a705bc8dc043217478a82bc37a4d.diff LOG: Avoid a potential exit(1) in LLVMContext::diagnose() (#84992) by handling *all* errors in IRExecDiagnosticHandler. The function that call this handles all unhandled errors with an `exit(1)`. rdar://124459751 I don't really have a testcase for this, since the crash report I got for this involved the Swift language plugin. Added: Modified: lldb/source/Expression/IRExecutionUnit.cpp Removed: diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp index e4e131d70d4319..cb9bee8733e15d 100644 --- a/lldb/source/Expression/IRExecutionUnit.cpp +++ b/lldb/source/Expression/IRExecutionUnit.cpp @@ -212,18 +212,17 @@ struct IRExecDiagnosticHandler : public llvm::DiagnosticHandler { Status *err; IRExecDiagnosticHandler(Status *err) : err(err) {} bool handleDiagnostics(const llvm::DiagnosticInfo &DI) override { -if (DI.getKind() == llvm::DK_SrcMgr) { +if (DI.getSeverity() == llvm::DS_Error) { const auto &DISM = llvm::cast(DI); if (err && err->Success()) { err->SetErrorToGenericError(); err->SetErrorStringWithFormat( -"Inline assembly error: %s", +"IRExecution error: %s", DISM.getSMDiag().getMessage().str().c_str()); } - return true; } -return false; +return true; } }; } // namespace ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Avoid a potential exit(1) in LLVMContext::diagnose() (PR #84992)
https://github.com/adrian-prantl closed https://github.com/llvm/llvm-project/pull/84992 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Add `pexpect` category for tests that `import pexpect` (PR #84860)
https://github.com/JDevlieghere approved this pull request. +1 https://github.com/llvm/llvm-project/pull/84860 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Add `pexpect` category for tests that `import pexpect` (PR #84860)
https://github.com/mysterymath approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/84860 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 8bed754 - [lldb][test] Add `pexpect` category for tests that `import pexpect` (#84860)
Author: Jordan Rupprecht Date: 2024-03-13T15:16:15-05:00 New Revision: 8bed754c2f965c8cbbb050be6f650b78f7fd78a6 URL: https://github.com/llvm/llvm-project/commit/8bed754c2f965c8cbbb050be6f650b78f7fd78a6 DIFF: https://github.com/llvm/llvm-project/commit/8bed754c2f965c8cbbb050be6f650b78f7fd78a6.diff LOG: [lldb][test] Add `pexpect` category for tests that `import pexpect` (#84860) Instead of directly annotating pexpect-based tests with `@skipIfWindows`, we can tag them with a new `pexpect` category. We still automatically skip windows behavior by adding `pexpect` to the skip category list if the platform is windows, but also allow non-Windows users to skip them by configuring cmake with `-DLLDB_TEST_USER_ARGS=--skip-category=pexpect` As a prerequisite, remove the restriction that `@add_test_categories` can only apply to test cases, and we make the test runner look for categories on both the class and the test method. Added: Modified: lldb/packages/Python/lldbsuite/test/decorators.py lldb/packages/Python/lldbsuite/test/dotest.py lldb/packages/Python/lldbsuite/test/lldbpexpect.py lldb/packages/Python/lldbsuite/test/test_categories.py lldb/packages/Python/lldbsuite/test/test_result.py lldb/test/API/benchmarks/expression/TestExpressionCmd.py lldb/test/API/benchmarks/expression/TestRepeatedExprs.py lldb/test/API/benchmarks/frame_variable/TestFrameVariableResponse.py lldb/test/API/benchmarks/startup/TestStartupDelays.py lldb/test/API/benchmarks/stepping/TestSteppingSpeed.py lldb/test/API/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py lldb/test/API/terminal/TestSTTYBeforeAndAfter.py Removed: diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py index b691f82b90652c..8e13aa6a13882f 100644 --- a/lldb/packages/Python/lldbsuite/test/decorators.py +++ b/lldb/packages/Python/lldbsuite/test/decorators.py @@ -409,10 +409,6 @@ def add_test_categories(cat): cat = test_categories.validate(cat, True) def impl(func): -if isinstance(func, type) and issubclass(func, unittest.TestCase): -raise Exception( -"@add_test_categories can only be used to decorate a test method" -) try: if hasattr(func, "categories"): cat.extend(func.categories) diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index 291d7bad5c0897..8c29145ecc5272 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -914,6 +914,18 @@ def checkForkVForkSupport(): configuration.skip_categories.append("fork") +def checkPexpectSupport(): +from lldbsuite.test import lldbplatformutil + +platform = lldbplatformutil.getPlatform() + +# llvm.org/pr22274: need a pexpect replacement for windows +if platform in ["windows"]: +if configuration.verbose: +print("pexpect tests will be skipped because of unsupported platform") +configuration.skip_categories.append("pexpect") + + def run_suite(): # On MacOS X, check to make sure that domain for com.apple.DebugSymbols defaults # does not exist before proceeding to running the test suite. @@ -1013,6 +1025,7 @@ def run_suite(): checkDebugServerSupport() checkObjcSupport() checkForkVForkSupport() +checkPexpectSupport() skipped_categories_list = ", ".join(configuration.skip_categories) print( diff --git a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py index 9d216d90307473..998a080565b6b3 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py +++ b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py @@ -10,7 +10,7 @@ @skipIfRemote -@skipIfWindows # llvm.org/pr22274: need a pexpect replacement for windows +@add_test_categories(["pexpect"]) class PExpectTest(TestBase): NO_DEBUG_INFO_TESTCASE = True PROMPT = "(lldb) " diff --git a/lldb/packages/Python/lldbsuite/test/test_categories.py b/lldb/packages/Python/lldbsuite/test/test_categories.py index 3f8de175e29df3..036bda9c957d11 100644 --- a/lldb/packages/Python/lldbsuite/test/test_categories.py +++ b/lldb/packages/Python/lldbsuite/test/test_categories.py @@ -33,6 +33,7 @@ "lldb-server": "Tests related to lldb-server", "lldb-dap": "Tests for the Debug Adaptor Protocol with lldb-dap", "llgs": "Tests for the gdb-server functionality of lldb-server", +"pexpect": "Tests requiring the pexpect library to be available", "objc": "Tests related to the Objective-C programming language support", "pyapi": "Tests related to the Python API", "std-module": "Tests related to importing the std module", diff --git a/lldb/packages/Python/lldbsuite/test/test_
[Lldb-commits] [lldb] [lldb][test] Add `pexpect` category for tests that `import pexpect` (PR #84860)
https://github.com/rupprecht closed https://github.com/llvm/llvm-project/pull/84860 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] XFAIL TestIndirectSymbols on darwin (PR #85127)
https://github.com/kastiglione created https://github.com/llvm/llvm-project/pull/85127 None >From 5d0a5c8721766544067ccd8e169a5e2effeba981 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Wed, 13 Mar 2024 13:30:20 -0700 Subject: [PATCH] [lldb] XFAIL TestIndirectSymbols on darwin --- lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py b/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py index fbe6db9f892d55..ad4cb4b12c796a 100644 --- a/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py +++ b/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py @@ -16,6 +16,7 @@ def setUp(self): @skipUnlessDarwin @add_test_categories(["pyapi"]) +@expectedFailureDarwin("rdar://120796553") def test_with_python_api(self): """Test stepping and setting breakpoints in indirect and re-exported symbols.""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] XFAIL TestIndirectSymbols on darwin (PR #85127)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Dave Lee (kastiglione) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/85127.diff 1 Files Affected: - (modified) lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py (+1) ``diff diff --git a/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py b/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py index fbe6db9f892d55..ad4cb4b12c796a 100644 --- a/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py +++ b/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py @@ -16,6 +16,7 @@ def setUp(self): @skipUnlessDarwin @add_test_categories(["pyapi"]) +@expectedFailureDarwin("rdar://120796553") def test_with_python_api(self): """Test stepping and setting breakpoints in indirect and re-exported symbols.""" self.build() `` https://github.com/llvm/llvm-project/pull/85127 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] XFAIL TestIndirectSymbols on darwin (PR #85127)
https://github.com/kastiglione edited https://github.com/llvm/llvm-project/pull/85127 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] e2b8cc1 - [lldb] XFAIL TestIndirectSymbols on darwin (#85127)
Author: Dave Lee Date: 2024-03-13T13:34:01-07:00 New Revision: e2b8cc11b307aaf2717c344cbaa1d3eb5a4e0401 URL: https://github.com/llvm/llvm-project/commit/e2b8cc11b307aaf2717c344cbaa1d3eb5a4e0401 DIFF: https://github.com/llvm/llvm-project/commit/e2b8cc11b307aaf2717c344cbaa1d3eb5a4e0401.diff LOG: [lldb] XFAIL TestIndirectSymbols on darwin (#85127) ``` AssertionError: 'main' != 'call_through_indirect_hidden' ``` Added: Modified: lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py Removed: diff --git a/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py b/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py index fbe6db9f892d55..ad4cb4b12c796a 100644 --- a/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py +++ b/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py @@ -16,6 +16,7 @@ def setUp(self): @skipUnlessDarwin @add_test_categories(["pyapi"]) +@expectedFailureDarwin("rdar://120796553") def test_with_python_api(self): """Test stepping and setting breakpoints in indirect and re-exported symbols.""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] XFAIL TestIndirectSymbols on darwin (PR #85127)
https://github.com/kastiglione closed https://github.com/llvm/llvm-project/pull/85127 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Skip TestIndirectSymbols (PR #85133)
https://github.com/kastiglione created https://github.com/llvm/llvm-project/pull/85133 Correction to cb8f3837e2311c369ef24a077a0c34e4ff56c08f >From f5fb7236ad4df2fe9322ab00e4839e92ef29a8d3 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Wed, 13 Mar 2024 14:09:20 -0700 Subject: [PATCH] [lldb] Skip TestIndirectSymbols Correction to cb8f3837e2311c369ef24a077a0c34e4ff56c08f --- lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py b/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py index ad4cb4b12c796a..c4bbedc9289130 100644 --- a/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py +++ b/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py @@ -16,7 +16,7 @@ def setUp(self): @skipUnlessDarwin @add_test_categories(["pyapi"]) -@expectedFailureDarwin("rdar://120796553") +@skipIf(bugnumber="rdar://120796553") def test_with_python_api(self): """Test stepping and setting breakpoints in indirect and re-exported symbols.""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Skip TestIndirectSymbols (PR #85133)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Dave Lee (kastiglione) Changes Correction to cb8f3837e2311c369ef24a077a0c34e4ff56c08f --- Full diff: https://github.com/llvm/llvm-project/pull/85133.diff 1 Files Affected: - (modified) lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py (+1-1) ``diff diff --git a/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py b/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py index ad4cb4b12c796a..c4bbedc9289130 100644 --- a/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py +++ b/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py @@ -16,7 +16,7 @@ def setUp(self): @skipUnlessDarwin @add_test_categories(["pyapi"]) -@expectedFailureDarwin("rdar://120796553") +@skipIf(bugnumber="rdar://120796553") def test_with_python_api(self): """Test stepping and setting breakpoints in indirect and re-exported symbols.""" self.build() `` https://github.com/llvm/llvm-project/pull/85133 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Skip TestIndirectSymbols (PR #85133)
https://github.com/kastiglione edited https://github.com/llvm/llvm-project/pull/85133 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] b49d741 - [lldb] Skip TestIndirectSymbols (#85133)
Author: Dave Lee Date: 2024-03-13T14:15:41-07:00 New Revision: b49d741c0c3bb21b40c925b4c1a717470181eb8d URL: https://github.com/llvm/llvm-project/commit/b49d741c0c3bb21b40c925b4c1a717470181eb8d DIFF: https://github.com/llvm/llvm-project/commit/b49d741c0c3bb21b40c925b4c1a717470181eb8d.diff LOG: [lldb] Skip TestIndirectSymbols (#85133) Correction to e2b8cc11b307aaf2717c344cbaa1d3eb5a4e0401 Added: Modified: lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py Removed: diff --git a/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py b/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py index ad4cb4b12c796a..c4bbedc9289130 100644 --- a/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py +++ b/lldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py @@ -16,7 +16,7 @@ def setUp(self): @skipUnlessDarwin @add_test_categories(["pyapi"]) -@expectedFailureDarwin("rdar://120796553") +@skipIf(bugnumber="rdar://120796553") def test_with_python_api(self): """Test stepping and setting breakpoints in indirect and re-exported symbols.""" self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Skip TestIndirectSymbols (PR #85133)
https://github.com/kastiglione closed https://github.com/llvm/llvm-project/pull/85133 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] [Mach-O] ProcessMachCore needs to strip TBI data from addrs (PR #84998)
https://github.com/jasonmolenda updated https://github.com/llvm/llvm-project/pull/84998 >From 4278537c262b01b1d6432391bd9d8017eb96c60a Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Tue, 12 Mar 2024 17:09:30 -0700 Subject: [PATCH 1/2] [lldb] [Mach-O] ProcessMachCore needs to strip TBI data from addrs Darwin AArch64 application processors are run with Top Byte Ignore mode enabled so metadata may be stored in the top byte, it needs to be ignored when reading/writing memory. David Spickett handled this already in the base class Process::ReadMemory but ProcessMachCore overrides that method (to avoid the memory cache) and did not pick up the same change. I add a test case that creates a pointer with metadata in the top byte and dereferences it with a live process and with a corefile. rdar://123784501 --- .../Process/mach-core/ProcessMachCore.cpp | 2 +- lldb/test/API/macosx/tbi-honored/Makefile | 3 ++ .../API/macosx/tbi-honored/TestTBIHonored.py | 49 +++ lldb/test/API/macosx/tbi-honored/main.c | 13 + 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 lldb/test/API/macosx/tbi-honored/Makefile create mode 100644 lldb/test/API/macosx/tbi-honored/TestTBIHonored.py create mode 100644 lldb/test/API/macosx/tbi-honored/main.c diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp index 3961dcf0fbcc0e..7b9938d4f02020 100644 --- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp +++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp @@ -652,7 +652,7 @@ size_t ProcessMachCore::ReadMemory(addr_t addr, void *buf, size_t size, Status &error) { // Don't allow the caching that lldb_private::Process::ReadMemory does since // in core files we have it all cached our our core file anyway. - return DoReadMemory(addr, buf, size, error); + return DoReadMemory(FixAnyAddress(addr), buf, size, error); } size_t ProcessMachCore::DoReadMemory(addr_t addr, void *buf, size_t size, diff --git a/lldb/test/API/macosx/tbi-honored/Makefile b/lldb/test/API/macosx/tbi-honored/Makefile new file mode 100644 index 00..10495940055b63 --- /dev/null +++ b/lldb/test/API/macosx/tbi-honored/Makefile @@ -0,0 +1,3 @@ +C_SOURCES := main.c + +include Makefile.rules diff --git a/lldb/test/API/macosx/tbi-honored/TestTBIHonored.py b/lldb/test/API/macosx/tbi-honored/TestTBIHonored.py new file mode 100644 index 00..d38685359af6d1 --- /dev/null +++ b/lldb/test/API/macosx/tbi-honored/TestTBIHonored.py @@ -0,0 +1,49 @@ +"""Test that lldb on Darwin ignores metadata in the top byte of addresses.""" + +import os +import re +import subprocess + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestTBIHonored(TestBase): +@no_debug_info_test +@skipUnlessDarwin +@skipIf(archs=no_match(["arm64", "arm64e"])) +@skipIfRemote +def do_variable_access_tests(self, frame): +self.assertEqual( +frame.variables["pb"][0] +.GetChildMemberWithName("p") +.Dereference() +.GetValueAsUnsigned(), +15, +) +addr = frame.variables["pb"][0].GetChildMemberWithName("p").GetValueAsUnsigned() +self.expect("expr -- *pb.p", substrs=["15"]) +self.expect("frame variable *pb.p", substrs=["15"]) +self.expect("expr -- *(int*)0x%x" % addr, substrs=["15"]) + +def test(self): +corefile = self.getBuildArtifact("process.core") +self.build() +(target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( +self, "// break here", lldb.SBFileSpec("main.c") +) + +self.do_variable_access_tests(thread.GetFrameAtIndex(0)) + +self.runCmd("process save-core -s stack " + corefile) +self.dbg.DeleteTarget(target) + +# Now load the corefile +target = self.dbg.CreateTarget("") +process = target.LoadCore(corefile) +thread = process.GetSelectedThread() +self.assertTrue(process.GetSelectedThread().IsValid()) + +self.do_variable_access_tests(thread.GetFrameAtIndex(0)) diff --git a/lldb/test/API/macosx/tbi-honored/main.c b/lldb/test/API/macosx/tbi-honored/main.c new file mode 100644 index 00..3d7ad0b04cd664 --- /dev/null +++ b/lldb/test/API/macosx/tbi-honored/main.c @@ -0,0 +1,13 @@ +#include +#include +union ptrbytes { + int *p; + uint8_t bytes[8]; +}; +int main() { + int c = 15; + union ptrbytes pb; + pb.p = &c; + pb.bytes[7] = 0xfe; + printf("%d\n", *pb.p); // break here +} >From 145e4161a311956ee15c4631667f332d50ef4e0b Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Wed, 13 Mar 2024 15:40:08 -0700 Subject: [PATCH 2/2] Address David Spickett's feedback on the testcase Lots of fixes to the test case for correctness and to mak
[Lldb-commits] [lldb] [lldb] [Mach-O] ProcessMachCore needs to strip TBI data from addrs (PR #84998)
jasonmolenda wrote: Thanks for all the helpful comments as always, David. I updated the test case to fix the issues you identified and added comments that I think make it clearer that it is testing both a live process and a corefile. https://github.com/llvm/llvm-project/pull/84998 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fix dwim-print to not delete non-result persistent variables (PR #85152)
https://github.com/kastiglione created https://github.com/llvm/llvm-project/pull/85152 None >From 970cf82fa3d64c5a4e1b3929c110b42974ef13cd Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Wed, 13 Mar 2024 14:49:23 -0700 Subject: [PATCH] [lldb] Fix dwim-print to not delete non-result persistent variables --- lldb/source/Commands/CommandObjectDWIMPrint.cpp| 12 ++-- lldb/test/API/commands/dwim-print/TestDWIMPrint.py | 12 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lldb/source/Commands/CommandObjectDWIMPrint.cpp b/lldb/source/Commands/CommandObjectDWIMPrint.cpp index b183cb423111fb..5c043dfd101be6 100644 --- a/lldb/source/Commands/CommandObjectDWIMPrint.cpp +++ b/lldb/source/Commands/CommandObjectDWIMPrint.cpp @@ -170,6 +170,14 @@ void CommandObjectDWIMPrint::DoExecute(StringRef command, ExpressionResults expr_result = target.EvaluateExpression( expr, exe_scope, valobj_sp, eval_options, &fixed_expression); +auto persistent_name = valobj_sp->GetName(); +// EvaluateExpression doesn't generate a new persistent result (`$0`) when +// the expression is already just a persistent variable (`$var`). Instead, +// the same persistent variable is reused. Take note of when a persistent +// result is created, to prevent unintentional deletion of a user's +// persistent variable. +bool did_persist_result = persistent_name != expr; + // Only mention Fix-Its if the expression evaluator applied them. // Compiler errors refer to the final expression after applying Fix-It(s). if (!fixed_expression.empty() && target.GetEnableNotifyAboutFixIts()) { @@ -199,9 +207,9 @@ void CommandObjectDWIMPrint::DoExecute(StringRef command, } } - if (suppress_result) + if (did_persist_result && suppress_result) if (auto result_var_sp = -target.GetPersistentVariable(valobj_sp->GetName())) { +target.GetPersistentVariable(persistent_name)) { auto language = valobj_sp->GetPreferredDisplayLanguage(); if (auto *persistent_state = target.GetPersistentExpressionStateForLanguage(language)) diff --git a/lldb/test/API/commands/dwim-print/TestDWIMPrint.py b/lldb/test/API/commands/dwim-print/TestDWIMPrint.py index 040632096c70e7..c650b1e3533e08 100644 --- a/lldb/test/API/commands/dwim-print/TestDWIMPrint.py +++ b/lldb/test/API/commands/dwim-print/TestDWIMPrint.py @@ -146,3 +146,15 @@ def test_void_result(self): self, "// break here", lldb.SBFileSpec("main.c") ) self.expect("dwim-print (void)15", matching=False, patterns=["(?i)error"]) + +def test_preserves_persistent_variables(self): +"""Test dwim-print does not delete persistent variables.""" +self.build() +lldbutil.run_to_source_breakpoint( +self, "// break here", lldb.SBFileSpec("main.c") +) +self.expect("dwim-print int $i = 15") +# Run the same expression twice and verify success. This ensures the +# first command does not delete the persistent variable. +for _ in range(2): +self.expect("dwim-print $i", startstr="(int) 15") ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fix dwim-print to not delete non-result persistent variables (PR #85152)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Dave Lee (kastiglione) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/85152.diff 2 Files Affected: - (modified) lldb/source/Commands/CommandObjectDWIMPrint.cpp (+10-2) - (modified) lldb/test/API/commands/dwim-print/TestDWIMPrint.py (+12) ``diff diff --git a/lldb/source/Commands/CommandObjectDWIMPrint.cpp b/lldb/source/Commands/CommandObjectDWIMPrint.cpp index b183cb423111fb..5c043dfd101be6 100644 --- a/lldb/source/Commands/CommandObjectDWIMPrint.cpp +++ b/lldb/source/Commands/CommandObjectDWIMPrint.cpp @@ -170,6 +170,14 @@ void CommandObjectDWIMPrint::DoExecute(StringRef command, ExpressionResults expr_result = target.EvaluateExpression( expr, exe_scope, valobj_sp, eval_options, &fixed_expression); +auto persistent_name = valobj_sp->GetName(); +// EvaluateExpression doesn't generate a new persistent result (`$0`) when +// the expression is already just a persistent variable (`$var`). Instead, +// the same persistent variable is reused. Take note of when a persistent +// result is created, to prevent unintentional deletion of a user's +// persistent variable. +bool did_persist_result = persistent_name != expr; + // Only mention Fix-Its if the expression evaluator applied them. // Compiler errors refer to the final expression after applying Fix-It(s). if (!fixed_expression.empty() && target.GetEnableNotifyAboutFixIts()) { @@ -199,9 +207,9 @@ void CommandObjectDWIMPrint::DoExecute(StringRef command, } } - if (suppress_result) + if (did_persist_result && suppress_result) if (auto result_var_sp = -target.GetPersistentVariable(valobj_sp->GetName())) { +target.GetPersistentVariable(persistent_name)) { auto language = valobj_sp->GetPreferredDisplayLanguage(); if (auto *persistent_state = target.GetPersistentExpressionStateForLanguage(language)) diff --git a/lldb/test/API/commands/dwim-print/TestDWIMPrint.py b/lldb/test/API/commands/dwim-print/TestDWIMPrint.py index 040632096c70e7..c650b1e3533e08 100644 --- a/lldb/test/API/commands/dwim-print/TestDWIMPrint.py +++ b/lldb/test/API/commands/dwim-print/TestDWIMPrint.py @@ -146,3 +146,15 @@ def test_void_result(self): self, "// break here", lldb.SBFileSpec("main.c") ) self.expect("dwim-print (void)15", matching=False, patterns=["(?i)error"]) + +def test_preserves_persistent_variables(self): +"""Test dwim-print does not delete persistent variables.""" +self.build() +lldbutil.run_to_source_breakpoint( +self, "// break here", lldb.SBFileSpec("main.c") +) +self.expect("dwim-print int $i = 15") +# Run the same expression twice and verify success. This ensures the +# first command does not delete the persistent variable. +for _ in range(2): +self.expect("dwim-print $i", startstr="(int) 15") `` https://github.com/llvm/llvm-project/pull/85152 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fix dwim-print to not delete non-result persistent variables (PR #85152)
https://github.com/kastiglione edited https://github.com/llvm/llvm-project/pull/85152 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fix dwim-print to not delete non-result persistent variables (PR #85152)
@@ -170,6 +170,14 @@ void CommandObjectDWIMPrint::DoExecute(StringRef command, ExpressionResults expr_result = target.EvaluateExpression( expr, exe_scope, valobj_sp, eval_options, &fixed_expression); +auto persistent_name = valobj_sp->GetName(); +// EvaluateExpression doesn't generate a new persistent result (`$0`) when +// the expression is already just a persistent variable (`$var`). Instead, +// the same persistent variable is reused. Take note of when a persistent +// result is created, to prevent unintentional deletion of a user's +// persistent variable. +bool did_persist_result = persistent_name != expr; jimingham wrote: This seems like a really fragile way to test what you want to test, which is whether the result of the expression was a new expression result variable. It might be better to add a "PeekNextPersistentVariableName" that just prints what the next persistent variable would be called but doesn't increment the counter, then assert that the variable you produced is NOT called that? https://github.com/llvm/llvm-project/pull/85152 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits