[haiku-commits] r43158 - haiku/trunk/src/apps/debugger

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 3 Nov 2011 13:21:06 +0100 (CET)

Author: anevilyak
Date: 2011-11-03 13:21:06 +0100 (Thu, 03 Nov 2011)
New Revision: 43158
Changeset: https://dev.haiku-os.org/changeset/43158

Modified:
   haiku/trunk/src/apps/debugger/Debugger.cpp
Log:
Add command line argument to specify usage of the CLI rather than the GUI.
Not used yet.


Modified: haiku/trunk/src/apps/debugger/Debugger.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/Debugger.cpp  2011-11-03 12:18:19 UTC (rev 
43157)
+++ haiku/trunk/src/apps/debugger/Debugger.cpp  2011-11-03 12:21:06 UTC (rev 
43158)
@@ -54,6 +54,7 @@
        "\n"
        "Options:\n"
        "  -h, --help    - Print this usage info and exit.\n"
+       "  -c, --cli     - Use command line user interface (not yet 
implemented)\n"
 ;
 
 
@@ -71,13 +72,15 @@
        const char* const*      commandLineArgv;
        team_id                         team;
        thread_id                       thread;
+       bool                            useCLI;
 
        Options()
                :
                commandLineArgc(0),
                commandLineArgv(NULL),
                team(-1),
-               thread(-1)
+               thread(-1),
+               useCLI(false)
        {
        }
 };
@@ -94,16 +97,21 @@
                        { "help", no_argument, 0, 'h' },
                        { "team", required_argument, 0, 't' },
                        { "thread", required_argument, 0, 'T' },
+                       { "cli", no_argument, 0, 'c' },
                        { 0, 0, 0, 0 }
                };
 
                opterr = 0; // don't print errors
 
-               int c = getopt_long(argc, (char**)argv, "+h", sLongOptions, 
NULL);
+               int c = getopt_long(argc, (char**)argv, "+ch", sLongOptions, 
NULL);
                if (c == -1)
                        break;
 
                switch (c) {
+                       case 'c':
+                               options.useCLI = true;
+                               break;
+
                        case 'h':
                                if (noOutput)
                                        return false;
@@ -324,6 +332,10 @@
                stopInMain = true;
        }
 
+       // no parameters given, prompt the user to attach to a team
+       if (team < 0 && thread < 0)
+               return;
+
        // If we've got
        if (team < 0) {
                printf("no team yet, getting thread info...\n");
@@ -430,7 +442,8 @@
 
 
 TeamDebugger*
-Debugger::_StartTeamDebugger(team_id teamID, thread_id threadID, bool 
stopInMain)
+Debugger::_StartTeamDebugger(team_id teamID, thread_id threadID,
+       bool stopInMain)
 {
        if (teamID < 0)
                return NULL;


Other related posts:

  • » [haiku-commits] r43158 - haiku/trunk/src/apps/debugger - anevilyak