summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--docs/source/commandline/commandline-all.rst22
-rw-r--r--docs/source/commandline/commandline-index.rst1
-rw-r--r--src/osd/modules/debugger/debuggdbstub.cpp12
-rw-r--r--src/osd/modules/lib/osdobj_common.cpp2
4 files changed, 27 insertions, 10 deletions
diff --git a/docs/source/commandline/commandline-all.rst b/docs/source/commandline/commandline-all.rst
index fe093cc0d86..d83b401cc32 100644
--- a/docs/source/commandline/commandline-all.rst
+++ b/docs/source/commandline/commandline-all.rst
@@ -3677,8 +3677,9 @@ Debugging Options
Acts as a remote debugging server for the GNU debugger (GDB). Only a
small subset of the CPUs emulated by MAME are supported. Use the
:ref:`debugger_port <mame-commandline-debuggerport>` option to set the
- listening port on the loopback interface. Supported on all platforms
- with TCP socket support.
+ listening port and the
+ :ref:`debugger_host <mame-commandline-debuggerhost>` option to set the
+ address to bind to. Supported on all platforms with TCP socket support.
Example:
.. code-block:: bash
@@ -3732,11 +3733,26 @@ Debugging Options
mame ibm_5150 -watchdog 30
+.. _mame-commandline-debuggerhost:
+
+**-debugger_host** *<address>*
+
+ Set the IP address to listen on to accept GDB connections when using the
+ GDB stub debugger module (see the
+ :ref:`debugger <mame-commandline-debugger>` option).
+
+ The default is ``localhost``.
+
+ Example:
+ .. code-block:: bash
+
+ mame rfjet -debug -debugger gdbstub -debugger_host 0.0.0.0
+
.. _mame-commandline-debuggerport:
**-debugger_port** *<port>*
- Set the TCP port number to listen on for GDB connections when using the GDB
+ Set the TCP port number to accept GDB connections on when using the GDB
stub debugger module (see the :ref:`debugger <mame-commandline-debugger>`
option).
diff --git a/docs/source/commandline/commandline-index.rst b/docs/source/commandline/commandline-index.rst
index c62dfef518b..cb6b9a7dfb4 100644
--- a/docs/source/commandline/commandline-index.rst
+++ b/docs/source/commandline/commandline-index.rst
@@ -298,6 +298,7 @@ Core Debugging Options
| :ref:`debugscript <mame-commandline-debugscript>`
| :ref:`[no]update_in_pause <mame-commandline-updateinpause>`
| :ref:`watchdog <mame-commandline-watchdog>`
+| :ref:`debugger_host <mame-commandline-debuggerhost>`
| :ref:`debugger_port <mame-commandline-debuggerport>`
| :ref:`debugger_font <mame-commandline-debuggerfont>`
| :ref:`debugger_font_size <mame-commandline-debuggerfontsize>`
diff --git a/src/osd/modules/debugger/debuggdbstub.cpp b/src/osd/modules/debugger/debuggdbstub.cpp
index ca042aa807f..77dea9ed048 100644
--- a/src/osd/modules/debugger/debuggdbstub.cpp
+++ b/src/osd/modules/debugger/debuggdbstub.cpp
@@ -496,8 +496,8 @@ static const std::map<std::string, const gdb_register_map &> gdb_register_maps =
class debug_gdbstub : public osd_module, public debug_module
{
public:
- debug_gdbstub()
- : osd_module(OSD_DEBUG_PROVIDER, "gdbstub"), debug_module(),
+ debug_gdbstub() :
+ osd_module(OSD_DEBUG_PROVIDER, "gdbstub"), debug_module(),
m_readbuf_state(PACKET_START),
m_machine(nullptr),
m_maincpu(nullptr),
@@ -506,7 +506,7 @@ public:
m_address_space(nullptr),
m_debugger_cpu(nullptr),
m_debugger_console(nullptr),
- m_debugger_host(nullptr),
+ m_debugger_host(),
m_debugger_port(0),
m_socket(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE),
m_is_be(false),
@@ -601,7 +601,7 @@ private:
address_space *m_address_space;
debugger_cpu *m_debugger_cpu;
debugger_console *m_debugger_console;
- const char *m_debugger_host;
+ std::string m_debugger_host;
int m_debugger_port;
emu_file m_socket;
bool m_is_be;
@@ -795,8 +795,8 @@ void debug_gdbstub::wait_for_debugger(device_t &device, bool firststop)
std::string socket_name = string_format("socket.%s:%d", m_debugger_host, m_debugger_port);
std::error_condition const filerr = m_socket.open(socket_name);
if ( filerr )
- fatalerror("gdbstub: failed to start listening on host %s port %d\n", m_debugger_host, m_debugger_port);
- osd_printf_info("gdbstub: listening on host %s port %d\n", m_debugger_host, m_debugger_port);
+ fatalerror("gdbstub: failed to start listening on address %s port %d\n", m_debugger_host, m_debugger_port);
+ osd_printf_info("gdbstub: listening on address %s port %d\n", m_debugger_host, m_debugger_port);
m_initialized = true;
}
diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp
index e2217df6ae4..ca166c3dbd9 100644
--- a/src/osd/modules/lib/osdobj_common.cpp
+++ b/src/osd/modules/lib/osdobj_common.cpp
@@ -58,7 +58,7 @@ const options_entry osd_options::s_option_entries[] =
{ nullptr, nullptr, core_options::option_type::HEADER, "OSD DEBUGGING OPTIONS" },
{ OSDOPTION_DEBUGGER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "debugger used: " },
- { OSDOPTION_DEBUGGER_HOST, "localhost", core_options::option_type::STRING, "host to use for gdbstub debugger" },
+ { OSDOPTION_DEBUGGER_HOST, "localhost", core_options::option_type::STRING, "address to bind to for gdbstub debugger" },
{ OSDOPTION_DEBUGGER_PORT, "23946", core_options::option_type::INTEGER, "port to use for gdbstub debugger" },
{ OSDOPTION_DEBUGGER_FONT ";dfont", OSDOPTVAL_AUTO, core_options::option_type::STRING, "font to use for debugger views" },
{ OSDOPTION_DEBUGGER_FONT_SIZE ";dfontsize", "0", core_options::option_type::FLOAT, "font size to use for debugger views" },