diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbb6607..55f5bf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: - name: Build run: | - sudo make install + make all && sudo make install - name: Install Busted run: luarocks --local install busted diff --git a/.gitignore b/.gitignore index 4e2aede..49627b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.o *.a *.so -/pt-run + +pt-run diff --git a/Makefile b/Makefile index ba5ed33..2bc4cf3 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,79 @@ # Copyright (c) 2024, The Pallene Developers # Pallene Tracer is licensed under the MIT license. # Please refer to the LICENSE and AUTHORS files for details -# SPDX-License-Identifier: MIT +# SPDX-License-Identifier: MIT -CC := gcc -CFLAGS := -DPT_DEBUG -O2 -std=c99 -pedantic -Wall -Wextra +# Where to install our things +PREFIX = /usr/local +BINDIR = $(PREFIX)/bin +INCDIR = $(PREFIX)/include -LUA_DIR := /usr +# Where to find Lua libraries +LUA_PREFIX = /usr/local +LUA_BINDIR = $(LUA_PREFIX)/bin +LUA_INCDIR = $(LUA_PREFIX)/include +LUA_LIBDIR = $(LUA_PREFIX)/lib -INSTALL_DIR := /usr/local -INSTALL_INCDIR := $(INSTALL_DIR)/include -INSTALL_LIBDIR := $(INSTALL_DIR)/lib -INSTALL_BINDIR := $(INSTALL_DIR)/bin +# How to install files +INSTALL= install -p +INSTALL_EXEC= $(INSTALL) -m 0755 +INSTALL_DATA= $(INSTALL) -m 0644 -.PHONY: install ptracer_header pt-run libptracer uninstall clean +# C compilation flags +CFLAGS = -DPT_DEBUG -O2 -std=c99 -pedantic -Wall -Wextra -Wformat-security +CPPFLAGS = -I$(LUA_INCDIR) -I. +LIBFLAG = -fPIC -shared -install: ptracer_header pt-run - cp pt-run $(INSTALL_BINDIR) +# The -Wl,-E tells the linker to not throw away unused Lua API symbols. +# We need them for Lua modules that are dynamically linked via require +PTRUN_LDFLAGS = -L$(LUA_LIBDIR) -Wl,-E +PTRUN_LDLIBS = -llua -lm -# We need the `ptracer.h` header to be installed first. -ptracer_header: - cp lib/ptracer.h $(INSTALL_INCDIR) +# =================== +# Compilation targets +# =================== -pt-run: - $(CC) $(CFLAGS) src/pt-run/main.c -o pt-run -llua -lm -Wl,-E -L$(LUA_DIR)/lib +.PHONY: library examples tests all install uninstall clean -uninstall: - rm -rf $(INSTALL_INCDIR)/ptracer.h - rm -rf $(INSTALL_BINDIR)/pt-run +library: \ + pt-run -clean: - rm -rf examples/*/*.so - rm -rf spec/tracebacks/*/*.so - rm -rf *.so - rm -rf pt-run +examples: library \ + examples/fibonacci/fibonacci.so +tests: library \ + spec/tracebacks/anon_lua/module.so \ + spec/tracebacks/depth_recursion/module.so \ + spec/tracebacks/dispatch/module.so \ + spec/tracebacks/ellipsis/module.so \ + spec/tracebacks/multimod/module_a.so \ + spec/tracebacks/multimod/module_b.so \ + spec/tracebacks/singular/module.so + +all: library examples tests + +install: + $(INSTALL_EXEC) pt-run $(BINDIR) + $(INSTALL_DATA) ptracer.h $(INCDIR) + +uninstall: + rm -rf $(INCDIR)/ptracer.h + rm -rf $(BINDIR)/pt-run + +clean: + rm -rf pt-run examples/*/*.so spec/tracebacks/*/*.so + +%.so: %.c + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LIBFLAG) $< -o $@ + +pt-run: pt-run.c ptracer.h + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(PTRUN_LDFLAGS) $< -o $@ $(PTRUN_LDLIBS) + +examples/fibonacci/fibonacci.so: examples/fibonacci/fibonacci.c ptracer.h +spec/tracebacks/anon_lua/module.so: spec/tracebacks/anon_lua/module.c ptracer.h +spec/tracebacks/depth_recursion/module.so: spec/tracebacks/depth_recursion/module.c ptracer.h +spec/tracebacks/dispatch/module.so: spec/tracebacks/dispatch/module.c ptracer.h +spec/tracebacks/ellipsis/module.so: spec/tracebacks/ellipsis/module.c ptracer.h +spec/tracebacks/multimod/module_a.so: spec/tracebacks/multimod/module_a.c ptracer.h +spec/tracebacks/multimod/module_b.so: spec/tracebacks/multimod/module_b.c ptracer.h +spec/tracebacks/singular/module.so: spec/tracebacks/singular/module.c ptracer.h diff --git a/examples/fibonacci/Makefile b/examples/fibonacci/Makefile deleted file mode 100644 index 948af4d..0000000 --- a/examples/fibonacci/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2024, The Pallene Developers -# Pallene Tracer is licensed under the MIT license. -# Please refer to the LICENSE and AUTHORS files for details -# SPDX-License-Identifier: MIT - -CC := gcc - -.PHONY : all debug clean -.SILENT: - -all: - $(CC) -std=c99 -pedantic -Wall -Wextra -fPIC -O2 -shared fibonacci.c -o fibonacci.so - -debug: - $(CC) -std=c99 -pedantic -Wall -Wextra -fPIC -O2 -DPT_DEBUG -shared fibonacci.c -o fibonacci.so - -clean: - rm -rf fibonacci.so diff --git a/examples/fibonacci/fibonacci.c b/examples/fibonacci/fibonacci.c index b31e406..8baf167 100644 --- a/examples/fibonacci/fibonacci.c +++ b/examples/fibonacci/fibonacci.c @@ -1,12 +1,12 @@ -/* +/* * Copyright (c) 2024, The Pallene Developers * Pallene Tracer is licensed under the MIT license. * Please refer to the LICENSE and AUTHORS files for details - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: MIT */ #define PT_IMPLEMENTATION -#include +#include "ptracer.h" /* User specific macros when Pallene Tracer debug mode is enabled. */ #ifdef PT_DEBUG diff --git a/src/pt-run/main.c b/pt-run.c similarity index 97% rename from src/pt-run/main.c rename to pt-run.c index 824ad37..2cbb1ff 100644 --- a/src/pt-run/main.c +++ b/pt-run.c @@ -2,7 +2,7 @@ * Copyright (c) 2024, The Pallene Developers * Pallene Tracer is licensed under the MIT license. * Please refer to the LICENSE and AUTHORS files for details - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: MIT */ #include @@ -13,7 +13,7 @@ #include #define PT_IMPLEMENTATION -#include +#include "ptracer.h" /* Traceback ellipsis top threshold. How many frames should we print first to trigger ellipsis? */ @@ -23,7 +23,7 @@ /* This should always be 2 fewer than top threshold, for symmetry. Becuase we will always have 2 tail frames lingering around at - at the end which is not captured by '_countlevels'. Lua also + at the end which is not captured by '_countlevels'. Lua also do it like this. */ #ifndef PT_RUN_TRACEBACK_BOTTOM_THRESHOLD #define PT_RUN_TRACEBACK_BOTTOM_THRESHOLD 8 @@ -38,7 +38,7 @@ static void pt_run_help() { printf("Pallene Tracer runner for call-stack backtrace\n\n"); printf("Arguments:\n" " lua_script Lua file to debug\n" - " args ... Arguments passed to Lua script\n\n"); + " args ... Arguments passed to Lua script\n\n"); printf("Options:\n" " -h, --help Show this help message and exit\n"); } @@ -149,7 +149,7 @@ static void pt_run_dbg_print(const char *buf, bool *ellipsis, int *pframes, int || ((nframes - *pframes) <= PT_RUN_TRACEBACK_BOTTOM_THRESHOLD); if(luai_likely(should_print)) - fprintf(stderr, buf); + fprintf(stderr, "%s", buf); else if(*ellipsis) { fprintf(stderr, "\n ... (Skipped %d frames) ...\n\n", nframes - (PT_RUN_TRACEBACK_TOP_THRESHOLD @@ -279,7 +279,7 @@ int main(int argc, char **argv) { if(!strncmp(argv[1], "-", 1)) { char *match = argv[1] + 1; - if(!strcmp(match, "h") || !strcmp(match, "-help")) + if(!strcmp(match, "h") || !strcmp(match, "-help")) pt_run_help(); else { pt_run_usage(stderr); @@ -314,17 +314,17 @@ int main(int argc, char **argv) { } /* Push arguments to Lua stack. */ - for(int i = 2; i < argc; i++) + for(int i = 2; i < argc; i++) lua_pushstring(L, argv[i]); /* Moment of truth. */ status = lua_pcall(L, argc - 2, LUA_MULTRET, traceback_fn); - if(status != LUA_OK) + if(status != LUA_OK) res = EXIT_FAILURE; -finalize: +finalize: /* Cleanup. */ lua_close(L); -out: +out: return res; } diff --git a/lib/ptracer.h b/ptracer.h similarity index 95% rename from lib/ptracer.h rename to ptracer.h index fc98009..1373f7b 100644 --- a/lib/ptracer.h +++ b/ptracer.h @@ -1,8 +1,8 @@ -/* +/* * Copyright (c) 2024, The Pallene Developers * Pallene Tracer is licensed under the MIT license. * Please refer to the LICENSE and AUTHORS files for details - * SPDX-License-Identifier: MIT + * SPDX-License-Identifier: MIT */ #ifndef PALLENE_TRACER_H @@ -50,16 +50,16 @@ #define PALLENE_TRACER_SETLINE(fnstack, line) pallene_tracer_setline(fnstack, line) #define PALLENE_TRACER_FRAMEEXIT(fnstack) pallene_tracer_frameexit(fnstack) -#else -#define PALLENE_TRACER_FRAMEENTER(fnstack, frame) -#define PALLENE_TRACER_SETLINE(fnstack, line) -#define PALLENE_TRACER_FRAMEEXIT(fnstack) +#else +#define PALLENE_TRACER_FRAMEENTER(fnstack, frame) +#define PALLENE_TRACER_SETLINE(fnstack, line) +#define PALLENE_TRACER_FRAMEEXIT(fnstack) #endif // PT_DEBUG /* Not part of the API. */ #ifdef PT_DEBUG -#define _PALLENE_TRACER_PREPARE_C_FRAME(fn_name, filename, var_name) \ -pt_fn_details_t var_name##_details = \ +#define _PALLENE_TRACER_PREPARE_C_FRAME(fn_name, filename, var_name) \ +pt_fn_details_t var_name##_details = \ PALLENE_TRACER_FN_DETAILS(fn_name, filename); \ pt_frame_t var_name = PALLENE_TRACER_C_FRAME(var_name##_details) @@ -70,21 +70,21 @@ pt_frame_t var_name = PALLENE_TRACER_LUA_FRAME(fnptr) lua_toclose(L, -1) #else -#define _PALLENE_TRACER_PREPARE_LUA_FRAME(fnptr, var_name) -#define _PALLENE_TRACER_PREPARE_C_FRAME(fn_name, filename, var_name) -#define _PALLENE_TRACER_FINALIZER(L, location) +#define _PALLENE_TRACER_PREPARE_LUA_FRAME(fnptr, var_name) +#define _PALLENE_TRACER_PREPARE_C_FRAME(fn_name, filename, var_name) +#define _PALLENE_TRACER_FINALIZER(L, location) #endif // PT_DEBUG /* ---- DATA-STRUCTURE HELPER MACROS ---- */ /* Use this macro to fill in the details structure. */ -/* E.U.: +/* E.U.: pt_fn_details_t det = PALLENE_TRACER_FN_DETAILS("fn_name", "some_mod.c"); */ #define PALLENE_TRACER_FN_DETAILS(name, fname) \ { .fn_name = name, .filename = fname } -/* Use this macro to fill in the frame structure as a +/* Use this macro to fill in the frame structure as a Lua interface frame. */ /* E.U.: `pt_frame_t frame = PALLENE_TRACER_LUA_FRAME(lua_fn);` */ #define PALLENE_TRACER_LUA_FRAME(fnptr) \ @@ -103,9 +103,9 @@ pt_frame_t var_name = PALLENE_TRACER_LUA_FRAME(fnptr) /* ---- API HELPER MACROS ---- */ /* Use this macro the bypass some frameenter boilerplates for Lua interface frames. */ -/* Note: `location` is where the finalizer object is in the stack, acquired from +/* Note: `location` is where the finalizer object is in the stack, acquired from `pallene_tracer_init()` function. If the object is passed to Lua C functions as an - upvalue, this should be `lua_upvalueindex(n)`. Otherwise, it should just be a number + upvalue, this should be `lua_upvalueindex(n)`. Otherwise, it should just be a number denoting the parameter index where the object is found if passed as a plain parameter to the functon. */ /* The `var_name` indicates the name of the `pt_frame_t` structure variable. */ @@ -185,7 +185,7 @@ PT_API pt_fnstack_t *pallene_tracer_init(lua_State *L); /* Pushes a frame to the stack. The frame structure is self-managed for every function. */ static inline void pallene_tracer_frameenter(pt_fnstack_t *fnstack, pt_frame_t *restrict frame) { /* Have we ran out of stack entries? If we do, stop pushing frames. */ - if(luai_likely(fnstack->count < PALLENE_TRACER_MAX_CALLSTACK)) + if(luai_likely(fnstack->count < PALLENE_TRACER_MAX_CALLSTACK)) fnstack->stack[fnstack->count] = *frame; fnstack->count++; diff --git a/run-tests b/run-tests index 2427a93..5e9f89c 100755 --- a/run-tests +++ b/run-tests @@ -6,5 +6,4 @@ # ./run-tests # ./run-tests -k # ./run-tests spec/traceback_spec.lua - -busted --verbose --no-keep-going "$@" +make tests && busted --verbose --no-keep-going "$@" diff --git a/spec/tracebacks/anon_lua/Makefile b/spec/tracebacks/anon_lua/Makefile deleted file mode 100644 index 15fb481..0000000 --- a/spec/tracebacks/anon_lua/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2024, The Pallene Developers -# Pallene Tracer is licensed under the MIT license. -# Please refer to the LICENSE and AUTHORS files for details -# SPDX-License-Identifier: MIT - -CC := gcc - -.PHONY : all -.SILENT: - -all: - $(CC) -std=c99 -pedantic -Wall -Wextra -fPIC -DPT_DEBUG -shared module.c -o module.so diff --git a/spec/tracebacks/anon_lua/module.c b/spec/tracebacks/anon_lua/module.c index 6f952f9..75d0a37 100644 --- a/spec/tracebacks/anon_lua/module.c +++ b/spec/tracebacks/anon_lua/module.c @@ -7,7 +7,7 @@ /* Static use of the library would suffice. */ #define PT_IMPLEMENTATION -#include +#include "ptracer.h" /* Here goes user specifc macros when Pallene Tracer debug mode is active. */ #ifdef PT_DEBUG diff --git a/spec/tracebacks/depth_recursion/Makefile b/spec/tracebacks/depth_recursion/Makefile deleted file mode 100644 index 15fb481..0000000 --- a/spec/tracebacks/depth_recursion/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2024, The Pallene Developers -# Pallene Tracer is licensed under the MIT license. -# Please refer to the LICENSE and AUTHORS files for details -# SPDX-License-Identifier: MIT - -CC := gcc - -.PHONY : all -.SILENT: - -all: - $(CC) -std=c99 -pedantic -Wall -Wextra -fPIC -DPT_DEBUG -shared module.c -o module.so diff --git a/spec/tracebacks/depth_recursion/module.c b/spec/tracebacks/depth_recursion/module.c index dcb3da0..73901cb 100644 --- a/spec/tracebacks/depth_recursion/module.c +++ b/spec/tracebacks/depth_recursion/module.c @@ -7,7 +7,7 @@ /* Static use of the library would suffice. */ #define PT_IMPLEMENTATION -#include +#include "ptracer.h" /* Here goes user specific macros when Pallene Tracer debug mode is active. */ #ifdef PT_DEBUG diff --git a/spec/tracebacks/dispatch/Makefile b/spec/tracebacks/dispatch/Makefile deleted file mode 100644 index fb0fceb..0000000 --- a/spec/tracebacks/dispatch/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2024, The Pallene Developers -# Pallene Tracer is licensed under the MIT license. -# Please refer to the LICENSE and AUTHORS files for details -# SPDX-License-Identifier: MIT - -CC := gcc - -.PHONY : all -.SILENT: - -all: - $(CC) -std=c99 -pedantic -Wextra -Wall -fPIC -DPT_DEBUG -shared module.c -o module.so diff --git a/spec/tracebacks/dispatch/module.c b/spec/tracebacks/dispatch/module.c index 368c649..c14317b 100644 --- a/spec/tracebacks/dispatch/module.c +++ b/spec/tracebacks/dispatch/module.c @@ -7,7 +7,7 @@ /* Static use of the library would suffice. */ #define PT_IMPLEMENTATION -#include +#include "ptracer.h" /* Here goes user specific macros when Pallene Tracer debug mode is active. */ #ifdef PT_DEBUG diff --git a/spec/tracebacks/ellipsis/Makefile b/spec/tracebacks/ellipsis/Makefile deleted file mode 100644 index 15fb481..0000000 --- a/spec/tracebacks/ellipsis/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2024, The Pallene Developers -# Pallene Tracer is licensed under the MIT license. -# Please refer to the LICENSE and AUTHORS files for details -# SPDX-License-Identifier: MIT - -CC := gcc - -.PHONY : all -.SILENT: - -all: - $(CC) -std=c99 -pedantic -Wall -Wextra -fPIC -DPT_DEBUG -shared module.c -o module.so diff --git a/spec/tracebacks/ellipsis/module.c b/spec/tracebacks/ellipsis/module.c index 2b9ab6c..6dcbcf5 100644 --- a/spec/tracebacks/ellipsis/module.c +++ b/spec/tracebacks/ellipsis/module.c @@ -7,7 +7,7 @@ /* Static use of the library would suffice. */ #define PT_IMPLEMENTATION -#include +#include "ptracer.h" /* Here goes user specific macros when Pallene Tracer debug mode is active. */ #ifdef PT_DEBUG diff --git a/spec/tracebacks/multimod/Makefile b/spec/tracebacks/multimod/Makefile deleted file mode 100644 index 5669961..0000000 --- a/spec/tracebacks/multimod/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2024, The Pallene Developers -# Pallene Tracer is licensed under the MIT license. -# Please refer to the LICENSE and AUTHORS files for details -# SPDX-License-Identifier: MIT - -CC := gcc -LIB_DIR := /usr/local/lib - -.PHONY : all -.SILENT: - -all: - $(CC) -std=c99 -pedantic -Wall -Wextra -fPIC -DPT_DEBUG -shared module_a.c -o module_a.so - $(CC) -std=c99 -pedantic -Wall -Wextra -fPIC -DPT_DEBUG -shared module_b.c -o module_b.so diff --git a/spec/tracebacks/multimod/module_a.c b/spec/tracebacks/multimod/module_a.c index cfa910e..7b09776 100644 --- a/spec/tracebacks/multimod/module_a.c +++ b/spec/tracebacks/multimod/module_a.c @@ -6,7 +6,7 @@ */ #define PT_IMPLEMENTATION -#include +#include "ptracer.h" #include "module_include.h" diff --git a/spec/tracebacks/multimod/module_b.c b/spec/tracebacks/multimod/module_b.c index 2e63519..cdbd15f 100644 --- a/spec/tracebacks/multimod/module_b.c +++ b/spec/tracebacks/multimod/module_b.c @@ -6,7 +6,7 @@ */ #define PT_IMPLEMENTATION -#include +#include "ptracer.h" #include "module_include.h" diff --git a/spec/tracebacks/singular/Makefile b/spec/tracebacks/singular/Makefile deleted file mode 100644 index 15fb481..0000000 --- a/spec/tracebacks/singular/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2024, The Pallene Developers -# Pallene Tracer is licensed under the MIT license. -# Please refer to the LICENSE and AUTHORS files for details -# SPDX-License-Identifier: MIT - -CC := gcc - -.PHONY : all -.SILENT: - -all: - $(CC) -std=c99 -pedantic -Wall -Wextra -fPIC -DPT_DEBUG -shared module.c -o module.so diff --git a/spec/tracebacks/singular/module.c b/spec/tracebacks/singular/module.c index 46f5d04..164e374 100644 --- a/spec/tracebacks/singular/module.c +++ b/spec/tracebacks/singular/module.c @@ -7,7 +7,7 @@ /* Static use of the library would suffice. */ #define PT_IMPLEMENTATION -#include +#include "ptracer.h" /* Here goes user specific macros when Pallene Tracer debug mode is active. */ #ifdef PT_DEBUG diff --git a/spec/tracebacks_spec.lua b/spec/tracebacks_spec.lua index 8ad5ced..55b942f 100644 --- a/spec/tracebacks_spec.lua +++ b/spec/tracebacks_spec.lua @@ -6,12 +6,12 @@ local util = require "spec.util" local function assert_test(example, expected_content) - local cdir = util.shell_quote("spec/tracebacks/"..example) - local ok, err = util.execute(string.format("cd %s && make", cdir)) - assert(ok, err) + assert(util.execute("make --quiet tests")) + local cdir = util.shell_quote("spec/tracebacks/"..example) + local ptrun = util.shell_quote("../../../pt-run") local ok, _, output_content, err_content = - util.outputs_of_execute(string.format("cd %s && pt-run main.lua", cdir)) + util.outputs_of_execute(string.format("cd %s && %s main.lua", cdir, ptrun)) assert(not ok, output_content) assert.are.same(expected_content, err_content) end @@ -20,10 +20,10 @@ it("Dispatch", function() assert_test("dispatch", [[ Runtime error: main.lua:9: Error from a C function, which has no trace in Lua callstack! Stack traceback: - module.c:48: in function 'some_oblivious_c_function' - module.c:92: in function 'module_fn_2' + spec/tracebacks/dispatch/module.c:48: in function 'some_oblivious_c_function' + spec/tracebacks/dispatch/module.c:92: in function 'module_fn_2' main.lua:9: in function 'lua_callee_1' - module.c:61: in function 'module_fn_1' + spec/tracebacks/dispatch/module.c:61: in function 'module_fn_1' main.lua:12: in
]]) end) @@ -32,8 +32,8 @@ it("Singular", function() assert_test("singular", [[ Runtime error: main.lua:9: Life's !good Stack traceback: - module.c:49: in function 'lifes_good_fn' - module.c:59: in function 'singular_fn' + spec/tracebacks/singular/module.c:49: in function 'lifes_good_fn' + spec/tracebacks/singular/module.c:59: in function 'singular_fn' main.lua:9: in function 'some_lua_fn' main.lua:12: in
]]) @@ -44,9 +44,9 @@ it("Multi-module", function() assert_test("multimod", [[ Runtime error: main.lua:10: Error from another module! Stack traceback: - module_b.c:19: in function 'another_mod_fn' + spec/tracebacks/multimod/module_b.c:19: in function 'another_mod_fn' main.lua:10: in function 'some_lua_fn' - module_a.c:20: in function 'some_mod_fn' + spec/tracebacks/multimod/module_a.c:20: in function 'some_mod_fn' main.lua:13: in
]]) end) @@ -57,15 +57,15 @@ Runtime error: main.lua:10: Depth reached 0! Stack traceback: C: in function 'error' main.lua:10: in function 'lua_fn' - module.c:56: in function 'module_fn' + spec/tracebacks/depth_recursion/module.c:56: in function 'module_fn' main.lua:13: in function 'lua_fn' - module.c:56: in function 'module_fn' + spec/tracebacks/depth_recursion/module.c:56: in function 'module_fn' main.lua:13: in function 'lua_fn' - module.c:56: in function 'module_fn' + spec/tracebacks/depth_recursion/module.c:56: in function 'module_fn' main.lua:13: in function 'lua_fn' - module.c:56: in function 'module_fn' + spec/tracebacks/depth_recursion/module.c:56: in function 'module_fn' main.lua:13: in function 'lua_fn' - module.c:56: in function 'module_fn' + spec/tracebacks/depth_recursion/module.c:56: in function 'module_fn' main.lua:13: in function 'lua_fn' main.lua:16: in
]]) @@ -75,10 +75,10 @@ it("Anonymous Lua Fn", function() assert_test("anon_lua", [[ Runtime error: main.lua:9: Error from a C function, which has no trace in Lua callstack! Stack traceback: - module.c:48: in function 'some_oblivious_c_function' - module.c:92: in function 'module_fn_2' + spec/tracebacks/anon_lua/module.c:48: in function 'some_oblivious_c_function' + spec/tracebacks/anon_lua/module.c:92: in function 'module_fn_2' main.lua:9: in function '' - module.c:61: in function 'module_fn_1' + spec/tracebacks/anon_lua/module.c:61: in function 'module_fn_1' main.lua:12: in
]]) end) @@ -87,27 +87,27 @@ it("Traceback Ellipsis", function() assert_test("ellipsis", [[ Runtime error: C stack overflow Stack traceback: - module.c:52: in function 'module_fn' + spec/tracebacks/ellipsis/module.c:52: in function 'module_fn' main.lua:9: in function 'lua_fn' - module.c:52: in function 'module_fn' + spec/tracebacks/ellipsis/module.c:52: in function 'module_fn' main.lua:9: in function 'lua_fn' - module.c:52: in function 'module_fn' + spec/tracebacks/ellipsis/module.c:52: in function 'module_fn' main.lua:9: in function 'lua_fn' - module.c:52: in function 'module_fn' + spec/tracebacks/ellipsis/module.c:52: in function 'module_fn' main.lua:9: in function 'lua_fn' - module.c:52: in function 'module_fn' + spec/tracebacks/ellipsis/module.c:52: in function 'module_fn' main.lua:9: in function 'lua_fn' ... (Skipped 380 frames) ... main.lua:9: in function 'lua_fn' - module.c:52: in function 'module_fn' + spec/tracebacks/ellipsis/module.c:52: in function 'module_fn' main.lua:9: in function 'lua_fn' - module.c:52: in function 'module_fn' + spec/tracebacks/ellipsis/module.c:52: in function 'module_fn' main.lua:9: in function 'lua_fn' - module.c:52: in function 'module_fn' + spec/tracebacks/ellipsis/module.c:52: in function 'module_fn' main.lua:9: in function 'lua_fn' - module.c:52: in function 'module_fn' + spec/tracebacks/ellipsis/module.c:52: in function 'module_fn' main.lua:9: in function 'lua_fn' main.lua:12: in
]])