2

I am trying to debug TensorFlow using GDB on macOS Sierra. I followed the instructions on the post.After I installed developer version of tensorflow for debug I tried to use gdb to attach a python session.

When I run gdb -p <pid>:

GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-apple-darwin16.0.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 18822
Reading symbols from /Users/dtong/.virtualenvs/tensorflow/bin/python3.5...(no debugging symbols found)...done.

warning: unhandled dyld version (15)
0x00007fffc4d83f4e in ?? ()
(gdb)

When I set the breakpoint:

(gdb) break TF_NewSession
Function "TF_NewSession" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (TF_NewSession) pending.

Then even I run sess = tf.Session() as the post says. GDB will never enter into breakpoint.

1 Answer 1

1

Well, after I change to use lldb on macOS, everything works fine. So I guess the solution to this problem is "USING LLDB INSTEAD OF GDB".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.