From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7970 invoked by alias); 29 Sep 2019 05:51:53 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 7955 invoked by uid 89); 29 Sep 2019 05:51:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.1 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=H*i:sk:hxi6ULr, H*f:CAH8yC8k1vu2bf, H*f:sk:hxi6ULr, H*f:ogCA X-HELO: mail-oi1-f175.google.com Received: from mail-oi1-f175.google.com (HELO mail-oi1-f175.google.com) (209.85.167.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 29 Sep 2019 05:51:51 +0000 Received: by mail-oi1-f175.google.com with SMTP id w17so8468507oiw.8 for ; Sat, 28 Sep 2019 22:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2eRmHcb1ySq0k66EDWyzWEk/qzC/GCfUDC9m77drUHM=; b=nhsJkTcueabyktdZZVVNyxlKmTebhUwH6hCHuqMKMs5NHGdbt/K3hbLzu4LPYO4EMp LxHojPh0JMlrJ04XEHp4s6/8K2AZIPvO/uvDRN8vC9nVJ9Dip2G6MwrP+Xi42vlu7ku9 w+rdCXjNRKsdhdKV9xAOtNPD35rppSzU1qFOuAtEa/LRahD5BpVIO0PyoSIYzKJhHBPR BMUPz7bMslziRQqigTI7EpfRL63EiBU8KuY/MDIzNdD224lUM14ZWZaiadccRC1eJ4xA iUUW8oqEfgbsLMgb/4rBhcWBGPDb8wmO1Djox/Cyz4y6ZoPlUtI+3c1b6l3YJy3v3qM/ Pl2g== MIME-Version: 1.0 References: In-Reply-To: From: "Christian Biesinger via gdb" Reply-To: Christian Biesinger Date: Sun, 29 Sep 2019 05:51:00 -0000 Message-ID: Subject: Re: GDB does not recognize cxx extension? To: noloader@gmail.com Cc: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00031.txt.bz2 On Sun, Sep 29, 2019 at 12:17 AM Jeffrey Walton wrote: > > On Sun, Sep 29, 2019 at 1:09 AM Christian Biesinger > wrote: > > > > On Sun, Sep 29, 2019 at 12:01 AM Jeffrey Walton wrote: > > > I've got a C++ program built from a source called pem_test.cxx. I'm > > > having trouble getting GDB to accept it. Autocomplete does not work: > > > > > > (gdb) b pem_ > > > pem_common.cpp pem_common.h pem_read.cpp pem_write.cpp > > > > GDB gets the list of files from the debug data in the binary, not from > > the current directory. Are you sure you compiled pem_test.cxx into the > > binary? > > Yes. A 'b main' stops in pem_test.cxx. > > The recipe to build pem_test.cxx is at > https://github.com/noloader/cryptopp-pem/blob/master/pem_create_keys.sh#L42 So, GDB does know that cxx is an extension for C++: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/c-lang.c;h=57592dfbce0f8822fa3ca3d68ed520b4124a0c5d;hb=612aac65e690387c963c34a31dd1fb138d88a45c#l1032 And .cxx does work for me: Reading symbols from ./test... (gdb) break test.cxx:2 Breakpoint 1 at 0x1129: file test.cxx, line 2. (gdb) r Starting program: /tmp/test Breakpoint 1, main () at test.cxx:2 2 return 42; (gdb) b test std::__atomic0::atomic_flag::test_and_set(std::memory_order) test.cxx There must be something odd about your build setup, but I don't know what it is. For testing purposes, if you build the cxx as part of your static library, does it work? Christian