step into tests

This commit is contained in:
Nikita Smith
2026-06-02 12:10:45 -07:00
committed by Ryan Fleury
parent 09afff7957
commit 79cb6c3c5e
3 changed files with 79 additions and 2 deletions
@@ -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 }
}
@@ -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 }
}
+2 -2
View File
@@ -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;
}