I would like to use strace
to debug a strange behaviour I have with db2
. I have a SQL function myFoo()
implemented in C
that doesn't get called for some reason (some code access path not existing or not authorized see here). My Sql Function call a function Foo
in shared library in /usr/local/lib/libmyfoo
(so in db2 term /usr/local/lib/libmyfoo!Foo
).
If I use strace
directly with db2 and the query I have an error saying
A database connection does not exist
so i created a script call debug.sh
with the following. The idea is to have a shell with the db2 connection active and trace it.
db2 "connect to MYDB"
db2 "select * from table(myFoo())" # this calls /usr/local/lib/libmyfoo!Foo
db2 "disconnect MYDB"
It doesn't work cos I realized that strace works with binary so I have the error
Exec Format Error