From d8eeb8a4cc504085d5e5dab14caf7d891f92d51a Mon Sep 17 00:00:00 2001 From: Zardshard <0azrune6@zard.anonaddy.com> Date: Wed, 5 Apr 2023 10:22:37 -0400 Subject: [PATCH] Debugger: explain target must be specified for CLI debugger Previous behaviour was to exit without any explanation. Change-Id: I3350a139fadffb197c7833f3c46861a401f86271 Reviewed-on: https://review.haiku-os.org/c/haiku/+/6306 Reviewed-by: Rene Gollent Reviewed-by: Adrien Destugues Tested-by: Automation --- src/apps/debugger/Debugger.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/apps/debugger/Debugger.cpp b/src/apps/debugger/Debugger.cpp index 8d3b02d0d9..2579c85b90 100644 --- a/src/apps/debugger/Debugger.cpp +++ b/src/apps/debugger/Debugger.cpp @@ -674,6 +674,14 @@ CliDebugger::~CliDebugger() bool CliDebugger::Run(const Options& options) { + if (options.commandLineArgc == 0 + && options.team < 0 + && options.thread < 0 + && options.coreFilePath == NULL) { + fprintf(stderr, "No target specified to debug\n"); + return false; + } + // Block SIGINT, in this thread so all threads created by it inherit the // a block mask with the signal blocked. In the input loop the signal will // be unblocked again.