================
@@ -38,7 +39,37 @@ Status CommandOptionsProcessLaunch::SetOptionValue(
   case 's': // Stop at program entry point
     launch_info.GetFlags().Set(eLaunchFlagStopAtEntry);
     break;
-
+  case 'm': // Stop at user entry point
+  {
+    TargetSP target_sp =
+        execution_context ? execution_context->GetTargetSP() : TargetSP();
+    ModuleSP main_module_sp = target_sp->GetExecutableModule();
+    FileSpecList shared_lib_filter;
+    shared_lib_filter.Append(main_module_sp->GetFileSpec());
+    std::set<std::string> entryPointNamesSet;
+    for (LanguageType lang_type : Language::GetSupportedLanguages()) {
+      Language *lang = Language::FindPlugin(lang_type);
+      if (lang) {
+        std::string entryPointName = lang->GetUserEntryPointName();
+        if (!entryPointName.empty())
+          entryPointNamesSet.insert(entryPointName);
+      }
+    }
+    std::vector<std::string> entryPointNames(entryPointNamesSet.begin(),
+                                             entryPointNamesSet.end());
+    BreakpointSP bp_sp = target_sp->CreateBreakpoint(
+        /*containingModules=*/&shared_lib_filter,
----------------
junior-jl wrote:

You mean like this?

```cpp
BreakpointSP bp_sp = target_sp->CreateBreakpoint(
    &shared_lib_filter, 
    nullptr,                 // containingSourceFiles
    entryPointNames,     
    eFunctionNameTypeFull,   // func_name_type_mask
    eLanguageTypeUnknown,    // language
    0,                       // offset
    eLazyBoolNo,             // skip_prologue
    false                    // internal
    false                    // hardware
);
```

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