Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8543673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:21:44+00:00 2026-06-11T12:21:44+00:00

I want to debug Clang plugin. However, I can’t find informations about debugging of

  • 0

I want to debug Clang plugin.
However, I can’t find informations about debugging of Clang plugin.
If you know how to debug Clang plugin, Could you tell me that information?
thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:21:45+00:00Added an answer on June 11, 2026 at 12:21 pm

    Just a small outline as i’m trying this myself atm. I am using lldb.

    I am currently able to stop at any given function in the plugin but the source code is missing. It only shows the assembly.

    When you invoke clang with -Xclang -plugin (...) it will fork into a child process. When invoking your plugin pass also the -v option to see the child process command line. Then use this command line in the debugger.

    Original command line:

    $> clang++ -Xclang -load -Xclang ${PLUGIN} -Xclang -plugin -Xclang cgd -std=c++11 -w -fsyntax-only -v
    

    should output:

    clang version 3.1 (tags/RELEASE_31/final 163510)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
     "/srv/scratch/sigubufo/clang/stable/3.1_src/build/bin/clang-3.1" -cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -disable-free -main-file-name call_in_if.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -v -resource-dir /srv/scratch/sigubufo/clang/stable/3.1_src/build/bin/../lib/clang/3.1
    -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
    -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
    -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
    -internal-isystem /usr/local/include -internal-isystem /srv/scratch/sigubufo/clang/stable/3.1_src/build/bin/../lib/clang/3.1/include
    -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -w -std=c++11 -fdeprecated-macro
    -fdebug-compilation-dir /srv/scratch/sigubufo/danceos_wd/clang/qtcreator-build -ferror-limit
    19 -fmessage-length 205 -mstackrealign -fgnu-runtime
    -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -load lib/CallGraphDumper.so -plugin cgd -x c++ ../test_cases/call_in_if.cpp
    clang -cc1 version 3.1 based upon LLVM 3.1svn default target x86_64-unknown-linux-gnu
    ignoring nonexistent directory "/include"
    #include "..." search starts here:
    #include <...> search starts here:
     /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
     /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
     /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
     /usr/local/include
     /srv/scratch/sigubufo/clang/stable/3.1_src/build/bin/../lib/clang/3.1/include
     /usr/include/x86_64-linux-gnu
     /usr/include
    End of search list.
    

    This is the part you need:

    "/srv/scratch/sigubufo/clang/stable/3.1_src/build/bin/clang-3.1" -cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -disable-free -main-file-name call_in_if.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -v -resource-dir /srv/scratch/sigubufo/clang/stable/3.1_src/build/bin/../lib/clang/3.1 -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward -internal-isystem /usr/local/include -internal-isystem /srv/scratch/sigubufo/clang/stable/3.1_src/build/bin/../lib/clang/3.1/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -w -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /srv/scratch/sigubufo/danceos_wd/clang/qtcreator-build -ferror-limit 19 -fmessage-length 205 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -load lib/CallGraphDumper.so -plugin cgd -x c++ ../test_cases/call_in_if.cpp
    

    Now you invoke lldb with:

    lldb "/srv/scratch/sigubufo/clang/stable/3.1_src/build/bin/clang-3.1"
    

    And then in the lldb prompt you do

    (lldb) break set --name YourPlugin::FunctionToBreakAt
    
    (lldb) process launch -- -cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -disable-free -main-file-name call_in_if.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -v -resource-dir /srv/scratch/sigubufo/clang/stable/3.1_src/build/bin/../lib/clang/3.1 -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward -internal-isystem /usr/local/include -internal-isystem /srv/scratch/sigubufo/clang/stable/3.1_src/build/bin/../lib/clang/3.1/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -w -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /srv/scratch/sigubufo/danceos_wd/clang/qtcreator-build -ferror-limit 19 -fmessage-length 205 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -load lib/CallGraphDumper.so -plugin cgd -x c++ ../test_cases/call_in_if.cpp
    

    And that should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use remote debugging. The program that I want to debug runs
I want a debug function-macro that works like this: int myVar = 5; PRINTVAR(myVar);
well I want to debug some script with Firebug, (cause I can't see anything
I have an ASP.NET web site project that I want to debug, but when
I know about filter_parameter_logging for request params, but that only works for request parameters.
I want to debug a form submit using netbeans but cannot find the option
I want to debug a c# application, it's a big application and I can't
I have a python script that I want to debug with python-mode . I
I have a controller that serves as webservice. I want to debug the following
i want to Debug some Networkproblem cases in my Application. But i can't really

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.