From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0483E3858D32 for ; Mon, 20 Mar 2023 19:08:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0483E3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679339326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4clcZl48BDdsjz+kP+F7st32dEPyEpDIDc9wREn1HfI=; b=HfNqdmSpwc074nEhAqvkjz2SMsYBRIBEXxLUbKVhOTmlKLdUdgutYA0Qc37NCy9138T36f iYNyNjDVLVYmXStsH5uq7FZVj+RsCMABPQqGwK5KwzJxDEXljUN5CVdZiufnbmF1F4wCra D69iHZ6hA6s3AFxy2aC9emRUDYYh+30= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-314-0h5App7COs2epf9bs8zd7Q-1; Mon, 20 Mar 2023 15:08:44 -0400 X-MC-Unique: 0h5App7COs2epf9bs8zd7Q-1 Received: by mail-qv1-f70.google.com with SMTP id j15-20020a0cc34f000000b005c824064b10so2247964qvi.17 for ; Mon, 20 Mar 2023 12:08:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679339323; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4clcZl48BDdsjz+kP+F7st32dEPyEpDIDc9wREn1HfI=; b=bcB97evCCJyeZ7w/kwgc/uItAxMLaIc1apFDh/IkezN6zxl0q1YNzmFLhMgLje8XBA HxxaZT08lH8LYnOUSbEhB6zaVgmybaUHs3F0yhBTyxrZtdQSY4EVwtf2PkwdJjreeiNg XFK+WbT8ERYGf+RrJsLmvHx1M6tjwbdCY5jEoRRN0z/Hb++WMD3AQ3ZYhi95PPv/824o SIdhOJc+D2ARx0ldr7tOUekx3yv0OfHm6JRYUeqFaTXBk6erFFaeklacaCkl8HCwo4CN gnDj5AGIr9JjaycEo2h+L/IlOj+20usRm5ux53jB0kY86mknmrk53l7c7TDGktbvLZ29 wwJw== X-Gm-Message-State: AO0yUKVwC7TU/K9Os4YY+FFm2N9LAXUVG7YtaqHxx8kPqS6HJ27AvUtb BVdQ9PsWZEx0Jog0FaNvcfGpRLRERs0FqQ4JR7TGgW3EA8Gcz4Ll78lKR0meSC7NXngMWxM9tUr espI3q4M= X-Received: by 2002:ac8:57cd:0:b0:3d2:a927:21bc with SMTP id w13-20020ac857cd000000b003d2a92721bcmr531754qta.18.1679339323656; Mon, 20 Mar 2023 12:08:43 -0700 (PDT) X-Google-Smtp-Source: AK7set+eXsB6n6T/P4/OecfnC/5nwONehNyGpQJ50zxNU9zTIgicqdmA/G6YI1F8ZrOE8xXy3VBr7Q== X-Received: by 2002:ac8:57cd:0:b0:3d2:a927:21bc with SMTP id w13-20020ac857cd000000b003d2a92721bcmr531721qta.18.1679339323362; Mon, 20 Mar 2023 12:08:43 -0700 (PDT) Received: from t14s.localdomain (c-73-69-212-193.hsd1.nh.comcast.net. [73.69.212.193]) by smtp.gmail.com with ESMTPSA id ay16-20020a05620a179000b007461e8efacbsm7872446qkb.69.2023.03.20.12.08.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 12:08:42 -0700 (PDT) Message-ID: <01f48360dda6dba8bb10c0058fb802314a13ebd0.camel@redhat.com> Subject: Re: [GSOC] getting "gdb: unrecognized option '-dumpdir'' while trying to debug gcc using gdb From: David Malcolm To: Rishi Raj , gcc@gcc.gnu.org, mjambor@suse.cz Date: Mon, 20 Mar 2023 15:08:41 -0400 In-Reply-To: References: User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 2023-03-20 at 22:36 +0530, Rishi Raj wrote: > I am sorry for the previous messed-up reply :(. I was trying to reply > back > to my previous mail thread but mistakenly replied to the entire > digest::((. > Thanks, David and Martin, for the heads up, and I am sorry for the > late > reply due to health issues. Anyways I could emit the warning "hello > world, > I am function foo.".=C2=A0 After that, I tried debugging using the` ../gc= c > -wrapper gdb test.c`(gcc binary is in parent folder) but I am getting > this > error "gdb: unrecognized option '-dumpdir' > Use `gdb --help' for a complete list of options.".=C2=A0 The invocation above should be: ../xgcc -B.. -wrapper gdb,--args test.c in that: - when building from source, the "driver" binary is normally called "xgcc" rather than "gcc" - you're missing "-B PATH_TO_GCC_DIR" so that the "xgcc" driver can find the cc1 binary - the wrapper argument is "gdb,--args" so that it adds the option "-- args" to gdb's invocation Does that fix things? That said, I normally debug from inside the BUILDDIR/gcc subdirectory, from which I type: ./xgcc -B. ARGS TO GCC -wrapper gdb,--args Another way to invoke cc1 under the debugger is to add "-v" to the gcc invocation to get verbose output, and then see what command-line it uses to invoke cc1, and then run: gdb --args ARGS_OF_CC1_INVOCATION but I tend to use the former approach. Hope this is helpful Dave > I googled it and got > this on Bugzilla > (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53195), but > it has already been fixed. These are the gdb configurations during > the > build: > Using built-in specs. > COLLECT_GCC=3D../gcc > COLLECT_LTO_WRAPPER=3Dgcc-dir/libexec/gcc/x86_64-pc-linux- > gnu/12.2.1/lto-wrapper > Target: x86_64-pc-linux-gnu > Configured with: ../project/configure --prefix=3Dgcc-dir > --enable-languages=3Dc,c++ --disable-bootstrap > Thread model: posix > Supported LTO compression algorithms: zlib zstd > gcc version 12.2.1 20230302 [OG12] (GCC) > COLLECT_GCC_OPTIONS=3D'-v' '-mtune=3Dgeneric' '-march=3Dx86-64' '-dumpdir= ' > 'a-' > Can anyone point out how to resolve this or if I am missing something > during build? > Thanks and regards > Rishi Raj