[llvm] 1617c8d - [lldb] Add LLDB_BUG_REPORT_URL macro to allow a different URL for lldb bug reporting. (#78210)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 16 07:50:51 PST 2024
Author: Zequan Wu
Date: 2024-01-16T10:50:48-05:00
New Revision: 1617c8d3b8c5fc5d1ec54e4e1b2c43679e573065
URL: https://github.com/llvm/llvm-project/commit/1617c8d3b8c5fc5d1ec54e4e1b2c43679e573065
DIFF: https://github.com/llvm/llvm-project/commit/1617c8d3b8c5fc5d1ec54e4e1b2c43679e573065.diff
LOG: [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`.
Added:
Modified:
lldb/include/lldb/Host/Config.h.cmake
lldb/tools/driver/Driver.cpp
lldb/tools/lldb-dap/lldb-dap.cpp
lldb/tools/lldb-server/lldb-server.cpp
llvm/CMakeLists.txt
llvm/utils/gn/secondary/lldb/include/lldb/Host/BUILD.gn
Removed:
################################################################################
diff --git a/lldb/include/lldb/Host/Config.h.cmake b/lldb/include/lldb/Host/Config.h.cmake
index 14ce46f6559c8c..3defa454f6d420 100644
--- a/lldb/include/lldb/Host/Config.h.cmake
+++ b/lldb/include/lldb/Host/Config.h.cmake
@@ -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
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index f8058f868d53ff..c63ff0ff597e5c 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -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;
diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index e91b4115156b73..8c8e92146e63c0 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -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);
diff --git a/lldb/tools/lldb-server/lldb-server.cpp b/lldb/tools/lldb-server/lldb-server.cpp
index 1808ffc0c97904..e2e6bfcd8645c7 100644
--- a/lldb/tools/lldb-server/lldb-server.cpp
+++ b/lldb/tools/lldb-server/lldb-server.cpp
@@ -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];
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 1ecfb36ab41a3c..61ab69d237470f 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -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)
diff --git a/llvm/utils/gn/secondary/lldb/include/lldb/Host/BUILD.gn b/llvm/utils/gn/secondary/lldb/include/lldb/Host/BUILD.gn
index b4f0f291144350..c46a916373ed01 100644
--- a/llvm/utils/gn/secondary/lldb/include/lldb/Host/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/include/lldb/Host/BUILD.gn
@@ -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=",
]
More information about the llvm-commits
mailing list