diff --git a/src/torture/dbg_tests/step_into_lazy_module_func.c b/src/torture/dbg_tests/step_into_lazy_module_func.c new file mode 100644 index 00000000..07a6b089 --- /dev/null +++ b/src/torture/dbg_tests/step_into_lazy_module_func.c @@ -0,0 +1,40 @@ +// TODO: step into alg needs to detect that it is about to step into a thunk and place breakpoint, respective to OS, +// where thunk calls into resolved function +// +// test: { +// windows: { +// compile: "/Od /Z7 /c main.c module.c" +// link: "/fixed /debug:full /dll module.obj" +// link: "/fixed /debug:full /entry:main kernel32.lib module.lib delayimp.lib main.obj /out:main.exe /delayload:module.dll /incremental:no" +// launch: "main.exe" +// } +// linux: { +// compile: "-O0 -g module.c -fPIC -shared -o libmodule.so" +// compile: "-O0 -g main.c -L. -lmodule -o main -Wl,-rpath,%CWD%" +// launch: "./main" +// } +// } +// + +/// file: "module.c" + +#if _WIN32 +__declspec(dllexport) +#endif +int foo(int a) +{ /// 6: { at, run } + return a + 1; +} + +/// file: "main.c" + +#if _WIN32 +__declspec(dllimport) +#endif +int foo(); + +int main() +{ /// 1: { step_into, at, step_over } + foo(123); /// 2: { at, step_into } +} + diff --git a/src/torture/dbg_tests/step_into_static_module_func.c b/src/torture/dbg_tests/step_into_static_module_func.c new file mode 100644 index 00000000..0c3f4937 --- /dev/null +++ b/src/torture/dbg_tests/step_into_static_module_func.c @@ -0,0 +1,37 @@ +/// test: { +/// windows: { +/// compile: "/Od /Z7 /c main.c module.c" +/// link: "/fixed /debug:full /dll module.obj" +/// link: "/fixed /debug:full module.lib main.obj /out:main.exe /incremental:no" +/// launch: "main.exe" +/// } +/// linux: { +/// compile: "-O0 -g module.c -fPIC -shared -o libmodule.so" +/// compile: "-O0 -g main.c -L. -lmodule -o main -Wl,-rpath,%CWD%,-z,now -fno-plt" +/// launch: "./main" +/// } +/// } +/// + +/// file: "module.c" + +#if _WIN32 +__declspec(dllexport) +#endif +int foo(int a) +{ /// 3: at + return a + 1; +} + +/// file: "main.c" + +#if _WIN32 +__declspec(dllimport) +#endif +int foo(); + +int main() +{ /// 1: { step_into, at, step_over } + foo(123); /// 2: { at, step_into } +} + diff --git a/src/torture/torture_dbg.c b/src/torture/torture_dbg.c index b52c8880..6472810f 100644 --- a/src/torture/torture_dbg.c +++ b/src/torture/torture_dbg.c @@ -757,7 +757,7 @@ T_RunSig(dbg_script_runner) // debugger is ready -- now invoke script if (t_dbg_script_invoke(&script, T_Dbg_DefaultTimeout) == 0) { - t_errrof("ERROR: %S: failed to run to completion\n", user_data); + t_errorf("ERROR: %S: failed to run to completion\n", user_data); T_Ok(0); } @@ -782,7 +782,7 @@ t_dbg_register_script_tests(Arena *arena, String8 folder_path) Temp scratch = scratch_begin(&arena, 1); if ( ! folder_path_exists(folder_path)) { - t_errof("ERROR: this folder does not exists: %S\n", folder_path); + t_errorf("ERROR: this folder does not exists: %S\n", folder_path); return; }