[Lldb-commits] [lldb] [lldb][test] Add --target-os argument to dotest.py (PR #93887)
labath wrote: Agreed. The reason code is looking like it does is because at some point in (now, pretty distant) past it was possible to `cd` into the test directory, type `make` and get the test binary out. Among other problems, this has caused duplicate code for determining various properties of the build between python and make. Since we no longer support these workflow anyway, there's no reason to keep the makefile code. https://github.com/llvm/llvm-project/pull/93887 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Improve identification of Dlang mangled names (PR #93881)
DavidSpickett wrote: The test is still failing on Windows on Arm, I will figure it out. https://github.com/llvm/llvm-project/pull/93881 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Disable PIE for some API tests (PR #93808)
labath wrote: > > Ok, I see now. It's an ld.bfd vs ld.lld thing. You probably have your clang > > configured to use lld. LLD does not put relocation addends into the data > > section (on both arm and intel). ld.bfd does, which is why this sort of > > happens to work there. Was your intention to test with LLD? > > Yep, I run it with lld built together with clang and lldb. Should the > condition be narrowed to affect only builds with lld? No, I think this is fine. I don't believe we have the ability to detect the linker used at the moment, and I'd like to avoid adding new dimensions to the test suite. Plus, the `PIE` flag captures the problem (that lldb depends on linker-specific relocation behavior, at least for ELF) these test expose fairly well. To fix this, we'd need to change ObjectFileELF::RelocateSection to relocate non-debug info sections as well. It may be worth linking these comments to a bug that provides more context. It's possible this could break some targets (like android) that do not support building/running non-PIE executables, but if that happens, we should just get those targets to set the PIE flag. https://github.com/llvm/llvm-project/pull/93808 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Disable PIE for some API tests (PR #93808)
https://github.com/labath approved this pull request. https://github.com/llvm/llvm-project/pull/93808 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Disable PIE for some API tests (PR #93808)
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/93808 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Disable PIE for some API tests (PR #93808)
@@ -3,4 +3,8 @@ # C_SOURCES := b.c # EXE := b.out +ifndef PIE + LDFLAGS := -no-pie labath wrote: Setting LD_EXTRAS is the typical way to pass linker flags from here (the same for other files) https://github.com/llvm/llvm-project/pull/93808 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fixed TestEchoCommands.test running on a remote target (PR #94127)
slydiman wrote: > we support running (all?) shell tests on a remote system? We have configured buildbots with Windows x86_64, Linux x86_64 hosts and Linux Aarch64 targets. Currently we got 2 failed Shell tests on Windows host and 2 failed test on Linux hosts. This test failed on both hosts. https://github.com/llvm/llvm-project/pull/94127 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add documentation for the max_children argument (PR #94192)
https://github.com/labath created https://github.com/llvm/llvm-project/pull/94192 None >From 8bb7817d913cd8843fe8c90dcd7c8b70a0366994 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 3 Jun 2024 09:58:47 +0200 Subject: [PATCH] [lldb] Add documentation for the max_children argument --- lldb/docs/use/variable.rst | 37 +++-- lldb/include/lldb/API/SBValue.h | 14 + 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/lldb/docs/use/variable.rst b/lldb/docs/use/variable.rst index e9175b25336ba..22c2bee73fa59 100644 --- a/lldb/docs/use/variable.rst +++ b/lldb/docs/use/variable.rst @@ -930,20 +930,27 @@ be implemented by the Python class): class SyntheticChildrenProvider: def __init__(self, valobj, internal_dict): - this call should initialize the Python object using valobj as the variable to provide synthetic children for - def num_children(self): - this call should return the number of children that you want your object to have + this call should initialize the Python object using valobj as the + variable to provide synthetic children for + def num_children(self, max_children): + this call should return the number of children that you want your + object to have[1] def get_child_index(self,name): - this call should return the index of the synthetic child whose name is given as argument + this call should return the index of the synthetic child whose name is + given as argument def get_child_at_index(self,index): - this call should return a new LLDB SBValue object representing the child at the index given as argument + this call should return a new LLDB SBValue object representing the + child at the index given as argument def update(self): - this call should be used to update the internal state of this Python object whenever the state of the variables in LLDB changes.[1] + this call should be used to update the internal state of this Python + object whenever the state of the variables in LLDB changes.[2] Also, this method is invoked before any other method in the interface. def has_children(self): - this call should return True if this object might have children, and False if this object can be guaranteed not to have children.[2] + this call should return True if this object might have children, and + False if this object can be guaranteed not to have children.[3] def get_value(self): - this call can return an SBValue to be presented as the value of the synthetic value under consideration.[3] + this call can return an SBValue to be presented as the value of the + synthetic value under consideration.[4] As a warning, exceptions that are thrown by python formatters are caught silently by LLDB and should be handled appropriately by the formatter itself. @@ -951,7 +958,15 @@ Being more specific, in case of exceptions, LLDB might assume that the given object has no children or it might skip printing some children, as they are printed one by one. -[1] This method is optional. Also, a boolean value must be returned (since lldb +[1] The `max_children` argument is optional (since lldb 3.8.0) and indicates the +maximum number of children that lldb is interested in (at this moment). If the +computation of the number of children is expensive (for example, requires +travesing a linked list to determine its size) your implementation may return +`max_children` rather than the actual number. If the computation is cheap (e.g., the +number is stored as a field of the object), then you can always return the true +number of children (that is, ignore the `max_children` argument). + +[2] This method is optional. Also, a boolean value must be returned (since lldb 3.1.0). If ``False`` is returned, then whenever the process reaches a new stop, this method will be invoked again to generate an updated list of the children for a given variable. Otherwise, if ``True`` is returned, then the value is @@ -959,11 +974,11 @@ cached and this method won't be called again, effectively freezing the state of the value in subsequent stops. Beware that returning ``True`` incorrectly could show misleading information to the user. -[2] This method is optional (since lldb 3.2.0). While implementing it in terms +[3] This method is optional (since lldb 3.2.0). While implementing it in terms of num_children is acceptable, implementors are encouraged to look for optimized coding alternatives whenever reasonable. -[3] This method is optional (since lldb 3.5.2). The `SBValue` you return here +[4] This method is optional (since lldb 3.5.2). The `SBValue` you return here will most likely be a numeric type (int, float, ...) as its value bytes will be used as-if they were the value of the root `SBValue` proper. As a shortcut for thi
[Lldb-commits] [lldb] [lldb] Add documentation for the max_children argument (PR #94192)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Pavel Labath (labath) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/94192.diff 2 Files Affected: - (modified) lldb/docs/use/variable.rst (+26-11) - (modified) lldb/include/lldb/API/SBValue.h (+14) ``diff diff --git a/lldb/docs/use/variable.rst b/lldb/docs/use/variable.rst index e9175b25336ba..22c2bee73fa59 100644 --- a/lldb/docs/use/variable.rst +++ b/lldb/docs/use/variable.rst @@ -930,20 +930,27 @@ be implemented by the Python class): class SyntheticChildrenProvider: def __init__(self, valobj, internal_dict): - this call should initialize the Python object using valobj as the variable to provide synthetic children for - def num_children(self): - this call should return the number of children that you want your object to have + this call should initialize the Python object using valobj as the + variable to provide synthetic children for + def num_children(self, max_children): + this call should return the number of children that you want your + object to have[1] def get_child_index(self,name): - this call should return the index of the synthetic child whose name is given as argument + this call should return the index of the synthetic child whose name is + given as argument def get_child_at_index(self,index): - this call should return a new LLDB SBValue object representing the child at the index given as argument + this call should return a new LLDB SBValue object representing the + child at the index given as argument def update(self): - this call should be used to update the internal state of this Python object whenever the state of the variables in LLDB changes.[1] + this call should be used to update the internal state of this Python + object whenever the state of the variables in LLDB changes.[2] Also, this method is invoked before any other method in the interface. def has_children(self): - this call should return True if this object might have children, and False if this object can be guaranteed not to have children.[2] + this call should return True if this object might have children, and + False if this object can be guaranteed not to have children.[3] def get_value(self): - this call can return an SBValue to be presented as the value of the synthetic value under consideration.[3] + this call can return an SBValue to be presented as the value of the + synthetic value under consideration.[4] As a warning, exceptions that are thrown by python formatters are caught silently by LLDB and should be handled appropriately by the formatter itself. @@ -951,7 +958,15 @@ Being more specific, in case of exceptions, LLDB might assume that the given object has no children or it might skip printing some children, as they are printed one by one. -[1] This method is optional. Also, a boolean value must be returned (since lldb +[1] The `max_children` argument is optional (since lldb 3.8.0) and indicates the +maximum number of children that lldb is interested in (at this moment). If the +computation of the number of children is expensive (for example, requires +travesing a linked list to determine its size) your implementation may return +`max_children` rather than the actual number. If the computation is cheap (e.g., the +number is stored as a field of the object), then you can always return the true +number of children (that is, ignore the `max_children` argument). + +[2] This method is optional. Also, a boolean value must be returned (since lldb 3.1.0). If ``False`` is returned, then whenever the process reaches a new stop, this method will be invoked again to generate an updated list of the children for a given variable. Otherwise, if ``True`` is returned, then the value is @@ -959,11 +974,11 @@ cached and this method won't be called again, effectively freezing the state of the value in subsequent stops. Beware that returning ``True`` incorrectly could show misleading information to the user. -[2] This method is optional (since lldb 3.2.0). While implementing it in terms +[3] This method is optional (since lldb 3.2.0). While implementing it in terms of num_children is acceptable, implementors are encouraged to look for optimized coding alternatives whenever reasonable. -[3] This method is optional (since lldb 3.5.2). The `SBValue` you return here +[4] This method is optional (since lldb 3.5.2). The `SBValue` you return here will most likely be a numeric type (int, float, ...) as its value bytes will be used as-if they were the value of the root `SBValue` proper. As a shortcut for this, you can inherit from lldb.SBSyntheticValueProvider, and just define diff --git a/lldb/include/lldb/API/SBValue.h b/lldb/include/lldb/API/SBValue.h index 8f4c4fd56dfb1..65920
[Lldb-commits] [lldb] [lldb] Avoid (unlimited) GetNumChildren calls when printing values (PR #93946)
https://github.com/labath updated https://github.com/llvm/llvm-project/pull/93946 >From 1e25ef1cc5ff4d12a3e5b85c8ea7cd30a3e0908e Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Fri, 31 May 2024 10:06:19 + Subject: [PATCH 1/2] [lldb] Avoid (unlimited) GetNumChildren calls when printing values For some data formatters, even getting the number of children can be an expensive operations (e.g., needing to walk a linked list to determine the number of elements). This is then wasted work when we know we will be printing only small number of them. This patch replaces the calls to GetNumChildren (at least those on the "frame var" path) with the calls to the capped version, passing the value of `max-children-count` setting (plus one) --- lldb/source/DataFormatters/FormatManager.cpp | 10 --- .../DataFormatters/ValueObjectPrinter.cpp | 27 ++- .../synthcapping/TestSyntheticCapping.py | 11 .../synthcapping/fooSynthProvider.py | 15 ++- 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index d7ba5b4b70c94..84c0c7eed1431 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -9,6 +9,7 @@ #include "lldb/DataFormatters/FormatManager.h" #include "lldb/Core/Debugger.h" +#include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/DataFormatters/LanguageCategory.h" #include "lldb/Interpreter/ScriptInterpreter.h" @@ -442,16 +443,19 @@ lldb::Format FormatManager::GetSingleItemFormat(lldb::Format vector_format) { } bool FormatManager::ShouldPrintAsOneLiner(ValueObject &valobj) { + TargetSP target_sp = valobj.GetTargetSP(); // if settings say no oneline whatsoever - if (valobj.GetTargetSP().get() && - !valobj.GetTargetSP()->GetDebugger().GetAutoOneLineSummaries()) + if (target_sp && !target_sp->GetDebugger().GetAutoOneLineSummaries()) return false; // then don't oneline // if this object has a summary, then ask the summary if (valobj.GetSummaryFormat().get() != nullptr) return valobj.GetSummaryFormat()->IsOneLiner(); - auto num_children = valobj.GetNumChildren(); + size_t max_num_children = + (target_sp ? *target_sp : Target::GetGlobalProperties()) + .GetMaximumNumberOfChildrenToDisplay(); + auto num_children = valobj.GetNumChildren(max_num_children); if (!num_children) { llvm::consumeError(num_children.takeError()); return true; diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp index bbdc2a9981570..c2933d8574583 100644 --- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp +++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp @@ -14,6 +14,8 @@ #include "lldb/Target/Language.h" #include "lldb/Target/Target.h" #include "lldb/Utility/Stream.h" +#include "llvm/Support/MathExtras.h" +#include using namespace lldb; using namespace lldb_private; @@ -628,22 +630,21 @@ ValueObjectPrinter::GetMaxNumChildrenToPrint(bool &print_dotdotdot) { if (m_options.m_pointer_as_array) return m_options.m_pointer_as_array.m_element_count; - auto num_children_or_err = synth_valobj.GetNumChildren(); + const uint32_t max_num_children = + m_options.m_ignore_cap ? UINT32_MAX + : GetMostSpecializedValue() + .GetTargetSP() + ->GetMaximumNumberOfChildrenToDisplay(); + // Ask for one more child than the maximum to see if we should print "...". + auto num_children_or_err = synth_valobj.GetNumChildren( + llvm::SaturatingAdd(max_num_children, uint32_t(1))); if (!num_children_or_err) return num_children_or_err; - uint32_t num_children = *num_children_or_err; - print_dotdotdot = false; - if (num_children) { -const size_t max_num_children = GetMostSpecializedValue() -.GetTargetSP() - ->GetMaximumNumberOfChildrenToDisplay(); - -if (num_children > max_num_children && !m_options.m_ignore_cap) { - print_dotdotdot = true; - return max_num_children; -} + if (*num_children_or_err > max_num_children) { +print_dotdotdot = true; +return max_num_children; } - return num_children; + return num_children_or_err; } void ValueObjectPrinter::PrintChildrenPostamble(bool print_dotdotdot) { diff --git a/lldb/test/API/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py b/lldb/test/API/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py index d53dadef836e5..9ca232abefa03 100644 --- a/lldb/test/API/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py +++ b/lldb/test/API/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py @@ -68,6 +68,11 @@ def cleanup():
[Lldb-commits] [lldb] [lldb] Avoid (unlimited) GetNumChildren calls when printing values (PR #93946)
@@ -442,16 +443,19 @@ lldb::Format FormatManager::GetSingleItemFormat(lldb::Format vector_format) { } bool FormatManager::ShouldPrintAsOneLiner(ValueObject &valobj) { + TargetSP target_sp = valobj.GetTargetSP(); // if settings say no oneline whatsoever - if (valobj.GetTargetSP().get() && - !valobj.GetTargetSP()->GetDebugger().GetAutoOneLineSummaries()) + if (target_sp && !target_sp->GetDebugger().GetAutoOneLineSummaries()) return false; // then don't oneline // if this object has a summary, then ask the summary if (valobj.GetSummaryFormat().get() != nullptr) return valobj.GetSummaryFormat()->IsOneLiner(); - auto num_children = valobj.GetNumChildren(); + size_t max_num_children = labath wrote: Done https://github.com/llvm/llvm-project/pull/93946 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Avoid (unlimited) GetNumChildren calls when printing values (PR #93946)
labath wrote: > This seems reasonable. However, I note that on the page where we show how to > write synthetic child providers, we say: > > def num_children(self): this call should return the number of children that > you want your object to have > > That's actually not true - we pass the max_children argument on to the > num_children method, and in fact some of the tests do use the max parameter. > But since you're making that actually useful, can you fix the docs so people > will know to take advantage of this? Sounds good. I've created a separate [pr](https://github.com/llvm/llvm-project/pull/94192) for that. > BTW, because the max number of children is probably getting ignored in the > wild, this has to be advisory, you can't require that: > > val.GetNumChildren(max_children) <= max_children > > I don't think you do that but it might be good to note the fact. Yes, I am keeping that in mind. https://github.com/llvm/llvm-project/pull/93946 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add documentation for the max_children argument (PR #94192)
@@ -930,40 +930,55 @@ be implemented by the Python class): class SyntheticChildrenProvider: def __init__(self, valobj, internal_dict): - this call should initialize the Python object using valobj as the variable to provide synthetic children for - def num_children(self): - this call should return the number of children that you want your object to have + this call should initialize the Python object using valobj as the + variable to provide synthetic children for + def num_children(self, max_children): + this call should return the number of children that you want your + object to have[1] def get_child_index(self,name): - this call should return the index of the synthetic child whose name is given as argument + this call should return the index of the synthetic child whose name is + given as argument def get_child_at_index(self,index): - this call should return a new LLDB SBValue object representing the child at the index given as argument + this call should return a new LLDB SBValue object representing the labath wrote: Reformatted because code blocks are not automatically wrapped (and the lines don't fit on one screen). https://github.com/llvm/llvm-project/pull/94192 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Avoid (unlimited) GetNumChildren calls when printing values (PR #93946)
https://github.com/labath closed https://github.com/llvm/llvm-project/pull/93946 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 763b96c - [lldb] Avoid (unlimited) GetNumChildren calls when printing values (#93946)
Author: Pavel Labath Date: 2024-06-03T10:34:44+02:00 New Revision: 763b96c86d81d51d0db430791a61fd1e8a406bce URL: https://github.com/llvm/llvm-project/commit/763b96c86d81d51d0db430791a61fd1e8a406bce DIFF: https://github.com/llvm/llvm-project/commit/763b96c86d81d51d0db430791a61fd1e8a406bce.diff LOG: [lldb] Avoid (unlimited) GetNumChildren calls when printing values (#93946) For some data formatters, even getting the number of children can be an expensive operations (e.g., needing to walk a linked list to determine the number of elements). This is then wasted work when we know we will be printing only small number of them. This patch replaces the calls to GetNumChildren (at least those on the "frame var" path) with the calls to the capped version, passing the value of `max-children-count` setting (plus one) Added: Modified: lldb/source/DataFormatters/FormatManager.cpp lldb/source/DataFormatters/ValueObjectPrinter.cpp lldb/test/API/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py lldb/test/API/functionalities/data-formatter/synthcapping/fooSynthProvider.py Removed: diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index 60765952760a2..7e19989a8264a 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -9,6 +9,7 @@ #include "lldb/DataFormatters/FormatManager.h" #include "lldb/Core/Debugger.h" +#include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/DataFormatters/LanguageCategory.h" #include "lldb/Interpreter/ScriptInterpreter.h" @@ -448,16 +449,19 @@ lldb::Format FormatManager::GetSingleItemFormat(lldb::Format vector_format) { } bool FormatManager::ShouldPrintAsOneLiner(ValueObject &valobj) { + TargetSP target_sp = valobj.GetTargetSP(); // if settings say no oneline whatsoever - if (valobj.GetTargetSP().get() && - !valobj.GetTargetSP()->GetDebugger().GetAutoOneLineSummaries()) + if (target_sp && !target_sp->GetDebugger().GetAutoOneLineSummaries()) return false; // then don't oneline // if this object has a summary, then ask the summary if (valobj.GetSummaryFormat().get() != nullptr) return valobj.GetSummaryFormat()->IsOneLiner(); - auto num_children = valobj.GetNumChildren(); + const size_t max_num_children = + (target_sp ? *target_sp : Target::GetGlobalProperties()) + .GetMaximumNumberOfChildrenToDisplay(); + auto num_children = valobj.GetNumChildren(max_num_children); if (!num_children) { llvm::consumeError(num_children.takeError()); return true; diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp index bbdc2a9981570..c2933d8574583 100644 --- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp +++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp @@ -14,6 +14,8 @@ #include "lldb/Target/Language.h" #include "lldb/Target/Target.h" #include "lldb/Utility/Stream.h" +#include "llvm/Support/MathExtras.h" +#include using namespace lldb; using namespace lldb_private; @@ -628,22 +630,21 @@ ValueObjectPrinter::GetMaxNumChildrenToPrint(bool &print_dotdotdot) { if (m_options.m_pointer_as_array) return m_options.m_pointer_as_array.m_element_count; - auto num_children_or_err = synth_valobj.GetNumChildren(); + const uint32_t max_num_children = + m_options.m_ignore_cap ? UINT32_MAX + : GetMostSpecializedValue() + .GetTargetSP() + ->GetMaximumNumberOfChildrenToDisplay(); + // Ask for one more child than the maximum to see if we should print "...". + auto num_children_or_err = synth_valobj.GetNumChildren( + llvm::SaturatingAdd(max_num_children, uint32_t(1))); if (!num_children_or_err) return num_children_or_err; - uint32_t num_children = *num_children_or_err; - print_dotdotdot = false; - if (num_children) { -const size_t max_num_children = GetMostSpecializedValue() -.GetTargetSP() - ->GetMaximumNumberOfChildrenToDisplay(); - -if (num_children > max_num_children && !m_options.m_ignore_cap) { - print_dotdotdot = true; - return max_num_children; -} + if (*num_children_or_err > max_num_children) { +print_dotdotdot = true; +return max_num_children; } - return num_children; + return num_children_or_err; } void ValueObjectPrinter::PrintChildrenPostamble(bool print_dotdotdot) { diff --git a/lldb/test/API/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py b/lldb/test/API/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py index d53dadef836e5..9ca232abefa03 100644 --- a/lldb/test/API/functionalities/data-fo
[Lldb-commits] [lldb] [lldb] Support reading DW_OP_piece from file address (PR #94026)
@@ -2153,26 +2152,42 @@ bool DWARFExpression::Evaluate( } break; - case Value::ValueType::FileAddress: - case Value::ValueType::HostAddress: -if (error_ptr) { - lldb::addr_t addr = curr_piece_source_value.GetScalar().ULongLong( - LLDB_INVALID_ADDRESS); + case Value::ValueType::FileAddress: { labath wrote: I'm wondering if it would be possible to use a single implementation for these two. Target::ReadMemory will call Process::ReadMemory if it was a process available (and the `force_live_memory` precisely so that one can require this behavior). https://github.com/llvm/llvm-project/pull/94026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Support reading DW_OP_piece from file address (PR #94026)
@@ -768,3 +768,63 @@ TEST(DWARFExpression, ExtensionsDWO) { testExpressionVendorExtensions(dwo_module_sp, *dwo_dwarf_unit); } + +TEST_F(DWARFExpressionMockProcessTest, DW_OP_piece_file_addr) { + struct MockTarget : Target { +MockTarget(Debugger &debugger, const ArchSpec &target_arch, + const lldb::PlatformSP &platform_sp) +: Target(debugger, target_arch, platform_sp, true) {} + +size_t ReadMemory(const Address &addr, void *dst, size_t dst_len, + Status &error, bool force_live_memory = false, + lldb::addr_t *load_addr_ptr = nullptr) override { + // We expected to be called in a very specific way. + assert(dst_len == 1); + assert(addr.GetOffset() == 0x40 || addr.GetOffset() == 0x50); + + if (addr.GetOffset() == 0x40) +((uint8_t *)dst)[0] = 0x11; + + if (addr.GetOffset() == 0x50) +((uint8_t *)dst)[0] = 0x22; + + return 1; +} + }; + + // Set up a mock process. + ArchSpec arch("i386-pc-linux"); + Platform::SetHostPlatform( + platform_linux::PlatformLinux::CreateInstance(true, &arch)); + lldb::DebuggerSP debugger_sp = Debugger::CreateInstance(); + ASSERT_TRUE(debugger_sp); + lldb::PlatformSP platform_sp; + lldb::TargetSP target_sp = + std::make_shared(*debugger_sp, arch, platform_sp); + ASSERT_TRUE(target_sp); + ASSERT_TRUE(target_sp->GetArchitecture().IsValid()); + + ExecutionContext exe_ctx(target_sp, false); + + uint8_t expr[] = {DW_OP_addr, 0x40, 0x0, 0x0, 0x0, DW_OP_piece, 1, +DW_OP_addr, 0x50, 0x0, 0x0, 0x0, DW_OP_piece, 1}; + DataExtractor extractor(expr, sizeof(expr), lldb::eByteOrderLittle, + /*addr_size*/ 4); + Value result; + Status status; + ASSERT_TRUE(DWARFExpression::Evaluate( + &exe_ctx, /*reg_ctx*/ nullptr, /*module_sp*/ {}, extractor, + /*unit*/ nullptr, lldb::eRegisterKindLLDB, + /*initial_value_ptr*/ nullptr, + /*object_address_ptr*/ nullptr, result, &status)) + << status.ToError(); + + ASSERT_EQ(result.GetValueType(), Value::ValueType::HostAddress); + + DataBufferHeap &buf = result.GetBuffer(); + ASSERT_EQ(buf.GetByteSize(), 2U); + + const uint8_t *bytes = buf.GetBytes(); + EXPECT_EQ(bytes[0], 0x11); + EXPECT_EQ(bytes[1], 0x22); labath wrote: `ASSERT_THAT(result.GetBuffer().GetData(), testing::ElementsAre(0x11, 0x22));` (or something along those lines, may need some massaging to compile) https://github.com/llvm/llvm-project/pull/94026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Support reading DW_OP_piece from file address (PR #94026)
@@ -768,3 +768,63 @@ TEST(DWARFExpression, ExtensionsDWO) { testExpressionVendorExtensions(dwo_module_sp, *dwo_dwarf_unit); } + +TEST_F(DWARFExpressionMockProcessTest, DW_OP_piece_file_addr) { + struct MockTarget : Target { labath wrote: You could consider using gmock with [this kind](https://github.com/llvm/llvm-project/blob/main/lldb/unittests/TestingSupport/Host/NativeProcessTestUtils.h#L73) of a pattern that would enable you to write `EXPECT_CALL(target, ReadMemory(0x40, 1)).WillOnce(Return(ByMove(std::vector{0x11})));` https://github.com/llvm/llvm-project/pull/94026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Support reading DW_OP_piece from file address (PR #94026)
https://github.com/labath commented: Can't say I'm thrilled by the addition of a random virtual method, but I don't want to stand in the way. I'll just note that there is an alternative - in the form of writing a minimal real target in assembly. In fact, I think `test/Shell/SymbolFile/DWARF/x86/DW_OP_piece-struct.s` has all of the boilerplate, so all you'd need is to replace `DW_OP_stack_value` with `DW_OP_addr`. https://github.com/llvm/llvm-project/pull/94026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Support reading DW_OP_piece from file address (PR #94026)
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/94026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 09c0607 - [lldb][test] Skip D lang mangling test on Windows
Author: David Spickett Date: 2024-06-03T09:02:06Z New Revision: 09c0607919c958c1a816acd58cc6c6585aec51a6 URL: https://github.com/llvm/llvm-project/commit/09c0607919c958c1a816acd58cc6c6585aec51a6 DIFF: https://github.com/llvm/llvm-project/commit/09c0607919c958c1a816acd58cc6c6585aec51a6.diff LOG: [lldb][test] Skip D lang mangling test on Windows While the fix is reviewed. Added: Modified: lldb/test/API/lang/c/non-mangled/TestCNonMangled.py Removed: diff --git a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py index aae2f05263fcd..c35d8a9bb9163 100644 --- a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py +++ b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py @@ -3,6 +3,7 @@ class TestCase(TestBase): +@skipIfWindows def test_functions_having_dlang_mangling_prefix(self): """ Ensure C functions with a '_D' prefix alone are not mistakenly treated ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use packaging module instead of pkg_resources (PR #93712)
labath wrote: > > That said, using a package designed (AIUI) for python versions for parsing > > versions of gcc/clang does strike me as somewhat... unusual, even if it > > does work, so _**maybe**_ there is case to be made for writing something > > custom (I'm not sure if we really need anything more elaborate than > > `tuple([int(part) for part in version.split(".")])`) > > Agreed. The first time I took a stab at this, that was the first thing I > tried, but I quickly discovered that we had at least one tool (I think it was > Python itself?) that contained alphabetical characters (something like > `1.2.3rc` or `1.2.3.dev`) and I didn't feel like dealing with all the > possible edge cases. Ah yes, I guess *one* of the versions we are parsing is the version of python itself.. > We have other packages the test suite relies on (pexpect, psutil, etc) so it > seemed reasonable, but if folks feel strongly about it we can maintain our > own "version parsing". While I don't think we should be adding deps willy-nilly, I don't think this one is more problematic than others in that they are all available through common package management systems. OTOH, it has two things going against it: - it's a hard dep breaking the ability to run any test (whereas e.g. pexpect would only break pexpect-based tests) - it should be relatively easy to replace This does not constitute an endorsement of one direction of the other, I'm just thinking out loud. https://github.com/llvm/llvm-project/pull/93712 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Fix D lang mangling test on Windows (PR #94196)
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/94196 On Windows the function does not have a symbol associated with it: Function: id = {0x01c9}, name = "_Dfunction", range = [0x000140001000-0x000140001004) LineEntry: <...> Whereas it does on Linux: Function: id = {0x0023}, name = "_Dfunction", range = [0x0734-0x0738) LineEntry: <...> Symbol: id = {0x0058}, range = [0x0734-0x0738), name="_Dfunction" This means that frame.symbol is not valid on Windows. However, frame.function is valid and it also has a "mangled" attribute. So I've updated the test to check the symbol if we've got it, and the function always. In both cases we check that mangled is empty (meaning it has not been treated as mangled) and that the display name matches the original symbol name. >From 5a3b6909601f742828d02357998be1c1338613ed Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 09:04:01 + Subject: [PATCH] [lldb][test] Fix D lang mangling test on Windows On Windows the function does not have a symbol associated with it: Function: id = {0x01c9}, name = "_Dfunction", range = [0x000140001000-0x000140001004) LineEntry: <...> Whereas it does on Linux: Function: id = {0x0023}, name = "_Dfunction", range = [0x0734-0x0738) LineEntry: <...> Symbol: id = {0x0058}, range = [0x0734-0x0738), name="_Dfunction" This means that frame.symbol is not valid on Windows. However, frame.function is valid and it also has a "mangled" attribute. So I've updated the test to check the symbol if we've got it, and the function always. In both cases we check that mangled is empty (meaning it has not been treated as mangled) and that the display name matches the original symbol name. --- lldb/test/API/lang/c/non-mangled/TestCNonMangled.py | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py index c35d8a9bb9163..c16a1185acb97 100644 --- a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py +++ b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py @@ -12,5 +12,14 @@ def test_functions_having_dlang_mangling_prefix(self): """ self.build() _, _, thread, _ = lldbutil.run_to_name_breakpoint(self, "_Dfunction") -symbol = thread.frame[0].symbol -self.assertEqual(symbol.GetDisplayName(), "_Dfunction") +frame = thread.frame[0] + +symbol = frame.symbol +# On Windows the function does not have an associated symbol. +if symbol.IsValid(): +self.assertFalse(symbol.mangled) +self.assertEqual(symbol.GetDisplayName(), "_Dfunction") + +function = frame.function +self.assertFalse(function.mangled) +self.assertEqual(function.GetDisplayName(), "_Dfunction") ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fixed TestEchoCommands.test running on a remote target (PR #94127)
labath wrote: I'd like to try this myself. How can I configure my build to run this sort of thing? https://github.com/llvm/llvm-project/pull/94127 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Fix D lang mangling test on Windows (PR #94196)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: David Spickett (DavidSpickett) Changes On Windows the function does not have a symbol associated with it: Function: id = {0x01c9}, name = "_Dfunction", range = [0x000140001000-0x000140001004) LineEntry: <...> Whereas it does on Linux: Function: id = {0x0023}, name = "_Dfunction", range = [0x0734-0x0738) LineEntry: <...> Symbol: id = {0x0058}, range = [0x0734-0x0738), name="_Dfunction" This means that frame.symbol is not valid on Windows. However, frame.function is valid and it also has a "mangled" attribute. So I've updated the test to check the symbol if we've got it, and the function always. In both cases we check that mangled is empty (meaning it has not been treated as mangled) and that the display name matches the original symbol name. --- Full diff: https://github.com/llvm/llvm-project/pull/94196.diff 1 Files Affected: - (modified) lldb/test/API/lang/c/non-mangled/TestCNonMangled.py (+11-2) ``diff diff --git a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py index c35d8a9bb9163..c16a1185acb97 100644 --- a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py +++ b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py @@ -12,5 +12,14 @@ def test_functions_having_dlang_mangling_prefix(self): """ self.build() _, _, thread, _ = lldbutil.run_to_name_breakpoint(self, "_Dfunction") -symbol = thread.frame[0].symbol -self.assertEqual(symbol.GetDisplayName(), "_Dfunction") +frame = thread.frame[0] + +symbol = frame.symbol +# On Windows the function does not have an associated symbol. +if symbol.IsValid(): +self.assertFalse(symbol.mangled) +self.assertEqual(symbol.GetDisplayName(), "_Dfunction") + +function = frame.function +self.assertFalse(function.mangled) +self.assertEqual(function.GetDisplayName(), "_Dfunction") `` https://github.com/llvm/llvm-project/pull/94196 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 8918d35 - [clang][Modules] Move `ASTSourceDescriptor` into its own file (#67930)
Author: David Stone Date: 2024-06-03T11:09:13+02:00 New Revision: 8918d35dbde126c95350b674a2bb102692d90260 URL: https://github.com/llvm/llvm-project/commit/8918d35dbde126c95350b674a2bb102692d90260 DIFF: https://github.com/llvm/llvm-project/commit/8918d35dbde126c95350b674a2bb102692d90260.diff LOG: [clang][Modules] Move `ASTSourceDescriptor` into its own file (#67930) Added: clang/include/clang/Basic/ASTSourceDescriptor.h clang/lib/Basic/ASTSourceDescriptor.cpp Modified: clang/include/clang/Basic/Module.h clang/lib/AST/ExternalASTSource.cpp clang/lib/Basic/CMakeLists.txt clang/lib/Basic/Module.cpp clang/lib/CodeGen/CGDebugInfo.h clang/lib/Serialization/ASTReader.cpp lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h lldb/source/Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.cpp lldb/source/Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.h Removed: diff --git a/clang/include/clang/Basic/ASTSourceDescriptor.h b/clang/include/clang/Basic/ASTSourceDescriptor.h new file mode 100644 index 0..175e0551db765 --- /dev/null +++ b/clang/include/clang/Basic/ASTSourceDescriptor.h @@ -0,0 +1,52 @@ +//===- ASTSourceDescriptor.h -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--===// +// +/// \file +/// Defines the clang::ASTSourceDescriptor class, which abstracts clang modules +/// and precompiled header files +// +//===--===// + +#ifndef LLVM_CLANG_BASIC_ASTSOURCEDESCRIPTOR_H +#define LLVM_CLANG_BASIC_ASTSOURCEDESCRIPTOR_H + +#include "clang/Basic/Module.h" +#include "llvm/ADT/StringRef.h" +#include +#include + +namespace clang { + +/// Abstracts clang modules and precompiled header files and holds +/// everything needed to generate debug info for an imported module +/// or PCH. +class ASTSourceDescriptor { + StringRef PCHModuleName; + StringRef Path; + StringRef ASTFile; + ASTFileSignature Signature; + Module *ClangModule = nullptr; + +public: + ASTSourceDescriptor() = default; + ASTSourceDescriptor(StringRef Name, StringRef Path, StringRef ASTFile, + ASTFileSignature Signature) + : PCHModuleName(std::move(Name)), Path(std::move(Path)), +ASTFile(std::move(ASTFile)), Signature(Signature) {} + ASTSourceDescriptor(Module &M); + + std::string getModuleName() const; + StringRef getPath() const { return Path; } + StringRef getASTFile() const { return ASTFile; } + ASTFileSignature getSignature() const { return Signature; } + Module *getModuleOrNull() const { return ClangModule; } +}; + +} // namespace clang + +#endif // LLVM_CLANG_BASIC_ASTSOURCEDESCRIPTOR_H diff --git a/clang/include/clang/Basic/Module.h b/clang/include/clang/Basic/Module.h index 2d62d05cd9190..e86f4303d732b 100644 --- a/clang/include/clang/Basic/Module.h +++ b/clang/include/clang/Basic/Module.h @@ -868,32 +868,6 @@ class VisibleModuleSet { unsigned Generation = 0; }; -/// Abstracts clang modules and precompiled header files and holds -/// everything needed to generate debug info for an imported module -/// or PCH. -class ASTSourceDescriptor { - StringRef PCHModuleName; - StringRef Path; - StringRef ASTFile; - ASTFileSignature Signature; - Module *ClangModule = nullptr; - -public: - ASTSourceDescriptor() = default; - ASTSourceDescriptor(StringRef Name, StringRef Path, StringRef ASTFile, - ASTFileSignature Signature) - : PCHModuleName(std::move(Name)), Path(std::move(Path)), -ASTFile(std::move(ASTFile)), Signature(Signature) {} - ASTSourceDescriptor(Module &M); - - std::string getModuleName() const; - StringRef getPath() const { return Path; } - StringRef getASTFile() const { return ASTFile; } - ASTFileSignature getSignature() const { return Signature; } - Module *getModuleOrNull() const { return ClangModule; } -}; - - } // namespace clang #endif // LLVM_CLANG_BASIC_MODULE_H diff --git a/clang/lib/AST/ExternalASTSource.cpp b/clang/lib/AST/ExternalASTSource.cpp index e96a474968511..a5b6f80bde694 100644 --- a/clang/lib/AST/ExternalASTSource.cpp +++ b/clang/lib/AST/ExternalASTSource.cpp @@ -15,10 +15,10 @@ #include "clang/AST/ExternalASTSource.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclarationName.h" +#include "clang/Basic/ASTSourceDescriptor.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/LLVM.h" -#include "clang/Basic/Module.h" #include "clang/Basic/SourceManager.h" #include "llvm/Support/ErrorHandling.h" #include diff --git a/clang/lib
[Lldb-commits] [clang] [lldb] [clang][Modules] Move `ASTSourceDescriptor` into its own file (PR #67930)
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/67930 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Fix D lang mangling test on Windows (PR #94196)
https://github.com/Michael137 approved this pull request. https://github.com/llvm/llvm-project/pull/94196 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 770b6c7 - [lldb][test] Add missing import in D lang mangling test
Author: David Spickett Date: 2024-06-03T09:16:49Z New Revision: 770b6c792472e1ff87e8598728d37c516861218e URL: https://github.com/llvm/llvm-project/commit/770b6c792472e1ff87e8598728d37c516861218e DIFF: https://github.com/llvm/llvm-project/commit/770b6c792472e1ff87e8598728d37c516861218e.diff LOG: [lldb][test] Add missing import in D lang mangling test Added: Modified: lldb/test/API/lang/c/non-mangled/TestCNonMangled.py Removed: diff --git a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py index c35d8a9bb9163..b10a3d6da30a1 100644 --- a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py +++ b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py @@ -1,5 +1,6 @@ import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.lldbtest import * +from lldbsuite.test.decorators import skipIfWindows class TestCase(TestBase): ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Fix D lang mangling test on Windows (PR #94196)
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/94196 >From f45103937007bbc42fe56dc172fcbee9c37a2f34 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 09:04:01 + Subject: [PATCH 1/2] [lldb][test] Fix D lang mangling test on Windows On Windows the function does not have a symbol associated with it: Function: id = {0x01c9}, name = "_Dfunction", range = [0x000140001000-0x000140001004) LineEntry: <...> Whereas it does on Linux: Function: id = {0x0023}, name = "_Dfunction", range = [0x0734-0x0738) LineEntry: <...> Symbol: id = {0x0058}, range = [0x0734-0x0738), name="_Dfunction" This means that frame.symbol is not valid on Windows. However, frame.function is valid and it also has a "mangled" attribute. So I've updated the test to check the symbol if we've got it, and the function always. In both cases we check that mangled is empty (meaning it has not been treated as mangled) and that the display name matches the original symbol name. --- lldb/test/API/lang/c/non-mangled/TestCNonMangled.py | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py index b10a3d6da30a1..78602d1b2a33c 100644 --- a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py +++ b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py @@ -13,5 +13,14 @@ def test_functions_having_dlang_mangling_prefix(self): """ self.build() _, _, thread, _ = lldbutil.run_to_name_breakpoint(self, "_Dfunction") -symbol = thread.frame[0].symbol -self.assertEqual(symbol.GetDisplayName(), "_Dfunction") +frame = thread.frame[0] + +symbol = frame.symbol +# On Windows the function does not have an associated symbol. +if symbol.IsValid(): +self.assertFalse(symbol.mangled) +self.assertEqual(symbol.GetDisplayName(), "_Dfunction") + +function = frame.function +self.assertFalse(function.mangled) +self.assertEqual(function.GetDisplayName(), "_Dfunction") >From 7157428f89a31cbe2bb06849f2578b370352b00c Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 09:17:27 + Subject: [PATCH 2/2] Remove Windows skip --- lldb/test/API/lang/c/non-mangled/TestCNonMangled.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py index 78602d1b2a33c..6f7ef247b063a 100644 --- a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py +++ b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py @@ -1,10 +1,8 @@ import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.lldbtest import * -from lldbsuite.test.decorators import skipIfWindows class TestCase(TestBase): -@skipIfWindows def test_functions_having_dlang_mangling_prefix(self): """ Ensure C functions with a '_D' prefix alone are not mistakenly treated ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 6abf361 - [lldb][test] Fix D lang mangling test on Windows (#94196)
Author: David Spickett Date: 2024-06-03T10:18:39+01:00 New Revision: 6abf361953e9c5d019a72fd83765498d269eb080 URL: https://github.com/llvm/llvm-project/commit/6abf361953e9c5d019a72fd83765498d269eb080 DIFF: https://github.com/llvm/llvm-project/commit/6abf361953e9c5d019a72fd83765498d269eb080.diff LOG: [lldb][test] Fix D lang mangling test on Windows (#94196) On Windows the function does not have a symbol associated with it: Function: id = {0x01c9}, name = "_Dfunction", range = [0x000140001000-0x000140001004) LineEntry: <...> Whereas it does on Linux: Function: id = {0x0023}, name = "_Dfunction", range = [0x0734-0x0738) LineEntry: <...> Symbol: id = {0x0058}, range = [0x0734-0x0738), name="_Dfunction" This means that frame.symbol is not valid on Windows. However, frame.function is valid and it also has a "mangled" attribute. So I've updated the test to check the symbol if we've got it, and the function always. In both cases we check that mangled is empty (meaning it has not been treated as mangled) and that the display name matches the original symbol name. Added: Modified: lldb/test/API/lang/c/non-mangled/TestCNonMangled.py Removed: diff --git a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py index b10a3d6da30a1..6f7ef247b063a 100644 --- a/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py +++ b/lldb/test/API/lang/c/non-mangled/TestCNonMangled.py @@ -1,10 +1,8 @@ import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.lldbtest import * -from lldbsuite.test.decorators import skipIfWindows class TestCase(TestBase): -@skipIfWindows def test_functions_having_dlang_mangling_prefix(self): """ Ensure C functions with a '_D' prefix alone are not mistakenly treated @@ -13,5 +11,14 @@ def test_functions_having_dlang_mangling_prefix(self): """ self.build() _, _, thread, _ = lldbutil.run_to_name_breakpoint(self, "_Dfunction") -symbol = thread.frame[0].symbol -self.assertEqual(symbol.GetDisplayName(), "_Dfunction") +frame = thread.frame[0] + +symbol = frame.symbol +# On Windows the function does not have an associated symbol. +if symbol.IsValid(): +self.assertFalse(symbol.mangled) +self.assertEqual(symbol.GetDisplayName(), "_Dfunction") + +function = frame.function +self.assertFalse(function.mangled) +self.assertEqual(function.GetDisplayName(), "_Dfunction") ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Fix D lang mangling test on Windows (PR #94196)
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/94196 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] d00731c - [lldb] s/assertEquals/assertEqual in TestDAP_variables_children
Author: Pavel Labath Date: 2024-06-03T11:23:51+02:00 New Revision: d00731cb7fcc91047531069e029964a39935a5bb URL: https://github.com/llvm/llvm-project/commit/d00731cb7fcc91047531069e029964a39935a5bb DIFF: https://github.com/llvm/llvm-project/commit/d00731cb7fcc91047531069e029964a39935a5bb.diff LOG: [lldb] s/assertEquals/assertEqual in TestDAP_variables_children Added: Modified: lldb/test/API/tools/lldb-dap/variables/children/TestDAP_variables_children.py Removed: diff --git a/lldb/test/API/tools/lldb-dap/variables/children/TestDAP_variables_children.py b/lldb/test/API/tools/lldb-dap/variables/children/TestDAP_variables_children.py index 54fb318289aec..805e88ddf8f70 100644 --- a/lldb/test/API/tools/lldb-dap/variables/children/TestDAP_variables_children.py +++ b/lldb/test/API/tools/lldb-dap/variables/children/TestDAP_variables_children.py @@ -31,7 +31,7 @@ def test_get_num_children(self): indexed = next(filter(lambda x: x["name"] == "indexed", local_vars)) not_indexed = next(filter(lambda x: x["name"] == "not_indexed", local_vars)) self.assertIn("indexedVariables", indexed) -self.assertEquals(indexed["indexedVariables"], 1) +self.assertEqual(indexed["indexedVariables"], 1) self.assertNotIn("indexedVariables", not_indexed) self.assertIn( ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] fix(lldb/**.py): fix comparison to None (PR #94017)
github-actions[bot] wrote: ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo. Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account. See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information. https://github.com/llvm/llvm-project/pull/94017 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix invalid escape sequences (PR #94034)
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/94034 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to True/False (PR #94039)
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/94039 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix invalid escape sequences (PR #94034)
github-actions[bot] wrote: ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo. Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account. See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information. https://github.com/llvm/llvm-project/pull/94034 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to None (PR #94017)
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/94017 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to None (PR #94017)
DavidSpickett wrote: I approved the workflows on this and your other changes. > We detected that you are using a GitHub private e-mail address to contribute > to the repo Please address this and then we can get this merged. https://github.com/llvm/llvm-project/pull/94017 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix invalid escape sequences (PR #94034)
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r fc21387b6510ee44520f2f17fb671f1265a9055f...5c7ba6c7d95cced5d8acc609a40a6b8307bc7fed lldb/examples/python/crashlog.py lldb/examples/python/delta.py lldb/examples/python/gdbremote.py lldb/examples/python/jump.py lldb/examples/python/performance.py lldb/examples/python/symbolication.py lldb/packages/Python/lldbsuite/test/lldbpexpect.py lldb/packages/Python/lldbsuite/test/test_runner/process_control.py lldb/test/API/commands/command/backticks/TestBackticksInAlias.py lldb/test/API/commands/expression/memory-allocation/TestMemoryAllocSettings.py lldb/test/API/commands/expression/test/TestExprs.py lldb/test/API/commands/gui/expand-threads-tree/TestGuiExpandThreadsTree.py lldb/test/API/commands/help/TestHelp.py lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py lldb/test/API/commands/register/register/TestRegistersUnavailable.py lldb/test/API/commands/settings/TestSettings.py lldb/test/API/commands/target/basic/TestTargetCommand.py lldb/test/API/commands/target/dump-separate-debug-info/dwo/TestDumpDwo.py lldb/test/API/commands/target/dump-separate-debug-info/oso/TestDumpOso.py lldb/test/API/commands/trace/TestTraceDumpInfo.py lldb/test/API/commands/trace/TestTraceEvents.py lldb/test/API/commands/trace/TestTraceStartStop.py lldb/test/API/commands/trace/TestTraceTSC.py lldb/test/API/driver/quit_speed/TestQuitWithProcess.py lldb/test/API/functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py lldb/test/API/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py lldb/test/API/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered/TestDataFormatterGenericUnordered.py lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py lldb/test/API/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py lldb/test/API/functionalities/memory-region/TestMemoryRegion.py lldb/test/API/functionalities/target_var/TestTargetVar.py lldb/test/API/iohandler/completion/TestIOHandlerCompletion.py lldb/test/API/lang/c/function_types/TestFunctionTypes.py lldb/test/API/lang/c/register_variables/TestRegisterVariables.py lldb/test/API/lang/c/set_values/TestSetValues.py lldb/test/API/lang/c/strings/TestCStrings.py lldb/test/API/lang/c/tls_globals/TestTlsGlobals.py lldb/test/API/lang/cpp/char1632_t/TestChar1632T.py lldb/test/API/lang/cpp/class_static/TestStaticVariables.py lldb/test/API/lang/cpp/class_types/TestClassTypes.py lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py lldb/test/API/lang/cpp/namespace/TestNamespace.py lldb/test/API/lang/cpp/signed_types/TestSignedTypes.py lldb/test/API/lang/cpp/unsigned_types/TestUnsignedTypes.py lldb/test/API/lang/mixed/TestMixedLanguages.py lldb/test/API/lang/objc/foundation/TestObjCMethods.py lldb/test/API/lang/objc/foundation/TestObjCMethodsNSArray.py lldb/test/API/lang/objc/foundation/TestObjCMethodsNSError.py lldb/test/API/lang/objc/foundation/TestObjCMethodsString.py lldb/test/API/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py lldb/test/API/lang/objcxx/objc-builtin-types/TestObjCBuiltinTypes.py lldb/test/API/linux/aarch64/mte_core_file/TestAArch64LinuxMTEMemoryTagCoreFile.py lldb/test/API/linux/aarch64/mte_tag_access/TestAArch64LinuxMTEMemoryTagAccess.py lldb/test/API/linux/aarch64/mte_tag_faults/TestAArch64LinuxMTEMemoryTagFaults.py lldb/test/API/linux/aarch64/tagged_memory_region/TestAArch64LinuxTaggedMemoryRegion.py lldb/test/API/macosx/add-dsym/TestAddDsymDownload.py lldb/test/API/macosx/lc-note/firmware-corefile/TestFirmwareCorefiles.py lldb/test/API/macosx/lc-note/kern-ver-str/TestKernVerStrLCNOTE.py lldb/test/API/macosx/lc-note/multiple-binary-corefile/TestMultipleBinaryCorefile.py lldb/test/API/macosx/simulator/TestSimulatorPlatform.py lldb/test/API/macosx/skinny-corefile/TestSkinnyCorefile.py lldb/test/API/python_api/target-arch-from-module/TestTargetArchFromModule.py lldb/test/API/source-manager/TestSourceManager.py lldb/test/API/tools/lldb-server/TestGdbRemoteModuleInfo.py lldb/test/API/tools/lldb-server/TestPtyServer.py lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py lldb/test/API/types/AbstractBase.py ll
[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to True/False (PR #94039)
github-actions[bot] wrote: ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo. Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account. See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information. https://github.com/llvm/llvm-project/pull/94039 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix invalid escape sequences (PR #94034)
DavidSpickett wrote: The formatter is failing, but I would prefer to keep this change purely addressing the lint warning. Certainly you can update this to reorder the "fr"/"rf" but ignore the rest of its complaints. Whoever merges this (probably me) can push a reformatting change directly afterwards. https://github.com/llvm/llvm-project/pull/94034 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to True/False (PR #94039)
https://github.com/DavidSpickett approved this pull request. This LGTM, can be merged once the private email is fixed. https://github.com/llvm/llvm-project/pull/94039 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to None (PR #94017)
https://github.com/DavidSpickett approved this pull request. Changes LGTM. https://github.com/llvm/llvm-project/pull/94017 ___ 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 --make argument to dotest.py (PR #93883)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/93883 >From 610481d82eae3423911f4cd5cac3c45a15904e57 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Sat, 13 Apr 2024 23:55:25 + Subject: [PATCH] [lldb][test] Add --make argument to dotest.py (#93883) This argument allows to specify the path to make which is used by LLDB API tests to compile test programs. It might come in handy for setting up cross-platform remote runs of API tests on Windows host. It can be used to override the make path of LLDB API tests using `LLDB_TEST_USER_ARGS` argument: ``` cmake ... -DLLDB_TEST_USER_ARGS="...;--make;C:\\Path\\to\\make.exe;..." ... ``` --- lldb/packages/Python/lldbsuite/test/builders/builder.py | 7 +-- lldb/packages/Python/lldbsuite/test/configuration.py| 1 + lldb/packages/Python/lldbsuite/test/dotest.py | 7 +++ lldb/packages/Python/lldbsuite/test/dotest_args.py | 6 ++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py index 21ea3530e24fc..4ea9a86c1d5fc 100644 --- a/lldb/packages/Python/lldbsuite/test/builders/builder.py +++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py @@ -40,11 +40,6 @@ def getMake(self, test_subdir, test_name): """Returns the invocation for GNU make. The first argument is a tuple of the relative path to the testcase and its filename stem.""" -if platform.system() == "FreeBSD" or platform.system() == "NetBSD": -make = "gmake" -else: -make = "make" - # Construct the base make invocation. lldb_test = os.environ["LLDB_TEST"] if not ( @@ -62,7 +57,7 @@ def getMake(self, test_subdir, test_name): if not os.path.isfile(makefile): makefile = os.path.join(build_dir, "Makefile") return [ -make, +configuration.make_path, "VPATH=" + src_dir, "-C", build_dir, diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py index dbd4a2d72a15d..27eef040497d1 100644 --- a/lldb/packages/Python/lldbsuite/test/configuration.py +++ b/lldb/packages/Python/lldbsuite/test/configuration.py @@ -43,6 +43,7 @@ compiler = None dsymutil = None sdkroot = None +make_path = None # The overriden dwarf verison. dwarf_version = 0 diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index 70bc1d85091bc..06acfb2f0756c 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -266,6 +266,13 @@ def parseOptionsAndInitTestdirs(): configuration.compiler = candidate break +if args.make: +configuration.make_path = args.make +elif platform_system == "FreeBSD" or platform_system == "NetBSD": +configuration.make_path = "gmake" +else: +configuration.make_path = "make" + if args.dsymutil: configuration.dsymutil = args.dsymutil elif platform_system == "Darwin": diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py index e385954f8cc03..a80428ebec589 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest_args.py +++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py @@ -96,6 +96,12 @@ def create_parser(): ), ) +group.add_argument( +"--make", +metavar="make", +dest="make", +help=textwrap.dedent("Specify which make to use."), +) group.add_argument( "--dsymutil", metavar="dsymutil", ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fixed TestEchoCommands.test running on a remote target (PR #94127)
slydiman wrote: > How can I configure my build to run this sort of thing? The simplest way is to use the same arch target, e. g. x86_64 Linux host and x86_64 Linux target. You do not need a cross compiler in this case. To run Shell tests with a remote target it is necesasry - define LLVM_TARGET_TRIPLE=x86_64-unknown-linux-gnu - define LLDB_PLATFORM_URL=connect://:1234 - run lldv-server on the target `sudo //lldb-server p --listen '*:1234' --server --log-channels 'lldb all' --min-gdbserver-port 1240 --max-gdbserver-port 1250` - run `cmake --build . --target check-lldb-shell` from a build dir https://github.com/llvm/llvm-project/pull/94127 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fixed TestEchoCommands.test running on a remote target (PR #94127)
slydiman wrote: Note `EchoCommandsQuiet.out` expects that `TestEchoCommands.test.tmp.file` will be ``` start done ``` But in case of a remote target it will be something like ``` start Platform: remote-linux Connected: no Platform: remote-linux Triple: aarch64-unknown-linux-gnu OS Version: 5.10.192 (5.10.192-tegra) Hostname: jetson-orin-1795 Connected: yes WorkingDir: /home/ubuntu Kernel: #1 SMP PREEMPT Mon Feb 19 20:19:53 PST 2024 done ``` https://github.com/llvm/llvm-project/pull/94127 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fixed TestEchoCommands.test running on a remote target (PR #94127)
labath wrote: > * LLDB_PLATFORM_URL Is that an environment variable or a cmake variable? I don't see a single instance of that string in the entire lldb source tree. Are you sure that's not some downstream feature? https://github.com/llvm/llvm-project/pull/94127 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/94220 This means that CI won't have to hardcode these. We can't do conditional installs here by platform so pexpect is listed normally. If it's installed on Windows that's fine, we just won't use it. >From e5a6eca78496e6f5ac67613f1f8368cf24ea1521 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 13:39:16 + Subject: [PATCH] [lldb] Add Python requirements.txt for test suite This means that CI won't have to hardcode these. We can't do conditional installs here by platform so pexpect is listed normally. If it's installed on Windows that's fine, we just won't use it. --- lldb/requirements.txt | 7 +++ 1 file changed, 7 insertions(+) create mode 100644 lldb/requirements.txt diff --git a/lldb/requirements.txt b/lldb/requirements.txt new file mode 100644 index 0..645004bd3f57c --- /dev/null +++ b/lldb/requirements.txt @@ -0,0 +1,7 @@ +# These Python packages are required to be able to run the LLDB test suite. + +psutil +# pexpect is only required on Linux, can be installed on Windows but pexpect +# tests are automatically skipped there because they are known not to work +# (llvm.org/pr22274). +pexpect ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: David Spickett (DavidSpickett) Changes This means that CI won't have to hardcode these. We can't do conditional installs here by platform so pexpect is listed normally. If it's installed on Windows that's fine, we just won't use it. --- Full diff: https://github.com/llvm/llvm-project/pull/94220.diff 1 Files Affected: - (added) lldb/requirements.txt (+7) ``diff diff --git a/lldb/requirements.txt b/lldb/requirements.txt new file mode 100644 index 0..645004bd3f57c --- /dev/null +++ b/lldb/requirements.txt @@ -0,0 +1,7 @@ +# These Python packages are required to be able to run the LLDB test suite. + +psutil +# pexpect is only required on Linux, can be installed on Windows but pexpect +# tests are automatically skipped there because they are known not to work +# (llvm.org/pr22274). +pexpect `` https://github.com/llvm/llvm-project/pull/94220 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
DavidSpickett wrote: I've not been able to find what versioning scheme these 2 packages use, so I'm not sure what versions to put here if any. Currently Linaro has: psutil==5.9.4 on Windows psutil == 5.9.8 on Linux pexpect==4.9.0 on Linux I don't think it needs to be `==`, but maybe pinning to a version that won't break API? If the projects have such a thing of course. This is initially for Github CI, so we could just use the Linux versions. https://github.com/llvm/llvm-project/pull/94220 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
DavidSpickett wrote: Example from MLIR: https://github.com/llvm/llvm-project/blob/a58dd0e948040b75266b2ee02292a16ed7b2afd5/mlir/python/requirements.txt#L1-L3 https://github.com/llvm/llvm-project/pull/94220 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/94220 >From e5a6eca78496e6f5ac67613f1f8368cf24ea1521 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 13:39:16 + Subject: [PATCH 1/2] [lldb] Add Python requirements.txt for test suite This means that CI won't have to hardcode these. We can't do conditional installs here by platform so pexpect is listed normally. If it's installed on Windows that's fine, we just won't use it. --- lldb/requirements.txt | 7 +++ 1 file changed, 7 insertions(+) create mode 100644 lldb/requirements.txt diff --git a/lldb/requirements.txt b/lldb/requirements.txt new file mode 100644 index 0..645004bd3f57c --- /dev/null +++ b/lldb/requirements.txt @@ -0,0 +1,7 @@ +# These Python packages are required to be able to run the LLDB test suite. + +psutil +# pexpect is only required on Linux, can be installed on Windows but pexpect +# tests are automatically skipped there because they are known not to work +# (llvm.org/pr22274). +pexpect >From c8bf4bf83e263ea48260c2f737868bd304b48e1f Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 13:51:22 + Subject: [PATCH 2/2] move to test folder --- lldb/{ => test}/requirements.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lldb/{ => test}/requirements.txt (100%) diff --git a/lldb/requirements.txt b/lldb/test/requirements.txt similarity index 100% rename from lldb/requirements.txt rename to lldb/test/requirements.txt ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fixed TestEchoCommands.test running on a remote target (PR #94127)
DavidSpickett wrote: There is an option `args.lldb_platform_url` for `dotest.py`, maybe it's that? https://github.com/llvm/llvm-project/pull/94127 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
Endilll wrote: > I've not been able to find what versioning scheme these 2 packages use, so > I'm not sure what versions to put here if any. > > Currently Linaro has: psutil==5.9.4 on Windows psutil == 5.9.8 on Linux > pexpect==4.9.0 on Linux > > I don't think it needs to be `==`, but maybe pinning to a version that won't > break API? If the projects have such a thing of course. > > This is initially for Github CI, so we could just use the Linux versions. I think you can list them as minimal required versions for now. https://github.com/llvm/llvm-project/pull/94220 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/94220 >From e5a6eca78496e6f5ac67613f1f8368cf24ea1521 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 13:39:16 + Subject: [PATCH 1/3] [lldb] Add Python requirements.txt for test suite This means that CI won't have to hardcode these. We can't do conditional installs here by platform so pexpect is listed normally. If it's installed on Windows that's fine, we just won't use it. --- lldb/requirements.txt | 7 +++ 1 file changed, 7 insertions(+) create mode 100644 lldb/requirements.txt diff --git a/lldb/requirements.txt b/lldb/requirements.txt new file mode 100644 index 0..645004bd3f57c --- /dev/null +++ b/lldb/requirements.txt @@ -0,0 +1,7 @@ +# These Python packages are required to be able to run the LLDB test suite. + +psutil +# pexpect is only required on Linux, can be installed on Windows but pexpect +# tests are automatically skipped there because they are known not to work +# (llvm.org/pr22274). +pexpect >From c8bf4bf83e263ea48260c2f737868bd304b48e1f Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 13:51:22 + Subject: [PATCH 2/3] move to test folder --- lldb/{ => test}/requirements.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lldb/{ => test}/requirements.txt (100%) diff --git a/lldb/requirements.txt b/lldb/test/requirements.txt similarity index 100% rename from lldb/requirements.txt rename to lldb/test/requirements.txt >From b4c4f0b948970f14c9615df83bbb56befced1d5b Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 14:02:52 + Subject: [PATCH 3/3] Add minimum versions --- lldb/test/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lldb/test/requirements.txt b/lldb/test/requirements.txt index 645004bd3f57c..677d7cef3d571 100644 --- a/lldb/test/requirements.txt +++ b/lldb/test/requirements.txt @@ -1,7 +1,7 @@ # These Python packages are required to be able to run the LLDB test suite. -psutil +psutil>=5.9.4 # pexpect is only required on Linux, can be installed on Windows but pexpect # tests are automatically skipped there because they are known not to work # (llvm.org/pr22274). -pexpect +pexpect>=4.9.0 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
DavidSpickett wrote: Added minimum versions. https://github.com/llvm/llvm-project/pull/94220 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
https://github.com/Endilll approved this pull request. https://github.com/llvm/llvm-project/pull/94220 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
DavidSpickett wrote: Anecdotal evidence - last time I updated these I just installed the most recent and nothing broke. So we're probably fine with minimums, especially as this will be checked regularly by the CI job. https://github.com/llvm/llvm-project/pull/94220 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/94220 >From e5a6eca78496e6f5ac67613f1f8368cf24ea1521 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 13:39:16 + Subject: [PATCH 1/4] [lldb] Add Python requirements.txt for test suite This means that CI won't have to hardcode these. We can't do conditional installs here by platform so pexpect is listed normally. If it's installed on Windows that's fine, we just won't use it. --- lldb/requirements.txt | 7 +++ 1 file changed, 7 insertions(+) create mode 100644 lldb/requirements.txt diff --git a/lldb/requirements.txt b/lldb/requirements.txt new file mode 100644 index 0..645004bd3f57c --- /dev/null +++ b/lldb/requirements.txt @@ -0,0 +1,7 @@ +# These Python packages are required to be able to run the LLDB test suite. + +psutil +# pexpect is only required on Linux, can be installed on Windows but pexpect +# tests are automatically skipped there because they are known not to work +# (llvm.org/pr22274). +pexpect >From c8bf4bf83e263ea48260c2f737868bd304b48e1f Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 13:51:22 + Subject: [PATCH 2/4] move to test folder --- lldb/{ => test}/requirements.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lldb/{ => test}/requirements.txt (100%) diff --git a/lldb/requirements.txt b/lldb/test/requirements.txt similarity index 100% rename from lldb/requirements.txt rename to lldb/test/requirements.txt >From b4c4f0b948970f14c9615df83bbb56befced1d5b Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 14:02:52 + Subject: [PATCH 3/4] Add minimum versions --- lldb/test/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lldb/test/requirements.txt b/lldb/test/requirements.txt index 645004bd3f57c..677d7cef3d571 100644 --- a/lldb/test/requirements.txt +++ b/lldb/test/requirements.txt @@ -1,7 +1,7 @@ # These Python packages are required to be able to run the LLDB test suite. -psutil +psutil>=5.9.4 # pexpect is only required on Linux, can be installed on Windows but pexpect # tests are automatically skipped there because they are known not to work # (llvm.org/pr22274). -pexpect +pexpect>=4.9.0 >From 3a0970fc822f74352e540efc9ffc0550415f7f66 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 3 Jun 2024 14:17:38 + Subject: [PATCH 4/4] no pexpect on windows --- lldb/test/requirements.txt | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lldb/test/requirements.txt b/lldb/test/requirements.txt index 677d7cef3d571..83fbe6a5e1b97 100644 --- a/lldb/test/requirements.txt +++ b/lldb/test/requirements.txt @@ -1,7 +1,6 @@ # These Python packages are required to be able to run the LLDB test suite. psutil>=5.9.4 -# pexpect is only required on Linux, can be installed on Windows but pexpect -# tests are automatically skipped there because they are known not to work -# (llvm.org/pr22274). -pexpect>=4.9.0 +# Pexpect tests are known not to work on Windows, so are disabled. +# See llvm.org/pr22274. +pexpect>=4.9.0; sys_platform != 'win32' ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/94220 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
DavidSpickett wrote: I was wrong, you can do conditionals - https://peps.python.org/pep-0508/. pexpect now not installed on Windows. https://github.com/llvm/llvm-project/pull/94220 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Add a test for evicting unreachable modules from the global module cache (PR #74894)
Michael137 wrote: Note I'm also seeing some flakiness on the public macOS buildbots: https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-matrix/322/execution/node/69/log/ https://github.com/llvm/llvm-project/pull/74894 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Improve identification of Dlang mangled names (PR #93881)
kastiglione wrote: @DavidSpickett thanks, is there a link to a log? I'm curious. https://github.com/llvm/llvm-project/pull/93881 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Improve identification of Dlang mangled names (PR #93881)
DavidSpickett wrote: Fix is https://github.com/llvm/llvm-project/pull/94196. There isn't anything to log really, the function just didn't have a symbol on Windows. https://github.com/llvm/llvm-project/pull/93881 ___ 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 --make argument to dotest.py (PR #93883)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/93883 >From 6b7b05b55926f1fecae34312a89c4271def7aa3a Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Sat, 13 Apr 2024 23:55:25 + Subject: [PATCH] [lldb][test] Add --make argument to dotest.py (#93883) This argument allows to specify the path to make which is used by LLDB API tests to compile test programs. It might come in handy for setting up cross-platform remote runs of API tests on Windows host. It can be used to override the make path of LLDB API tests using `LLDB_TEST_USER_ARGS` argument: ``` cmake ... -DLLDB_TEST_USER_ARGS="...;--make;C:\\Path\\to\\make.exe;..." ... ``` --- lldb/packages/Python/lldbsuite/test/builders/builder.py | 7 +-- lldb/packages/Python/lldbsuite/test/configuration.py| 1 + lldb/packages/Python/lldbsuite/test/dotest.py | 7 +++ lldb/packages/Python/lldbsuite/test/dotest_args.py | 6 ++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py index 21ea3530e24fc..4ea9a86c1d5fc 100644 --- a/lldb/packages/Python/lldbsuite/test/builders/builder.py +++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py @@ -40,11 +40,6 @@ def getMake(self, test_subdir, test_name): """Returns the invocation for GNU make. The first argument is a tuple of the relative path to the testcase and its filename stem.""" -if platform.system() == "FreeBSD" or platform.system() == "NetBSD": -make = "gmake" -else: -make = "make" - # Construct the base make invocation. lldb_test = os.environ["LLDB_TEST"] if not ( @@ -62,7 +57,7 @@ def getMake(self, test_subdir, test_name): if not os.path.isfile(makefile): makefile = os.path.join(build_dir, "Makefile") return [ -make, +configuration.make_path, "VPATH=" + src_dir, "-C", build_dir, diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py index dbd4a2d72a15d..27eef040497d1 100644 --- a/lldb/packages/Python/lldbsuite/test/configuration.py +++ b/lldb/packages/Python/lldbsuite/test/configuration.py @@ -43,6 +43,7 @@ compiler = None dsymutil = None sdkroot = None +make_path = None # The overriden dwarf verison. dwarf_version = 0 diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index 70bc1d85091bc..06acfb2f0756c 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -266,6 +266,13 @@ def parseOptionsAndInitTestdirs(): configuration.compiler = candidate break +if args.make: +configuration.make_path = args.make +elif platform_system == "FreeBSD" or platform_system == "NetBSD": +configuration.make_path = "gmake" +else: +configuration.make_path = "make" + if args.dsymutil: configuration.dsymutil = args.dsymutil elif platform_system == "Darwin": diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py index e385954f8cc03..a80428ebec589 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest_args.py +++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py @@ -96,6 +96,12 @@ def create_parser(): ), ) +group.add_argument( +"--make", +metavar="make", +dest="make", +help=textwrap.dedent("Specify which make to use."), +) group.add_argument( "--dsymutil", metavar="dsymutil", ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 6b7b05b - [lldb][test] Add --make argument to dotest.py (#93883)
Author: Vladislav Dzhidzhoev Date: 2024-06-03T17:30:10+02:00 New Revision: 6b7b05b55926f1fecae34312a89c4271def7aa3a URL: https://github.com/llvm/llvm-project/commit/6b7b05b55926f1fecae34312a89c4271def7aa3a DIFF: https://github.com/llvm/llvm-project/commit/6b7b05b55926f1fecae34312a89c4271def7aa3a.diff LOG: [lldb][test] Add --make argument to dotest.py (#93883) This argument allows to specify the path to make which is used by LLDB API tests to compile test programs. It might come in handy for setting up cross-platform remote runs of API tests on Windows host. It can be used to override the make path of LLDB API tests using `LLDB_TEST_USER_ARGS` argument: ``` cmake ... -DLLDB_TEST_USER_ARGS="...;--make;C:\\Path\\to\\make.exe;..." ... ``` Added: Modified: lldb/packages/Python/lldbsuite/test/builders/builder.py lldb/packages/Python/lldbsuite/test/configuration.py lldb/packages/Python/lldbsuite/test/dotest.py lldb/packages/Python/lldbsuite/test/dotest_args.py Removed: diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py index 21ea3530e24fc..4ea9a86c1d5fc 100644 --- a/lldb/packages/Python/lldbsuite/test/builders/builder.py +++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py @@ -40,11 +40,6 @@ def getMake(self, test_subdir, test_name): """Returns the invocation for GNU make. The first argument is a tuple of the relative path to the testcase and its filename stem.""" -if platform.system() == "FreeBSD" or platform.system() == "NetBSD": -make = "gmake" -else: -make = "make" - # Construct the base make invocation. lldb_test = os.environ["LLDB_TEST"] if not ( @@ -62,7 +57,7 @@ def getMake(self, test_subdir, test_name): if not os.path.isfile(makefile): makefile = os.path.join(build_dir, "Makefile") return [ -make, +configuration.make_path, "VPATH=" + src_dir, "-C", build_dir, diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py index dbd4a2d72a15d..27eef040497d1 100644 --- a/lldb/packages/Python/lldbsuite/test/configuration.py +++ b/lldb/packages/Python/lldbsuite/test/configuration.py @@ -43,6 +43,7 @@ compiler = None dsymutil = None sdkroot = None +make_path = None # The overriden dwarf verison. dwarf_version = 0 diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index 70bc1d85091bc..06acfb2f0756c 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -266,6 +266,13 @@ def parseOptionsAndInitTestdirs(): configuration.compiler = candidate break +if args.make: +configuration.make_path = args.make +elif platform_system == "FreeBSD" or platform_system == "NetBSD": +configuration.make_path = "gmake" +else: +configuration.make_path = "make" + if args.dsymutil: configuration.dsymutil = args.dsymutil elif platform_system == "Darwin": diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py index e385954f8cc03..a80428ebec589 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest_args.py +++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py @@ -96,6 +96,12 @@ def create_parser(): ), ) +group.add_argument( +"--make", +metavar="make", +dest="make", +help=textwrap.dedent("Specify which make to use."), +) group.add_argument( "--dsymutil", metavar="dsymutil", ___ 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 --make argument to dotest.py (PR #93883)
https://github.com/dzhidzhoev closed https://github.com/llvm/llvm-project/pull/93883 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Disable find-module.test in case of a remote target (PR #94165)
https://github.com/slydiman converted_to_draft https://github.com/llvm/llvm-project/pull/94165 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fixed TestEchoCommands.test running on a remote target (PR #94127)
dzhidzhoev wrote: > > * LLDB_PLATFORM_URL > > Is that an environment variable or a cmake variable? I don't see a single > instance of that string in the entire lldb source tree. Are you sure that's > not some downstream feature? > > * LLDB_PLATFORM_URL > > Is that an environment variable or a cmake variable? I don't see a single > instance of that string in the entire lldb source tree. Are you sure that's > not some downstream feature? Sorry for the confusion, the PR for the remote run of Shell tests is coming soon. This PR will be relevant after that. https://github.com/llvm/llvm-project/pull/94127 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Fixed TestEchoCommands.test running on a remote target (PR #94127)
https://github.com/slydiman converted_to_draft https://github.com/llvm/llvm-project/pull/94127 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] aad7874 - [lldb][test][NFC] TestBreakpointSetRestart.py: split up assertion to determine which check specifically fails in CI
Author: Michael Buch Date: 2024-06-03T17:04:16+01:00 New Revision: aad7874000faed77836e2bbd5c72af8776636f89 URL: https://github.com/llvm/llvm-project/commit/aad7874000faed77836e2bbd5c72af8776636f89 DIFF: https://github.com/llvm/llvm-project/commit/aad7874000faed77836e2bbd5c72af8776636f89.diff LOG: [lldb][test][NFC] TestBreakpointSetRestart.py: split up assertion to determine which check specifically fails in CI This test consistently fails on the public macOS ASAN CI (and isn't reproducible locally): ``` FAIL: test_breakpoint_set_restart_dwarf (TestBreakpointSetRestart.BreakpointSetRestart) -- Traceback (most recent call last): File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1756, in test_method return attrvalue(self) File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py", line 150, in wrapper return func(*args, **kwargs) File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py", line 36, in test_breakpoint_set_restart self.assertTrue(bp.IsValid() and bp.GetNumLocations() == 1, VALID_BREAKPOINT) AssertionError: False is not true : Got a valid breakpoint ``` >From this error we're not quite sure what about the breakpoint here is the problem. This patch splits up the assertion to narrow down the issue. Added: Modified: lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py Removed: diff --git a/lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py b/lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py index 3347f57f32869..dac6a8f06c221 100644 --- a/lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py +++ b/lldb/test/API/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py @@ -33,7 +33,8 @@ def test_breakpoint_set_restart(self): bp = target.BreakpointCreateBySourceRegex( self.BREAKPOINT_TEXT, lldb.SBFileSpec("main.cpp") ) -self.assertTrue(bp.IsValid() and bp.GetNumLocations() == 1, VALID_BREAKPOINT) +self.assertTrue(bp.IsValid(), VALID_BREAKPOINT) +self.assertEqual(bp.GetNumLocations(), 1, VALID_BREAKPOINT) while self.dbg.GetListener().WaitForEvent(2, event): if lldb.SBProcess.GetStateFromEvent( ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add documentation for the max_children argument (PR #94192)
https://github.com/jimingham approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/94192 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
https://github.com/JDevlieghere approved this pull request. https://github.com/llvm/llvm-project/pull/94220 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
https://github.com/medismailben approved this pull request. https://github.com/llvm/llvm-project/pull/94220 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb/crashlog] Always load Application Specific Backtrace Thread images (PR #94259)
https://github.com/medismailben created https://github.com/llvm/llvm-project/pull/94259 This patch changes the crashlog image loading default behaviour to not only load images from the crashed thread but also for the application specific backtrace thread. This patch also move the Application Specific Backtrace / Last Exception Backtrace tag from the thread queue field to the thread name. rdar://128276576 >From f5e231b2fa730cb0b673a0915ae418b302038184 Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Sat, 25 May 2024 13:19:03 -0700 Subject: [PATCH] [lldb/crashlog] Always load Application Specific Backtrace Thread images This patch changes the crashlog image loading default behaviour to not only load images from the crashed thread but also for the application specific backtrace thread. This patch also move the Application Specific Backtrace / Last Exception Backtrace tag from the thread queue field to the thread name. rdar://128276576 Signed-off-by: Med Ismail Bennani --- lldb/examples/python/crashlog.py | 10 ++ lldb/examples/python/crashlog_scripted_process.py | 5 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py index 641b2e64d53b1..6d5a1a74818de 100755 --- a/lldb/examples/python/crashlog.py +++ b/lldb/examples/python/crashlog.py @@ -545,9 +545,9 @@ def load_images(self, options, loaded_images=None): for image in self.images: image.resolve = True elif options.crashed_only: +images_to_load = [] for thread in self.threads: -if thread.did_crash(): -images_to_load = [] +if thread.did_crash() or thread.app_specific_backtrace: for ident in thread.idents: for image in self.find_images_with_identifier(ident): image.resolve = True @@ -858,7 +858,7 @@ def parse_app_specific_backtraces(self, json_app_specific_bts): thread = self.crashlog.Thread( len(self.crashlog.threads), True, self.crashlog.process_arch ) -thread.queue = "Application Specific Backtrace" +thread.name = "Application Specific Backtrace" if self.parse_asi_backtrace(thread, json_app_specific_bts[0]): self.crashlog.threads.append(thread) else: @@ -868,7 +868,7 @@ def parse_last_exception_backtraces(self, json_last_exc_bts): thread = self.crashlog.Thread( len(self.crashlog.threads), True, self.crashlog.process_arch ) -thread.queue = "Last Exception Backtrace" +thread.name = "Last Exception Backtrace" self.parse_frames(thread, json_last_exc_bts) self.crashlog.threads.append(thread) @@ -1168,11 +1168,13 @@ def parse_normal(self, line): self.thread = self.crashlog.Thread( idx, True, self.crashlog.process_arch ) +self.thread.name = "Application Specific Backtrace" elif line.startswith("Last Exception Backtrace:"): # iOS self.parse_mode = self.CrashLogParseMode.THREAD self.app_specific_backtrace = True idx = 1 self.thread = self.crashlog.Thread(idx, True, self.crashlog.process_arch) +self.thread.name = "Last Exception Backtrace" self.crashlog.info_lines.append(line.strip()) def parse_thread(self, line): diff --git a/lldb/examples/python/crashlog_scripted_process.py b/lldb/examples/python/crashlog_scripted_process.py index 26c5c37b7371d..4bc816e333a69 100644 --- a/lldb/examples/python/crashlog_scripted_process.py +++ b/lldb/examples/python/crashlog_scripted_process.py @@ -165,10 +165,7 @@ def __init__(self, process, args, crashlog_thread): self.backing_thread = crashlog_thread self.idx = self.backing_thread.index self.tid = self.backing_thread.id -if self.backing_thread.app_specific_backtrace: -self.name = "Application Specific Backtrace" -else: -self.name = self.backing_thread.name +self.name = self.backing_thread.name self.queue = self.backing_thread.queue self.has_crashed = self.originating_process.crashed_thread_idx == self.idx self.create_stackframes() ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb/crashlog] Always load Application Specific Backtrace Thread images (PR #94259)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Med Ismail Bennani (medismailben) Changes This patch changes the crashlog image loading default behaviour to not only load images from the crashed thread but also for the application specific backtrace thread. This patch also move the Application Specific Backtrace / Last Exception Backtrace tag from the thread queue field to the thread name. rdar://128276576 --- Full diff: https://github.com/llvm/llvm-project/pull/94259.diff 2 Files Affected: - (modified) lldb/examples/python/crashlog.py (+6-4) - (modified) lldb/examples/python/crashlog_scripted_process.py (+1-4) ``diff diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py index 641b2e64d53b1..6d5a1a74818de 100755 --- a/lldb/examples/python/crashlog.py +++ b/lldb/examples/python/crashlog.py @@ -545,9 +545,9 @@ def load_images(self, options, loaded_images=None): for image in self.images: image.resolve = True elif options.crashed_only: +images_to_load = [] for thread in self.threads: -if thread.did_crash(): -images_to_load = [] +if thread.did_crash() or thread.app_specific_backtrace: for ident in thread.idents: for image in self.find_images_with_identifier(ident): image.resolve = True @@ -858,7 +858,7 @@ def parse_app_specific_backtraces(self, json_app_specific_bts): thread = self.crashlog.Thread( len(self.crashlog.threads), True, self.crashlog.process_arch ) -thread.queue = "Application Specific Backtrace" +thread.name = "Application Specific Backtrace" if self.parse_asi_backtrace(thread, json_app_specific_bts[0]): self.crashlog.threads.append(thread) else: @@ -868,7 +868,7 @@ def parse_last_exception_backtraces(self, json_last_exc_bts): thread = self.crashlog.Thread( len(self.crashlog.threads), True, self.crashlog.process_arch ) -thread.queue = "Last Exception Backtrace" +thread.name = "Last Exception Backtrace" self.parse_frames(thread, json_last_exc_bts) self.crashlog.threads.append(thread) @@ -1168,11 +1168,13 @@ def parse_normal(self, line): self.thread = self.crashlog.Thread( idx, True, self.crashlog.process_arch ) +self.thread.name = "Application Specific Backtrace" elif line.startswith("Last Exception Backtrace:"): # iOS self.parse_mode = self.CrashLogParseMode.THREAD self.app_specific_backtrace = True idx = 1 self.thread = self.crashlog.Thread(idx, True, self.crashlog.process_arch) +self.thread.name = "Last Exception Backtrace" self.crashlog.info_lines.append(line.strip()) def parse_thread(self, line): diff --git a/lldb/examples/python/crashlog_scripted_process.py b/lldb/examples/python/crashlog_scripted_process.py index 26c5c37b7371d..4bc816e333a69 100644 --- a/lldb/examples/python/crashlog_scripted_process.py +++ b/lldb/examples/python/crashlog_scripted_process.py @@ -165,10 +165,7 @@ def __init__(self, process, args, crashlog_thread): self.backing_thread = crashlog_thread self.idx = self.backing_thread.index self.tid = self.backing_thread.id -if self.backing_thread.app_specific_backtrace: -self.name = "Application Specific Backtrace" -else: -self.name = self.backing_thread.name +self.name = self.backing_thread.name self.queue = self.backing_thread.queue self.has_crashed = self.originating_process.crashed_thread_idx == self.idx self.create_stackframes() `` https://github.com/llvm/llvm-project/pull/94259 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb/crashlog] Create stackframes for non-crashed threads (PR #94262)
https://github.com/medismailben created https://github.com/llvm/llvm-project/pull/94262 By default, the crashlog script only loads images for the crashed thread as well as the application specific thread. Prior to using SymbolFileJSON and ObjectFileJSON, it didn't make sense to create stackframes for the non-crashed threads however now, we should still create stackframes for non-crashed threads. This should also let the user pull the images after the process is launched, using `add-dsym`. >From 8a60c6526184511ce347e9975bcb4c10b04ba40f Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Sat, 25 May 2024 13:28:46 -0700 Subject: [PATCH] [lldb/crashlog] Create stackframes for non-crashed threads By default, the crashlog script only loads images for the crashed thread as well as the application specific thread. Prior to using SymbolFileJSON and ObjectFileJSON, it didn't make sense to create stackframes for the non-crashed threads however now, we should still create stackframes for non-crashed threads. This should also let the user pull the images after the process is launched, using `add-dsym`. Signed-off-by: Med Ismail Bennani --- lldb/examples/python/crashlog_scripted_process.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/lldb/examples/python/crashlog_scripted_process.py b/lldb/examples/python/crashlog_scripted_process.py index 26c5c37b7371d..9fc4b09efbd4e 100644 --- a/lldb/examples/python/crashlog_scripted_process.py +++ b/lldb/examples/python/crashlog_scripted_process.py @@ -147,9 +147,6 @@ def resolve_stackframes(thread, addr_mask, target): return frames def create_stackframes(self): -if not (self.originating_process.options.load_all_images or self.has_crashed): -return None - if not self.backing_thread or not len(self.backing_thread.frames): return None ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb/crashlog] Create stackframes for non-crashed threads (PR #94262)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Med Ismail Bennani (medismailben) Changes By default, the crashlog script only loads images for the crashed thread as well as the application specific thread. Prior to using SymbolFileJSON and ObjectFileJSON, it didn't make sense to create stackframes for the non-crashed threads however now, we should still create stackframes for non-crashed threads. This should also let the user pull the images after the process is launched, using `add-dsym`. --- Full diff: https://github.com/llvm/llvm-project/pull/94262.diff 1 Files Affected: - (modified) lldb/examples/python/crashlog_scripted_process.py (-3) ``diff diff --git a/lldb/examples/python/crashlog_scripted_process.py b/lldb/examples/python/crashlog_scripted_process.py index 26c5c37b7371d..9fc4b09efbd4e 100644 --- a/lldb/examples/python/crashlog_scripted_process.py +++ b/lldb/examples/python/crashlog_scripted_process.py @@ -147,9 +147,6 @@ def resolve_stackframes(thread, addr_mask, target): return frames def create_stackframes(self): -if not (self.originating_process.options.load_all_images or self.has_crashed): -return None - if not self.backing_thread or not len(self.backing_thread.frames): return None `` https://github.com/llvm/llvm-project/pull/94262 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 0232e2b - [lldb] Add Python requirements.txt for test suite (#94220)
Author: David Spickett Date: 2024-06-03T18:25:05+01:00 New Revision: 0232e2b15b8d3b2653f069a5683ccd29a5d29caf URL: https://github.com/llvm/llvm-project/commit/0232e2b15b8d3b2653f069a5683ccd29a5d29caf DIFF: https://github.com/llvm/llvm-project/commit/0232e2b15b8d3b2653f069a5683ccd29a5d29caf.diff LOG: [lldb] Add Python requirements.txt for test suite (#94220) This means that CI won't have to hardcode these. Added: lldb/test/requirements.txt Modified: Removed: diff --git a/lldb/test/requirements.txt b/lldb/test/requirements.txt new file mode 100644 index 0..83fbe6a5e1b97 --- /dev/null +++ b/lldb/test/requirements.txt @@ -0,0 +1,6 @@ +# These Python packages are required to be able to run the LLDB test suite. + +psutil>=5.9.4 +# Pexpect tests are known not to work on Windows, so are disabled. +# See llvm.org/pr22274. +pexpect>=4.9.0; sys_platform != 'win32' ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Add Python requirements.txt for test suite (PR #94220)
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/94220 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Fix formatter tests for clang version 15 (PR #93710)
https://github.com/clayborg commented: My main question is how did you determine the clang-14 being the right version to check against here? Which clang-14 or clang-15 did you use? The public release branches from upstream? https://github.com/llvm/llvm-project/pull/93710 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb/crashlog] Create stackframes for non-crashed threads (PR #94262)
https://github.com/medismailben updated https://github.com/llvm/llvm-project/pull/94262 >From ec250e197e73b5743566db884152bea9c17dd4b9 Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Mon, 3 Jun 2024 10:28:43 -0700 Subject: [PATCH] [lldb/crashlog] Create stackframes for non-crashed threads By default, the crashlog script only loads images for the crashed thread as well as the application specific thread. Prior to using SymbolFileJSON and ObjectFileJSON, it didn't make sense to create stackframes for the non-crashed threads however now, we should still create stackframes for non-crashed threads. This should also let the user pull the images after the process is launched, using `add-dsym`. rdar://129171513 Signed-off-by: Med Ismail Bennani --- lldb/examples/python/crashlog_scripted_process.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/lldb/examples/python/crashlog_scripted_process.py b/lldb/examples/python/crashlog_scripted_process.py index 26c5c37b7371d..9fc4b09efbd4e 100644 --- a/lldb/examples/python/crashlog_scripted_process.py +++ b/lldb/examples/python/crashlog_scripted_process.py @@ -147,9 +147,6 @@ def resolve_stackframes(thread, addr_mask, target): return frames def create_stackframes(self): -if not (self.originating_process.options.load_all_images or self.has_crashed): -return None - if not self.backing_thread or not len(self.backing_thread.frames): return None ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb/crashlog] Create stackframes for non-crashed threads (PR #94262)
https://github.com/medismailben edited https://github.com/llvm/llvm-project/pull/94262 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Re-merge `A few updates around "transcript"` #92843 (PR #94067)
https://github.com/royitaqi edited https://github.com/llvm/llvm-project/pull/94067 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Re-merge `A few updates around "transcript"` (#92843) (PR #94067)
https://github.com/royitaqi edited https://github.com/llvm/llvm-project/pull/94067 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Re-merge `A few updates around "transcript"` (#92843) (PR #94067)
https://github.com/royitaqi edited https://github.com/llvm/llvm-project/pull/94067 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Support reading DW_OP_piece from file address (PR #94026)
https://github.com/JDevlieghere updated https://github.com/llvm/llvm-project/pull/94026 >From 72844ebd5cf8f74f6db5d1c52d1f557ca942dbee Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 31 May 2024 12:21:28 -0700 Subject: [PATCH 1/2] [lldb] Support reading DW_OP_piece from file address We received a bug report where someone was trying to print a global variable without a process. This would succeed in a debug build but fail in a on optimized build. We traced the issue back to the location being described by a DW_OP_addr + DW_OP_piece. The issue is that the DWARF expression evaluator only support reading pieces from a load address. There's no reason it cannot do the same for a file address, and indeed, that solves the problem. I unsuccessfully tried to craft a test case to illustrate the original example, using a global struct and trying to trick the compiler into breaking it apart with SROA. Instead I wrote a unit test that uses a mock target to read memory from. rdar://127435923 --- lldb/include/lldb/Target/Target.h | 8 +-- lldb/source/Expression/DWARFExpression.cpp| 57 +++--- .../Expression/DWARFExpressionTest.cpp| 60 +++ 3 files changed, 100 insertions(+), 25 deletions(-) diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h index 7ad9f33586054..792a4caa76e2d 100644 --- a/lldb/include/lldb/Target/Target.h +++ b/lldb/include/lldb/Target/Target.h @@ -1077,9 +1077,9 @@ class Target : public std::enable_shared_from_this, // section, then read from the file cache // 2 - if there is a process, then read from memory // 3 - if there is no process, then read from the file cache - size_t ReadMemory(const Address &addr, void *dst, size_t dst_len, -Status &error, bool force_live_memory = false, -lldb::addr_t *load_addr_ptr = nullptr); + virtual size_t ReadMemory(const Address &addr, void *dst, size_t dst_len, +Status &error, bool force_live_memory = false, +lldb::addr_t *load_addr_ptr = nullptr); size_t ReadCStringFromMemory(const Address &addr, std::string &out_str, Status &error, bool force_live_memory = false); @@ -1615,7 +1615,7 @@ class Target : public std::enable_shared_from_this, TargetStats &GetStatistics() { return m_stats; } -private: +protected: /// Construct with optional file and arch. /// /// This member is private. Clients must use diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp index c061fd1140fff..326be0d683804 100644 --- a/lldb/source/Expression/DWARFExpression.cpp +++ b/lldb/source/Expression/DWARFExpression.cpp @@ -2123,23 +2123,22 @@ bool DWARFExpression::Evaluate( const Value::ValueType curr_piece_source_value_type = curr_piece_source_value.GetValueType(); + Scalar &scalar = curr_piece_source_value.GetScalar(); + const lldb::addr_t addr = scalar.ULongLong(LLDB_INVALID_ADDRESS); switch (curr_piece_source_value_type) { case Value::ValueType::Invalid: return false; case Value::ValueType::LoadAddress: if (process) { if (curr_piece.ResizeData(piece_byte_size) == piece_byte_size) { -lldb::addr_t load_addr = -curr_piece_source_value.GetScalar().ULongLong( -LLDB_INVALID_ADDRESS); -if (process->ReadMemory( -load_addr, curr_piece.GetBuffer().GetBytes(), -piece_byte_size, error) != piece_byte_size) { +if (process->ReadMemory(addr, curr_piece.GetBuffer().GetBytes(), +piece_byte_size, +error) != piece_byte_size) { if (error_ptr) error_ptr->SetErrorStringWithFormat( "failed to read memory DW_OP_piece(%" PRIu64 -") from 0x%" PRIx64, -piece_byte_size, load_addr); +") from load address 0x%" PRIx64, +piece_byte_size, addr); return false; } } else { @@ -2153,26 +2152,42 @@ bool DWARFExpression::Evaluate( } break; - case Value::ValueType::FileAddress: - case Value::ValueType::HostAddress: -if (error_ptr) { - lldb::addr_t addr = curr_piece_source_value.GetScalar().ULongLong( - LLDB_INVALID_ADDRESS); + case Value::ValueType::FileAddress: { +if (target) { + if (curr_piece.ResizeData(piece_byte_size) == piece_byte_size) { +if (target->ReadMemory(addr, curr_piece.GetBuffer().GetBytes(), +
[Lldb-commits] [lldb] [lldb] Support reading DW_OP_piece from file address (PR #94026)
@@ -768,3 +768,63 @@ TEST(DWARFExpression, ExtensionsDWO) { testExpressionVendorExtensions(dwo_module_sp, *dwo_dwarf_unit); } + +TEST_F(DWARFExpressionMockProcessTest, DW_OP_piece_file_addr) { + struct MockTarget : Target { JDevlieghere wrote: Very cool, thanks for the suggestion. I had to tweak it a little bit since this is using an out parameter for the bugger. I couldn't find a declarative way to do that, but if you know of one I'd love to learn more about it. https://github.com/llvm/llvm-project/pull/94026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Reapply [lldb][DWARF] Delay struct/class/union definition DIE searching when parsing declaration DIEs. (PR #92328)
Michael137 wrote: Sorry for the late ping, but the LLDB matrix bot failure has gone unnoticed for a bit. This patch caused following test to fail for DWARFv5: ``` FAIL: test_inline_static_members_dsym (TestConstStaticIntegralMember.TestCase) -- Traceback (most recent call last): File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1756, in test_method return attrvalue(self) File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py", line 132, in test_inline_static_members self.check_global_var("A::int_val", "const int", "1") File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py", line 118, in check_global_var self.assertGreaterEqual(len(var_list), 1) AssertionError: 0 not greater than or equal to 1 Config=x86_64-/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/lldb-build/bin/clang == FAIL: test_shadowed_static_inline_members_dsym (TestConstStaticIntegralMember.TestCase) Tests that the expression evaluator and SBAPI can both -- Traceback (most recent call last): File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1756, in test_method return attrvalue(self) File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py", line 184, in test_shadowed_static_inline_members self.check_global_var("ns::Foo::mem", "const int", "10") File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py", line 118, in check_global_var self.assertGreaterEqual(len(var_list), 1) AssertionError: 0 not greater than or equal to 1 Config=x86_64-/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/lldb-build/bin/clang -- Ran 18 tests in 13.171s FAILED (failures=2, skipped=6, expected failures=4) ``` https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-matrix/321/execution/node/79/log/ You can repro this by running `./bin/lldb-dotest -p TestConstStaticIntegralMember.py --dwarf-version 5` https://github.com/llvm/llvm-project/pull/92328 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Fix formatter tests for clang version 15 (PR #93710)
Michael137 wrote: What platform was this failing on for you? We have a matrix bot for macOS that runs these tests on older Clang versions. https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-matrix/ I probably wrote these checks when clang was on 16.0 to fix the matrix bot (which only had 15.0 back then) https://github.com/llvm/llvm-project/pull/93710 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Support reading DW_OP_piece from file address (PR #94026)
@@ -768,3 +768,63 @@ TEST(DWARFExpression, ExtensionsDWO) { testExpressionVendorExtensions(dwo_module_sp, *dwo_dwarf_unit); } + +TEST_F(DWARFExpressionMockProcessTest, DW_OP_piece_file_addr) { + struct MockTarget : Target { labath wrote: The code I linked to ([this one](https://github.com/llvm/llvm-project/blob/main/lldb/unittests/TestingSupport/Host/NativeProcessTestUtils.h#L73)) shows one way to do it. Basically, you implement the real function in terms on some other interface -- one which is easier to mock -- and then you mock *that*. https://github.com/llvm/llvm-project/pull/94026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Adds additional fields to ProcessInfo (PR #91544)
feg208 wrote: @clayborg This pr is ready for re-review https://github.com/llvm/llvm-project/pull/91544 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Support reading DW_OP_piece from file address (PR #94026)
https://github.com/JDevlieghere updated https://github.com/llvm/llvm-project/pull/94026 >From 72844ebd5cf8f74f6db5d1c52d1f557ca942dbee Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 31 May 2024 12:21:28 -0700 Subject: [PATCH 1/3] [lldb] Support reading DW_OP_piece from file address We received a bug report where someone was trying to print a global variable without a process. This would succeed in a debug build but fail in a on optimized build. We traced the issue back to the location being described by a DW_OP_addr + DW_OP_piece. The issue is that the DWARF expression evaluator only support reading pieces from a load address. There's no reason it cannot do the same for a file address, and indeed, that solves the problem. I unsuccessfully tried to craft a test case to illustrate the original example, using a global struct and trying to trick the compiler into breaking it apart with SROA. Instead I wrote a unit test that uses a mock target to read memory from. rdar://127435923 --- lldb/include/lldb/Target/Target.h | 8 +-- lldb/source/Expression/DWARFExpression.cpp| 57 +++--- .../Expression/DWARFExpressionTest.cpp| 60 +++ 3 files changed, 100 insertions(+), 25 deletions(-) diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h index 7ad9f33586054..792a4caa76e2d 100644 --- a/lldb/include/lldb/Target/Target.h +++ b/lldb/include/lldb/Target/Target.h @@ -1077,9 +1077,9 @@ class Target : public std::enable_shared_from_this, // section, then read from the file cache // 2 - if there is a process, then read from memory // 3 - if there is no process, then read from the file cache - size_t ReadMemory(const Address &addr, void *dst, size_t dst_len, -Status &error, bool force_live_memory = false, -lldb::addr_t *load_addr_ptr = nullptr); + virtual size_t ReadMemory(const Address &addr, void *dst, size_t dst_len, +Status &error, bool force_live_memory = false, +lldb::addr_t *load_addr_ptr = nullptr); size_t ReadCStringFromMemory(const Address &addr, std::string &out_str, Status &error, bool force_live_memory = false); @@ -1615,7 +1615,7 @@ class Target : public std::enable_shared_from_this, TargetStats &GetStatistics() { return m_stats; } -private: +protected: /// Construct with optional file and arch. /// /// This member is private. Clients must use diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp index c061fd1140fff..326be0d683804 100644 --- a/lldb/source/Expression/DWARFExpression.cpp +++ b/lldb/source/Expression/DWARFExpression.cpp @@ -2123,23 +2123,22 @@ bool DWARFExpression::Evaluate( const Value::ValueType curr_piece_source_value_type = curr_piece_source_value.GetValueType(); + Scalar &scalar = curr_piece_source_value.GetScalar(); + const lldb::addr_t addr = scalar.ULongLong(LLDB_INVALID_ADDRESS); switch (curr_piece_source_value_type) { case Value::ValueType::Invalid: return false; case Value::ValueType::LoadAddress: if (process) { if (curr_piece.ResizeData(piece_byte_size) == piece_byte_size) { -lldb::addr_t load_addr = -curr_piece_source_value.GetScalar().ULongLong( -LLDB_INVALID_ADDRESS); -if (process->ReadMemory( -load_addr, curr_piece.GetBuffer().GetBytes(), -piece_byte_size, error) != piece_byte_size) { +if (process->ReadMemory(addr, curr_piece.GetBuffer().GetBytes(), +piece_byte_size, +error) != piece_byte_size) { if (error_ptr) error_ptr->SetErrorStringWithFormat( "failed to read memory DW_OP_piece(%" PRIu64 -") from 0x%" PRIx64, -piece_byte_size, load_addr); +") from load address 0x%" PRIx64, +piece_byte_size, addr); return false; } } else { @@ -2153,26 +2152,42 @@ bool DWARFExpression::Evaluate( } break; - case Value::ValueType::FileAddress: - case Value::ValueType::HostAddress: -if (error_ptr) { - lldb::addr_t addr = curr_piece_source_value.GetScalar().ULongLong( - LLDB_INVALID_ADDRESS); + case Value::ValueType::FileAddress: { +if (target) { + if (curr_piece.ResizeData(piece_byte_size) == piece_byte_size) { +if (target->ReadMemory(addr, curr_piece.GetBuffer().GetBytes(), +
[Lldb-commits] [lldb] Re-merge `A few updates around "transcript"` (#92843) (PR #94067)
https://github.com/clayborg approved this pull request. https://github.com/llvm/llvm-project/pull/94067 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] c2d061d - Re-merge `A few updates around "transcript"` (#92843) (#94067)
Author: royitaqi Date: 2024-06-03T13:52:03-07:00 New Revision: c2d061da7e17e61d4a0efad261e5280793c1b7ce URL: https://github.com/llvm/llvm-project/commit/c2d061da7e17e61d4a0efad261e5280793c1b7ce DIFF: https://github.com/llvm/llvm-project/commit/c2d061da7e17e61d4a0efad261e5280793c1b7ce.diff LOG: Re-merge `A few updates around "transcript"` (#92843) (#94067) Problematic PR: https://github.com/llvm/llvm-project/pull/92843 Reverted by: https://github.com/llvm/llvm-project/pull/94088 The first PR added a test which fails in Linux builds (see the last few comments there). This PR contains all the changes in the first PR, plus the fix to the said test. - Co-authored-by: Roy Shi Added: Modified: lldb/include/lldb/API/SBCommandInterpreter.h lldb/include/lldb/Interpreter/CommandInterpreter.h lldb/include/lldb/Target/Statistics.h lldb/source/Commands/CommandObjectStats.cpp lldb/source/Commands/Options.td lldb/source/Interpreter/CommandInterpreter.cpp lldb/source/Target/Statistics.cpp lldb/test/API/commands/statistics/basic/TestStats.py lldb/test/API/python_api/interpreter/TestCommandInterpreterAPI.py Removed: diff --git a/lldb/include/lldb/API/SBCommandInterpreter.h b/lldb/include/lldb/API/SBCommandInterpreter.h index 8ac36344b3a79..639309aa32bfc 100644 --- a/lldb/include/lldb/API/SBCommandInterpreter.h +++ b/lldb/include/lldb/API/SBCommandInterpreter.h @@ -320,10 +320,17 @@ class SBCommandInterpreter { /// Returns a list of handled commands, output and error. Each element in /// the list is a dictionary with the following keys/values: - /// - "command" (string): The command that was executed. + /// - "command" (string): The command that was given by the user. + /// - "commandName" (string): The name of the executed command. + /// - "commandArguments" (string): The arguments of the executed command. /// - "output" (string): The output of the command. Empty ("") if no output. /// - "error" (string): The error of the command. Empty ("") if no error. - /// - "seconds" (float): The time it took to execute the command. + /// - "durationInSeconds" (float): The time it took to execute the command. + /// - "timestampInEpochSeconds" (int): The timestamp when the command is + /// executed. + /// + /// Turn on settings `interpreter.save-transcript` for LLDB to populate + /// this list. Otherwise this list is empty. SBStructuredData GetTranscript(); protected: diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h index ccc30cf4f1a82..8863523b2e31f 100644 --- a/lldb/include/lldb/Interpreter/CommandInterpreter.h +++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h @@ -776,10 +776,14 @@ class CommandInterpreter : public Broadcaster, /// Contains a list of handled commands and their details. Each element in /// the list is a dictionary with the following keys/values: - /// - "command" (string): The command that was executed. + /// - "command" (string): The command that was given by the user. + /// - "commandName" (string): The name of the executed command. + /// - "commandArguments" (string): The arguments of the executed command. /// - "output" (string): The output of the command. Empty ("") if no output. /// - "error" (string): The error of the command. Empty ("") if no error. - /// - "seconds" (float): The time it took to execute the command. + /// - "durationInSeconds" (float): The time it took to execute the command. + /// - "timestampInEpochSeconds" (int): The timestamp when the command is + /// executed. /// /// Turn on settings `interpreter.save-transcript` for LLDB to populate /// this list. Otherwise this list is empty. diff --git a/lldb/include/lldb/Target/Statistics.h b/lldb/include/lldb/Target/Statistics.h index c4f17b503a1f9..c04d529290fff 100644 --- a/lldb/include/lldb/Target/Statistics.h +++ b/lldb/include/lldb/Target/Statistics.h @@ -133,6 +133,7 @@ struct ConstStringStats { struct StatisticsOptions { bool summary_only = false; bool load_all_debug_info = false; + bool include_transcript = false; }; /// A class that represents statistics for a since lldb_private::Target. diff --git a/lldb/source/Commands/CommandObjectStats.cpp b/lldb/source/Commands/CommandObjectStats.cpp index a92bb5d1165ee..1935b0fdfadfb 100644 --- a/lldb/source/Commands/CommandObjectStats.cpp +++ b/lldb/source/Commands/CommandObjectStats.cpp @@ -81,6 +81,9 @@ class CommandObjectStatsDump : public CommandObjectParsed { case 'f': m_stats_options.load_all_debug_info = true; break; + case 't': +m_stats_options.include_transcript = true; +break; default: llvm_unreachable("Unimplemented option"); } diff --git a/lldb/source/Commands/Options.td b/lldb/source/Commands/Options.td index
[Lldb-commits] [lldb] Re-merge `A few updates around "transcript"` (#92843) (PR #94067)
https://github.com/clayborg closed https://github.com/llvm/llvm-project/pull/94067 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)
cjappl wrote: Hi @Endilll I did a git bisect that pointed to this change as the one blocking my compilation on an Ubuntu docker image with clang 14.0 The error I see: ``` CMake Error at /test_radsan/llvm-project/compiler-rt/cmake/Modules/CheckSectionExists.cmake:72 (message): cc: error: unrecognized command-line option '-Wcovered-switch-default'; did you mean '-Wno-switch-default'? cc: error: unrecognized command-line option '-Wstring-conversion'; did you mean '-Wsign-conversion'? Call Stack (most recent call first): /test_radsan/llvm-project/compiler-rt/lib/builtins/CMakeLists.txt:923 (check_section_exists) ``` My compiler info, printed from CMake: ``` CMAKE_CXX_COMPILER_VERSION: 14.0.0 CMAKE_CXX_COMPILER_ID: Clang ``` More info from the command line: ``` $ clang --version Ubuntu clang version 14.0.0-1ubuntu1.1 Target: aarch64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/bin $ uname -a Linux 18728bf50582 6.5.11-linuxkit #1 SMP PREEMPT Mon Dec 4 11:30:00 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux $ cmake --version cmake version 3.22.1 ``` Let me know what other information may be helpful, or if this is user error. It seems from your godbolt links above, clang 5.0 and higher should work, so I'm surprised that 14.0 is dying in this environment https://github.com/llvm/llvm-project/pull/92953 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb/crashlog] Create stackframes for non-crashed threads (PR #94262)
https://github.com/JDevlieghere approved this pull request. LGTM but can we test this? https://github.com/llvm/llvm-project/pull/94262 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] fix(lldb/**.py): fix comparison to True/False (PR #94039)
@@ -39,7 +39,7 @@ def check_simulator_ostype(self, sdk, platform_name, arch=platform.machine()): for device in devices: if "availability" in device and device["availability"] != "(available)": continue -if "isAvailable" in device and device["isAvailable"] != True: +if "isAvailable" in device and device["isAvailable"] is not True: JDevlieghere wrote: Can this be simplified to `if "isAvailable" in device and not device["isAvailable"]:`? https://github.com/llvm/llvm-project/pull/94039 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits