I'm trying to use gdb to debug Torch library binary file to . When I run from the command line : gdb --args th
I get the following error:
"/xxx/xxxx/torch/install/bin/th": not in executable format: File format not recognized
I checked if my current installation of gdb
is 64 bit i installed gdb64 and when i run
gdb64 --args th
I still get the same error, the output of :
file /xxx/xxxx/torch/install/bin/th
is :
/xxx/xxxx/torch/install/bin/th: POSIX shell script, ASCII text executable, with very long lines
I have learned that the problem is that the executable file is not a binary, but a script, so gdb is trying to debug the script instead.
My question is how to overcome this and let gdb debug the execution of the command itself. or even replace the Torch installation to be a binary execution instead of a script.
Try LLDB Debugger (
lldb
) instead which aims to replace GNU Debugger (gdb
).It's available by default on BSD/OS X, on Linux install via:
sudo apt-get install lldb
(or useyum
).For usage, check gdb to lldb command map page.
with some help from the comments i was able to run gdb over the torch script, through :