public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tim Lange <mail@tim-lange.me>
To: Berke Yavas <iamberkeyavas@gmail.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Debugging C++ frontend using CLion IDE
Date: Thu, 02 Mar 2023 00:08:57 +0100	[thread overview]
Message-ID: <XY6VQR.3GOOK95DZ0HG3@tim-lange.me> (raw)
In-Reply-To: <CAFTM=Ks-yJvy2+PC-JQ+gAoM_xH-rjh_GhsrPP+VUxaa0FtzFg@mail.gmail.com>

Hi Berke,

I had the same problem last year. Many IDEs don't really work for 
developing gcc. Most here probably use either emacs or vim. If you want 
to use an IDE, you might have to do some hacks.

The oldschool indentation style of gcc (mix of tab and spaces) is not 
widely supported. IDEs/Editors that support displaying this identation 
style are GNOME Builder (but that doesn't support the way gcc is 
built), Eclipse, VS Code (since Dec 22) and vim/emacs of course.
For VS Code, you need to apply 'unexpand' to the source files as it 
does not support converting 8 spaces to 1 tab automatically. There are 
plugins for Code to run customs commands on save.

To keep your IDE snappy, you should exclude everything that you won't 
need from the indexing, especially the test directory.

At last, for debugging, I had good experiences with launching a 
gdbserver, i.e. replacing "-wrapper gdb" with "-wrapper 
gdbserver,localhost:2345". Then you can connect your IDE to that 
gdbserver and fully use the IDE interface to debug. You can configure 
running gcc with a gdbserver as a pre-task to automate this.

- Tim

PS: When I tried CLion last year, I neither could get the build system 
working nor the indentation. So you might want to look at one of the 
other IDEs but I don't if something changed in the time.

On Mi, Mär 1 2023 at 20:59:17 +0300, Berke Yavas via Gcc 
<gcc@gcc.gnu.org> wrote:
> Hi,
> 
> I am trying to set up my environment for the upcoming google summer of
> code. One thing I haven't figured out yet, how can I debug C++ 
> frontend(or
> any other language frontend) with CLion. If anybody managed to do 
> this(or
> using another IDE), could you please share your settings with me?
> 
> Best regards,
> Berke



      parent reply	other threads:[~2023-03-01 23:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01 17:59 Berke Yavas
2023-03-01 18:08 ` Charalampos Mitrodimas
2023-03-01 18:09 ` Charalampos Mitrodimas
2023-03-01 18:23 ` Paul Smith
2023-03-01 23:08 ` Tim Lange [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=XY6VQR.3GOOK95DZ0HG3@tim-lange.me \
    --to=mail@tim-lange.me \
    --cc=gcc@gcc.gnu.org \
    --cc=iamberkeyavas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).