From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from www523.your-server.de (www523.your-server.de [159.69.224.22]) by sourceware.org (Postfix) with ESMTPS id 1B7F53858D33 for ; Wed, 1 Mar 2023 23:09:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B7F53858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tim-lange.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tim-lange.me DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tim-lange.me; s=default2108; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Cc:To:Subject:From:Date:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=II4cjyx2sxrxkzh8F0aIGraeV9fzALrmh6f0UA5SK8k=; b=fP6DMSiBMlp2HeHwNQmLg/b5mC 0XzaG36Yi339jv8oSXqS8nTuEow60GG9ZCxB1hPGjQ0NxiJ6CQpCCUju7OZEe/9c7EmgCu1vY0reV LQHjGwq2BadLUGlCM5sCMu4HPJy1DFL7tjAh3aGbIpOkaynUX7sjZYi64nj45hYaZzBJqMeMiofEy 2MTbfwAmKUrswFlCvxXWGFCsKTXSEYu+f139IZqL641KFNKJCwjiNBWjuMoYnNbChH9B7vsbdfVEf OQvvWKRllqdIGdjf01PAlg58hLf/Rtm+HTX9U3VYfdNeqfqEvGswKRQ01ZKe1InVX4zfPYd2xUaHL dZQM7Ccg==; Received: from sslproxy01.your-server.de ([78.46.139.224]) by www523.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pXVZH-0007N2-JR; Thu, 02 Mar 2023 00:09:03 +0100 Received: from [2a02:908:1861:d6a0::2bfa] (helo=fedora) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXVZH-000Ay9-Al; Thu, 02 Mar 2023 00:09:03 +0100 Date: Thu, 02 Mar 2023 00:08:57 +0100 From: Tim Lange Subject: Re: Debugging C++ frontend using CLion IDE To: Berke Yavas Cc: gcc@gcc.gnu.org Message-Id: In-Reply-To: References: X-Mailer: geary/43.0 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: mail@tim-lange.me X-Virus-Scanned: Clear (ClamAV 0.103.8/26827/Wed Mar 1 09:28:49 2023) X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_INFOUSMEBIZ,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Berke, I had the same problem last year. Many IDEs don't really work for=20 developing gcc. Most here probably use either emacs or vim. If you want=20 to use an IDE, you might have to do some hacks. The oldschool indentation style of gcc (mix of tab and spaces) is not=20 widely supported. IDEs/Editors that support displaying this identation=20 style are GNOME Builder (but that doesn't support the way gcc is=20 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=20 does not support converting 8 spaces to 1 tab automatically. There are=20 plugins for Code to run customs commands on save. To keep your IDE snappy, you should exclude everything that you won't=20 need from the indexing, especially the test directory. At last, for debugging, I had good experiences with launching a=20 gdbserver, i.e. replacing "-wrapper gdb" with "-wrapper=20 gdbserver,localhost:2345". Then you can connect your IDE to that=20 gdbserver and fully use the IDE interface to debug. You can configure=20 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=20 working nor the indentation. So you might want to look at one of the=20 other IDEs but I don't if something changed in the time. On Mi, M=E4r 1 2023 at 20:59:17 +0300, Berke Yavas via Gcc=20 wrote: > Hi, >=20 > 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++=20 > frontend(or > any other language frontend) with CLion. If anybody managed to do=20 > this(or > using another IDE), could you please share your settings with me? >=20 > Best regards, > Berke