opdb: add option for setting default GDB port.

This commit is contained in:
Daniel Beer 2013-04-22 10:29:30 +12:00
parent a0499ab6f0
commit 1c0bdccc74
3 changed files with 15 additions and 2 deletions

View File

@ -258,7 +258,8 @@ repeated without padding as many times as necessary without exceeding the
bounds of the specified region.
.IP "\fBgdb\fR [\fIport\fR]"
Start a GDB remote stub, optionally specifying a TCP port to listen on.
If no port is given, the default port is 2000.
If no port is given, the default port is controlled by the option
\fBgdb_default_port\fR.
MSPDebug will wait for a connection on this port, and then act as a
GDB remote stub until GDB disconnects.
@ -715,6 +716,9 @@ BSL memory. If in doubt, do not enable this.
If set, some drivers will allow erase/program access to the info A
segment. If in doubt, do not enable this. Currently, the tilib and uif
drivers are affected by this option.
.IP "\fBgdb_default_port\fR (numeric)"
This option controls the default TCP port for the GDB server, if no
argument is given to the "\fBgdb\fR" command.
.IP "\fBgdb_loop\fR (boolean)"
Automatically restart the GDB server after disconnection. If this
option is set, then the GDB server keeps running until an error occurs,

View File

@ -536,7 +536,7 @@ static int gdb_server(int port)
int cmd_gdb(char **arg)
{
char *port_text = get_arg(arg);
address_t port = 2000;
address_t port = opdb_get_numeric("gdb_default_port");
if (port_text && expr_eval(port_text, &port) < 0) {
printc_err("gdb: can't parse port: %s\n", port_text);

View File

@ -94,6 +94,15 @@ static const struct opdb_key keys[] = {
.help =
"If set, some drivers will allow erase/program access to flash\n"
"BSL memory. If in doubt, do not enable this.\n"
},
{
.name = "gdb_default_port",
.type = OPDB_TYPE_NUMERIC,
.help =
"Default TCP port for GDB server, if no argument is given.\n",
.defval = {
.numeric = 2000
}
}
};