## Description This pull request adds a new `stop-at-user-entry` option to LLDB `process launch` command, allowing users to launch a process and pause execution at the entry point of the program (for C-based languages, `main` function). ## Motivation This option provides a convenient way to begin debugging a program by launching it and breaking at the desired entry point. ## Changes Made - Added `stop-at-user-entry` option to `Options.td` and the corresponding case in `CommandOptionsProcessLaunch.cpp` (short option is 'm') - Implemented `GetUserEntryPointName` method in the Language plugins available at the moment. - Declared the `CreateBreakpointAtUserEntry` method in the Target API. - Create Shell test for the command `command-process-launch-user-entry.test`. ## Usage `process launch --stop-at-user-entry` or `process launch -m` launches the process and pauses execution at the entry point of the program.
56 lines
1.7 KiB
C++
56 lines
1.7 KiB
C++
//===-- ObjCPlusPlusLanguage.h ----------------------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLDB_SOURCE_PLUGINS_LANGUAGE_OBJCPLUSPLUS_OBJCPLUSPLUSLANGUAGE_H
|
|
#define LLDB_SOURCE_PLUGINS_LANGUAGE_OBJCPLUSPLUS_OBJCPLUSPLUSLANGUAGE_H
|
|
|
|
#include "Plugins/Language/ClangCommon/ClangHighlighter.h"
|
|
#include "lldb/Target/Language.h"
|
|
#include "lldb/lldb-private.h"
|
|
|
|
namespace lldb_private {
|
|
|
|
class ObjCPlusPlusLanguage : public Language {
|
|
ClangHighlighter m_highlighter;
|
|
|
|
public:
|
|
ObjCPlusPlusLanguage() = default;
|
|
|
|
~ObjCPlusPlusLanguage() override = default;
|
|
|
|
lldb::LanguageType GetLanguageType() const override {
|
|
return lldb::eLanguageTypeObjC_plus_plus;
|
|
}
|
|
|
|
llvm::StringRef GetUserEntryPointName() const override { return "main"; }
|
|
|
|
llvm::StringRef GetNilReferenceSummaryString() override { return "nil"; }
|
|
|
|
bool IsSourceFile(llvm::StringRef file_path) const override;
|
|
|
|
const Highlighter *GetHighlighter() const override { return &m_highlighter; }
|
|
|
|
// Static Functions
|
|
static void Initialize();
|
|
|
|
static void Terminate();
|
|
|
|
static lldb_private::Language *CreateInstance(lldb::LanguageType language);
|
|
|
|
llvm::StringRef GetInstanceVariableName() override { return "self"; }
|
|
|
|
static llvm::StringRef GetPluginNameStatic() { return "objcplusplus"; }
|
|
|
|
// PluginInterface protocol
|
|
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
|
};
|
|
|
|
} // namespace lldb_private
|
|
|
|
#endif // LLDB_SOURCE_PLUGINS_LANGUAGE_OBJCPLUSPLUS_OBJCPLUSPLUSLANGUAGE_H
|