How to debug a clang plugin with Visual Studio?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to debug a clang plugin with Visual Studio?

Adam Cieszkiel via cfe-dev
Hello,

has anybody experience with debugging a clang plugin with Visual Studio?

Thanks

Marcel

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to debug a clang plugin with Visual Studio?

Adam Cieszkiel via cfe-dev
Dear community,

to be more specific:

clang.exe spanws another process of it self and then loads the plugin dll.

This is a real pain to debug. Is there a clang option to ease debugging
of plugins?

Any idea appreciated...

Thanks

Marcel


Am 13.07.2017 um 18:09 schrieb Marcel Schaible via cfe-dev:

> Hello,
>
> has anybody experience with debugging a clang plugin with Visual Studio?
>
> Thanks
>
> Marcel
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to debug a clang plugin with Visual Studio?

Adam Cieszkiel via cfe-dev
Run whatever command you normally run, but with an extra "-v".  Clang will print out what command line to use for the sub-processes.

When debugging, use the command for the subprocess rather than normal top level command.

> -----Original Message-----
> From: cfe-dev [mailto:[hidden email]] On Behalf Of Marcel
> Schaible via cfe-dev
> Sent: Thursday, July 13, 2017 12:17 PM
> To: [hidden email]
> Subject: Re: [cfe-dev] How to debug a clang plugin with Visual Studio?
>
> Dear community,
>
> to be more specific:
>
> clang.exe spanws another process of it self and then loads the plugin dll.
>
> This is a real pain to debug. Is there a clang option to ease debugging of
> plugins?
>
> Any idea appreciated...
>
> Thanks
>
> Marcel
>
>
> Am 13.07.2017 um 18:09 schrieb Marcel Schaible via cfe-dev:
> > Hello,
> >
> > has anybody experience with debugging a clang plugin with Visual Studio?
> >
> > Thanks
> >
> > Marcel
> >
> > _______________________________________________
> > cfe-dev mailing list
> > [hidden email]
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to debug a clang plugin with Visual Studio?

Adam Cieszkiel via cfe-dev
In reply to this post by Adam Cieszkiel via cfe-dev
I've not debugged plugins specifically, but in general, if you invoke clang
with -v or -###, it should give you a clang -cc1 command. You can debug that
command instead of your original one, and it should avoid any further process
spawning (or at least it does when plugins aren't involved).

On 7/13/17, 10:16 AM, "cfe-dev on behalf of Marcel Schaible via cfe-dev" <[hidden email] on behalf of [hidden email]> wrote:

    Dear community,
   
    to be more specific:
   
    clang.exe spanws another process of it self and then loads the plugin dll.
   
    This is a real pain to debug. Is there a clang option to ease debugging
    of plugins?
   
    Any idea appreciated...
   
    Thanks
   
    Marcel
   
   
    Am 13.07.2017 um 18:09 schrieb Marcel Schaible via cfe-dev:
    > Hello,
    >
    > has anybody experience with debugging a clang plugin with Visual Studio?
    >
    > Thanks
    >
    > Marcel
    >
    > _______________________________________________
    > cfe-dev mailing list
    > [hidden email]
    > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Ddev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=AqDh226SIR8ASVq0eVOWojO-GaROFoVPYpAclxBVJao&s=z-Ru3yQQKXJ5R1bxkZ6bqoLhjJulzhoqR7dF6TMl7bQ&e= 
   
    _______________________________________________
    cfe-dev mailing list
    [hidden email]
    https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Ddev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=AqDh226SIR8ASVq0eVOWojO-GaROFoVPYpAclxBVJao&s=z-Ru3yQQKXJ5R1bxkZ6bqoLhjJulzhoqR7dF6TMl7bQ&e= 
   

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to debug a clang plugin with Visual Studio?

Adam Cieszkiel via cfe-dev
In reply to this post by Adam Cieszkiel via cfe-dev
Most debuggers have a setting as to whether to follow forks or not.  GDB for example has 'set follow-fork-mode ...'

MVSC has this plugin available as a power tool to do this: https://blogs.msdn.microsoft.com/devops/2014/11/24/introducing-the-child-process-debugging-power-tool/

Alternatively, you can do "clang <compile command> -### "to see the command handed to that child process.  You can then debug THAT instead.

-----Original Message-----
From: cfe-dev [mailto:[hidden email]] On Behalf Of Marcel Schaible via cfe-dev
Sent: Thursday, July 13, 2017 10:17 AM
To: [hidden email]
Subject: Re: [cfe-dev] How to debug a clang plugin with Visual Studio?

Dear community,

to be more specific:

clang.exe spanws another process of it self and then loads the plugin dll.

This is a real pain to debug. Is there a clang option to ease debugging of plugins?

Any idea appreciated...

Thanks

Marcel


Am 13.07.2017 um 18:09 schrieb Marcel Schaible via cfe-dev:

> Hello,
>
> has anybody experience with debugging a clang plugin with Visual Studio?
>
> Thanks
>
> Marcel
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to debug a clang plugin with Visual Studio?

Adam Cieszkiel via cfe-dev
Your proposed solution with "-v" or "-###" works fine.

Thanks for your help

Marcel
Am 13.07.2017 um 19:23 schrieb Keane, Erich:

> Most debuggers have a setting as to whether to follow forks or not.  GDB for example has 'set follow-fork-mode ...'
>
> MVSC has this plugin available as a power tool to do this: https://blogs.msdn.microsoft.com/devops/2014/11/24/introducing-the-child-process-debugging-power-tool/
>
> Alternatively, you can do "clang <compile command> -### "to see the command handed to that child process.  You can then debug THAT instead.
>
> -----Original Message-----
> From: cfe-dev [mailto:[hidden email]] On Behalf Of Marcel Schaible via cfe-dev
> Sent: Thursday, July 13, 2017 10:17 AM
> To: [hidden email]
> Subject: Re: [cfe-dev] How to debug a clang plugin with Visual Studio?
>
> Dear community,
>
> to be more specific:
>
> clang.exe spanws another process of it self and then loads the plugin dll.
>
> This is a real pain to debug. Is there a clang option to ease debugging of plugins?
>
> Any idea appreciated...
>
> Thanks
>
> Marcel
>
>
> Am 13.07.2017 um 18:09 schrieb Marcel Schaible via cfe-dev:
>> Hello,
>>
>> has anybody experience with debugging a clang plugin with Visual Studio?
>>
>> Thanks
>>
>> Marcel
>>
>> _______________________________________________
>> cfe-dev mailing list
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Loading...