Browse Source

Adding duktape v1.5 with debugging hooks enabled.

Shaddock Heath 9 years ago
parent
commit
d45cc2ba8f

+ 1 - 1
Source/AtomicJS/Javascript/JSPlugin.cpp

@@ -362,8 +362,8 @@ namespace Atomic
         gJSVMExports.duk_log = duk_log;
         gJSVMExports.duk_log_va = duk_log_va;
         gJSVMExports.duk_push_context_dump = duk_push_context_dump;
-        gJSVMExports.duk_debugger_attach = duk_debugger_attach;
         gJSVMExports.duk_debugger_detach = duk_debugger_detach;
+        gJSVMExports.duk_debugger_attach_custom = duk_debugger_attach_custom;
         gJSVMExports.duk_debugger_cooperate = duk_debugger_cooperate;
 
     }

+ 7 - 9
Source/AtomicJS/Javascript/JSPluginExports.h

@@ -23,7 +23,6 @@
 #pragma once
 
 #include <Duktape/duktape.h>
-#include <Duktape/duk_logging.h>
 
 namespace Atomic
 {
@@ -52,8 +51,8 @@ namespace Atomic
         typedef void(*__duk_get_memory_functions)(duk_context *ctx, duk_memory_functions *out_funcs);
         typedef void(*__duk_gc)(duk_context *ctx, duk_uint_t flags);
 
-        typedef void(*__duk_throw_raw)(duk_context *ctx);
-        typedef void(*__duk_fatal_raw)(duk_context *ctx, const char *err_msg);
+        typedef void(*__duk_throw)(duk_context *ctx);
+        typedef void(*__duk_fatal)(duk_context *ctx, duk_errcode_t err_code, const char *err_msg);
         typedef void(*__duk_error_raw)(duk_context *ctx, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, ...);
         typedef void(*__duk_error_va_raw)(duk_context *ctx, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, va_list ap);
 
@@ -262,7 +261,7 @@ namespace Atomic
         typedef duk_int_t(*__duk_pcall_method)(duk_context *ctx, duk_idx_t nargs);
         typedef duk_int_t(*__duk_pcall_prop)(duk_context *ctx, duk_idx_t obj_index, duk_idx_t nargs);
         typedef void(*__duk_new)(duk_context *ctx, duk_idx_t nargs);
-        typedef duk_int_t(*__duk_safe_call)(duk_context *ctx, duk_safe_call_function func, void* data, duk_idx_t nargs, duk_idx_t nrets);
+        typedef duk_int_t(*__duk_safe_call)(duk_context *ctx, duk_safe_call_function func, duk_idx_t nargs, duk_idx_t nrets);
 
         typedef duk_int_t(*__duk_eval_raw)(duk_context *ctx, const char *src_buffer, duk_size_t src_length, duk_uint_t flags);
         typedef duk_int_t(*__duk_compile_raw)(duk_context *ctx, const char *src_buffer, duk_size_t src_length, duk_uint_t flags);
@@ -272,8 +271,7 @@ namespace Atomic
 
         typedef void(*__duk_push_context_dump)(duk_context *ctx);
 
-
-        typedef void(*__duk_debugger_attach)(duk_context *ctx,
+        typedef void(*__duk_debugger_attach_custom)(duk_context *ctx,
             duk_debug_read_function read_cb,
             duk_debug_write_function write_cb,
             duk_debug_peek_function peek_cb,
@@ -299,8 +297,8 @@ namespace Atomic
             __duk_get_memory_functions duk_get_memory_functions;
             __duk_gc duk_gc;
 
-            __duk_throw_raw duk_throw_raw;
-            __duk_fatal_raw duk_fatal_raw;
+            __duk_throw duk_throw;
+            __duk_fatal duk_fatal;
             __duk_error_raw duk_error_raw;
             __duk_error_va_raw duk_error_va_raw;
 
@@ -511,8 +509,8 @@ namespace Atomic
             __duk_log duk_log;
             __duk_log_va duk_log_va;
             __duk_push_context_dump duk_push_context_dump;
-            __duk_debugger_attach duk_debugger_attach;
             __duk_debugger_detach duk_debugger_detach;
+            __duk_debugger_attach_custom duk_debugger_attach_custom;
             __duk_debugger_cooperate duk_debugger_cooperate;
 
             JSVMImports()

+ 15 - 11
Source/ThirdParty/Duktape/README.TXT

@@ -1,14 +1,18 @@
-To create the duk_config.h file change into the directory ${DUKTAPE}/tools and run the
-following Python command (you can copy/paste it):
 
-python2 configure.py \
-    --output-directory=out \
-    --omit-removed-config-options --omit-deprecated-config-options --omit-unused-config-options \
-    --emit-config-sanity-check \
-    --option-file ../config/examples/performance_sensitive.yaml \
-    --option-file ../config/examples/timing_sensitive.yaml
+duk_config.h generated by replacing default in util/make_dist.py with:
 
-An 'extern "C"' block has to be added to the headers duk_logging.h and duk_module_duktape.h
-(from the directory ${DUKTAPE}/extras) to avoid C++ decoration of the function names.
-This is tracked in https://github.com/svaarala/duktape/issues/1405.
+# Build default duk_config.h from snippets using genconfig.
+exec_print_stdout([
+	'python', os.path.join('config', 'genconfig.py'), '--metadata', 'config',
+	'--output', os.path.join(dist, 'duk_config.h.tmp'),
+	'--git-commit', git_commit, '--git-describe', git_describe, '--git-branch', git_branch,
+	'--omit-removed-config-options', '--omit-unused-config-options',
+	'--emit-config-sanity-check',
+	'--support-feature-options',
+	'--option-file', dist + '/../config/examples/performance_sensitive.yaml',
+	'--option-file', dist + '/../config/examples/timing_sensitive.yaml',
+	'--option-file', dist + '/../config/examples/debugger_support.yaml',
+	'duk-config-header'
+])
 
+... and then: python util/make_dist.py

File diff suppressed because it is too large
+ 959 - 231
Source/ThirdParty/Duktape/duk_config.h


File diff suppressed because it is too large
+ 231 - 368
Source/ThirdParty/Duktape/duktape.c


File diff suppressed because it is too large
+ 293 - 393
Source/ThirdParty/Duktape/duktape.h


Some files were not shown because too many files changed in this diff