From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20912 invoked by alias); 29 Sep 2019 06:49:03 -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 20787 invoked by uid 89); 29 Sep 2019 06:48:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=H*i:sk:vNj5sAg, H*f:sk:vNj5sAg, H*f:CAPTJ0XH82z4, H*f:sk:OdOfB0f X-HELO: mail-io1-f41.google.com Received: from mail-io1-f41.google.com (HELO mail-io1-f41.google.com) (209.85.166.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 29 Sep 2019 06:48:45 +0000 Received: by mail-io1-f41.google.com with SMTP id b136so29064261iof.3 for ; Sat, 28 Sep 2019 23:48:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=bhHCRdaeVn+6FwF2VxLhs89O6cvc2mP0BSDC5aGxWYI=; b=O2jJ10/yIjPmLCUjE5fuBhhGsIdcdsyayhJ3SrYZ+61bARsD5MwQIpotIGXDt4g7bi DH6+xGlaDg5iWEdfS8nAejjxxzzV/XV1hT6UlG8esvKN0H6kHDGdpwxreNXw8oZu0R9J oOCZ5zae5khNIlEVYOFxRfiV+yFNl1Rv0aSDUmT9hdoXc4UxAgXzmZHH+CIELbuXbrDb LADc6TcuxZrXPpSDn3sXInY8zq0mnnAbP8UblVxAtRswPfPOKwfuh6Ajd+DKv8NvkSMZ UKh9+5dZxlyj2bk0K+GmcmYB1vFR46bILLwR4ew0/H+jbMMwIgCJW3dg8crYVjVsKtWR s3Mw== MIME-Version: 1.0 References: In-Reply-To: Reply-To: noloader@gmail.com From: Jeffrey Walton Date: Sun, 29 Sep 2019 06:49:00 -0000 Message-ID: Subject: Re: GDB does not recognize cxx extension? To: Christian Biesinger Cc: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00032.txt.bz2 On Sun, Sep 29, 2019 at 1:51 AM Christian Biesinger wrote: > > 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? Ack, thanks. Let me try to sort it out on my end. Out of curiosity, are you using Ubuntu, Fedora or something else? Jeff