I've tried hooking to other commands such as echo and it works well. But when it comes to hooking the x command, it fails. Here's the codes inside of my .gdbinit file.
set $pince_injection_failed = 1
set $pince_debugging_mode = 0
define hook-x
if $pince_injection_failed = 1
echo asdf
end
define hookpost-x
if $pince_debugging_mode = 0
echo zxcv
end
I'm aware that gdb doesn't accept aliases of a function for hooking. But x is already a full function isn't it? I couldn't find any aliases for it. I'm also doubting about it because a single character is too short for a command to be