[Lldb-commits] [lldb] [lldb][AIX] Header Parsing for XCOFF Object File in AIX (PR #116338)

2024-12-13 Thread David Spickett via lldb-commits
@@ -130,19 +164,41 @@ bool ObjectFileXCOFF::MagicBytesMatch(DataBufferSP &data_sp, lldb::addr_t data_length) { lldb_private::DataExtractor data; data.SetData(data_sp, data_offset, data_length); + + // Need to set this as XCOFF is only

[Lldb-commits] [lldb] [lldb][AIX] Header Parsing for XCOFF Object File in AIX (PR #116338)

2024-12-13 Thread David Spickett via lldb-commits
@@ -130,19 +164,41 @@ bool ObjectFileXCOFF::MagicBytesMatch(DataBufferSP &data_sp, lldb::addr_t data_length) { lldb_private::DataExtractor data; data.SetData(data_sp, data_offset, data_length); + + // Need to set this as XCOFF is only

[Lldb-commits] [lldb] [lldb][AIX] Header Parsing for XCOFF Object File in AIX (PR #116338)

2024-12-13 Thread David Spickett via lldb-commits
@@ -10,16 +10,14 @@ #ifndef LLDB_SOURCE_PLUGINS_OBJECTFILE_XCOFF_OBJECTFILEXCOFF_H #define LLDB_SOURCE_PLUGINS_OBJECTFILE_XCOFF_OBJECTFILEXCOFF_H -#include - -#include - #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/ArchSpec.h" #include "lldb/Utility/FileSpec

[Lldb-commits] [lldb] [lldb][AIX] Header Parsing for XCOFF Object File in AIX (PR #116338)

2024-12-13 Thread David Spickett via lldb-commits
@@ -13,7 +13,7 @@ FileHeader: MagicNumber: 0x1F7 NumberOfSections: 1 CreationTime:0 - Flags: 0x + Flags: 0x0002 DavidSpickett wrote: Not sure if we're allowed comments in this YAML. But could you at least confir

[Lldb-commits] [lldb] [lldb][AIX] Header Parsing for XCOFF Object File in AIX (PR #116338)

2024-12-13 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/116338 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][Linux] Moving APIs from HostInfoLinux to HostInfoPosix (PR #119694)

2024-12-13 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett commented: At a glance, this seems like what Pavel (and maybe me, I forget :) ) asked for. Assuming you have a Linux system to test on, please get this to a reviewable point. Remove commented code, all that stuff. If the tests still pass, you should be fine. T

[Lldb-commits] [lldb] [lldb][Linux] Moving APIs from HostInfoLinux to HostInfoPosix (PR #119694)

2024-12-13 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/119694 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][Linux] Moving APIs from HostInfoLinux to HostInfoPosix (PR #119694)

2024-12-13 Thread David Spickett via lldb-commits
@@ -27,6 +30,31 @@ using namespace lldb_private; +namespace { +struct HostInfoPosixFields { + llvm::once_flag m_os_version_once_flag; + llvm::VersionTuple m_os_version; +}; +} // namespace + +llvm::VersionTuple HostInfoPosix::GetOSVersion() { + static HostInfoPosixFields *

[Lldb-commits] [lldb] [lldb][Linux] Moving APIs from HostInfoLinux to HostInfoPosix (PR #119694)

2024-12-13 Thread David Spickett via lldb-commits
@@ -27,6 +30,31 @@ using namespace lldb_private; +namespace { +struct HostInfoPosixFields { + llvm::once_flag m_os_version_once_flag; + llvm::VersionTuple m_os_version; +}; +} // namespace + +llvm::VersionTuple HostInfoPosix::GetOSVersion() { + static HostInfoPosixFields *

[Lldb-commits] [lldb] [lldb][test] Prefer gmake to make and warn for potentially non-GNU make (PR #119573)

2024-12-13 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/119573 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][test] Prefer gmake to make and warn for potentially non-GNU make (PR #119573)

2024-12-13 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/119573 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][test] Prefer gmake to make and warn for potentially non-GNU make (PR #119573)

2024-12-13 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/119573 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][test] Prefer gmake to make and warn for potentially non-GNU make (PR #119573)

2024-12-13 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/119573 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][test] Prefer gmake to make and warn for potentially non-GNU make (PR #119573)

2024-12-13 Thread David Spickett via lldb-commits
DavidSpickett wrote: I've updated it as suggested. The non-GUN check isn't great but as long as it isn't spamming the build logs it should be ok. FreeBSD make's --version is just an empty string (odd, but ok) and all the GNU makes I tried all start with "GNU Make". https://github.com/llvm/llv

[Lldb-commits] [lldb] [lldb][AIX] XCOFF clang-format and other minor changes (PR #119892)

2024-12-13 Thread David Spickett via lldb-commits
DavidSpickett wrote: Please rebase this so it is just one commit to merge into `main`, and limit it just to the clang-format changes. (if I implied it should include the new comments, my apologies) https://github.com/llvm/llvm-project/pull/119892 ___

[Lldb-commits] [lldb] [lldb][AIX] Header Parsing for XCOFF Object File in AIX (PR #116338)

2024-12-13 Thread David Spickett via lldb-commits
@@ -10,16 +10,14 @@ #ifndef LLDB_SOURCE_PLUGINS_OBJECTFILE_XCOFF_OBJECTFILEXCOFF_H #define LLDB_SOURCE_PLUGINS_OBJECTFILE_XCOFF_OBJECTFILEXCOFF_H -#include - -#include - #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/ArchSpec.h" #include "lldb/Utility/FileSpec

[Lldb-commits] [lldb] [lldb][AIX] Header Parsing for XCOFF Object File in AIX (PR #116338)

2024-12-13 Thread David Spickett via lldb-commits
@@ -13,7 +13,7 @@ FileHeader: MagicNumber: 0x1F7 NumberOfSections: 1 CreationTime:0 - Flags: 0x + Flags: 0x0002 DavidSpickett wrote: Ok thanks. I don't see any test files with comments here, they mostly use the

[Lldb-commits] [lldb] [lldb][debugserver] Read/write SME registers on arm64 (PR #119171)

2024-12-19 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/119171 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AIX] GetOpt support in AIX (PR #120574)

2024-12-19 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/120574 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AIX] GetOpt support in AIX (PR #120574)

2024-12-19 Thread David Spickett via lldb-commits
DavidSpickett wrote: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access My understanding is that this also allows you to add reviewers directly, and other non-commit things that are useful. https://github.com/llvm/llvm-project/pull/120574 ___

[Lldb-commits] [lldb] [lldb][AIX] clang-format changes for ProcessLauncherPosixFork.cpp (PR #120459)

2024-12-19 Thread David Spickett via lldb-commits
DavidSpickett wrote: Thanks! https://github.com/llvm/llvm-project/pull/120459 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][debugserver] Read/write SME registers on arm64 (PR #119171)

2024-12-19 Thread David Spickett via lldb-commits
DavidSpickett wrote: I've taken the liberty of repeating the fact that the required APIs are not in a publicly available OS release, at the top of the PR description. Since we had someone on Discord try this and they could not read the registers. Might save a few enthusiasts some time if they

[Lldb-commits] [lldb] [lldb][Linux] Moving APIs from HostInfoLinux to HostInfoPosix (PR #119694)

2024-12-19 Thread David Spickett via lldb-commits
@@ -139,8 +178,38 @@ FileSpec HostInfoPosix::GetDefaultShell() { return FileSpec("/bin/sh"); } +// Keeping the original one for reference +// bool HostInfoPosix::ComputeSupportExeDirectory(FileSpec &file_spec) { +// return ComputePathRelativeToLibrary(file_spec, "/bin"); +/

[Lldb-commits] [lldb] [lldb][Linux] Moving generic APIs from HostInfoLinux to HostInfoPosix (PR #119694)

2024-12-19 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/119694 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][Linux] Moving APIs from HostInfoLinux to HostInfoPosix (PR #119694)

2024-12-19 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/119694 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][Linux] Moving generic APIs from HostInfoLinux to HostInfoPosix (PR #119694)

2024-12-19 Thread David Spickett via lldb-commits
DavidSpickett wrote: Just need to remove the commented code and then I'm happy with this. I also edited your PR description to be ready for merging. @labath should confirm that their final comment was addressed and approve if so. https://github.com/llvm/llvm-project/pull/119694 ___

[Lldb-commits] [lldb] [lldb][AIX] clang-format changes for ProcessLauncherPosixFork.cpp (PR #120459)

2024-12-19 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/120459 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AIX] Introducing ALL_SOURCE macro into driver CMakeLists (PR #120607)

2024-12-20 Thread David Spickett via lldb-commits
DavidSpickett wrote: I assume the macro is `_ALL_SOURCE` with the leading underscore, you put `ALL_SOURCE` in the title and description. I see that https://github.com/llvm/llvm-project/blob/d66f653c8db90d0c643f8f2740bbdc01bf647f18/third-party/unittest/CMakeLists.txt#L18 also does this. https

[Lldb-commits] [lldb] [lldb][AIX] Adding AIX version of ptrace64 (PR #120390)

2024-12-20 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/120390 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AIX] Introducing ALL_SOURCE macro into driver CMakeLists (PR #120607)

2024-12-20 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett approved this pull request. LGTM. Please correct the macro name in the title/description then I'll merge this. https://github.com/llvm/llvm-project/pull/120607 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

[Lldb-commits] [lldb] [LLDB][LoongArch] Add LSX and LASX register definitions and operations (PR #120664)

2024-12-20 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett commented: Please note in the PR description that this is for live processes and core files (at least it looks like it is). I would also like to see test cases for both scenarios. Are your vector registers ever absent? Because in AArch64's case we assume we al

[Lldb-commits] [lldb] [LLDB][LoongArch] Add LSX and LASX register definitions and operations (PR #120664)

2024-12-20 Thread David Spickett via lldb-commits
@@ -48,6 +48,10 @@ bool RegisterContextCorePOSIX_loongarch64::ReadGPR() { return true; } bool RegisterContextCorePOSIX_loongarch64::ReadFPR() { return true; } +bool RegisterContextCorePOSIX_loongarch64::ReadLSX() { return true; } + +bool RegisterContextCorePOSIX_loongarch64:

[Lldb-commits] [lldb] [LLDB][LoongArch] Add LSX and LASX register definitions and operations (PR #120664)

2024-12-20 Thread David Spickett via lldb-commits
@@ -27,6 +27,14 @@ // struct iovec definition #include +#ifndef NT_LARCH_LSX DavidSpickett wrote: Our usual pattern is: ``` #ifndef THE_MACRO #define THE_MACRO the_value_it_is_in_the_latest_kernel_headers #endif ``` This allows you to build with older kernel

[Lldb-commits] [lldb] [LLDB][LoongArch] Add LSX and LASX register definitions and operations (PR #120664)

2024-12-20 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/120664 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

2024-11-21 Thread David Spickett via lldb-commits
@@ -224,7 +224,7 @@ Status ProcessElfCore::DoLoadCore() { ArchSpec core_arch(m_core_module_sp->GetArchitecture()); target_arch.MergeFrom(core_arch); GetTarget().SetArchitecture(target_arch); - + DavidSpickett wrote: Keep formatting changes separate, pus

[Lldb-commits] [lldb] [lldb] Fix ELF core debugging (PR #117070)

2024-11-21 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/117070 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fix typos in `StackFrame.cpp` (PR #118991)

2024-12-06 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/118991 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fix typos in `StackFrame.cpp` (PR #118991)

2024-12-06 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/118991 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fix typo in `StackFrame.cpp` (PR #118991)

2024-12-06 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett approved this pull request. Thanks, much appreciated! https://github.com/llvm/llvm-project/pull/118991 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commi

[Lldb-commits] [lldb] [lldb] Fix typos in `StackFrame.cpp` (PR #118991)

2024-12-06 Thread David Spickett via lldb-commits
DavidSpickett wrote: I'm going to merge this as is, but there are more uses of `sythetic` in `lldb/` you can fix if you like. None of them should break any tests if changed. https://github.com/llvm/llvm-project/pull/118991 ___ lldb-commits mailing lis

[Lldb-commits] [lldb] [lldb] Fix off by one in array index check (PR #118995)

2024-12-06 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/118995 Reported in #116944 / https://pvs-studio.com/en/blog/posts/cpp/1188/. >From 6a227a0ee3e6b4c0091b94f69d348f155575192a Mon Sep 17 00:00:00 2001 From: David Spickett Date: Fri, 6 Dec 2024 16:21:51 + Subj

[Lldb-commits] [lldb] [lldb] Fix off by one in array index check in Objective C runtime plugin (PR #118995)

2024-12-06 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/118995 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fix off by one in array index check in Objective C runtime plugin (PR #118995)

2024-12-06 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/118995 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fix off by one in array index check in Objective C runtime code (PR #118995)

2024-12-06 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/118995 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fix off by one in array index check in Objective C runtime plugin (PR #118995)

2024-12-06 Thread David Spickett via lldb-commits
DavidSpickett wrote: Seems obvious but perhaps Apple folks can confirm that there isn't some hidden detail here, or a larger mistake hiding in the background. https://github.com/llvm/llvm-project/pull/118995 ___ lldb-commits mailing list lldb-commits@

[Lldb-commits] [lldb] [lldb][AIX] Some base #if _AIX changes of a minimal lldb build (PR #120979)

2025-01-08 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett approved this pull request. LGTM, @labath ? https://github.com/llvm/llvm-project/pull/120979 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AIX] Added support for AIX in HostInfo section (PR #122301)

2025-01-10 Thread David Spickett via lldb-commits
DavidSpickett wrote: You can never 100% trust anything that isn't the code (and even then, be careful), but it is nice when the descriptions are at least helpful. https://github.com/llvm/llvm-project/pull/122301 ___ lldb-commits mailing list lldb-comm

[Lldb-commits] [lldb] [lldb] Migrate away from PointerUnion::{is, get} (NFC) (PR #122420)

2025-01-10 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett approved this pull request. https://github.com/llvm/llvm-project/pull/122420 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AIX] Added support for AIX in HostInfo section (PR #122301)

2025-01-10 Thread David Spickett via lldb-commits
DavidSpickett wrote: This is actually a common point of confusion, the LLVM repo is setup to create the final commit message from the PR description, not the commit(s) message(s) in the PR itself. I guess because A: the PR description is easier to edit and B: we always squash before merging, s

[Lldb-commits] [lldb] [lldb][Linux] Add Control Protection Fault signal (PR #122917)

2025-01-21 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/122917 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AArch64] Fix expression evaluation with Guarded Control Stacks (PR #123918)

2025-01-22 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/123918 When the Guarded Control Stack (GCS) is enabled, returns cause the processor to validate that the address at the location pointed to by gcspr_el0 matches the one in the link register. ``` ret (lr=A) << pc

[Lldb-commits] [lldb] [lldb][AArch64] Fix expression evaluation with Guarded Control Stacks (PR #123918)

2025-01-22 Thread David Spickett via lldb-commits
DavidSpickett wrote: The first commit of this is https://github.com/llvm/llvm-project/pull/123720. I'm putting this up now because that previous PR is pretty straightforward, it's just adding registers. But this is the one that needs the most thought. So if you like, you can tackle them in one

[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2025-01-22 Thread David Spickett via lldb-commits
@@ -0,0 +1,492 @@ +import os +import os.path +import lldb +from lldbsuite.test.lldbtest import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbproxy import * +import lldbgdbserverutils +import re + + +class ThreadSnapshot: +def __init__(self, thread_

[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2025-01-22 Thread David Spickett via lldb-commits
DavidSpickett wrote: Yes, I presented AArch64 as the counter example to show where it does work, but didn't make that clear. I've got a solution for this bit, but the watchpoint test is still failing one part on Arm 32 bit. https://github.com/llvm/llvm-project/pull/112079

[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2025-01-22 Thread David Spickett via lldb-commits
@@ -0,0 +1,492 @@ +import os +import os.path +import lldb +from lldbsuite.test.lldbtest import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbproxy import * +import lldbgdbserverutils +import re + + +class ThreadSnapshot: +def __init__(self, thread_

[Lldb-commits] [lldb] Reland "[lldb] Implement basic support for reverse-continue" (#123906)" (PR #123945)

2025-01-22 Thread David Spickett via lldb-commits
@@ -0,0 +1,528 @@ +import os +import os.path +import lldb +from lldbsuite.test.lldbtest import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbproxy import * +import lldbgdbserverutils +import re + + +class ThreadSnapshot: +def __init__(self, thread_

[Lldb-commits] [lldb] Reland "[lldb] Implement basic support for reverse-continue" (#123906)" (PR #123945)

2025-01-22 Thread David Spickett via lldb-commits
@@ -0,0 +1,528 @@ +import os +import os.path +import lldb +from lldbsuite.test.lldbtest import * +from lldbsuite.test.gdbclientutils import * +from lldbsuite.test.lldbgdbproxy import * +import lldbgdbserverutils +import re + + +class ThreadSnapshot: +def __init__(self, thread_

[Lldb-commits] [lldb] Reland "[lldb] Implement basic support for reverse-continue" (#123906)" (PR #123945)

2025-01-22 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/123945 This reverts commit 22561cfb443267905d4190f0e2a738e6b412457f and fixes b7b9ccf44988edf49886743ae5c3cf4184db211f (#112079). The problem is that x86_64 and Arm 32-bit have memory regions above the stack th

[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2025-01-22 Thread David Spickett via lldb-commits
DavidSpickett wrote: https://github.com/llvm/llvm-project/pull/123945 to fix the testing. https://github.com/llvm/llvm-project/pull/112079 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-co

[Lldb-commits] [lldb] Reland "[lldb] Implement basic support for reverse-continue" (#123906)" (PR #123945)

2025-01-22 Thread David Spickett via lldb-commits
DavidSpickett wrote: I also noticed that if you don't save memory at all, the breakpoint tests pass. Which is surprising, but ok given that the test doesn't check any memory values, and watchpoint tests *do* fail if you do not save memory. https://github.com/llvm/llvm-project/pull/123945 _

[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2025-01-21 Thread David Spickett via lldb-commits
DavidSpickett wrote: This is a point of confusion, the LLVM project is set up to take the PR description, https://github.com/llvm/llvm-project/pull/112079#issue-2582537001 (the one you see on the page where this comment is also) as the commit message for the squashed commits. As opposed to us

[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2025-01-21 Thread David Spickett via lldb-commits
DavidSpickett wrote: If the final message is in fact just the several commit messages, and that describes the changes well, then great! Doesn't have to be a new, unique thing. https://github.com/llvm/llvm-project/pull/112079 ___ lldb-commits mailing l

[Lldb-commits] [lldb] [lldb][LoongArch] Complete register alias name in `AugmentRegisterInfo` (PR #124059)

2025-01-23 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/124059 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][LoongArch] Complete register alias name in `AugmentRegisterInfo` (PR #124059)

2025-01-23 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett commented: ABI details are someone else's job but on generic things this is the right idea. It needs tests, I suggest you find the tests that read general registers and add aliased name reads to those. Though it's unlikely to break for just one use case, I woul

[Lldb-commits] [lldb] [lldb][LoongArch] Complete register alias name in `AugmentRegisterInfo` (PR #124059)

2025-01-23 Thread David Spickett via lldb-commits
@@ -644,32 +644,22 @@ void ABISysV_loongarch::AugmentRegisterInfo( std::vector ®s) { lldb_private::RegInfoBasedABI::AugmentRegisterInfo(regs); + static const std::unordered_map reg_aliases = { DavidSpickett wrote: There is `llvm/include/llvm/ADT/String

[Lldb-commits] [lldb] Reland "[lldb] Implement basic support for reverse-continue" (#123906)" (PR #123945)

2025-01-23 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/123945 >From ecb1b90e109df650ef1b50cc3d07b56fd302e274 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 22 Jan 2025 10:52:16 + Subject: [PATCH 1/4] Reland "[lldb] Implement basic support for reverse-c

[Lldb-commits] [lldb] Reland "[lldb] Implement basic support for reverse-continue" (#123906)" (PR #123945)

2025-01-23 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/123945 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] Reland "[lldb] Implement basic support for reverse-continue" (#123906)" (PR #123945)

2025-01-23 Thread David Spickett via lldb-commits
DavidSpickett wrote: > can you add @skipIfRemote to the tests? Done > Another, simpler way to fix the memory read problem might be to just tolerate > failed memory writes --- log and continue. Log and continue is liable to be "triager forgets to look at logs, wastes days, disables the test a

[Lldb-commits] [lldb] [lldb][LoongArch] Complete register alias name in `AugmentRegisterInfo` (PR #124059)

2025-01-23 Thread David Spickett via lldb-commits
@@ -644,32 +644,22 @@ void ABISysV_loongarch::AugmentRegisterInfo( std::vector ®s) { lldb_private::RegInfoBasedABI::AugmentRegisterInfo(regs); + static const std::unordered_map reg_aliases = { + {"r0", "zero"}, {"r1", "ra"}, {"r2", "tp"}, {"r3", "sp"}, + {"r

[Lldb-commits] [lldb] Reland "[lldb] Implement basic support for reverse-continue" (#123906)" (PR #123945)

2025-01-23 Thread David Spickett via lldb-commits
DavidSpickett wrote: So this is ready for anyone who is able to test on Mac x86_64. https://github.com/llvm/llvm-project/pull/123945 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AArch64] Add Guarded Control Stack registers (PR #123720)

2025-01-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/123720 >From 951a38910e49f3e93dc6c9a084e955ab01ad4c49 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Fri, 9 Aug 2024 11:56:29 +0100 Subject: [PATCH 1/3] [lldb][AArch64] Add Guarded Control Stack registers T

[Lldb-commits] [lldb] [lldb][AArch64] Add Guarded Control Stack registers (PR #123720)

2025-01-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/123720 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AArch64] Fix expression evaluation with Guarded Control Stacks (PR #123918)

2025-01-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/123918 >From 951a38910e49f3e93dc6c9a084e955ab01ad4c49 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Fri, 9 Aug 2024 11:56:29 +0100 Subject: [PATCH 1/4] [lldb][AArch64] Add Guarded Control Stack registers T

[Lldb-commits] [lldb] [lldb][AArch64] Fix expression evaluation with Guarded Control Stacks (PR #123918)

2025-01-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/123918 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AArch64] Fix expression evaluation with Guarded Control Stacks (PR #123918)

2025-01-24 Thread David Spickett via lldb-commits
@@ -103,6 +156,9 @@ bool ABISysV_arm64::PrepareTrivialCall(Thread &thread, addr_t sp, return_addr)) return false; + if (GetProcessSP()->GetTarget().GetArchitecture().GetTriple().isOSLinux()) +PushToLinuxGuardedControlStack(return_addr, reg_ctx, thread); ---

[Lldb-commits] [lldb] [lldb][AArch64] Fix expression evaluation with Guarded Control Stacks (PR #123918)

2025-01-24 Thread David Spickett via lldb-commits
DavidSpickett wrote: This conflicts a lot with main but I'm going to deal with that after approval. https://github.com/llvm/llvm-project/pull/123918 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[Lldb-commits] [lldb] [lldb][AArch64] Fix expression evaluation with Guarded Control Stacks (PR #123918)

2025-01-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/123918 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AArch64] Fix expression evaluation with Guarded Control Stacks (PR #123918)

2025-01-24 Thread David Spickett via lldb-commits
@@ -60,6 +60,69 @@ ABISysV_arm64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) return ABISP(); } +static Status PushToLinuxGuardedControlStack(addr_t return_addr, + RegisterContext *reg_ctx, +

[Lldb-commits] [lldb] [lldb][AArch64] Fix expression evaluation with Guarded Control Stacks (PR #123918)

2025-01-24 Thread David Spickett via lldb-commits
@@ -87,6 +150,18 @@ bool ABISysV_arm64::PrepareTrivialCall(Thread &thread, addr_t sp, if (args.size() > 8) return false; + // Do this first, as it's got the most chance of failing (though still very + // low). + if (GetProcessSP()->GetTarget().GetArchitecture().GetTr

[Lldb-commits] [lldb] [lldb][AArch64] Fix expression evaluation with Guarded Control Stacks (PR #123918)

2025-01-24 Thread David Spickett via lldb-commits
@@ -83,3 +83,278 @@ def test_gcs_fault(self): "stop reason = signal SIGSEGV: control protection fault", ], ) + +def check_gcs_registers( +self, +expected_gcs_features_enabled=None, +expected_gcs_features_locked=Non

[Lldb-commits] [lldb] [lldb][AArch64] Fix expression evaluation with Guarded Control Stacks (PR #123918)

2025-01-24 Thread David Spickett via lldb-commits
@@ -103,6 +156,9 @@ bool ABISysV_arm64::PrepareTrivialCall(Thread &thread, addr_t sp, return_addr)) return false; + if (GetProcessSP()->GetTarget().GetArchitecture().GetTriple().isOSLinux()) +PushToLinuxGuardedControlStack(return_addr, reg_ctx, thread); ---

[Lldb-commits] [lldb] [lldb][AArch64] Fix expression evaluation with Guarded Control Stacks (PR #123918)

2025-01-24 Thread David Spickett via lldb-commits
@@ -103,6 +156,9 @@ bool ABISysV_arm64::PrepareTrivialCall(Thread &thread, addr_t sp, return_addr)) return false; + if (GetProcessSP()->GetTarget().GetArchitecture().GetTriple().isOSLinux()) +PushToLinuxGuardedControlStack(return_addr, reg_ctx, thread); ---

[Lldb-commits] [lldb] [lldb][LoongArch] Complete register alias name in `AugmentRegisterInfo` (PR #124059)

2025-01-24 Thread David Spickett via lldb-commits
DavidSpickett wrote: `lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py` - `test_loongarch64_regs` for example. You should be able to read all those registers using the aliases as well as the normal names. If you look through the LoongArch lldb changes you'll probably find the

[Lldb-commits] [lldb] [lldb][AArch64] Add Guarded Control Stack registers (PR #123720)

2025-01-24 Thread David Spickett via lldb-commits
@@ -83,3 +83,137 @@ def test_gcs_fault(self): "stop reason = signal SIGSEGV: control protection fault", ], ) + +@skipUnlessArch("aarch64") +@skipUnlessPlatform(["linux"]) +def test_gcs_registers(self): +if not self.isAArch

[Lldb-commits] [lldb] [lldb][AArch64] Add Guarded Control Stack registers (PR #123720)

2025-01-24 Thread David Spickett via lldb-commits
@@ -2,8 +2,8 @@ #include #include -#ifndef HWCAP2_GCS -#define HWCAP2_GCS (1UL << 63) +#ifndef HWCAP_GCS +#define HWCAP_GCS (1UL << 32) DavidSpickett wrote: Yes that is strange. Initially it was a HWCAP2 value but it was moved for some reason. I think this

[Lldb-commits] [lldb] [lldb] Use the first address range as the function address (PR #122440)

2025-01-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/122440 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AArch64] Add Guarded Control Stack registers (PR #123720)

2025-01-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/123720 >From 951a38910e49f3e93dc6c9a084e955ab01ad4c49 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Fri, 9 Aug 2024 11:56:29 +0100 Subject: [PATCH 1/2] [lldb][AArch64] Add Guarded Control Stack registers T

[Lldb-commits] [lldb] [lldb][AArch64] Add Guarded Control Stack registers (PR #123720)

2025-01-24 Thread David Spickett via lldb-commits
@@ -83,3 +83,137 @@ def test_gcs_fault(self): "stop reason = signal SIGSEGV: control protection fault", ], ) + +@skipUnlessArch("aarch64") +@skipUnlessPlatform(["linux"]) +def test_gcs_registers(self): +if not self.isAArch

[Lldb-commits] [lldb] [lldb][AArch64] Add Guarded Control Stack support for Linux core files (PR #124293)

2025-01-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/124293 This allows you to read the same registers as you would for a live process. As the content of proc/pid/smaps is not included in the core file, we don't get the "ss" marker. The GCS region is stil in the li

[Lldb-commits] [lldb] [lldb][AArch64] Add Guarded Control Stack support for Linux core files (PR #124293)

2025-01-24 Thread David Spickett via lldb-commits
DavidSpickett wrote: Only the latest commit is new, the rest is from https://github.com/llvm/llvm-project/pull/123918. I will rebase and fix conflicts as and when these get landed. https://github.com/llvm/llvm-project/pull/124293 ___ lldb-commits mai

[Lldb-commits] [lldb] [lldb][AArch64] Add Guarded Control Stack support for Linux core files (PR #124293)

2025-01-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/124293 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AArch64] Add register fields for Guarded Control Stack registers (PR #124295)

2025-01-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/124295 >From 951a38910e49f3e93dc6c9a084e955ab01ad4c49 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Fri, 9 Aug 2024 11:56:29 +0100 Subject: [PATCH 1/6] [lldb][AArch64] Add Guarded Control Stack registers T

[Lldb-commits] [lldb] [lldb][AArch64] Add register fields for Guarded Control Stack registers (PR #124295)

2025-01-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/124295 The features and locked registers hold the same bits, the latter is a lock for the former. Tested with core files and live processes. I thought about setting a non-zero lock register in the core file, howe

[Lldb-commits] [lldb] [lldb][AArch64] Add register fields for Guarded Control Stack registers (PR #124295)

2025-01-24 Thread David Spickett via lldb-commits
DavidSpickett wrote: All commits before the one named the same as this PR are from https://github.com/llvm/llvm-project/pull/124293. I will handle the rebasing and conflicts as that gets landed. https://github.com/llvm/llvm-project/pull/124295 ___ ll

[Lldb-commits] [lldb] [lldb][AArch64] Add register fields for Guarded Control Stack registers (PR #124295)

2025-01-24 Thread David Spickett via lldb-commits
DavidSpickett wrote: This is the last piece of functionality for GCS. Remaining is the documentation (https://github.com/llvm/llvm-project/pull/117860) and a release note that I'll push directly if the 20 branch hasn't happened yet by that time. https://github.com/llvm/llvm-project/pull/12429

[Lldb-commits] [lldb] [lldb][AArch64] Add register fields for Guarded Control Stack registers (PR #124295)

2025-01-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/124295 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][AArch64] Add Guarded Control Stack registers (PR #123720)

2025-01-24 Thread David Spickett via lldb-commits
@@ -2,8 +2,8 @@ #include #include -#ifndef HWCAP2_GCS -#define HWCAP2_GCS (1UL << 63) +#ifndef HWCAP_GCS +#define HWCAP_GCS (1UL << 32) DavidSpickett wrote: Mark Brown confirmed that the documentation is incorrect. It is in HWCAP as the code shows. https:

[Lldb-commits] [lldb] [llvm] [lldb] Enable "frame diagnose" on linux (PR #123217)

2025-01-20 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/123217 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

2025-01-20 Thread David Spickett via lldb-commits
DavidSpickett wrote: > Technically that is already true --- with stock LLDB and latest rr you can > debug an rr replay, which is useful. You just don't get the reverse-execution > superpower. Ok so nothing has actually changed on that front, best wait until we can do the reverse execution fro

[Lldb-commits] [lldb] [lldb] Implement ${target.file} format variable (PR #123431)

2025-01-20 Thread David Spickett via lldb-commits
@@ -113,11 +113,11 @@ A complete list of currently supported format string variables is listed below: +---+---

<    19   20   21   22   23   24   25   26   27   28   >