[lldb] Add LLDB_BUG_REPORT_URL macro to allow a different URL for lldb bug reporting. (#78210)

This allows release teams to customize the bug report url for lldb. It
also removes unnecessary constructions of
`llvm::PrettyStackTraceProgram` as it's already constructed inside
`llvm::InitLLVM`.
This commit is contained in:
Zequan Wu 2024-01-16 10:50:48 -05:00 committed by GitHub
parent 9a402d6fbb
commit 1617c8d3b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 2 deletions

View File

@ -55,4 +55,6 @@
#cmakedefine LLDB_GLOBAL_INIT_DIRECTORY R"(${LLDB_GLOBAL_INIT_DIRECTORY})"
#define LLDB_BUG_REPORT_URL "${LLDB_BUG_REPORT_URL}"
#endif // #ifndef LLDB_HOST_CONFIG_H

View File

@ -18,6 +18,7 @@
#include "lldb/API/SBStream.h"
#include "lldb/API/SBStringList.h"
#include "lldb/API/SBStructuredData.h"
#include "lldb/Host/Config.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Format.h"
@ -746,6 +747,8 @@ int main(int argc, char const *argv[]) {
// Setup LLVM signal handlers and make sure we call llvm_shutdown() on
// destruction.
llvm::InitLLVM IL(argc, argv, /*InstallPipeSignalExitHandler=*/false);
llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
" and include the crash backtrace.\n");
// Parse arguments.
LLDBOptTable T;

View File

@ -47,6 +47,7 @@
#include <thread>
#include <vector>
#include "lldb/Host/Config.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/ScopeExit.h"
@ -3733,7 +3734,8 @@ int SetupStdoutStderrRedirection() {
int main(int argc, char *argv[]) {
llvm::InitLLVM IL(argc, argv, /*InstallPipeSignalExitHandler=*/false);
llvm::PrettyStackTraceProgram X(argc, argv);
llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
" and include the crash backtrace.\n");
llvm::SmallString<256> program_path(argv[0]);
llvm::sys::fs::make_absolute(program_path);

View File

@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "SystemInitializerLLGS.h"
#include "lldb/Host/Config.h"
#include "lldb/Initialization/SystemLifetimeManager.h"
#include "lldb/Version/Version.h"
@ -50,7 +51,8 @@ static void terminate_debugger() { g_debugger_lifetime->Terminate(); }
// main
int main(int argc, char *argv[]) {
llvm::InitLLVM IL(argc, argv, /*InstallPipeSignalExitHandler=*/false);
llvm::PrettyStackTraceProgram X(argc, argv);
llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
" and include the crash backtrace.\n");
int option_error = 0;
const char *progname = argv[0];

View File

@ -346,6 +346,8 @@ set(PACKAGE_BUGREPORT "https://github.com/llvm/llvm-project/issues/")
set(BUG_REPORT_URL "${PACKAGE_BUGREPORT}" CACHE STRING
"Default URL where bug reports are to be submitted.")
set(LLDB_BUG_REPORT_URL "${BUG_REPORT_URL}" CACHE STRING
"Default URL where lldb bug reports are to be submitted.")
# Configure CPack.
if(NOT DEFINED CPACK_PACKAGE_INSTALL_DIRECTORY)

View File

@ -25,6 +25,7 @@ write_cmake_config("Config") {
"LLDB_GLOBAL_INIT_DIRECTORY=",
"LLDB_PYTHON_HOME=",
"LLDB_BUG_REPORT_URL=https://github.com/llvm/llvm-project/issues/",
"HAVE_LIBCOMPRESSION=",
]