diff gdb_remote.c @ 1189:75ba222877f7

Force IPV4 for GDB remote debugging on Windows. Bind to localhost instead of unspecified address since listening on external ports probably isn't a good idea in the general case
author Michael Pavone <pavone@retrodev.com>
date Sun, 22 Jan 2017 19:40:32 -0800
parents 73e36dac5be7
children 42fb3ee1e92c
line wrap: on
line diff
--- a/gdb_remote.c	Sun Jan 22 17:12:17 2017 -0800
+++ b/gdb_remote.c	Sun Jan 22 19:40:32 2017 -0800
@@ -577,10 +577,10 @@
 
 	struct addrinfo request, *result;
 	memset(&request, 0, sizeof(request));
-	request.ai_family = AF_UNSPEC;
+	request.ai_family = AF_INET;
 	request.ai_socktype = SOCK_STREAM;
 	request.ai_flags = AI_PASSIVE;
-	getaddrinfo(NULL, "1234", &request, &result);
+	getaddrinfo("localhost", "1234", &request, &result);
 
 	int listen_sock = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
 	if (listen_sock < 0) {