Simplify debugger-ws.h (#2266)
Remove several macros and types from it. This change simplifies the external debugger interface. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -53,10 +53,16 @@
|
||||
|
||||
/**
|
||||
* Calculate the maximum number of items for a given type
|
||||
* which can be transmitted by one message.
|
||||
* which can be transmitted in one message.
|
||||
*/
|
||||
#define JERRY_DEBUGGER_SEND_MAX(type) \
|
||||
((JERRY_DEBUGGER_MAX_SEND_SIZE - sizeof (jerry_debugger_send_header_t) - 1) / sizeof (type))
|
||||
((size_t) ((JERRY_CONTEXT (debugger_max_send_size) - sizeof (jerry_debugger_send_type_t)) / sizeof (type)))
|
||||
|
||||
/**
|
||||
* Calculate the size of a message when a count number of items transmitted.
|
||||
*/
|
||||
#define JERRY_DEBUGGER_SEND_SIZE(count, type) \
|
||||
((size_t) ((count * sizeof (type)) + sizeof (jerry_debugger_send_type_t)))
|
||||
|
||||
/**
|
||||
* Debugger operation modes:
|
||||
@@ -226,7 +232,6 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
jerry_debugger_send_header_t header; /**< message header */
|
||||
uint8_t type; /**< type of the message */
|
||||
uint8_t max_message_size; /**< maximum incoming message size */
|
||||
uint8_t cpointer_size; /**< size of compressed pointers */
|
||||
@@ -239,7 +244,6 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
jerry_debugger_send_header_t header; /**< message header */
|
||||
uint8_t type; /**< type of the message */
|
||||
} jerry_debugger_send_type_t;
|
||||
|
||||
@@ -256,9 +260,8 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
jerry_debugger_send_header_t header; /**< message header */
|
||||
uint8_t type; /**< type of the message */
|
||||
uint8_t string[JERRY_DEBUGGER_SEND_MAX (uint8_t)]; /**< string data */
|
||||
uint8_t string[]; /**< string data */
|
||||
} jerry_debugger_send_string_t;
|
||||
|
||||
/**
|
||||
@@ -266,7 +269,6 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
jerry_debugger_send_header_t header; /**< message header */
|
||||
uint8_t type; /**< type of the message */
|
||||
uint8_t line[sizeof (uint32_t)]; /**< value data */
|
||||
uint8_t column[sizeof (uint32_t)]; /**< value data */
|
||||
@@ -277,7 +279,6 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
jerry_debugger_send_header_t header; /**< message header */
|
||||
uint8_t type; /**< type of the message */
|
||||
uint8_t byte_code_cp[sizeof (jmem_cpointer_t)]; /**< byte code compressed pointer */
|
||||
} jerry_debugger_send_byte_code_cp_t;
|
||||
@@ -307,7 +308,6 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
jerry_debugger_send_header_t header; /**< message header */
|
||||
uint8_t type; /**< type of the message */
|
||||
uint8_t allocated_bytes[sizeof (uint32_t)]; /**< allocated bytes */
|
||||
uint8_t byte_code_bytes[sizeof (uint32_t)]; /**< byte code bytes */
|
||||
@@ -321,7 +321,6 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
jerry_debugger_send_header_t header; /**< message header */
|
||||
uint8_t type; /**< type of the message */
|
||||
uint8_t byte_code_cp[sizeof (jmem_cpointer_t)]; /**< byte code compressed pointer */
|
||||
uint8_t offset[sizeof (uint32_t)]; /**< breakpoint offset */
|
||||
@@ -341,9 +340,8 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
jerry_debugger_send_header_t header; /**< message header */
|
||||
uint8_t type; /**< type of the message */
|
||||
jerry_debugger_frame_t frames[JERRY_DEBUGGER_SEND_MAX (jerry_debugger_frame_t)]; /**< frames */
|
||||
jerry_debugger_frame_t frames[]; /**< frames */
|
||||
} jerry_debugger_send_backtrace_t;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user