[Lldb-commits] [lldb] [lldb] add stop-at-main option to process launch (PR #67019)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 26 10:04:36 PDT 2023
=?utf-8?q?José?= L. Junior <jljuniorpb at gmail.com>,
=?utf-8?q?José?= L. Junior <jljuniorpb at gmail.com>,
=?utf-8?q?José?= L. Junior <jljuniorpb at gmail.com>
Message-ID:
In-Reply-To: <llvm/llvm-project/pull/67019/lldb at github.com>
jimingham wrote:
> On Sep 26, 2023, at 7:29 AM, José Lira Junior ***@***.***> wrote:
>
>
> @junior-jl commented on this pull request.
>
> In lldb/source/Commands/CommandOptionsProcessLaunch.cpp <https://github.com/llvm/llvm-project/pull/67019#discussion_r1337311231>:
>
> > @@ -38,7 +38,18 @@ Status CommandOptionsProcessLaunch::SetOptionValue(
> case 's': // Stop at program entry point
> launch_info.GetFlags().Set(eLaunchFlagStopAtEntry);
> break;
> -
> + case 'm': // Stop at main function
> + {
> + TargetSP target_sp =
> + execution_context ? execution_context->GetTargetSP() : TargetSP();
> + BreakpointSP bp_sp = target_sp->CreateBreakpoint(
> + nullptr, nullptr, "main", eFunctionNameTypeAuto, eLanguageTypeUnknown,
> We should add a new API to the Language plugin: Language::GetUserEntrypointName() and then this code should iterate over all the supported languages building up a unique list of entry point names using this API. At present there's going to be one: "main" repeated many times but I think Walter promised us another one soon...
>
> About this, Walter had proposed the following: "I'd suggest adding a virtual method GetMainSymbol to the Language.h interface, which could be implemented by each language plugin.". I guess it's a good approach. What are your thoughts?
>
Right, that's also what I was suggesting. W.r.t. Walter's suggestion, I still think it's better to use a generic term (I suggested GetUserEntrypointName) rather than explicitly using the word "main", which is the C name for this feature... Greg suggested making this change to the option name as well earlier in this thread.
Jim
> —
> Reply to this email directly, view it on GitHub <https://github.com/llvm/llvm-project/pull/67019#discussion_r1337311231>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADUPVW42YJDE57AFPW3Y7CDX4LRFPANCNFSM6AAAAAA5BUJK5M>.
> You are receiving this because you were mentioned.
>
https://github.com/llvm/llvm-project/pull/67019
More information about the lldb-commits
mailing list