Add debugger connection port setting to build script (#1599)

JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
This commit is contained in:
Levente Orban 2017-02-21 15:39:22 +01:00 committed by Zoltan Herczeg
parent 9043ec620d
commit cc0f69613a
3 changed files with 9 additions and 0 deletions

View File

@ -19,6 +19,7 @@ project (${JERRY_CORE_NAME} C)
# Optional features
set(FEATURE_CPOINTER_32_BIT OFF CACHE BOOL "Enable 32 bit compressed pointers?")
set(FEATURE_DEBUGGER OFF CACHE BOOL "Enable JerryScript debugger?")
set(FEATURE_DEBUGGER_PORT "5001" CACHE STRING "Set debugger port number (default: 5001)")
set(FEATURE_ERROR_MESSAGES OFF CACHE BOOL "Enable error messages?")
set(FEATURE_JS_PARSER ON CACHE BOOL "Enable js-parser?")
set(FEATURE_MEM_STATS OFF CACHE BOOL "Enable memory statistics?")
@ -40,6 +41,7 @@ endif()
# Status messages
message(STATUS "FEATURE_CPOINTER_32_BIT " ${FEATURE_CPOINTER_32_BIT})
message(STATUS "FEATURE_DEBUGGER " ${FEATURE_DEBUGGER})
message(STATUS "FEATURE_DEBUGGER_PORT " ${FEATURE_DEBUGGER_PORT})
message(STATUS "FEATURE_ERROR_MESSAGES " ${FEATURE_ERROR_MESSAGES})
message(STATUS "FEATURE_JS_PARSER " ${FEATURE_JS_PARSER})
message(STATUS "FEATURE_MEM_STATS " ${FEATURE_MEM_STATS})
@ -175,6 +177,9 @@ if(FEATURE_DEBUGGER)
set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_DEBUGGER)
endif()
# Debugger port
set(DEFINES_JERRY ${DEFINES_JERRY} JERRY_DEBUGGER_PORT=${FEATURE_DEBUGGER_PORT})
# Memory management stress-test mode
if(FEATURE_MEM_STRESS_TEST)
set(DEFINES_JERRY ${DEFINES_JERRY} JMEM_GC_BEFORE_EACH_ALLOC)

View File

@ -27,7 +27,9 @@
/**
* Debugger socket communication port.
*/
#ifndef JERRY_DEBUGGER_PORT
#define JERRY_DEBUGGER_PORT 5001
#endif
/**
* Masking-key is available.

View File

@ -57,6 +57,7 @@ def get_arguments():
parser.add_argument('--jerry-cmdline', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper, help='build jerry command line tool (%(choices)s; default: %(default)s)')
parser.add_argument('--jerry-cmdline-minimal', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper, help='build minimal version of the jerry command line tool (%(choices)s; default: %(default)s)')
parser.add_argument('--jerry-debugger', metavar='X', choices=['ON', 'OFF'], default='OFF', type=str.upper, help='enable the jerry debugger (%(choices)s; default: %(default)s)')
parser.add_argument('--jerry-debugger-port', metavar='N', action='store', type=int, default=5001, help='add custom port number (default: %(default)s)')
parser.add_argument('--jerry-libc', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper, help='build and use jerry-libc (%(choices)s; default: %(default)s)')
parser.add_argument('--jerry-libm', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper, help='build and use jerry-libm (%(choices)s; default: %(default)s)')
parser.add_argument('--js-parser', metavar='X', choices=['ON', 'OFF'], default='ON', type=str.upper, help='enable js-parser (%(choices)s; default: %(default)s)')
@ -119,6 +120,7 @@ def generate_build_options(arguments):
build_options.append('-DFEATURE_PROFILE=%s' % PROFILE)
build_options.append('-DFEATURE_DEBUGGER=%s' % arguments.jerry_debugger)
build_options.append('-DFEATURE_DEBUGGER_PORT=%d' % arguments.jerry_debugger_port)
build_options.append('-DFEATURE_SNAPSHOT_EXEC=%s' % arguments.snapshot_exec)
build_options.append('-DFEATURE_SNAPSHOT_SAVE=%s' % arguments.snapshot_save)
build_options.append('-DFEATURE_SYSTEM_ALLOCATOR=%s' % arguments.system_allocator)