summaryrefslogtreecommitdiff
path: root/gdb_remote.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2017-01-22 19:40:32 -0800
committerMichael Pavone <pavone@retrodev.com>2017-01-22 19:40:32 -0800
commit95bad3f04ee801f5337e6c10e566085fd4d48bd2 (patch)
tree1a69ddf50fa56f6d2e856c0bbe882e6b948e62cf /gdb_remote.c
parent329be930106842ee60e0d9335b2f585c90a6c337 (diff)
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
Diffstat (limited to 'gdb_remote.c')
-rw-r--r--gdb_remote.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb_remote.c b/gdb_remote.c
index 2742d34..73aa81f 100644
--- a/gdb_remote.c
+++ b/gdb_remote.c
@@ -577,10 +577,10 @@ void gdb_remote_init(void)
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) {