Make debugger port runtime configurable

Convert debug server port from a compile-time constant to a context
variable. This enables each engine instance (either running in the
same process or in different processes) to listen for connections
at different ports, i.e., multiple engines can be debugged at the
same time on the same machine.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss [email protected]
This commit is contained in:
Akos Kiss authored and yichoi committed 2017-07-06 07:08:00 +09:00
1 parent cfa4fdd1ef
commit 18283d22c0
21 files changed
+59 -47

No files matched your search

+1 -10
View File
@@ -24,13 +24,6 @@
#include <fcntl.h>
#include <unistd.h>
/**
* Debugger socket communication port.
*/
#ifndef JERRY_DEBUGGER_PORT
#define JERRY_DEBUGGER_PORT 5001
#endif
/**
* Masking-key is available.
*/
@@ -314,10 +307,8 @@ jerry_debugger_accept_connection (void)
struct sockaddr_in addr;
socklen_t sin_size = sizeof (struct sockaddr_in);
JERRY_ASSERT (JERRY_CONTEXT (jerry_init_flags) & ECMA_INIT_DEBUGGER);
addr.sin_family = AF_INET;
addr.sin_port = htons (JERRY_DEBUGGER_PORT);
addr.sin_port = htons (JERRY_CONTEXT (debugger_port));
addr.sin_addr.s_addr = INADDR_ANY;
if ((server_socket = socket (AF_INET, SOCK_STREAM, 0)) == -1)