[cfe-dev] GDB on LLVM-clang

Keane, Erich via cfe-dev cfe-dev at lists.llvm.org
Wed Jun 17 13:39:23 PDT 2020

I don't think this is necessary anymore!  We aren't forking the cc1 in a separate process anymore I think.

-----Original Message-----
From: David Blaikie <dblaikie at gmail.com> 
Sent: Wednesday, June 17, 2020 1:38 PM
To: Keane, Erich <erich.keane at intel.com>
Cc: cfe-dev at lists.llvm.org
Subject: Re: [cfe-dev] GDB on LLVM-clang

yep, just like any other program/debugger

You do have to be careful about debugging the clang driver versus the clang frontend - either run clang -### and run the resulting -cc1 command line under the debugger, or set "fork-follow-mode child" to have the debugger follow the frontend process from the driver process.
(I usually do the former)

On Wed, Jun 17, 2020 at 1:25 PM Keane, Erich via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> I’m not sure we have a guide anywhere, but its just like debugging any other program with GDB.  Make sure you’ve built with debug symbols, and have at it.  There are some tips (many things have a .dump method that prints some interesting info, and we also have some pretty-printers for gdb in llvm/utils/gdb-scripts/prettyprinters.py), but otherwise you just use GDB like normal.
> From: cfe-dev <cfe-dev-bounces at lists.llvm.org> On Behalf Of 
> Gousemoodhin Nadaf via cfe-dev
> Sent: Wednesday, June 17, 2020 1:22 PM
> To: cfe-dev at lists.llvm.org
> Subject: [cfe-dev] GDB on LLVM-clang
> Hello Team,
> I would like to know that Is it possible to debug LLVM-clang with GDB?
> If yes, please point out the steps or wiki page.
> Regards,
> Nadaf.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

More information about the cfe-dev mailing list