[Lldb-commits] [PATCH] D97985: [lldb] Rename QueueFundamentalPlan to QueueBasePlan (NFC)
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe7361c8eccb7: [lldb] Rename QueueFundamentalPlan to QueueBasePlan (NFC) (authored by kastiglione). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97985/new/ https://reviews.llvm.org/D97985 Files: lldb/include/lldb/Target/Thread.h lldb/include/lldb/Target/ThreadPlanBase.h lldb/source/Target/Thread.cpp lldb/source/Target/ThreadPlanStack.cpp Index: lldb/source/Target/ThreadPlanStack.cpp === --- lldb/source/Target/ThreadPlanStack.cpp +++ lldb/source/Target/ThreadPlanStack.cpp @@ -375,7 +375,7 @@ lldb::tid_t cur_tid = thread->GetID(); if (!Find(cur_tid)) { AddThread(*thread.get()); -thread->QueueFundamentalPlan(true); +thread->QueueBasePlan(true); } } } Index: lldb/source/Target/Thread.cpp === --- lldb/source/Target/Thread.cpp +++ lldb/source/Target/Thread.cpp @@ -1229,7 +1229,7 @@ return error; } -ThreadPlanSP Thread::QueueFundamentalPlan(bool abort_other_plans) { +ThreadPlanSP Thread::QueueBasePlan(bool abort_other_plans) { ThreadPlanSP thread_plan_sp(new ThreadPlanBase(*this)); QueueThreadPlan(thread_plan_sp, abort_other_plans); return thread_plan_sp; Index: lldb/include/lldb/Target/ThreadPlanBase.h === --- lldb/include/lldb/Target/ThreadPlanBase.h +++ lldb/include/lldb/Target/ThreadPlanBase.h @@ -44,8 +44,7 @@ ThreadPlanBase(Thread &thread); private: - friend lldb::ThreadPlanSP - Thread::QueueFundamentalPlan(bool abort_other_plans); + friend lldb::ThreadPlanSP Thread::QueueBasePlan(bool abort_other_plans); ThreadPlanBase(const ThreadPlanBase &) = delete; const ThreadPlanBase &operator=(const ThreadPlanBase &) = delete; Index: lldb/include/lldb/Target/Thread.h === --- lldb/include/lldb/Target/Thread.h +++ lldb/include/lldb/Target/Thread.h @@ -615,7 +615,7 @@ /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - virtual lldb::ThreadPlanSP QueueFundamentalPlan(bool abort_other_plans); + lldb::ThreadPlanSP QueueBasePlan(bool abort_other_plans); /// Queues the plan used to step one instruction from the current PC of \a /// thread. Index: lldb/source/Target/ThreadPlanStack.cpp === --- lldb/source/Target/ThreadPlanStack.cpp +++ lldb/source/Target/ThreadPlanStack.cpp @@ -375,7 +375,7 @@ lldb::tid_t cur_tid = thread->GetID(); if (!Find(cur_tid)) { AddThread(*thread.get()); -thread->QueueFundamentalPlan(true); +thread->QueueBasePlan(true); } } } Index: lldb/source/Target/Thread.cpp === --- lldb/source/Target/Thread.cpp +++ lldb/source/Target/Thread.cpp @@ -1229,7 +1229,7 @@ return error; } -ThreadPlanSP Thread::QueueFundamentalPlan(bool abort_other_plans) { +ThreadPlanSP Thread::QueueBasePlan(bool abort_other_plans) { ThreadPlanSP thread_plan_sp(new ThreadPlanBase(*this)); QueueThreadPlan(thread_plan_sp, abort_other_plans); return thread_plan_sp; Index: lldb/include/lldb/Target/ThreadPlanBase.h === --- lldb/include/lldb/Target/ThreadPlanBase.h +++ lldb/include/lldb/Target/ThreadPlanBase.h @@ -44,8 +44,7 @@ ThreadPlanBase(Thread &thread); private: - friend lldb::ThreadPlanSP - Thread::QueueFundamentalPlan(bool abort_other_plans); + friend lldb::ThreadPlanSP Thread::QueueBasePlan(bool abort_other_plans); ThreadPlanBase(const ThreadPlanBase &) = delete; const ThreadPlanBase &operator=(const ThreadPlanBase &) = delete; Index: lldb/include/lldb/Target/Thread.h === --- lldb/include/lldb/Target/Thread.h +++ lldb/include/lldb/Target/Thread.h @@ -615,7 +615,7 @@ /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - virtual lldb::ThreadPlanSP QueueFundamentalPlan(bool abort_other_plans); + lldb::ThreadPlanSP QueueBasePlan(bool abort_other_plans); /// Queues the plan used to step one instruction from the current PC of \a /// thread. ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] e7361c8 - [lldb] Rename QueueFundamentalPlan to QueueBasePlan (NFC)
Author: Dave Lee Date: 2021-03-04T21:46:49-08:00 New Revision: e7361c8eccb7663146096622549dc03240414157 URL: https://github.com/llvm/llvm-project/commit/e7361c8eccb7663146096622549dc03240414157 DIFF: https://github.com/llvm/llvm-project/commit/e7361c8eccb7663146096622549dc03240414157.diff LOG: [lldb] Rename QueueFundamentalPlan to QueueBasePlan (NFC) Minor change for naming consistency. Differential Revision: https://reviews.llvm.org/D97985 Added: Modified: lldb/include/lldb/Target/Thread.h lldb/include/lldb/Target/ThreadPlanBase.h lldb/source/Target/Thread.cpp lldb/source/Target/ThreadPlanStack.cpp Removed: diff --git a/lldb/include/lldb/Target/Thread.h b/lldb/include/lldb/Target/Thread.h index 916493c061bb..0f6b5741573e 100644 --- a/lldb/include/lldb/Target/Thread.h +++ b/lldb/include/lldb/Target/Thread.h @@ -615,7 +615,7 @@ class Thread : public std::enable_shared_from_this, /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - virtual lldb::ThreadPlanSP QueueFundamentalPlan(bool abort_other_plans); + lldb::ThreadPlanSP QueueBasePlan(bool abort_other_plans); /// Queues the plan used to step one instruction from the current PC of \a /// thread. diff --git a/lldb/include/lldb/Target/ThreadPlanBase.h b/lldb/include/lldb/Target/ThreadPlanBase.h index 48058a9b40ab..5c44b9fb17b2 100644 --- a/lldb/include/lldb/Target/ThreadPlanBase.h +++ b/lldb/include/lldb/Target/ThreadPlanBase.h @@ -44,8 +44,7 @@ class ThreadPlanBase : public ThreadPlan { ThreadPlanBase(Thread &thread); private: - friend lldb::ThreadPlanSP - Thread::QueueFundamentalPlan(bool abort_other_plans); + friend lldb::ThreadPlanSP Thread::QueueBasePlan(bool abort_other_plans); ThreadPlanBase(const ThreadPlanBase &) = delete; const ThreadPlanBase &operator=(const ThreadPlanBase &) = delete; diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index e261cae4bd8a..e5271ccbe514 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -1229,7 +1229,7 @@ Status Thread::UnwindInnermostExpression() { return error; } -ThreadPlanSP Thread::QueueFundamentalPlan(bool abort_other_plans) { +ThreadPlanSP Thread::QueueBasePlan(bool abort_other_plans) { ThreadPlanSP thread_plan_sp(new ThreadPlanBase(*this)); QueueThreadPlan(thread_plan_sp, abort_other_plans); return thread_plan_sp; diff --git a/lldb/source/Target/ThreadPlanStack.cpp b/lldb/source/Target/ThreadPlanStack.cpp index 5a4ca8812136..8ae5c948e27b 100644 --- a/lldb/source/Target/ThreadPlanStack.cpp +++ b/lldb/source/Target/ThreadPlanStack.cpp @@ -375,7 +375,7 @@ void ThreadPlanStackMap::Update(ThreadList ¤t_threads, lldb::tid_t cur_tid = thread->GetID(); if (!Find(cur_tid)) { AddThread(*thread.get()); -thread->QueueFundamentalPlan(true); +thread->QueueBasePlan(true); } } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D97999: [lldb/Interpreter] Add `interpreter.repeat-previous-command` setting
JDevlieghere accepted this revision. JDevlieghere added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97999/new/ https://reviews.llvm.org/D97999 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D98001: [lldb/API] Add CommandInterpreter::{Get, Set}PrintErrors to SBAPI (NFC)
JDevlieghere added a comment. Test? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98001/new/ https://reviews.llvm.org/D98001 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D98001: [lldb/API] Add CommandInterpreter::{Get, Set}PrintErrors to SBAPI (NFC)
mib created this revision. mib added reviewers: JDevlieghere, teemperor, jingham. mib added a project: LLDB. mib requested review of this revision. Herald added a subscriber: lldb-commits. This patch exposes the getter and setter methods for the command interpreter `print_errors` run option. rdar://74816984 Signed-off-by: Med Ismail Bennani Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D98001 Files: lldb/bindings/interface/SBCommandInterpreterRunOptions.i lldb/include/lldb/API/SBCommandInterpreterRunOptions.h lldb/source/API/SBCommandInterpreterRunOptions.cpp Index: lldb/source/API/SBCommandInterpreterRunOptions.cpp === --- lldb/source/API/SBCommandInterpreterRunOptions.cpp +++ lldb/source/API/SBCommandInterpreterRunOptions.cpp @@ -131,6 +131,20 @@ m_opaque_up->SetPrintResults(print_results); } +bool SBCommandInterpreterRunOptions::GetPrintErrors() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommandInterpreterRunOptions, + GetPrintErrors); + + return m_opaque_up->GetPrintErrors(); +} + +void SBCommandInterpreterRunOptions::SetPrintErrors(bool print_errors) { + LLDB_RECORD_METHOD(void, SBCommandInterpreterRunOptions, SetPrintErrors, + (bool), print_errors); + + m_opaque_up->SetPrintErrors(print_errors); +} + bool SBCommandInterpreterRunOptions::GetAddToHistory() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommandInterpreterRunOptions, GetAddToHistory); @@ -269,6 +283,10 @@ GetPrintResults, ()); LLDB_REGISTER_METHOD(void, SBCommandInterpreterRunOptions, SetPrintResults, (bool)); + LLDB_REGISTER_METHOD_CONST(bool, SBCommandInterpreterRunOptions, + GetPrintErrors, ()); + LLDB_REGISTER_METHOD(void, SBCommandInterpreterRunOptions, SetPrintErrors, + (bool)); LLDB_REGISTER_METHOD_CONST(bool, SBCommandInterpreterRunOptions, GetAddToHistory, ()); LLDB_REGISTER_METHOD(void, SBCommandInterpreterRunOptions, SetAddToHistory, Index: lldb/include/lldb/API/SBCommandInterpreterRunOptions.h === --- lldb/include/lldb/API/SBCommandInterpreterRunOptions.h +++ lldb/include/lldb/API/SBCommandInterpreterRunOptions.h @@ -56,6 +56,10 @@ void SetPrintResults(bool); + bool GetPrintErrors() const; + + void SetPrintErrors(bool); + bool GetAddToHistory() const; void SetAddToHistory(bool); Index: lldb/bindings/interface/SBCommandInterpreterRunOptions.i === --- lldb/bindings/interface/SBCommandInterpreterRunOptions.i +++ lldb/bindings/interface/SBCommandInterpreterRunOptions.i @@ -58,6 +58,12 @@ void SetPrintResults (bool); +bool +GetPrintErrors () const; + +void +SetPrintErrors (bool); + bool GetAddToHistory () const; Index: lldb/source/API/SBCommandInterpreterRunOptions.cpp === --- lldb/source/API/SBCommandInterpreterRunOptions.cpp +++ lldb/source/API/SBCommandInterpreterRunOptions.cpp @@ -131,6 +131,20 @@ m_opaque_up->SetPrintResults(print_results); } +bool SBCommandInterpreterRunOptions::GetPrintErrors() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommandInterpreterRunOptions, + GetPrintErrors); + + return m_opaque_up->GetPrintErrors(); +} + +void SBCommandInterpreterRunOptions::SetPrintErrors(bool print_errors) { + LLDB_RECORD_METHOD(void, SBCommandInterpreterRunOptions, SetPrintErrors, + (bool), print_errors); + + m_opaque_up->SetPrintErrors(print_errors); +} + bool SBCommandInterpreterRunOptions::GetAddToHistory() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommandInterpreterRunOptions, GetAddToHistory); @@ -269,6 +283,10 @@ GetPrintResults, ()); LLDB_REGISTER_METHOD(void, SBCommandInterpreterRunOptions, SetPrintResults, (bool)); + LLDB_REGISTER_METHOD_CONST(bool, SBCommandInterpreterRunOptions, + GetPrintErrors, ()); + LLDB_REGISTER_METHOD(void, SBCommandInterpreterRunOptions, SetPrintErrors, + (bool)); LLDB_REGISTER_METHOD_CONST(bool, SBCommandInterpreterRunOptions, GetAddToHistory, ()); LLDB_REGISTER_METHOD(void, SBCommandInterpreterRunOptions, SetAddToHistory, Index: lldb/include/lldb/API/SBCommandInterpreterRunOptions.h === --- lldb/include/lldb/API/SBCommandInterpreterRunOptions.h +++ lldb/include/lldb/API/SBCommandInterpreterRunOptions.h @@ -56,6 +56,10 @@ void SetPrintResults(bool); + bool GetPrintErr
[Lldb-commits] [PATCH] D97999: [lldb/Interpreter] Add `interpreter.repeat-previous-command` setting
mib created this revision. mib added a reviewer: JDevlieghere. mib requested review of this revision. Herald added a project: LLDB. Herald added a subscriber: lldb-commits. This patch introduces a new interpreter setting to prevent LLDB from re-executing the previous command when passing an empty command. This can be very useful when performing actions that requires a long time to complete. To preserve the original behaviour, the setting defaults to `true`. rdar://74983516 Signed-off-by: Med Ismail Bennani Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D97999 Files: lldb/include/lldb/Interpreter/CommandInterpreter.h lldb/source/Interpreter/CommandInterpreter.cpp lldb/source/Interpreter/InterpreterProperties.td lldb/test/API/commands/settings/TestSettings.py Index: lldb/test/API/commands/settings/TestSettings.py === --- lldb/test/API/commands/settings/TestSettings.py +++ lldb/test/API/commands/settings/TestSettings.py @@ -25,6 +25,42 @@ "environment variables", "executable's environment"]) +def test_set_interpreter_repeat_prev_command(self): +"""Test the `interpreter.repeat-previous-command` setting.""" +self.build() + +exe = self.getBuildArtifact("a.out") +self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) +setting = "interpreter.repeat-previous-command" + +def cleanup(setting): +self.runCmd( +"settings clear %s" % +setting, check=False) + +# Execute the cleanup function during test case tear down. +self.addTearDownHook(cleanup(setting)) + +# First, check for the setting default value. +self.expect("setting show %s" % setting, +substrs=["interpreter.repeat-previous-command (boolean) = true"]) + +# Then, invert the setting, and check that was set correctly +self.runCmd("setting set %s false" % setting) +self.expect("setting show %s" % setting, +substrs=["interpreter.repeat-previous-command (boolean) = false"]) + + +ci = self.dbg.GetCommandInterpreter() +self.assertTrue(ci.IsValid(), "Invalid command interpreter.") +# Now, test the functionnality +res = lldb.SBCommandReturnObject() +ci.HandleCommand('breakpoint set -n main', res) +self.assertTrue(res.Succeeded(), "Command failed.") +ci.HandleCommand('', res) +self.assertTrue(res.Succeeded(), "Empty command failed.") +self.assertEqual(self.dbg.GetSelectedTarget().GetNumBreakpoints(), 1) + def test_append_target_env_vars(self): """Test that 'append target.run-args' works.""" # Append the env-vars. Index: lldb/source/Interpreter/InterpreterProperties.td === --- lldb/source/Interpreter/InterpreterProperties.td +++ lldb/source/Interpreter/InterpreterProperties.td @@ -29,4 +29,8 @@ Global, DefaultTrue, Desc<"If true, commands will be echoed even if they are pure comment lines.">; + def RepeatPreviousCommand: Property<"repeat-previous-command", "Boolean">, +Global, +DefaultTrue, +Desc<"If true, LLDB will repeat the previous command if no command was passed to the interpreter. If false, LLDB won't repeat the previous command but only return a new prompt.">; } Index: lldb/source/Interpreter/CommandInterpreter.cpp === --- lldb/source/Interpreter/CommandInterpreter.cpp +++ lldb/source/Interpreter/CommandInterpreter.cpp @@ -223,6 +223,12 @@ nullptr, idx, g_interpreter_properties[idx].default_uint_value != 0); } +bool CommandInterpreter::GetRepeatPreviousCommand() const { + const uint32_t idx = ePropertyRepeatPreviousCommand; + return m_collection_sp->GetPropertyAtIndexAsBoolean( + nullptr, idx, g_interpreter_properties[idx].default_uint_value != 0); +} + void CommandInterpreter::Initialize() { LLDB_SCOPED_TIMER(); @@ -1695,6 +1701,11 @@ } if (empty_command) { +if (!GetRepeatPreviousCommand()) { + result.SetStatus(eReturnStatusSuccessFinishNoResult); + return true; +} + if (m_command_history.IsEmpty()) { result.AppendError("empty command"); result.SetStatus(eReturnStatusFailed); Index: lldb/include/lldb/Interpreter/CommandInterpreter.h === --- lldb/include/lldb/Interpreter/CommandInterpreter.h +++ lldb/include/lldb/Interpreter/CommandInterpreter.h @@ -504,6 +504,8 @@ bool GetEchoCommentCommands() const; void SetEchoCommentCommands(bool enable); + bool GetRepeatPreviousCommand() const; + const CommandObject::CommandMap &GetUserCommands() const { return m_user_dict; } ___ lldb-commits m
[Lldb-commits] [PATCH] D96548: [lldb] [Process/FreeBSDRemote] Introduce aarch64 hw break/watchpoint support
mhorne added inline comments. Comment at: lldb/packages/Python/lldbsuite/test/dotest.py:807 +if lldb.SBPlatform.GetHostPlatform().GetOSMajorVersion() < 14: +return False, "Watchpoint support on arm64 requires FreeBSD 14.0" return True, "watchpoint support available" It seems like this should become 13.0. Comment at: lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h:28 +# define LLDB_HAS_FREEBSD_WATCHPOINT 1 +#elif __FreeBSD_version >= 1300139 && __FreeBSD_version < 140 +# define LLDB_HAS_FREEBSD_WATCHPOINT 1 This is technically correct, but I don't think it's important to make provisions for versions 140 to 144. The reason is that these represent development versions in a < 2 month time period. Anyone affected by this would simply be asked to update their kernel to a more recent snapshot. `__FreeBSD_version >= 1300139` should be enough. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96548/new/ https://reviews.llvm.org/D96548 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D97985: [lldb] Rename QueueFundamentalPlan to QueueBasePlan (NFC)
jingham accepted this revision. jingham added a comment. This revision is now accepted and ready to land. Herald added a subscriber: JDevlieghere. Yeah, apparently I got tired of typing Fundamental pretty quickly... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97985/new/ https://reviews.llvm.org/D97985 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D97985: [lldb] Rename QueueFundamentalPlan to QueueBasePlan (NFC)
kastiglione created this revision. kastiglione added a reviewer: jingham. kastiglione requested review of this revision. Herald added a project: LLDB. Herald added a subscriber: lldb-commits. Minor change for naming consistency. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D97985 Files: lldb/include/lldb/Target/Thread.h lldb/include/lldb/Target/ThreadPlanBase.h lldb/source/Target/Thread.cpp lldb/source/Target/ThreadPlanStack.cpp Index: lldb/source/Target/ThreadPlanStack.cpp === --- lldb/source/Target/ThreadPlanStack.cpp +++ lldb/source/Target/ThreadPlanStack.cpp @@ -374,7 +374,7 @@ lldb::tid_t cur_tid = thread->GetID(); if (!Find(cur_tid)) { AddThread(*thread.get()); -thread->QueueFundamentalPlan(true); +thread->QueueBasePlan(true); } } } Index: lldb/source/Target/Thread.cpp === --- lldb/source/Target/Thread.cpp +++ lldb/source/Target/Thread.cpp @@ -1226,7 +1226,7 @@ return error; } -ThreadPlanSP Thread::QueueFundamentalPlan(bool abort_other_plans) { +ThreadPlanSP Thread::QueueBasePlan(bool abort_other_plans) { ThreadPlanSP thread_plan_sp(new ThreadPlanBase(*this)); QueueThreadPlan(thread_plan_sp, abort_other_plans); return thread_plan_sp; Index: lldb/include/lldb/Target/ThreadPlanBase.h === --- lldb/include/lldb/Target/ThreadPlanBase.h +++ lldb/include/lldb/Target/ThreadPlanBase.h @@ -41,8 +41,7 @@ ThreadPlanBase(Thread &thread); private: - friend lldb::ThreadPlanSP - Thread::QueueFundamentalPlan(bool abort_other_plans); + friend lldb::ThreadPlanSP Thread::QueueBasePlan(bool abort_other_plans); ThreadPlanBase(const ThreadPlanBase &) = delete; const ThreadPlanBase &operator=(const ThreadPlanBase &) = delete; Index: lldb/include/lldb/Target/Thread.h === --- lldb/include/lldb/Target/Thread.h +++ lldb/include/lldb/Target/Thread.h @@ -615,7 +615,7 @@ /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - virtual lldb::ThreadPlanSP QueueFundamentalPlan(bool abort_other_plans); + lldb::ThreadPlanSP QueueBasePlan(bool abort_other_plans); /// Queues the plan used to step one instruction from the current PC of \a /// thread. Index: lldb/source/Target/ThreadPlanStack.cpp === --- lldb/source/Target/ThreadPlanStack.cpp +++ lldb/source/Target/ThreadPlanStack.cpp @@ -374,7 +374,7 @@ lldb::tid_t cur_tid = thread->GetID(); if (!Find(cur_tid)) { AddThread(*thread.get()); -thread->QueueFundamentalPlan(true); +thread->QueueBasePlan(true); } } } Index: lldb/source/Target/Thread.cpp === --- lldb/source/Target/Thread.cpp +++ lldb/source/Target/Thread.cpp @@ -1226,7 +1226,7 @@ return error; } -ThreadPlanSP Thread::QueueFundamentalPlan(bool abort_other_plans) { +ThreadPlanSP Thread::QueueBasePlan(bool abort_other_plans) { ThreadPlanSP thread_plan_sp(new ThreadPlanBase(*this)); QueueThreadPlan(thread_plan_sp, abort_other_plans); return thread_plan_sp; Index: lldb/include/lldb/Target/ThreadPlanBase.h === --- lldb/include/lldb/Target/ThreadPlanBase.h +++ lldb/include/lldb/Target/ThreadPlanBase.h @@ -41,8 +41,7 @@ ThreadPlanBase(Thread &thread); private: - friend lldb::ThreadPlanSP - Thread::QueueFundamentalPlan(bool abort_other_plans); + friend lldb::ThreadPlanSP Thread::QueueBasePlan(bool abort_other_plans); ThreadPlanBase(const ThreadPlanBase &) = delete; const ThreadPlanBase &operator=(const ThreadPlanBase &) = delete; Index: lldb/include/lldb/Target/Thread.h === --- lldb/include/lldb/Target/Thread.h +++ lldb/include/lldb/Target/Thread.h @@ -615,7 +615,7 @@ /// \return /// A shared pointer to the newly queued thread plan, or nullptr if the /// plan could not be queued. - virtual lldb::ThreadPlanSP QueueFundamentalPlan(bool abort_other_plans); + lldb::ThreadPlanSP QueueBasePlan(bool abort_other_plans); /// Queues the plan used to step one instruction from the current PC of \a /// thread. ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D97739: Add a progress class that can track and report long running operations that happen in LLDB.
wallace added a comment. This looks really nice. The only thought I have is that you should accept multiple callbacks instead of only one, as the current implementation discards any existing callback if SetProgressCallback is called twice. I know that it'd be rare that two or more callbacks are registered simultaneously, but it might happen in the future and you could save someone's time by making this a little bit more flexible. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97739/new/ https://reviews.llvm.org/D97739 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D97910: [lldb/Interpreter] Make OptionGroupPythonClassWithDict options non-required
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc16fef19f6b0: [lldb/Interpreter] Make OptionGroupPythonClassWithDict options non-required (authored by mib). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97910/new/ https://reviews.llvm.org/D97910 Files: lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp Index: lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp === --- lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp +++ lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp @@ -13,12 +13,10 @@ using namespace lldb; using namespace lldb_private; -OptionGroupPythonClassWithDict::OptionGroupPythonClassWithDict -(const char *class_use, - bool is_class, - int class_option, - int key_option, - int value_option) : m_is_class(is_class) { +OptionGroupPythonClassWithDict::OptionGroupPythonClassWithDict( +const char *class_use, bool is_class, int class_option, int key_option, +int value_option, uint16_t required_options) +: m_is_class(is_class), m_required_options(required_options) { m_key_usage_text.assign("The key for a key/value pair passed to the " "implementation of a "); m_key_usage_text.append(class_use); @@ -36,7 +34,7 @@ m_class_usage_text.append("."); m_option_definition[0].usage_mask = LLDB_OPT_SET_1; - m_option_definition[0].required = true; + m_option_definition[0].required = m_required_options.Test(eScriptClass); m_option_definition[0].long_option = "script-class"; m_option_definition[0].short_option = class_option; m_option_definition[0].validator = nullptr; @@ -47,7 +45,7 @@ m_option_definition[0].usage_text = m_class_usage_text.data(); m_option_definition[1].usage_mask = LLDB_OPT_SET_2; - m_option_definition[1].required = false; + m_option_definition[1].required = m_required_options.Test(eDictKey); m_option_definition[1].long_option = "structured-data-key"; m_option_definition[1].short_option = key_option; m_option_definition[1].validator = nullptr; @@ -58,7 +56,7 @@ m_option_definition[1].usage_text = m_key_usage_text.data(); m_option_definition[2].usage_mask = LLDB_OPT_SET_2; - m_option_definition[2].required = false; + m_option_definition[2].required = m_required_options.Test(eDictValue); m_option_definition[2].long_option = "structured-data-value"; m_option_definition[2].short_option = value_option; m_option_definition[2].validator = nullptr; @@ -69,7 +67,7 @@ m_option_definition[2].usage_text = m_value_usage_text.data(); m_option_definition[3].usage_mask = LLDB_OPT_SET_3; - m_option_definition[3].required = true; + m_option_definition[3].required = m_required_options.Test(ePythonFunction); m_option_definition[3].long_option = "python-function"; m_option_definition[3].short_option = class_option; m_option_definition[3].validator = nullptr; @@ -78,7 +76,6 @@ m_option_definition[3].completion_type = 0; m_option_definition[3].argument_type = eArgTypePythonFunction; m_option_definition[3].usage_text = m_class_usage_text.data(); - } Status OptionGroupPythonClassWithDict::SetOptionValue( Index: lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h === --- lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h +++ lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h @@ -1,4 +1,4 @@ -//===-- OptionGroupPythonClassWithDict.h -*- C++ -*-===// +//===-- OptionGroupPythonClassWithDict.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. @@ -9,9 +9,10 @@ #ifndef LLDB_INTERPRETER_OPTIONGROUPPYTHONCLASSWITHDICT_H #define LLDB_INTERPRETER_OPTIONGROUPPYTHONCLASSWITHDICT_H -#include "lldb/lldb-types.h" #include "lldb/Interpreter/Options.h" +#include "lldb/Utility/Flags.h" #include "lldb/Utility/StructuredData.h" +#include "lldb/lldb-types.h" namespace lldb_private { @@ -23,12 +24,20 @@ // StructuredData::Dictionary is constructed with those pairs. class OptionGroupPythonClassWithDict : public OptionGroup { public: - OptionGroupPythonClassWithDict(const char *class_use, - bool is_class = true, - int class_option = 'C', - int key_option = 'k', - int value_option = 'v'); - + enum OptionKind { +eScriptClass= 1 << 0, +eDictKey= 1 << 1, +eDictValue = 1 << 2, +ePythonFunction = 1 << 3, +eAllOptio
[Lldb-commits] [lldb] c16fef1 - [lldb/Interpreter] Make OptionGroupPythonClassWithDict options non-required
Author: Med Ismail Bennani Date: 2021-03-04T20:24:26+01:00 New Revision: c16fef19f6b002ba6ec7104d9f7dc44fef99ef57 URL: https://github.com/llvm/llvm-project/commit/c16fef19f6b002ba6ec7104d9f7dc44fef99ef57 DIFF: https://github.com/llvm/llvm-project/commit/c16fef19f6b002ba6ec7104d9f7dc44fef99ef57.diff LOG: [lldb/Interpreter] Make OptionGroupPythonClassWithDict options non-required When using `OptionGroupPythonClassWithDict` options in an `OptionGroup` with other `Options`, it can happen that the combinaison of some options of each group makes the command invalid. To solve that issue, this patch adds a bitmask argument to the `OptionGroupPythonClassWithDict` constuctor that is used to mark each option as required (or not). If the `required_options` bitmask isn't passed to the constructor, the class will keep its default behaviour, making the `--script-class` and `--python-function` required. rdar://65508855 Differential Revision: https://reviews.llvm.org/D97910 Signed-off-by: Med Ismail Bennani Added: Modified: lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp Removed: diff --git a/lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h b/lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h index 7ad4bc092678..a0de1bc8b8a1 100644 --- a/lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h +++ b/lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h @@ -1,4 +1,4 @@ -//===-- OptionGroupPythonClassWithDict.h -*- C++ -*-===// +//===-- OptionGroupPythonClassWithDict.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. @@ -9,9 +9,10 @@ #ifndef LLDB_INTERPRETER_OPTIONGROUPPYTHONCLASSWITHDICT_H #define LLDB_INTERPRETER_OPTIONGROUPPYTHONCLASSWITHDICT_H -#include "lldb/lldb-types.h" #include "lldb/Interpreter/Options.h" +#include "lldb/Utility/Flags.h" #include "lldb/Utility/StructuredData.h" +#include "lldb/lldb-types.h" namespace lldb_private { @@ -23,12 +24,20 @@ namespace lldb_private { // StructuredData::Dictionary is constructed with those pairs. class OptionGroupPythonClassWithDict : public OptionGroup { public: - OptionGroupPythonClassWithDict(const char *class_use, - bool is_class = true, - int class_option = 'C', - int key_option = 'k', - int value_option = 'v'); - + enum OptionKind { +eScriptClass= 1 << 0, +eDictKey= 1 << 1, +eDictValue = 1 << 2, +ePythonFunction = 1 << 3, +eAllOptions = (eScriptClass | eDictKey | eDictValue | ePythonFunction) + }; + + OptionGroupPythonClassWithDict(const char *class_use, bool is_class = true, + int class_option = 'C', int key_option = 'k', + int value_option = 'v', + uint16_t required_options = eScriptClass | + ePythonFunction); + ~OptionGroupPythonClassWithDict() override = default; llvm::ArrayRef GetDefinitions() override { @@ -55,6 +64,7 @@ class OptionGroupPythonClassWithDict : public OptionGroup { std::string m_class_usage_text, m_key_usage_text, m_value_usage_text; bool m_is_class; OptionDefinition m_option_definition[4]; + Flags m_required_options; }; } // namespace lldb_private diff --git a/lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp b/lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp index 654cc8f9cc57..a01c190266dd 100644 --- a/lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp +++ b/lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp @@ -13,12 +13,10 @@ using namespace lldb; using namespace lldb_private; -OptionGroupPythonClassWithDict::OptionGroupPythonClassWithDict -(const char *class_use, - bool is_class, - int class_option, - int key_option, - int value_option) : m_is_class(is_class) { +OptionGroupPythonClassWithDict::OptionGroupPythonClassWithDict( +const char *class_use, bool is_class, int class_option, int key_option, +int value_option, uint16_t required_options) +: m_is_class(is_class), m_required_options(required_options) { m_key_usage_text.assign("The key for a key/value pair passed to the " "implementation of a "); m_key_usage_text.append(class_use); @@ -36,7 +34,7 @@ OptionGroupPythonClassWithDict::OptionGroupPythonClassWithDict m_class_usage_text.append("."); m_option_definition[0].usage_mask = LLDB_OPT_SET_1; - m_option_definition[0].required = true; +
[Lldb-commits] [PATCH] D97910: [lldb/Interpreter] Make OptionGroupPythonClassWithDict options non-required
JDevlieghere accepted this revision. JDevlieghere added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97910/new/ https://reviews.llvm.org/D97910 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D97910: [lldb/Interpreter] Make OptionGroupPythonClassWithDict options non-required
mib updated this revision to Diff 328228. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97910/new/ https://reviews.llvm.org/D97910 Files: lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp Index: lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp === --- lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp +++ lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp @@ -13,12 +13,10 @@ using namespace lldb; using namespace lldb_private; -OptionGroupPythonClassWithDict::OptionGroupPythonClassWithDict -(const char *class_use, - bool is_class, - int class_option, - int key_option, - int value_option) : m_is_class(is_class) { +OptionGroupPythonClassWithDict::OptionGroupPythonClassWithDict( +const char *class_use, bool is_class, int class_option, int key_option, +int value_option, uint16_t required_options) +: m_is_class(is_class), m_required_options(required_options) { m_key_usage_text.assign("The key for a key/value pair passed to the " "implementation of a "); m_key_usage_text.append(class_use); @@ -36,7 +34,7 @@ m_class_usage_text.append("."); m_option_definition[0].usage_mask = LLDB_OPT_SET_1; - m_option_definition[0].required = true; + m_option_definition[0].required = m_required_options.Test(eScriptClass); m_option_definition[0].long_option = "script-class"; m_option_definition[0].short_option = class_option; m_option_definition[0].validator = nullptr; @@ -47,7 +45,7 @@ m_option_definition[0].usage_text = m_class_usage_text.data(); m_option_definition[1].usage_mask = LLDB_OPT_SET_2; - m_option_definition[1].required = false; + m_option_definition[1].required = m_required_options.Test(eDictKey); m_option_definition[1].long_option = "structured-data-key"; m_option_definition[1].short_option = key_option; m_option_definition[1].validator = nullptr; @@ -58,7 +56,7 @@ m_option_definition[1].usage_text = m_key_usage_text.data(); m_option_definition[2].usage_mask = LLDB_OPT_SET_2; - m_option_definition[2].required = false; + m_option_definition[2].required = m_required_options.Test(eDictValue); m_option_definition[2].long_option = "structured-data-value"; m_option_definition[2].short_option = value_option; m_option_definition[2].validator = nullptr; @@ -69,7 +67,7 @@ m_option_definition[2].usage_text = m_value_usage_text.data(); m_option_definition[3].usage_mask = LLDB_OPT_SET_3; - m_option_definition[3].required = true; + m_option_definition[3].required = m_required_options.Test(ePythonFunction); m_option_definition[3].long_option = "python-function"; m_option_definition[3].short_option = class_option; m_option_definition[3].validator = nullptr; @@ -78,7 +76,6 @@ m_option_definition[3].completion_type = 0; m_option_definition[3].argument_type = eArgTypePythonFunction; m_option_definition[3].usage_text = m_class_usage_text.data(); - } Status OptionGroupPythonClassWithDict::SetOptionValue( Index: lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h === --- lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h +++ lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h @@ -1,4 +1,4 @@ -//===-- OptionGroupPythonClassWithDict.h -*- C++ -*-===// +//===-- OptionGroupPythonClassWithDict.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. @@ -9,9 +9,10 @@ #ifndef LLDB_INTERPRETER_OPTIONGROUPPYTHONCLASSWITHDICT_H #define LLDB_INTERPRETER_OPTIONGROUPPYTHONCLASSWITHDICT_H -#include "lldb/lldb-types.h" #include "lldb/Interpreter/Options.h" +#include "lldb/Utility/Flags.h" #include "lldb/Utility/StructuredData.h" +#include "lldb/lldb-types.h" namespace lldb_private { @@ -23,12 +24,20 @@ // StructuredData::Dictionary is constructed with those pairs. class OptionGroupPythonClassWithDict : public OptionGroup { public: - OptionGroupPythonClassWithDict(const char *class_use, - bool is_class = true, - int class_option = 'C', - int key_option = 'k', - int value_option = 'v'); - + enum OptionKind { +eScriptClass= 1 << 0, +eDictKey= 1 << 1, +eDictValue = 1 << 2, +ePythonFunction = 1 << 3, +eAllOptions = (eScriptClass | eDictKey | eDictValue | ePythonFunction) + }; + + OptionGroupPythonClassWithDict(const char *class_use, bool is_class = true, + int class_option = 'C', int ke
[Lldb-commits] [PATCH] D97910: [lldb/Interpreter] Make OptionGroupPythonClassWithDict options non-required
mib updated this revision to Diff 328213. mib added a comment. Replace `std::bitset` by `lldb_private::Flags` as suggested by @JDevlieghere Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97910/new/ https://reviews.llvm.org/D97910 Files: lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp Index: lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp === --- lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp +++ lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp @@ -13,12 +13,10 @@ using namespace lldb; using namespace lldb_private; -OptionGroupPythonClassWithDict::OptionGroupPythonClassWithDict -(const char *class_use, - bool is_class, - int class_option, - int key_option, - int value_option) : m_is_class(is_class) { +OptionGroupPythonClassWithDict::OptionGroupPythonClassWithDict( +const char *class_use, bool is_class, int class_option, int key_option, +int value_option, uint16_t required_options) +: m_is_class(is_class), m_required_options(required_options) { m_key_usage_text.assign("The key for a key/value pair passed to the " "implementation of a "); m_key_usage_text.append(class_use); @@ -36,7 +34,7 @@ m_class_usage_text.append("."); m_option_definition[0].usage_mask = LLDB_OPT_SET_1; - m_option_definition[0].required = true; + m_option_definition[0].required = m_required_options.Test(0); m_option_definition[0].long_option = "script-class"; m_option_definition[0].short_option = class_option; m_option_definition[0].validator = nullptr; @@ -47,7 +45,7 @@ m_option_definition[0].usage_text = m_class_usage_text.data(); m_option_definition[1].usage_mask = LLDB_OPT_SET_2; - m_option_definition[1].required = false; + m_option_definition[1].required = m_required_options.Test(1); m_option_definition[1].long_option = "structured-data-key"; m_option_definition[1].short_option = key_option; m_option_definition[1].validator = nullptr; @@ -58,7 +56,7 @@ m_option_definition[1].usage_text = m_key_usage_text.data(); m_option_definition[2].usage_mask = LLDB_OPT_SET_2; - m_option_definition[2].required = false; + m_option_definition[2].required = m_required_options.Test(2); m_option_definition[2].long_option = "structured-data-value"; m_option_definition[2].short_option = value_option; m_option_definition[2].validator = nullptr; @@ -69,7 +67,7 @@ m_option_definition[2].usage_text = m_value_usage_text.data(); m_option_definition[3].usage_mask = LLDB_OPT_SET_3; - m_option_definition[3].required = true; + m_option_definition[3].required = m_required_options.Test(3); m_option_definition[3].long_option = "python-function"; m_option_definition[3].short_option = class_option; m_option_definition[3].validator = nullptr; @@ -78,7 +76,6 @@ m_option_definition[3].completion_type = 0; m_option_definition[3].argument_type = eArgTypePythonFunction; m_option_definition[3].usage_text = m_class_usage_text.data(); - } Status OptionGroupPythonClassWithDict::SetOptionValue( Index: lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h === --- lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h +++ lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h @@ -1,4 +1,4 @@ -//===-- OptionGroupPythonClassWithDict.h -*- C++ -*-===// +//===-- OptionGroupPythonClassWithDict.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. @@ -11,6 +11,7 @@ #include "lldb/lldb-types.h" #include "lldb/Interpreter/Options.h" +#include "lldb/Utility/Flags.h" #include "lldb/Utility/StructuredData.h" namespace lldb_private { @@ -23,12 +24,20 @@ // StructuredData::Dictionary is constructed with those pairs. class OptionGroupPythonClassWithDict : public OptionGroup { public: - OptionGroupPythonClassWithDict(const char *class_use, - bool is_class = true, - int class_option = 'C', - int key_option = 'k', - int value_option = 'v'); - + enum OptionKind { +eScriptClass= 1 << 0, +eDictKey= 1 << 1, +eDictValue = 1 << 2, +eScriptFunction = 1 << 3, +eAllOptions = (eScriptClass | eDictKey | eDictValue | eScriptFunction) + }; + + OptionGroupPythonClassWithDict(const char *class_use, bool is_class = true, + int class_option = 'C', int key_option = 'k', + int value_option = 'v', +
[Lldb-commits] [PATCH] D97786: LLDB: Use path relative to binary, not relative to debugger CWD, for finding .dwo files.
cmtice updated this revision to Diff 328191. cmtice added a comment. Update to incorporate Pavel's suggested simplification. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786 Files: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1639,6 +1639,13 @@ return nullptr; dwo_file.SetFile(comp_dir, FileSpec::Style::native); +if (dwo_file.IsRelative()) { + // if DW_AT_comp_dir is relative, it should be relative to the location + // of the executable, not to the location from which the debugger was + // launched. + dwo_file.PrependPathComponent( + m_objfile_sp->GetFileSpec().GetDirectory().GetStringRef()); +} FileSystem::Instance().Resolve(dwo_file); dwo_file.AppendPathComponent(dwo_name); } Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp === --- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1639,6 +1639,13 @@ return nullptr; dwo_file.SetFile(comp_dir, FileSpec::Style::native); +if (dwo_file.IsRelative()) { + // if DW_AT_comp_dir is relative, it should be relative to the location + // of the executable, not to the location from which the debugger was + // launched. + dwo_file.PrependPathComponent( + m_objfile_sp->GetFileSpec().GetDirectory().GetStringRef()); +} FileSystem::Instance().Resolve(dwo_file); dwo_file.AppendPathComponent(dwo_name); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D96548: [lldb] [Process/FreeBSDRemote] Introduce aarch64 hw break/watchpoint support
mgorny updated this revision to Diff 328189. mgorny added a comment. Updated version conditions since watchpoint support was backported to FreeBSD 13.0-BETA4 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96548/new/ https://reviews.llvm.org/D96548 Files: lldb/packages/Python/lldbsuite/test/dotest.py lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h lldb/source/Plugins/Process/Utility/CMakeLists.txt lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.cpp lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h Index: lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h === --- /dev/null +++ lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h @@ -0,0 +1,79 @@ +//===-- NativeRegisterContextDBReg_arm64.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 +// +//===--===// + +#ifndef lldb_NativeRegisterContextDBReg_arm64_h +#define lldb_NativeRegisterContextDBReg_arm64_h + +#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h" + +#include + +namespace lldb_private { + +class NativeRegisterContextDBReg_arm64 +: public virtual NativeRegisterContextRegisterInfo { +public: + uint32_t NumSupportedHardwareBreakpoints() override; + + uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override; + + bool ClearHardwareBreakpoint(uint32_t hw_idx) override; + + Status ClearAllHardwareBreakpoints() override; + + Status GetHardwareBreakHitIndex(uint32_t &bp_index, + lldb::addr_t trap_addr) override; + + bool BreakpointIsEnabled(uint32_t bp_index); + + uint32_t NumSupportedHardwareWatchpoints() override; + + uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size, + uint32_t watch_flags) override; + + bool ClearHardwareWatchpoint(uint32_t hw_index) override; + + Status ClearAllHardwareWatchpoints() override; + + Status GetWatchpointHitIndex(uint32_t &wp_index, + lldb::addr_t trap_addr) override; + + lldb::addr_t GetWatchpointHitAddress(uint32_t wp_index) override; + + lldb::addr_t GetWatchpointAddress(uint32_t wp_index) override; + + uint32_t GetWatchpointSize(uint32_t wp_index); + + bool WatchpointIsEnabled(uint32_t wp_index); + + // Debug register type select + enum DREGType { eDREGTypeWATCH = 0, eDREGTypeBREAK }; + +protected: + // Debug register info for hardware breakpoints and watchpoints management. + struct DREG { +lldb::addr_t address; // Breakpoint/watchpoint address value. +lldb::addr_t hit_addr; // Address at which last watchpoint trigger exception + // occurred. +lldb::addr_t real_addr; // Address value that should cause target to stop. +uint32_t control; // Breakpoint/watchpoint control value. + }; + + std::array m_hbp_regs; // hardware breakpoints + std::array m_hwp_regs; // hardware watchpoints + + uint32_t m_max_hbp_supported; + uint32_t m_max_hwp_supported; + + virtual llvm::Error ReadHardwareDebugInfo() = 0; + virtual llvm::Error WriteHardwareDebugRegs(DREGType hwbType) = 0; +}; + +} // namespace lldb_private + +#endif // #ifndef lldb_NativeRegisterContextDBReg_arm64_h Index: lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.cpp === --- /dev/null +++ lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.cpp @@ -0,0 +1,466 @@ +//===-- NativeRegisterContextDBReg_arm64.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: Apache-2.0 WITH LLVM-exception +// +//===--===// + +#include "NativeRegisterContextDBReg_arm64.h" + +#include "lldb/Utility/Log.h" +#include "lldb/Utility/RegisterValue.h" + +using namespace lldb_private; + +// E (bit 0), used to enable breakpoint/watchpoint +constexpr uint32_t g_enable_bit = 1; +// PAC (bits 2:1): 0b10 +constexpr uint32_t g_pac_bits = (2 << 1); + +// Returns appropriate control register bits for the specified size +static constexpr inline uint64_t GetSizeBits(int size) { + // BAS (bits 12:5) hold a bit-mask of addresses to watch + /
[Lldb-commits] [PATCH] D97786: LLDB: Use path relative to binary, not relative to debugger CWD, for finding .dwo files.
cmtice added a comment. I'm not sure about using target.debug-file-search-paths, and what the changes Pavel is suggesting would entail. But the real question I am trying to resolve here is not "what are all the places we should be searching for the .dwo files?" but "When we're given a *relative path* in the DWARF for finding the files, what should it be relative TO?". I still think the most correct answer to that question is "relative to the location of the binary" (I know, this is assuming that the binary has not been moved since it was built, or all bets are off). If you like, I can update this patch so that it continues to search relative to the cwd (where the debugger was launched), and IN ADDITION, will search relative to where the binary is. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D95601: [lldb][AArch64] Add memory tag reading to lldb-server
DavidSpickett marked an inline comment as done. DavidSpickett added inline comments. Comment at: lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:1357 + + if (error.Fail()) +return error; DavidSpickett wrote: > omjavaid wrote: > > ptrace request is a success if number of tags requested is not equal to no > > of tags read? If not then this and following condition may be redundant. > Well ptracewrapper doesn't check the iovec, but I'll check the kernel source > to see if it's actually possible for it to fail that way. In `linux/arch/arm64/kernel/mte.c` `__access_remote_tags` there is a comment: ``` +/* + * Access MTE tags in another process' address space as given in mm. Update + * the number of tags copied. Return 0 if any tags copied, error otherwise. + * Inspired by __access_remote_vm(). + */ ``` *any tags* being the key words. So the scenario is: * ask to read from addr X in page 0, with length of pagesize+some so the range spills into page 1 * kernel can access page 0, reads tags until the end of the page * tries to access page 1 to read the rest, fails, returns 0 (success) since *some* tags were read * we see the ptrace call succeeded but with less tags than we expected I don't see it's worth dealing with this corner case here since lldb will look before it leaps. It would have errored much earlier here because either page 1 isn't in the tracee's memory regions or it wasn't MTE enabled. Comment at: lldb/test/API/tools/lldb-server/memory-tagging/TestGdbRemoteMemoryTagging.py:19 +@skipUnlessPlatform(["linux"]) +@skipUnlessAArch64MTELinuxCompiler +def test_qmemtags_packets(self): DavidSpickett wrote: > omjavaid wrote: > > If skipUnlessAArch64MTELinuxCompiler can check for AArch64 and Linux then > > we wont need above two decorators. > I'll merge them into one (at least one you use in tests, separate functions). > Also I just realised this is not checking that the remote supports MTE, only > worked because I've been using the one qemu instance. On further consideration I don't think it's worth merging them. Sure we save 2 lines in each test but then anyone reading it is going to have to lookup what the combo does. I'd rather keep them listed like this for clarity (and later adding new platforms?). Also I was wrong, the test does check for non MTE systems. If the tracee prints (nil) for the buffer, that means it's not an MTE system. (we can't use the isAArch64MTE call in this type of test) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95601/new/ https://reviews.llvm.org/D95601 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D97769: [lldb] Apply gdb-remote timeout to platform connections as well
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGbf3ac994c4d5: [lldb] Apply gdb-remote timeout to platform connections as well (authored by labath). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97769/new/ https://reviews.llvm.org/D97769 Files: lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h lldb/test/API/commands/platform/connect/TestPlatformConnect.py lldb/test/API/functionalities/gdb_remote_client/TestPlatformClient.py Index: lldb/test/API/functionalities/gdb_remote_client/TestPlatformClient.py === --- lldb/test/API/functionalities/gdb_remote_client/TestPlatformClient.py +++ lldb/test/API/functionalities/gdb_remote_client/TestPlatformClient.py @@ -1,6 +1,7 @@ import lldb import binascii import os +import time from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * from gdbclientutils import * @@ -64,3 +65,41 @@ substrs=["error: no processes were found on the \"remote-linux\" platform"]) finally: self.dbg.GetSelectedPlatform().DisconnectRemote() + +class TimeoutResponder(MockGDBServerResponder): +"""A mock server, which takes a very long time to compute the working +directory.""" +def __init__(self): +MockGDBServerResponder.__init__(self) + +def qGetWorkingDir(self): +time.sleep(10) +return hexlify("/foo/bar") + +def test_no_timeout(self): +"""Test that we honor the timeout setting. With a large enough timeout, +we should get the CWD successfully.""" + +self.server.responder = TestPlatformClient.TimeoutResponder() +self.runCmd("settings set plugin.process.gdb-remote.packet-timeout 30") +plat = lldb.SBPlatform("remote-linux") +try: +self.assertSuccess(plat.ConnectRemote(lldb.SBPlatformConnectOptions("connect://" ++ self.server.get_connect_address( +self.assertEqual(plat.GetWorkingDirectory(), "/foo/bar") +finally: +plat.DisconnectRemote() + +def test_timeout(self): +"""Test that we honor the timeout setting. With a small timeout, CWD +retrieval should fail.""" + +self.server.responder = TestPlatformClient.TimeoutResponder() +self.runCmd("settings set plugin.process.gdb-remote.packet-timeout 3") +plat = lldb.SBPlatform("remote-linux") +try: +self.assertSuccess(plat.ConnectRemote(lldb.SBPlatformConnectOptions("connect://" ++ self.server.get_connect_address( +self.assertIsNone(plat.GetWorkingDirectory()) +finally: +plat.DisconnectRemote() Index: lldb/test/API/commands/platform/connect/TestPlatformConnect.py === --- lldb/test/API/commands/platform/connect/TestPlatformConnect.py +++ lldb/test/API/commands/platform/connect/TestPlatformConnect.py @@ -13,7 +13,6 @@ @expectedFailureAll(hostoslist=["windows"], triple='.*-android') @skipIfWindows # lldb-server does not terminate correctly @skipIfDarwin # lldb-server not found correctly -@skipIf(oslist=["linux"], archs=["arm", "aarch64"]) # Fails randomly @add_test_categories(["lldb-server"]) def test_platform_process_connect(self): self.build() Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h === --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -68,6 +68,8 @@ static const char *GetPluginDescriptionStatic(); + static std::chrono::seconds GetPacketTimeout(); + // Check if a given Process bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp === --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -213,6 +213,10 @@ return process_sp; } +std::chrono::seconds ProcessGDBRemote::GetPacketTimeout() { + return std::chrono::seconds(GetGlobalPluginProperties()->GetPacketTimeout()); +} + bool ProcessGDBRemote::CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) { if (plugin_specified_by_name) Index: lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp === --- lldb/source/Plugins/Platform/gdb-serve
[Lldb-commits] [lldb] bf3ac99 - [lldb] Apply gdb-remote timeout to platform connections as well
Author: Pavel Labath Date: 2021-03-04T14:46:02+01:00 New Revision: bf3ac994c4d526b74044a977176e8e07d83f2049 URL: https://github.com/llvm/llvm-project/commit/bf3ac994c4d526b74044a977176e8e07d83f2049 DIFF: https://github.com/llvm/llvm-project/commit/bf3ac994c4d526b74044a977176e8e07d83f2049.diff LOG: [lldb] Apply gdb-remote timeout to platform connections as well We have a plugin.process.gdb-remote.packet-timeout setting, which can be used to control how long the lldb client is willing to wait before declaring the server side dead. Our test suite makes use of this feature, and sets the setting value fairly high, as the low default value can cause flaky tests, particularly on slower bots. After fixing TestPlatformConnect (one of the few tests exercising the remote platform capabilities of lldb) in 4b284b9ca, it immediately started being flaky on the arm bots. It turns out this is because the packet-timeout setting is not being applied to platform connections. This patch makes the platform connections also respect the value of this setting. It also adds a test which checks that the timeout value is being honored. Differential Revision: https://reviews.llvm.org/D97769 Added: Modified: lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h lldb/test/API/commands/platform/connect/TestPlatformConnect.py lldb/test/API/functionalities/gdb_remote_client/TestPlatformClient.py Removed: diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index 6a4275d249f6..8227199f52b6 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -30,6 +30,7 @@ #include "lldb/Utility/UriParser.h" #include "Plugins/Process/Utility/GDBRemoteSignals.h" +#include "Plugins/Process/gdb-remote/ProcessGDBRemote.h" using namespace lldb; using namespace lldb_private; @@ -202,7 +203,10 @@ Status PlatformRemoteGDBServer::GetFileWithUUID(const FileSpec &platform_file, /// Default Constructor PlatformRemoteGDBServer::PlatformRemoteGDBServer() : Platform(false), // This is a remote platform - m_gdb_client() {} + m_gdb_client() { + m_gdb_client.SetPacketTimeout( + process_gdb_remote::ProcessGDBRemote::GetPacketTimeout()); +} /// Destructor. /// diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index a2e41e738dbd..4a8eb0777886 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -213,6 +213,10 @@ ProcessGDBRemote::CreateInstance(lldb::TargetSP target_sp, return process_sp; } +std::chrono::seconds ProcessGDBRemote::GetPacketTimeout() { + return std::chrono::seconds(GetGlobalPluginProperties()->GetPacketTimeout()); +} + bool ProcessGDBRemote::CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) { if (plugin_specified_by_name) diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h index 0921bf17c4e4..9c74369fd6c5 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -68,6 +68,8 @@ class ProcessGDBRemote : public Process, static const char *GetPluginDescriptionStatic(); + static std::chrono::seconds GetPacketTimeout(); + // Check if a given Process bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; diff --git a/lldb/test/API/commands/platform/connect/TestPlatformConnect.py b/lldb/test/API/commands/platform/connect/TestPlatformConnect.py index cc9726ad303a..5c6ee5743208 100644 --- a/lldb/test/API/commands/platform/connect/TestPlatformConnect.py +++ b/lldb/test/API/commands/platform/connect/TestPlatformConnect.py @@ -13,7 +13,6 @@ class TestPlatformProcessConnect(TestBase): @expectedFailureAll(hostoslist=["windows"], triple='.*-android') @skipIfWindows # lldb-server does not terminate correctly @skipIfDarwin # lldb-server not found correctly -@skipIf(oslist=["linux"], archs=["arm", "aarch64"]) # Fails randomly @add_test_categories(["lldb-server"]) def test_platform_process_connect(self): self.build() diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformClient.py b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformClient.py index e05089ecc18e..30262fce7480 100644 --- a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformClient.py +++ b/lldb/test
[Lldb-commits] [PATCH] D97786: LLDB: Use path relative to binary, not relative to debugger CWD, for finding .dwo files.
labath added a comment. Having a setting for this would not be unreasonable. But what about reusing an existing setting for this purpose? I thinking of the (global) `target.debug-file-search-paths` setting and the associated logic (`Symbols::LocateExecutableSymbolFile` and friends). If we used this mechanism, then dwo files would be found automatically, as (I believe) the directory containing the executable file is being always searched, even with an empty setting. And this function is already being used to locate the dwp file, which is why we are able to find the dwp file next to the executable, regardless of the cwd. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97786/new/ https://reviews.llvm.org/D97786 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D96548: [lldb] [Process/FreeBSDRemote] Introduce aarch64 hw break/watchpoint support
mgorny added a comment. Gentle ping. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96548/new/ https://reviews.llvm.org/D96548 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits