[Lldb-commits] [lldb] [lldb] add stop-at-user-entry option to process launch (PR #67019)
Med Ismail Bennani via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 29 08:47:07 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>,
=?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>,
=?utf-8?q?José?= L. Junior <jljuniorpb at gmail.com>
Message-ID:
In-Reply-To: <llvm/llvm-project/pull/67019/lldb at github.com>
================
@@ -38,7 +40,40 @@ 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());
+ llvm::SetVector<std::string, std::vector<std::string>,
+ std::unordered_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);
+ }
+ }
----------------
medismailben wrote:
You could check the size of `entryPointNamesSet` before trying to create the breakpoint, and return early if it's empty.
Breakpoint creation could fail for many reasons, so if you couldn't get any entry point name from the language plugin, we shouldn't bother creating a breakpoint and give the user a more accurate error message.
https://github.com/llvm/llvm-project/pull/67019
More information about the lldb-commits
mailing list