From 0f1f968ffb6f4b19193ccad1a4edae9e9a46ab19 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 20 Jul 2012 23:26:14 +0200 Subject: [PATCH] Debugger: Actually create the CLI, if requested --- src/apps/debugger/Debugger.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/apps/debugger/Debugger.cpp b/src/apps/debugger/Debugger.cpp index c7a687c855..f5617470aa 100644 --- a/src/apps/debugger/Debugger.cpp +++ b/src/apps/debugger/Debugger.cpp @@ -56,7 +56,7 @@ static const char* kUsage = "\n" "Options:\n" " -h, --help - Print this usage info and exit.\n" - " -c, --cli - Use command line user interface (not yet implemented)\n" + " -c, --cli - Use command line user interface\n" ; @@ -397,7 +397,8 @@ Debugger::ArgvReceived(int32 argc, char** argv) return; } - start_team_debugger(team, &fSettingsManager, this, thread, stopInMain); + start_team_debugger(team, &fSettingsManager, this, thread, stopInMain, + options.useCLI); } @@ -481,6 +482,7 @@ Debugger::_FindTeamDebugger(team_id teamID) const // #pragma mark - + int main(int argc, const char* const* argv) { @@ -493,20 +495,15 @@ main(int argc, const char* const* argv) Options options; parse_arguments(argc, argv, false, options); - if (options.useCLI) { - // TODO: implement - fprintf(stderr, "Error: Command line interface unimplemented\n"); + Debugger app; + status_t error = app.Init(); + if (error != B_OK) { + fprintf(stderr, "Error: Failed to init application: %s\n", + strerror(error)); return 1; - } else { - Debugger app; - status_t error = app.Init(); - if (error != B_OK) { - fprintf(stderr, "Error: Failed to init application: %s\n", - strerror(error)); - return 1; - } - - app.Run(); } + + app.Run(); + return 0; }