[Scummvm-git-logs] scummvm master -> f1d2ba701aa42b9c5589ace6f9a8df1395bcbf81

digitall noreply at scummvm.org
Sun May 14 23:57:45 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f1d2ba701a WII: Add Code for GDB Debugging Over Ethernet using TCP


Commit: f1d2ba701aa42b9c5589ace6f9a8df1395bcbf81
    https://github.com/scummvm/scummvm/commit/f1d2ba701aa42b9c5589ace6f9a8df1395bcbf81
Author: D G Turner (digitall at scummvm.org)
Date: 2023-05-15T00:51:27+01:00

Commit Message:
WII: Add Code for GDB Debugging Over Ethernet using TCP

The Gecko USB serial adapter is no longer easy to obtain and using
the Ethernet adapter instead is supported by devkitPro/libogc.

However, when enabled, this fails to link when dynamic plugins are
enabled due to missing symbols for gdbstub_getoffsets() found in
devkitPro/libogc/libdb/debug_supp.c. To be exact, this is the
u8 __text_fstart[],__data_fstart[],__bss_fstart[] which should be
implicitly provided by the linker(?)

A monolithic static build with this enabled does succeed, but has not
yet been tested.

Changed paths:
  A backends/platform/wii/gdb-network.txt
    backends/platform/wii/main.cpp
    backends/platform/wii/wii.mk
    configure


diff --git a/backends/platform/wii/gdb-network.txt b/backends/platform/wii/gdb-network.txt
new file mode 100644
index 00000000000..38248c1cacb
--- /dev/null
+++ b/backends/platform/wii/gdb-network.txt
@@ -0,0 +1,3 @@
+target remote 192.168.123.101:5656
+info threads
+bt
diff --git a/backends/platform/wii/main.cpp b/backends/platform/wii/main.cpp
index b8bd57d2c1e..f3adb6fa413 100644
--- a/backends/platform/wii/main.cpp
+++ b/backends/platform/wii/main.cpp
@@ -40,7 +40,7 @@
 #ifdef USE_WII_DI
 #include <di/di.h>
 #endif
-#ifdef DEBUG_WII_GDB
+#if defined(DEBUG_WII_GDB) || defined (DEBUG_WII_GDB_NETWORK)
 #include <debug.h>
 #endif
 #include <gxflux/gfx_con.h>
@@ -59,7 +59,7 @@ void reset_cb(u32, void *) {
 #else
 void reset_cb(void) {
 #endif
-#ifdef DEBUG_WII_GDB
+#if defined(DEBUG_WII_GDB) || defined (DEBUG_WII_GDB_NETWORK)
 	printf("attach gdb now\n");
 	_break();
 #else
@@ -88,7 +88,7 @@ static void show_console(int code) {
 	for (i = 0; i < 60 * 3; ++i)
 		VIDEO_WaitVSync();
 
-#ifdef DEBUG_WII_GDB
+#if defined(DEBUG_WII_GDB) || defined (DEBUG_WII_GDB_NETWORK)
 	printf("attach gdb now\n");
 	_break();
 #endif
@@ -172,6 +172,14 @@ void wii_memstats(void) {
 }
 #endif
 
+#ifdef DEBUG_WII_GDB_NETWORK
+#define GDBSTUB_NETWORK_TCP_PORT 5656
+
+const char *tcp_localip = "192.168.123.101";
+const char *tcp_netmask = "255.255.255.0";
+const char *tcp_gateway = "192.168.123.100";
+#endif
+
 int main(int argc, char *argv[]) {
 	s32 res;
 
@@ -192,6 +200,10 @@ int main(int argc, char *argv[]) {
 	DEBUG_Init(GDBSTUB_DEVICE_USB, 1);
 #endif
 
+#ifdef DEBUG_WII_GDB_NETWORK
+	DEBUG_Init(GDBSTUB_DEVICE_TCP, GDBSTUB_NETWORK_TCP_PORT);
+#endif
+
 	printf("startup as ");
 	if (argc > 0)
 		printf("'%s'\n", argv[0]);
diff --git a/backends/platform/wii/wii.mk b/backends/platform/wii/wii.mk
index fbfc9a7f446..c0e57cb15a2 100644
--- a/backends/platform/wii/wii.mk
+++ b/backends/platform/wii/wii.mk
@@ -22,6 +22,9 @@ wiigdb:
 wiidebug:
 	$(DEVKITPPC)/bin/powerpc-eabi-gdb -n $(EXECUTABLE) -x $(srcdir)/backends/platform/wii/gdb.txt
 
+wiidebug_network:
+	$(DEVKITPPC)/bin/powerpc-eabi-gdb -n $(EXECUTABLE) -x $(srcdir)/backends/platform/wii/gdb-network.txt
+
 # target to create a Wii snapshot
 wiidist: all
 	$(MKDIR) wiidist/scummvm
diff --git a/configure b/configure
index 2c7551cef78..d9f760360b4 100755
--- a/configure
+++ b/configure
@@ -3563,6 +3563,7 @@ if test -n "$_host"; then
 			add_line_to_config_h "/* #define DEBUG_WII_USBGECKO */"
 			add_line_to_config_h "/* #define DEBUG_WII_MEMSTATS */"
 			add_line_to_config_h "/* #define DEBUG_WII_GDB */"
+			add_line_to_config_h "/* #define DEBUG_WII_GDB_NETWORK */"
 			add_line_to_config_h "#define USE_WII_DI"
 			;;
 		gcw0)
@@ -3939,6 +3940,7 @@ if test -n "$_host"; then
 			add_line_to_config_h "#define DEBUG_WII_USBGECKO"
 			add_line_to_config_h "/* #define DEBUG_WII_MEMSTATS */"
 			add_line_to_config_h "/* #define DEBUG_WII_GDB */"
+			add_line_to_config_h "/* #define DEBUG_WII_GDB_NETWORK */"
 			add_line_to_config_h "#define USE_WII_DI"
 			add_line_to_config_h "#define USE_WII_SMB"
 			add_line_to_config_h "#define USE_WII_KBD"




More information about the Scummvm-git-logs mailing list