[Lldb-commits] [lldb] [lldb] Treat address found via function name as a callable address (PR #151973)

2025-08-06 Thread Pavel Labath via lldb-commits
https://github.com/labath approved this pull request. https://github.com/llvm/llvm-project/pull/151973 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB] added getName method in SBModule (PR #150331)

2025-08-04 Thread Pavel Labath via lldb-commits
https://github.com/labath commented: The code looks good, but I have a problem with the docstring, as it captures none of the subtlety around this function (which was discussed in the other thread). I'd recommend something like: "If this Module represents a part of a larger file, returns the n

[Lldb-commits] [lldb] [lldb] Reimplment PyRun_String using the Python stable C API (PR #151761)

2025-08-04 Thread Pavel Labath via lldb-commits
@@ -1469,11 +1466,33 @@ python::runStringMultiLine(const llvm::Twine &string, const PythonDictionary &locals) { if (!globals.IsValid() || !locals.IsValid()) return nullDeref(); - PyObject *result = PyRun_String(NullTerminated(string), Py_file_i

[Lldb-commits] [lldb] [lldb] Update JSONTransport to use MainLoop for reading. (PR #148300)

2025-08-04 Thread Pavel Labath via lldb-commits
@@ -7,163 +7,104 @@ //===--===// #include "lldb/Host/JSONTransport.h" -#include "lldb/Utility/IOObject.h" #include "lldb/Utility/LLDBLog.h" #include "lldb/Utility/Log.h" -#include "lldb/Utility/SelectHelper

[Lldb-commits] [lldb] [lldb] Update JSONTransport to use MainLoop for reading. (PR #148300)

2025-08-04 Thread Pavel Labath via lldb-commits
https://github.com/labath approved this pull request. Looks much better. Thanks. https://github.com/llvm/llvm-project/pull/148300 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Update JSONTransport to use MainLoop for reading. (PR #148300)

2025-08-04 Thread Pavel Labath via lldb-commits
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/148300 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB] Update DIL handling of array subscripting. (PR #151605)

2025-08-04 Thread Pavel Labath via lldb-commits
@@ -323,47 +323,144 @@ Interpreter::Visit(const MemberOfNode *node) { m_expr, errMsg, node->GetLocation(), node->GetFieldName().size()); } + llvm::Expected Interpreter::Visit(const ArraySubscriptNode *node) { auto lhs_or_err = Evaluate(node->GetBase()); if (!lhs_

[Lldb-commits] [lldb] [LLDB] Update DIL handling of array subscripting. (PR #151605)

2025-08-04 Thread Pavel Labath via lldb-commits
@@ -323,47 +323,144 @@ Interpreter::Visit(const MemberOfNode *node) { m_expr, errMsg, node->GetLocation(), node->GetFieldName().size()); } + llvm::Expected Interpreter::Visit(const ArraySubscriptNode *node) { auto lhs_or_err = Evaluate(node->GetBase()); if (!lhs_

[Lldb-commits] [lldb] [LLDB] Update DIL handling of array subscripting. (PR #151605)

2025-08-04 Thread Pavel Labath via lldb-commits
https://github.com/labath commented: I see the bitfield handling is reflected in the test case, but I don't see anything about handling of synthetic children or objc pointers. For the objc case, I'm very tempted to *not* copy that bit of code over, since it: a) is untested (or you wouldn't hav

[Lldb-commits] [lldb] [LLDB] Update DIL handling of array subscripting. (PR #151605)

2025-08-04 Thread Pavel Labath via lldb-commits
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/151605 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB] Update DIL handling of array subscripting. (PR #151605)

2025-08-04 Thread Pavel Labath via lldb-commits
@@ -323,47 +323,144 @@ Interpreter::Visit(const MemberOfNode *node) { m_expr, errMsg, node->GetLocation(), node->GetFieldName().size()); } + llvm::Expected Interpreter::Visit(const ArraySubscriptNode *node) { auto lhs_or_err = Evaluate(node->GetBase()); if (!lhs_

[Lldb-commits] [lldb] [lldb] Zero extend APInt when piece size is bigger than the bitwidth (PR #150149)

2025-08-04 Thread Pavel Labath via lldb-commits
https://github.com/labath approved this pull request. Thanks. https://github.com/llvm/llvm-project/pull/150149 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fix auto advance PC in `EmulateInstructionARM64` if PC >= 4G (PR #151460)

2025-08-04 Thread Pavel Labath via lldb-commits
@@ -13,15 +13,124 @@ #include "lldb/Core/Disassembler.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Utility/ArchSpec.h" +#include "lldb/Utility/RegisterValue.h" #include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h" +#include "Plugins/Process/Utility/Re

[Lldb-commits] [lldb] [lldb] Fix auto advance PC in `EmulateInstructionARM64` if PC >= 4G (PR #151460)

2025-08-04 Thread Pavel Labath via lldb-commits
https://github.com/labath approved this pull request. https://github.com/llvm/llvm-project/pull/151460 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Implement DW_CFA_val_offset and DW_CFA_val_offset_sf (PR #150732)

2025-08-04 Thread Pavel Labath via lldb-commits
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/150732 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Implement DW_CFA_val_offset and DW_CFA_val_offset_sf (PR #150732)

2025-08-04 Thread Pavel Labath via lldb-commits
https://github.com/labath approved this pull request. > I don't think the non-standard return pointer bit from > eh-frame-dwarf-unwind.test should be necessary but if I remove it, lldb > starts trying to read the code instead of using the CFI and it stops > unwinding correctly Yeah, that's be

[Lldb-commits] [lldb] [lldb] Implement DW_CFA_val_offset and DW_CFA_val_offset_sf (PR #150732)

2025-08-04 Thread Pavel Labath via lldb-commits
@@ -0,0 +1,58 @@ +# Test handing of the dwarf val_offset() rule which can be used to reconstruct +# the value of a register that is neither in a live register or saved on the +# stack but is computable with CFA + offset. + +# UNSUPPORTED: system-windows, ld_new-bug +# REQUIRES: ta

[Lldb-commits] [lldb] [lldb] Fix race condition in Process::WaitForProcessToStop() (PR #144919)

2025-08-04 Thread Pavel Labath via lldb-commits
labath wrote: Agreed. I think the right fix is to make sure that event gets consumed by the EvaluateExpression machinery. https://github.com/llvm/llvm-project/pull/144919 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-31 Thread Pavel Labath via lldb-commits
https://github.com/labath approved this pull request. LGTM. Thanks for working on this. https://github.com/llvm/llvm-project/pull/148877 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-comm

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-31 Thread Pavel Labath via lldb-commits
@@ -906,6 +982,20 @@ lldb::addr_t IRExecutionUnit::FindInUserDefinedSymbols( lldb::addr_t IRExecutionUnit::FindSymbol(lldb_private::ConstString name, bool &missing_weak) { + if (name.GetStringRef().starts_with(FunctionCallLabelPrefix))

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-30 Thread Pavel Labath via lldb-commits
@@ -26,3 +30,74 @@ Expression::Expression(ExecutionContextScope &exe_scope) m_jit_end_addr(LLDB_INVALID_ADDRESS) { assert(m_target_wp.lock()); } + +/// Returns the components of the specified function call label. +/// +/// The format of \c label is described in \c Funct

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-30 Thread Pavel Labath via lldb-commits
@@ -906,6 +982,20 @@ lldb::addr_t IRExecutionUnit::FindInUserDefinedSymbols( lldb::addr_t IRExecutionUnit::FindSymbol(lldb_private::ConstString name, bool &missing_weak) { + if (name.GetStringRef().starts_with(FunctionCallLabelPrefix))

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-30 Thread Pavel Labath via lldb-commits
@@ -2158,6 +2160,21 @@ FunctionDecl *TypeSystemClang::CreateFunctionDeclaration( func_decl->setConstexprKind(isConstexprSpecified ? ConstexprSpecKind::Constexpr : ConstexprSpecKind::Unspecified); + + // Atta

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-30 Thread Pavel Labath via lldb-commits
@@ -2471,6 +2471,58 @@ bool SymbolFileDWARF::ResolveFunction(const DWARFDIE &orig_die, return false; } +llvm::Error +SymbolFileDWARF::ResolveFunctionCallLabel(SymbolContextList &sc_list, + const FunctionCallLabel &label) { + std::lo

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-30 Thread Pavel Labath via lldb-commits
@@ -26,3 +30,74 @@ Expression::Expression(ExecutionContextScope &exe_scope) m_jit_end_addr(LLDB_INVALID_ADDRESS) { assert(m_target_wp.lock()); } + +/// Returns the components of the specified function call label. +/// +/// The format of \c label is described in \c Funct

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-30 Thread Pavel Labath via lldb-commits
@@ -771,6 +774,79 @@ class LoadAddressResolver { lldb::addr_t m_best_internal_load_address = LLDB_INVALID_ADDRESS; }; +/// Find a module by LLDB-specific unique identifier. +/// +/// \param[in] uid The UID of the module assigned to it on construction. +/// +/// \returns Modu

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-30 Thread Pavel Labath via lldb-commits
@@ -7651,7 +7668,7 @@ TypeSystemClang::CreateParameterDeclarations( clang::CXXMethodDecl *TypeSystemClang::AddMethodToCXXRecordType( lldb::opaque_compiler_type_t type, llvm::StringRef name, -const char *mangled_name, const CompilerType &method_clang_type, +std::opt

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-30 Thread Pavel Labath via lldb-commits
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/148877 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-30 Thread Pavel Labath via lldb-commits
https://github.com/labath commented: I think this is looking very good now. A couple of small comments, but nothing fundamental. It would be nice to put the TypeSystemClang interface changes into a separate PR, just so we reduce the blast radius in case this ends up (temporarily :)) reverted

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-30 Thread Pavel Labath via lldb-commits
@@ -328,6 +329,21 @@ class SymbolFile : public PluginInterface { GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector &mangled_names); + /// Resolves the function corresponding to the specified LLDB function + /// cal

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-30 Thread Pavel Labath via lldb-commits
@@ -771,6 +774,81 @@ class LoadAddressResolver { lldb::addr_t m_best_internal_load_address = LLDB_INVALID_ADDRESS; }; +/// Find a module by LLDB-specific unique identifier. +/// +/// \param[in] uid The UID of the module assigned to it on construction. +/// +/// \returns Modu

[Lldb-commits] [lldb] [lldb] Implement DW_CFA_val_offset and DW_CFA_val_offset_sf (PR #150732)

2025-07-30 Thread Pavel Labath via lldb-commits
labath wrote: Okay I see what you mean now. I agree with your assessment. The code looks code. The test you added only checks that the eh_frame section was parsed correctly. Could you also add a test to verify that we compute the right register value? I'm imagining something like test/Shell/U

[Lldb-commits] [lldb] [LLDB][NativePDB] Fix name access for classes in `CVTagRecord::name` (PR #151190)

2025-07-29 Thread Pavel Labath via lldb-commits
https://github.com/labath approved this pull request. https://github.com/llvm/llvm-project/pull/151190 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB] added getName method in SBModule (PR #150331)

2025-07-29 Thread Pavel Labath via lldb-commits
@@ -18,6 +18,26 @@ def tearDown(self): if self.background_pid: os.kill(self.background_pid, signal.SIGKILL) +def test_getname(self): +"""Test the SBModule::GetName() method""" +self.build() +target, _, _, _ = lldbutil.run_to_sour

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-29 Thread Pavel Labath via lldb-commits
@@ -121,6 +121,15 @@ size_t Module::GetNumberAllocatedModules() { return GetModuleCollection().size(); } +Module *Module::GetAllocatedModuleWithUID(lldb::user_id_t uid) { + std::lock_guard guard( + GetAllocationModuleCollectionMutex()); + for (Module *mod : GetModuleC

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-29 Thread Pavel Labath via lldb-commits
https://github.com/labath commented: I have a feeling something went wrong with the latest update. (I don't think you meant to undo the last months changes to ConnectionFileDescriptor). Can you fix that? I'm fine with a force-push, if needed. Did you also want to drop the "Draft" annotation (m

[Lldb-commits] [lldb] [LLDB][NativePDB] Allow type lookup in namespaces (PR #149876)

2025-07-29 Thread Pavel Labath via lldb-commits
@@ -2203,9 +2207,13 @@ void SymbolFileNativePDB::BuildParentMap() { RecordIndices &indices = record_indices[tag.asTag().getUniqueName()]; if (tag.asTag().isForwardRef()) labath wrote: Add braces on both sides. https://github.com/llvm/llvm-project/pull/

[Lldb-commits] [lldb] [LLDB][NativePDB] Allow type lookup in namespaces (PR #149876)

2025-07-29 Thread Pavel Labath via lldb-commits
https://github.com/labath commented: This looks good to me, unless someone has additional comments (?) https://github.com/llvm/llvm-project/pull/149876 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[Lldb-commits] [lldb] [LLDB][NativePDB] Allow type lookup in namespaces (PR #149876)

2025-07-29 Thread Pavel Labath via lldb-commits
@@ -134,7 +134,9 @@ bool TypeQuery::ContextMatches( if (ctx == ctx_end) return false; // Pattern too long. -if (ctx->kind == CompilerContextKind::Namespace && ctx->name.IsEmpty()) { +if ((ctx->kind & CompilerContextKind::Namespace) == labath

[Lldb-commits] [lldb] [LLDB][NativePDB] Allow type lookup in namespaces (PR #149876)

2025-07-29 Thread Pavel Labath via lldb-commits
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/149876 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Zero extend APInt when piece size is bigger than the bitwidth (PR #150149)

2025-07-29 Thread Pavel Labath via lldb-commits
@@ -1978,7 +1978,12 @@ llvm::Expected DWARFExpression::Evaluate( // grows to the nearest host integer type. llvm::APInt fail_value(1, 0, false); llvm::APInt ap_int = scalar.UInt128(fail_value); -assert(ap_int.getBitWidth() >= bit_

[Lldb-commits] [lldb] [LLDB] added getName method in SBModule (PR #150331)

2025-07-29 Thread Pavel Labath via lldb-commits
@@ -18,6 +18,26 @@ def tearDown(self): if self.background_pid: os.kill(self.background_pid, signal.SIGKILL) +def test_getname(self): +"""Test the SBModule::GetName() method""" +self.build() +target, _, _, _ = lldbutil.run_to_sour

[Lldb-commits] [lldb] [lldb] Implement DW_CFA_val_offset and DW_CFA_val_offset_sf (PR #150732)

2025-07-29 Thread Pavel Labath via lldb-commits
labath wrote: This looks better, though it makes me even more convinced that this could handled by extending the existing case rather than introducing a new one. The code you added to `ReadRegisterValueFromRegisterLocation` is basically a copy of the `eRegisterInRegister`, with the addition of

[Lldb-commits] [lldb] [lldb][test] Fix running TestWithLimitDebugInfo.py on Windows (PR #150579)

2025-07-29 Thread Pavel Labath via lldb-commits
@@ -1775,16 +1775,20 @@ def no_reason(_): attrvalue, "__no_debug_info_test__", False ): # If any debug info categories were explicitly tagged, assume that list to be -# authoritative. If none were specified, try with

[Lldb-commits] [lldb] [lldb] Zero extend APInt when piece size is bigger than the bitwidth (PR #150149)

2025-07-28 Thread Pavel Labath via lldb-commits
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/150149 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][NFC] Use IterationAction for ModuleList::ForEach callbacks (PR #150930)

2025-07-28 Thread Pavel Labath via lldb-commits
https://github.com/labath approved this pull request. https://github.com/llvm/llvm-project/pull/150930 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] [Windows] Silence format string warnings (PR #150886)

2025-07-28 Thread Pavel Labath via lldb-commits
Martin =?utf-8?q?Storsjö?= Message-ID: In-Reply-To: https://github.com/labath approved this pull request. Looks good, though personally, I'd use `FromErrorStringWithFormatv` and let it deduce the format. https://github.com/llvm/llvm-project/pull/150886 ___

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-28 Thread Pavel Labath via lldb-commits
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/148877 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Zero extend APInt when piece size is bigger than the bitwidth (PR #150149)

2025-07-28 Thread Pavel Labath via lldb-commits
@@ -1978,7 +1978,12 @@ llvm::Expected DWARFExpression::Evaluate( // grows to the nearest host integer type. llvm::APInt fail_value(1, 0, false); llvm::APInt ap_int = scalar.UInt128(fail_value); -assert(ap_int.getBitWidth() >= bit_

[Lldb-commits] [lldb] [lldb] Implement DW_CFA_val_offset and DW_CFA_val_offset_sf (PR #150732)

2025-07-28 Thread Pavel Labath via lldb-commits
labath wrote: Would it make sense to also remove the `inOtherRegister` case (make it a special case of this one with offset=0)? https://github.com/llvm/llvm-project/pull/150732 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.ll

[Lldb-commits] [lldb] [lldb][test] Fix running TestWithLimitDebugInfo.py on Windows (PR #150579)

2025-07-28 Thread Pavel Labath via lldb-commits
https://github.com/labath approved this pull request. https://github.com/llvm/llvm-project/pull/150579 ___ 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 running TestWithLimitDebugInfo.py on Windows (PR #150579)

2025-07-28 Thread Pavel Labath via lldb-commits
@@ -1775,16 +1775,20 @@ def no_reason(_): attrvalue, "__no_debug_info_test__", False ): # If any debug info categories were explicitly tagged, assume that list to be -# authoritative. If none were specified, try with

[Lldb-commits] [lldb] [lldb][test] Fix running TestWithLimitDebugInfo.py on Windows (PR #150579)

2025-07-28 Thread Pavel Labath via lldb-commits
@@ -1775,16 +1775,20 @@ def no_reason(_): attrvalue, "__no_debug_info_test__", False ): # If any debug info categories were explicitly tagged, assume that list to be -# authoritative. If none were specified, try with

[Lldb-commits] [lldb] [LLDB][NativePDB] Allow type lookup in namespaces (PR #149876)

2025-07-28 Thread Pavel Labath via lldb-commits
@@ -134,7 +134,9 @@ bool TypeQuery::ContextMatches( if (ctx == ctx_end) return false; // Pattern too long. -if (ctx->kind == CompilerContextKind::Namespace && ctx->name.IsEmpty()) { +if ((ctx->kind & CompilerContextKind::Namespace) == labath

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-28 Thread Pavel Labath via lldb-commits
@@ -2471,6 +2471,47 @@ bool SymbolFileDWARF::ResolveFunction(const DWARFDIE &orig_die, return false; } +llvm::Error +SymbolFileDWARF::FindAndResolveFunction(SymbolContextList &sc_list, +llvm::StringRef lookup_name) { + std::lock_guar

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -20,212 +18,342 @@ using namespace testing; namespace { -class MockSyncService : public AdbClient::SyncService { +class MockConnection : public Connection { labath wrote: Is this used anywhere? If it is, it may be better to just use a real connection ins

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -0,0 +1,46 @@ +//===-- AdbClientUtils.h --===// +// +// 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: Apa

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -220,6 +220,12 @@ ConnectionStatus ConnectionFileDescriptor::Disconnect(Status *error_ptr) { // Prevents reads and writes during shutdown. m_shutting_down = true; + if (!m_io_sp) { labath wrote: Is this still needed? I mean, it sort of makes sense, b

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -8,98 +8,45 @@ #include "AdbClient.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/FileUtilities.h" - -#include "lldb/Host/ConnectionFileDescriptor.h" -#include "lldb/Host/FileSystem.h" -#inclu

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -32,50 +34,14 @@ class AdbClient { using DeviceIDList = std::list; - class SyncService { -friend class AdbClient; - - public: -virtual ~SyncService(); - -virtual Status PullFile(const FileSpec &remote_file, -const FileSpec &local

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -418,13 +436,68 @@ bool PlatformAndroid::GetRemoteOSVersion() { return !m_os_version.empty(); } +uint32_t PlatformAndroid::FindProcesses( +const ProcessInstanceInfoMatch &match_info, +ProcessInstanceInfoList &process_infos) { + Status error; + AdbClientUP adb(Ge

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -418,13 +436,68 @@ bool PlatformAndroid::GetRemoteOSVersion() { return !m_os_version.empty(); } +uint32_t PlatformAndroid::FindProcesses( labath wrote: How does this relate to the rest of the patch? https://github.com/llvm/llvm-project/pull/145382 _

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -445,11 +518,9 @@ PlatformAndroid::GetLibdlFunctionDeclarations(lldb_private::Process *process) { } PlatformAndroid::AdbClientUP PlatformAndroid::GetAdbClient(Status &error) { - AdbClientUP adb(std::make_unique(m_device_id)); - if (adb) -error.Clear(); - else -e

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -108,62 +55,73 @@ Status AdbClient::CreateByDeviceID(const std::string &device_id, "Expected a single connected device, got instead %zu - try " "setting 'ANDROID_SERIAL'", connected_devices.size()); -adb.SetDeviceID(connected_devices.front(

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/145382 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
https://github.com/labath commented: I like what you've done, though it makes it a bit difficult to review. In the future, if you find yourself moving lot of code around, try to separate that from the functional changes into a PR of its own. That makes things flow a lot easier. In this case,

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -0,0 +1,162 @@ +//===-- AdbClientUtils.cpp ===// +// +// 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: Ap

[Lldb-commits] [lldb] [lldb] refactor PlatformAndroid (PR #145382)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -0,0 +1,162 @@ +//===-- AdbClientUtils.cpp ===// +// +// 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: Ap

[Lldb-commits] [lldb] [lldb][test] Fix running TestWithLimitDebugInfo.py on Windows (PR #150579)

2025-07-25 Thread Pavel Labath via lldb-commits
https://github.com/labath commented: This makes sense, but I wouldn't want people to start using `@remove_test_categories` randomly. Could you make it so that the removal logic is internal to the magic test multiplier? The code is already dealing with categories explicitly, so I think that you

[Lldb-commits] [lldb] [lldb][test] Fix running TestWithLimitDebugInfo.py on Windows (PR #150579)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -1799,6 +1799,7 @@ def no_reason(_): for cat in categories: @decorators.add_test_categories([cat]) +@decorators.remove_test_categories(categories) labath wrote: (Also, the decorators are applied from

[Lldb-commits] [lldb] [lldb][test] Fix running TestWithLimitDebugInfo.py on Windows (PR #150579)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -1799,6 +1799,7 @@ def no_reason(_): for cat in categories: @decorators.add_test_categories([cat]) +@decorators.remove_test_categories(categories) labath wrote: The loop creates a new function every i

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -771,6 +774,63 @@ class LoadAddressResolver { lldb::addr_t m_best_internal_load_address = LLDB_INVALID_ADDRESS; }; +/// Returns address of the function referred to by the special function call +/// label \c label. +/// +/// \param[in] label Function call label encoding th

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -2471,6 +2471,47 @@ bool SymbolFileDWARF::ResolveFunction(const DWARFDIE &orig_die, return false; } +llvm::Error +SymbolFileDWARF::FindAndResolveFunction(SymbolContextList &sc_list, +llvm::StringRef lookup_name) { + std::lock_guar

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -96,6 +96,31 @@ class Expression { ///invalid. }; +/// Holds parsed information about a function call label that +/// LLDB attaches as an AsmLabel to function AST nodes it parses +/// from debug-info. +/// +/// The format being: +/// +///

[Lldb-commits] [lldb] [llvm] [LLDB] Switch to using DIL as default implementation for 'frame var'. (PR #147887)

2025-07-25 Thread Pavel Labath via lldb-commits
labath wrote: Okay, here goes nothing. https://github.com/llvm/llvm-project/pull/147887 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [llvm] [LLDB] Switch to using DIL as default implementation for 'frame var'. (PR #147887)

2025-07-25 Thread Pavel Labath via lldb-commits
labath wrote: /cherry-pick f5c676d6d95dc63b8dcb43dd2e4dfc913a9c5a50 33396d71e9aef624670380e11348a11b8ff74246 https://github.com/llvm/llvm-project/pull/147887 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[Lldb-commits] [lldb] [llvm] [LLDB] Switch to using DIL as default implementation for 'frame var'. (PR #147887)

2025-07-25 Thread Pavel Labath via lldb-commits
https://github.com/labath milestoned https://github.com/llvm/llvm-project/pull/147887 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [LLDB] added getName method in SBModule (PR #150331)

2025-07-25 Thread Pavel Labath via lldb-commits
labath wrote: I don't think that `m_object_name` is what you're looking for. It's supposed to be used for disambiguation when a single physical file contains multiple logical object files, such as with BSD archives. It being empty for "normal" files is kind of expected: ``` ConstString m_obj

[Lldb-commits] [lldb] [llvm] [lldb][windows] use Windows APIs to print to the console (PR #149493)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -247,6 +248,28 @@ uint32_t File::GetPermissions(Status &error) const { return file_stats.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); } +NativeFile::NativeFile() +: m_descriptor(kInvalidDescriptor), m_stream(kInvalidStream) {} + +NativeFile::NativeFile(FILE *fh, bool tran

[Lldb-commits] [lldb] [lldb] Zero extend APInt when piece size is bigger than the bitwidth (PR #150149)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -1978,7 +1978,12 @@ llvm::Expected DWARFExpression::Evaluate( // grows to the nearest host integer type. llvm::APInt fail_value(1, 0, false); llvm::APInt ap_int = scalar.UInt128(fail_value); -assert(ap_int.getBitWidth() >= bit_

[Lldb-commits] [lldb] [lldb] Zero extend APInt when piece size is bigger than the bitwidth (PR #150149)

2025-07-25 Thread Pavel Labath via lldb-commits
https://github.com/labath edited https://github.com/llvm/llvm-project/pull/150149 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Zero extend APInt when piece size is bigger than the bitwidth (PR #150149)

2025-07-25 Thread Pavel Labath via lldb-commits
https://github.com/labath commented: I'm not sure that what clang is doing is completely compliant. According to the standard, DWARF expression values """can represent a value of any supported base type of the target machine. Instead of a base type, elements can have a generic type, which is a

[Lldb-commits] [lldb] [LLDB][NativePDB] Allow type lookup in namespaces (PR #149876)

2025-07-25 Thread Pavel Labath via lldb-commits
@@ -134,7 +134,9 @@ bool TypeQuery::ContextMatches( if (ctx == ctx_end) return false; // Pattern too long. -if (ctx->kind == CompilerContextKind::Namespace && ctx->name.IsEmpty()) { +if ((ctx->kind & CompilerContextKind::Namespace) == labath

[Lldb-commits] [lldb] Draft: [LLDB] Add scalar literal node (PR #147064)

2025-07-24 Thread Pavel Labath via lldb-commits
labath wrote: > single interface to traverse the AST tree: That's the part that would change in this setup. Instead of one API, we'd have two: `EvaluateValueNode()` and `EvaluateScalarNode()`, and we'd have two node hierarchies: ValueNode and ScalarNode. MemberOfNode would be a ValueNode beca

[Lldb-commits] [lldb] [llvm] [LLDB] Switch to using DIL as default implementation for 'frame var'. (PR #147887)

2025-07-24 Thread Pavel Labath via lldb-commits
labath wrote: In that case, please create the cherry pick as soon as possible, and we can see where that discussion leads us. For myself, I'm going to defer @JDevlieghere opinion. https://github.com/llvm/llvm-project/pull/147887 ___ lldb-commits mail

[Lldb-commits] [lldb] [LLDB] Process minidump is in memory check command (PR #149401)

2025-07-24 Thread Pavel Labath via lldb-commits
labath wrote: The command does seem rather specialized. Being able to see where a piece of memory was mapped to is useful even if you can't read that piece of memory, but I can definitely imagine the "memory region" command flagging this specially in some way. Not sure how though... https://g

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-24 Thread Pavel Labath via lldb-commits
@@ -2471,6 +2471,47 @@ bool SymbolFileDWARF::ResolveFunction(const DWARFDIE &orig_die, return false; } +llvm::Error +SymbolFileDWARF::FindAndResolveFunction(SymbolContextList &sc_list, +llvm::StringRef lookup_name) { + std::lock_guar

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-24 Thread Pavel Labath via lldb-commits
@@ -9759,3 +9782,51 @@ void TypeSystemClang::LogCreation() const { LLDB_LOG(log, "Created new TypeSystem for (ASTContext*){0:x} '{1}'", &getASTContext(), getDisplayName()); } + +// Expected format is: +// $__lldb_func::: labath wrote: Maybe pu

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-24 Thread Pavel Labath via lldb-commits
@@ -249,6 +250,28 @@ static unsigned GetCXXMethodCVQuals(const DWARFDIE &subprogram, return cv_quals; } +static std::optional MakeLLDBFuncAsmLabel(const DWARFDIE &die) { + char const *name = die.GetMangledName(/*substitute_name_allowed*/ false); + if (!name) +return s

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-24 Thread Pavel Labath via lldb-commits
@@ -130,8 +139,11 @@ Module *Module::GetAllocatedModuleAtIndex(size_t idx) { return nullptr; } +// TODO: needs a mutex labath wrote: .. or you can make it an atomic. https://github.com/llvm/llvm-project/pull/148877 _

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-24 Thread Pavel Labath via lldb-commits
@@ -130,8 +139,11 @@ Module *Module::GetAllocatedModuleAtIndex(size_t idx) { return nullptr; } +// TODO: needs a mutex +static lldb::user_id_t g_unique_id = 1; + Module::Module(const ModuleSpec &module_spec) -: m_unwind_table(*this), m_file_has_changed(false), +: Us

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-24 Thread Pavel Labath via lldb-commits
@@ -96,6 +96,31 @@ class Expression { ///invalid. }; +/// Holds parsed information about a function call label that +/// LLDB attaches as an AsmLabel to function AST nodes it parses +/// from debug-info. +/// +/// The format being: +/// +///

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-24 Thread Pavel Labath via lldb-commits
@@ -771,6 +774,63 @@ class LoadAddressResolver { lldb::addr_t m_best_internal_load_address = LLDB_INVALID_ADDRESS; }; +/// Returns address of the function referred to by the special function call +/// label \c label. +/// +/// \param[in] label Function call label encoding th

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-24 Thread Pavel Labath via lldb-commits
@@ -121,6 +121,15 @@ size_t Module::GetNumberAllocatedModules() { return GetModuleCollection().size(); } +Module *Module::GetAllocatedModuleWithUID(lldb::user_id_t uid) { + std::lock_guard guard( + GetAllocationModuleCollectionMutex()); + for (Module *mod : GetModuleC

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-24 Thread Pavel Labath via lldb-commits
@@ -96,6 +96,31 @@ class Expression { ///invalid. }; +/// Holds parsed information about a function call label that +/// LLDB attaches as an AsmLabel to function AST nodes it parses +/// from debug-info. +/// +/// The format being: +/// +///

[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

2025-07-24 Thread Pavel Labath via lldb-commits
@@ -96,6 +96,31 @@ class Expression { ///invalid. }; +/// Holds parsed information about a function call label that +/// LLDB attaches as an AsmLabel to function AST nodes it parses +/// from debug-info. +/// +/// The format being: +/// +///

[Lldb-commits] [lldb] [LLDB] Run API tests with native PDB too (PR #149305)

2025-07-24 Thread Pavel Labath via lldb-commits
labath wrote: Don't take this to imply I'm against removing the non-native plugin (I'm not, I'd very much like to get rid of it myself), but here are a couple of alternatives: - it has always bothered me that this is controlled by an environment variable. The original justification was that it

[Lldb-commits] [lldb] [llvm] [LLDB] Switch to using DIL as default implementation for 'frame var'. (PR #147887)

2025-07-24 Thread Pavel Labath via lldb-commits
labath wrote: The process for that is [here](https://llvm.org/docs/GitHub.html#backporting-fixes-to-the-release-branches), though it's a bit unfortunate that a week has passed since then (I was OOO this week so I couldn't reply sooner). At this point, I'm no longer sure it makes sense to do t

[Lldb-commits] [lldb] Draft: [LLDB] Add scalar literal node (PR #147064)

2025-07-24 Thread Pavel Labath via lldb-commits
labath wrote: > 1. Constant wrapping/unwrapping of Scalar(APInt). For literals, it goes: > parse as APInt -> wrap to Scalar to create a node -> unwrap APInt to create > ValueObjectSP -> wrap to Scalar to use arithmetic operation -> unwrap APInt > to create ValueObjectSP. Not sure if it's a pro

[Lldb-commits] [lldb] [LLDB] Ptrace seize dead processes on Linux (PR #137041)

2025-07-24 Thread Pavel Labath via lldb-commits
labath wrote: Sorry about the delay. I'm not sure I understand the question, but the way I'm imagining this is to let the server communicate the "is it safe to resume" bit to the client. After that, the client can do whatever it wants/needs (e.g. disable jitting/expression evaluation). I thin

  1   2   3   4   5   6   7   8   9   10   >