-
Notifications
You must be signed in to change notification settings - Fork 0
Add the structures for the debugger #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
uint16_t count; /**< line count */ | ||
} package; | ||
|
||
#endif /* JERRY_DEBUG_H */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be /* JERRY_DEBUGGER_H */
@@ -0,0 +1,39 @@ | |||
/* Copyright 2016 University of Szeged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file name should be jerry-debug.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or jerry-debugger.h
*/ | ||
|
||
#ifndef JERRY_DEBUGGER_H | ||
#define JERRY_DEBUGGER_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must come from the file name.
char msg[128]; /**< the literal array */ | ||
uint32_t line_offset; /**< line offset */ | ||
uint32_t line_index; /**< line index */ | ||
uint16_t count; /**< line count */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should not be packed everything into one structure. The layout should look like this (without comments):
typdef struct
{
uint8_t type;
uint8_t size;
} jerry_debug_message_header;
And each message should have its own type.
typdef struct
{
jerry_debug_message_header header;
char file_name[1];
} jerry_debug_message_source_name;
One structure for each message.
Perhaps SOURCE_FILE type is enough for this patch.
|
||
typedef struct | ||
{ | ||
package_type_t type; /**< type of the package */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We never use types with unspecified length for network messages because the compiler might use types for them.
242caf7
to
9e7c685
Compare
Updated the PR. |
typdef struct | ||
{ | ||
jerry_debug_message_header header; /**< header of the source file name struct */ | ||
char file_name[128]; /**< the message */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file name should be 1 character long, and the real name should adapt the size
JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
eca7048
to
b3b80dd
Compare
typdef struct | ||
{ | ||
jerry_debug_message_header header; /**< header of the source file name struct */ | ||
char file_name[1]; /**< the message */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definetely wrong. This means 1 character long string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is correct.
This struct is a mapping struct, mapped to a buffer, and the maximum buffer size limits the file_name.
LGTM |
Add the structures what the debugger will be use.
JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu