I've done some research of libcudadebugger.so internals - seems that it has exactly the same patterns:
- functions table returned by GetCUDADebuggerAPI located in .data section so you can patch any callback address
- and each API function has logger
This last fact is strange - while loggers from libcuda.so were used by debugger then who consume logs from debugger itself? Check code to load those loggers:
lea rdi, aNvtxInjection6 ; "NVTX_INJECTION64_PATH"
call _getenv
mov rdi, rax ; file
test rax, rax
jz short loc_14B160
mov esi, 1 ; mode
call _dlopen
mov r13, rax
test rax, rax
jz short loc_14B190
lea rsi, aInitializeinje_1 ; "InitializeInjectionNvtx2"
mov rdi, rax ; handle
call _dlsym
test rax, rax
jz short loc_14B1A0
lea rdi, sub_14A270
call rax
lea rax, aFailedCreatede+7 ; "CreateDebuggerSession"
mov [rbp+var_18], rax
mov rax, cs:dbg_log
mov [rbp+var_20], 0
mov dword ptr [rbp+var_40], 300003h
mov dword ptr [rbp+var_20], 1
movaps [rbp+var_30], xmm0
test rax, rax
jz loc_1470AC
lea rdx, [rbp+var_40]
mov r12, rdx
mov rdi, rdx
call rax