簡體   English   中英

無法在 macOS 上使用 gdb 調試 tensorflow

[英]Cannot debug tensorflow using gdb on macOS

我正在嘗試在 macOS Sierra 上使用 GDB 調試 TensorFlow。 我按照帖子上的說明進行操作。在我安裝了用於調試的 tensorflow 開發人員版本后,我嘗試使用 gdb 附加一個 python 會話。

當我運行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)

當我設置斷點時:

(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.

然后即使我像帖子所說的那樣運行sess = tf.Session() GDB 永遠不會進入斷點。

好吧,在我更改為在 macOS 上使用lldb后,一切正常。 所以我想這個問題的解決方案是“使用 LLDB 代替 GDB”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM