summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2023-07-27 14:42:11 +0200
committerJo-Philipp Wich <jo@mein.io>2023-08-09 01:03:26 +0200
commit6940c283d57d2c4e2ddab689fdba770823b8bcc0 (patch)
treec70e0e687e59911fb0a6ed6b03cd5b78b8f33ac6 /include
parentbe071072115059726846163c6f28f62dc01573ec (diff)
lib: introduce debug library
Introduce a new debug library which provides introspection facilities for debugging ucode scripts. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'include')
-rw-r--r--include/ucode/chunk.h4
-rw-r--r--include/ucode/lib.h2
-rw-r--r--include/ucode/program.h4
-rw-r--r--include/ucode/source.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/include/ucode/chunk.h b/include/ucode/chunk.h
index a5f0b1c..1e6ab1f 100644
--- a/include/ucode/chunk.h
+++ b/include/ucode/chunk.h
@@ -30,8 +30,8 @@ __hidden size_t uc_chunk_add(uc_chunk_t *chunk, uint8_t byte, size_t line);
__hidden void uc_chunk_pop(uc_chunk_t *chunk);
-__hidden size_t uc_chunk_debug_get_srcpos(uc_chunk_t *chunk, size_t off);
+size_t uc_chunk_debug_get_srcpos(uc_chunk_t *chunk, size_t offset);
__hidden void uc_chunk_debug_add_variable(uc_chunk_t *chunk, size_t from, size_t to, size_t slot, bool upval, uc_value_t *name);
-__hidden uc_value_t *uc_chunk_debug_get_variable(uc_chunk_t *chunk, size_t off, size_t slot, bool upval);
+uc_value_t *uc_chunk_debug_get_variable(uc_chunk_t *chunk, size_t offset, size_t slot, bool upval);
#endif /* UCODE_CHUNK_H */
diff --git a/include/ucode/lib.h b/include/ucode/lib.h
index 74d8866..cf5f12f 100644
--- a/include/ucode/lib.h
+++ b/include/ucode/lib.h
@@ -31,7 +31,7 @@ extern const uc_function_list_t uc_stdlib_functions[];
void uc_stdlib_load(uc_value_t *scope);
uc_cfn_ptr_t uc_stdlib_function(const char *name);
-__hidden bool uc_source_context_format(uc_stringbuf_t *buf, uc_source_t *src, size_t off, bool compact);
+bool uc_source_context_format(uc_stringbuf_t *buf, uc_source_t *src, size_t off, bool compact);
__hidden bool uc_error_context_format(uc_stringbuf_t *buf, uc_source_t *src, uc_value_t *stacktrace, size_t off);
__hidden void uc_error_message_indent(char **msg);
diff --git a/include/ucode/program.h b/include/ucode/program.h
index 19c8bdf..76b54b4 100644
--- a/include/ucode/program.h
+++ b/include/ucode/program.h
@@ -51,8 +51,8 @@ uc_program_put(uc_program_t *prog) {
__hidden uc_function_t *uc_program_function_new(uc_program_t *, const char *, uc_source_t *, size_t);
__hidden size_t uc_program_function_id(uc_program_t *, uc_function_t *);
__hidden uc_function_t *uc_program_function_load(uc_program_t *, size_t);
-__hidden uc_source_t *uc_program_function_source(uc_function_t *);
-__hidden size_t uc_program_function_srcpos(uc_function_t *, size_t);
+uc_source_t *uc_program_function_source(uc_function_t *);
+size_t uc_program_function_srcpos(uc_function_t *, size_t);
__hidden void uc_program_function_free(uc_function_t *);
__hidden uc_value_t *uc_program_get_constant(uc_program_t *, size_t);
diff --git a/include/ucode/source.h b/include/ucode/source.h
index e1fd211..92011d8 100644
--- a/include/ucode/source.h
+++ b/include/ucode/source.h
@@ -35,7 +35,7 @@ typedef enum {
uc_source_t *uc_source_new_file(const char *path);
uc_source_t *uc_source_new_buffer(const char *name, char *buf, size_t len);
-__hidden size_t uc_source_get_line(uc_source_t *source, size_t *offset);
+size_t uc_source_get_line(uc_source_t *source, size_t *offset);
static inline uc_source_t *
uc_source_get(uc_source_t *source) {