# See the License for the specific language governing permissions and
# limitations under the License.
-# Client for the nit debugger nitdbg
+# Client for the nit debugger nitdbg-server
#
# Can send commands to the debugger
-module dbgcli
+module nitdbg_client
import socket
import toolcontext
print "[HOST ADDRESS] : "+debugger_connection.address
print "[HOST] : "+debugger_connection.host.as(not null)
print "[PORT] : "+debugger_connection.port.to_s
- print "Connecting ... "+debugger_connection.connect.to_s
end
init with_port (host: String, port: Int)
# Create a tool context to handle options and paths
var toolcontext = new ToolContext
-toolcontext.process_options
+toolcontext.tooldescription = "Usage: nitdbg_client [OPTION]...\nConnects to a nitdbg_server and controls it."
+toolcontext.accept_no_arguments = true
+toolcontext.process_options(args)
var debug: DebugClient
-if toolcontext.opt_help.value then
- toolcontext.option_context.usage
- return
-end
-
# If the port value is not an Int between 0 and 65535 (Mandatory according to the norm)
# Print the usage
if toolcontext.opt_debug_port.value < 0 or toolcontext.opt_debug_port.value > 65535 then
debug = new DebugClient("127.0.0.1", toolcontext.opt_debug_port.value)
end
+var res = debug.debugger_connection.connect
+print "Connecting ... " + res.to_s
+if not res then exit 1
+
var recv_cmd: String
var written_cmd: String