================
@@ -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,
----------------
junior-jl wrote:

> 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?

https://github.com/llvm/llvm-project/pull/67019
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to