3

I want to debug the c++ source code of tensorflow, e.g tensorflow/c/c_api.cc . I've found some answers about how to debug the c++ code with gdb,but I want to know if it's possible to debug it with ide like Xcode, which can be very comfortable for editing and debug.Thanks .

1 Answer 1

5

After much search and dig, I finally succeed to debug the tensorflow c++ source code in an acceptable way.I used bazel+vscode+lldb on mac.

bazel: build the target(Also can be done by vscode).
visual studio code: debug and read code
lldb : debug backend

my vscode lanch.json is :

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(lldb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceRoot}/bazel-out/darwin_x86_64-dbg/bin/tensorflow/cc/example/example",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceRoot}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "lldb"
        }
    ]
}

vscode debug tf

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.