summaryrefslogtreecommitdiffstats
path: root/lldb/tools/driver/Driver.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-11-21 13:25:43 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2019-11-21 13:25:53 -0800
commitb26d9e417d2d4dbb47f6e967926dbb31f6d7a4b4 (patch)
treebdfa6ceb38172bcfd12b0e36382d21131babfca2 /lldb/tools/driver/Driver.cpp
parent44fe1f024d542bb7d286f9dd03ef35ad474399bd (diff)
downloadbcm5719-llvm-b26d9e417d2d4dbb47f6e967926dbb31f6d7a4b4.tar.gz
bcm5719-llvm-b26d9e417d2d4dbb47f6e967926dbb31f6d7a4b4.zip
[Reproducer] Instruct users to replay reproducer
Improve the message printed when LLDB crashes by asking the user to replay the reproducer before attaching it to a bugreport.. ******************** Crash reproducer for lldb version 10.0.0 (git@github.com:llvm/llvm-project.git revision ...) clang revision ... llvm revision ... Reproducer written to '/path/to/reproducer' Before attaching the reproducer to a bug report: - Look at the directory to ensure you're willing to share its content. - Make sure the reproducer works by replaying the reproducer. Replay the reproducer with the following command: ./bin/lldb -replay /path/to/reproducer ********************
Diffstat (limited to 'lldb/tools/driver/Driver.cpp')
-rw-r--r--lldb/tools/driver/Driver.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index 806922bc860..465ccdb9539 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -732,16 +732,24 @@ void sigcont_handler(int signo) {
signal(signo, sigcont_handler);
}
-void reproducer_handler(void *) {
+void reproducer_handler(void *argv0) {
if (SBReproducer::Generate()) {
+ auto exe = static_cast<const char *>(argv0);
llvm::outs() << "********************\n";
llvm::outs() << "Crash reproducer for ";
llvm::outs() << lldb::SBDebugger::GetVersionString() << '\n';
+ llvm::outs() << '\n';
llvm::outs() << "Reproducer written to '" << SBReproducer::GetPath()
<< "'\n";
+ llvm::outs() << '\n';
+ llvm::outs() << "Before attaching the reproducer to a bug report:\n";
+ llvm::outs() << " - Look at the directory to ensure you're willing to "
+ "share its content.\n";
llvm::outs()
- << "Please have a look at the directory to assess if you're willing to "
- "share the contained information.\n";
+ << " - Make sure the reproducer works by replaying the reproducer.\n";
+ llvm::outs() << '\n';
+ llvm::outs() << "Replay the reproducer with the following command:\n";
+ llvm::outs() << exe << " -replay " << SBReproducer::GetPath() << "\n";
llvm::outs() << "********************\n";
}
}
@@ -847,7 +855,7 @@ int main(int argc, char const *argv[]) {
}
// Register the reproducer signal handler.
- llvm::sys::AddSignalHandler(reproducer_handler, nullptr);
+ llvm::sys::AddSignalHandler(reproducer_handler, (void *)(argv[0]));
SBError error = SBDebugger::InitializeWithErrorHandling();
if (error.Fail()) {
OpenPOWER on IntegriCloud