if not _usertaskdebugging_availabe:
print "You do not have the usertask debugging files available. "
return
+ log_level = logging.ERROR
+ if '-D' in cmd_options:
+ log_level = logging.DEBUG
+ elif '-W' in cmd_options:
+ log_level = logging.WARNING
+
+ setupLogging(debug_level=log_level)
+ if not cmd_args:
+ raise ArgumentError("Please provide valid task argument.")
+
+ t = kern.GetValueFromAddress(cmd_args[0], 'task_t')
+
+ up = userprocess.UserProcess(t)
+ gbs = gdbserver.GDBServer(up)
+ print "Starting debug session for %s at localhost:%d." % (GetProcNameForTask(t), gbs.portnum)
+ gbs.run()
+ print "stopped the debug session"