public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Debugging C++ frontend using CLion IDE
@ 2023-03-01 17:59 Berke Yavas
  2023-03-01 18:08 ` Charalampos Mitrodimas
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Berke Yavas @ 2023-03-01 17:59 UTC (permalink / raw)
  To: gcc

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Debugging C++ frontend using CLion IDE
  2023-03-01 17:59 Debugging C++ frontend using CLion IDE Berke Yavas
@ 2023-03-01 18:08 ` Charalampos Mitrodimas
  2023-03-01 18:09 ` Charalampos Mitrodimas
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Charalampos Mitrodimas @ 2023-03-01 18:08 UTC (permalink / raw)
  To: gcc

Hi Berke,

> 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?

It might be best to proceed with something that is already documented by 
the GCC GNU team. The best way for you to learn how to step through the 
code is in the documentation.

See: https://gcc-newbies-guide.readthedocs.io/en/latest/debugging.html


Thanks,

Charalampos

>
> Best regards,
> Berke

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Debugging C++ frontend using CLion IDE
  2023-03-01 17:59 Debugging C++ frontend using CLion IDE 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
  3 siblings, 0 replies; 5+ messages in thread
From: Charalampos Mitrodimas @ 2023-03-01 18:09 UTC (permalink / raw)
  To: Berke Yavas; +Cc: gcc

[-- Attachment #1: Type: text/plain, Size: 611 bytes --]

Hi Berke,

> 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?

It might be best to proceed with something that is already documented by
the GCC GNU team. The best way for you to learn how to step through the
code is in the documentation.

See: https://gcc-newbies-guide.readthedocs.io/en/latest/debugging.html


Thanks,

Charalampos

>
> Best regards,
> Berke

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Debugging C++ frontend using CLion IDE
  2023-03-01 17:59 Debugging C++ frontend using CLion IDE 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
  3 siblings, 0 replies; 5+ messages in thread
From: Paul Smith @ 2023-03-01 18:23 UTC (permalink / raw)
  To: Berke Yavas, gcc

On Wed, 2023-03-01 at 20:59 +0300, Berke Yavas via Gcc wrote:
> 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?

Since CLion is (a) not free (by either definition), and (b) requires
projects to use CMake (at least it did last time I checked), it's
highly unlikely you'll find too many GNU projects that have any
information about how to configure it.

I'm not sure what IDEs other devs use: probably vim or Emacs mostly.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Debugging C++ frontend using CLion IDE
  2023-03-01 17:59 Debugging C++ frontend using CLion IDE Berke Yavas
                   ` (2 preceding siblings ...)
  2023-03-01 18:23 ` Paul Smith
@ 2023-03-01 23:08 ` Tim Lange
  3 siblings, 0 replies; 5+ messages in thread
From: Tim Lange @ 2023-03-01 23:08 UTC (permalink / raw)
  To: Berke Yavas; +Cc: gcc

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-01 23:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 17:59 Debugging C++ frontend using CLion IDE 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 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).