[Lldb-commits] [lldb] [lldb] add stop-at-main option to process launch (PR #67019)

José Lira Junior via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 26 07:55:46 PDT 2023


================
@@ -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:

> If you find more than one name, there's a Target::CreateBreakpoint overload that takes a `const char *func_names[]` - that you can use to make one portmanteau breakpoint for all the entry point names.

Is this meant for scenarios where a program is written in more than one programming language?

https://github.com/llvm/llvm-project/pull/67019


More information about the lldb-commits mailing list