diff options
| -rw-r--r-- | include/utils.h | 2 | ||||
| -rw-r--r-- | src/events.c | 2 | ||||
| -rw-r--r-- | src/pdb.c | 8 | ||||
| -rw-r--r-- | src/stack_walk.c | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/include/utils.h b/include/utils.h index 30a5612..69197d9 100644 --- a/include/utils.h +++ b/include/utils.h @@ -15,6 +15,8 @@ #define INFINITE 0xFFFFFFFF // Infinite timeout #define SUCCEEDED(hr) (((i32)(hr)) >= 0) +#define UNUSED_VAR(x) (void)x +#define UNUSED_PARAM(x) (void)x extern void print(const char* format, ...); diff --git a/src/events.c b/src/events.c index 85e68c2..ae78851 100644 --- a/src/events.c +++ b/src/events.c @@ -616,7 +616,7 @@ void handle_create_process(void) { CREATE_PROCESS_DEBUG_INFO proc_dbg_info = dbg_event.u.CreateProcessInfo; void* hproc = OpenProcess(PROCESS_VM_READ, FALSE, dbg_event.dwProcessId); - (void)hproc; + UNUSED_VAR(hproc); struct module* module = &modules[add_module()]; // https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-create_process_debug_info @@ -365,7 +365,7 @@ void open_pdb(const i8* pdb_path, struct module* module) { print("END SYMBOL\n"); } else if (rec->rectyp == S_FRAMEPROC) { struct FRAMEPROCSYM* frameproc = (struct FRAMEPROCSYM*)cur_sym; - (void)frameproc; // Not used yet + UNUSED_VAR(frameproc); // Not used yet print("FRAMEPROC SYMBOL\n"); } else if (rec->rectyp == S_OBJNAME) { struct OBJNAMESYM* objname = (struct OBJNAMESYM*)cur_sym; @@ -401,7 +401,7 @@ void open_pdb(const i8* pdb_path, struct module* module) { print("REGREL32 SYMBOL %s\n", regrel->name); } else if (rec->rectyp == S_COMPILE2) { struct COMPILESYM* compile = (struct COMPILESYM*)cur_sym; - (void)compile; // Not used yet + UNUSED_VAR(compile); // Not used yet print("COMPILE2 SYMBOL\n"); } else if (rec->rectyp == S_SECTION) { struct SECTIONSYM* section = (struct SECTIONSYM*)cur_sym; @@ -411,14 +411,14 @@ void open_pdb(const i8* pdb_path, struct module* module) { print("COFFGROUP SYMBOL %s\n", coff->name); } else if (rec->rectyp == S_CALLSITEINFO) { struct CALLSITEINFO* callsiteinfo = (struct CALLSITEINFO*)cur_sym; - (void)callsiteinfo; // Not used yet + UNUSED_VAR(callsiteinfo); // Not used yet print("CALLSITEINFO SYMBOL\n"); } else if (rec->rectyp == S_COMPILE3) { struct COMPILESYM3* compile = (struct COMPILESYM3*)cur_sym; print("COMPILE3 SYMBOL %s\n", compile->verSz); } else if (rec->rectyp == S_BUILDINFO) { struct BUILDINFOSYM* buildinfo = (struct BUILDINFOSYM*)cur_sym; - (void)buildinfo; // Not used yet + UNUSED_VAR(buildinfo); // Not used yet print("BUILDINFO SYMBOL\n"); } else { print("Unknown symbol kind %x\n", rec->rectyp); diff --git a/src/stack_walk.c b/src/stack_walk.c index 1cd97e4..a161f6f 100644 --- a/src/stack_walk.c +++ b/src/stack_walk.c @@ -223,7 +223,7 @@ void walk_stack(void* ctx) { u64 addr = ((CONTEXT*)ctx)->Rip; u64 rsp = ((CONTEXT*)ctx)->Rsp; u64 rbp = ((CONTEXT*)ctx)->Rbp; - (void)rbp; // Not used + UNUSED_VAR(rbp); // Not used struct module* module = NULL; struct UNWIND_INFO* u_info = VirtualAlloc(NULL, 4096U, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); while (addr) { |
