Add version fields for debugger configuration

By adding version information to the debugger protocol
it is possible to report if the debugger client and server
have different expectations on debugger workings (opcodes, types, etc.).

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
Peter Gal
2018-01-15 18:10:37 +01:00
committed by yichoi
parent 52a14fa08f
commit 40d05cdca2
4 changed files with 45 additions and 3 deletions
+10
View File
@@ -30,6 +30,15 @@
#include <unistd.h>
#endif /* HAVE_TIME_H */
/**
* The number of message types in the debugger should reflect the
* debugger versioning.
*/
JERRY_STATIC_ASSERT (JERRY_DEBUGGER_MESSAGES_OUT_MAX_COUNT == 26
&& JERRY_DEBUGGER_MESSAGES_IN_MAX_COUNT == 16
&& JERRY_DEBUGGER_VERSION == 1,
debugger_version_correlates_to_message_type_count);
/**
* Type cast the debugger send buffer into a specific type.
*/
@@ -707,6 +716,7 @@ jerry_debugger_send_configuration (uint8_t max_message_size) /**< maximum messag
configuration_p->max_message_size = max_message_size;
configuration_p->cpointer_size = sizeof (jmem_cpointer_t);
configuration_p->little_endian = (endian_data.uint8_value[0] == 1);
configuration_p->version = JERRY_DEBUGGER_VERSION;
return jerry_debugger_send (sizeof (jerry_debugger_send_configuration_t));
} /* jerry_debugger_send_configuration */