Hi,
What's the best approach to debug TensorFlow C++ source code?
I've compiled TensoFlow with "--config=dbg", but I'm having problems to reach the C++ code from python. This is the approach I'm following:
1) I've created the following test TensorFlow program named test_gdb.py
import tensorflow as tf
import os
input("pid: " + str(os.getpid()) +", press enter to continue")
a = tf.constant([[1,3]])
b = tf.constant([[3],[1]])
c = tf.matmul(a, b)
print(c)
2) I run the script in one terminal:
$ python test_gdb.py
pid: 54974, press enter to continue
3) In a second terminal, I connect gdb to the pid:
$ gdb -p 54974
GNU gdb (GDB) Red Hat Enterprise Linux 8.2-6.el8_0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 54974
[New LWP 55049]
[New LWP 55050]
[New LWP 55051]
...
[New LWP 55128]
[New LWP 55129]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Missing separate debuginfo for /linkhome/rech/genlir01/umx47tt/.local/lib/python3.8/site-packages/numpy/core/../../numpy.libs/libgfortran-2e0d59d6.so.5.0.0
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/5e/f8275331f3c7aea4d0b59f2fa7ae783457a91a.debug
Missing separate debuginfo for /linkhome/rech/genlir01/umx47tt/.local/lib/python3.8/site-packages/numpy/core/../../numpy.libs/libquadmath-2d0c479f.so.0.0.0
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/e9/e2b7af3158e70f8af44f54f17ca0d14d95ed2d.debug
Missing separate debuginfo for /linkhome/rech/genlir01/umx47tt/.local/lib/python3.8/site-packages/numpy/core/../../numpy.libs/libz-eb09ad1d.so.1.2.3
Try: dnf --enablerepo='*debug*' install /usr/lib/debug/.build-id/5f/a8e5038ec04a774af72a9bb62dc86e1049c4d6.debug
Killed
Is there a problem with my debugging method or with my system configuration? Is there a better method to debug TensorFlow C++ source code?