From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12029 invoked by alias); 29 Sep 2019 15:48:54 -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 11928 invoked by uid 89); 29 Sep 2019 15:48:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.0 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= X-HELO: mail-ot1-f67.google.com Received: from mail-ot1-f67.google.com (HELO mail-ot1-f67.google.com) (209.85.210.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 29 Sep 2019 15:48:36 +0000 Received: by mail-ot1-f67.google.com with SMTP id m19so6299772otp.1 for ; Sun, 29 Sep 2019 08:48:36 -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=3ghAJsC6g693MscXUymdzUgSURIE9LjbViSG4NHtgVM=; b=Ygt+Oh0iexKxO2UhwQNGz4ZEK7lgoB7BWIuP5hn+nJ8fkmCJmRBY1AQOf02vQOzkPH TPZjxApaK/kTK2/jJNJxkYM4hYG/V1Zan7RaJzUTZ6B0eJ0qDVvkg6W4u3vMcKSEGfWF LkDt+an9jTV/BqlG0RJ39NXTSnZPClE9Awc0MF3DOrwjFgrWe0zdXM5aA+LULD9RGEvs m59HtEC8sHvS6cfRUpzXWwKQhwEuZmQWdDFSsI7+9KqgN+nXcaOceLosaJwA/+7m8/0U yIz/Wm3GvbGNRK10fqFTMiFkDHq5cv5BoHJ2ZOGoCSadyS1gRU1Hxr6E7ctmwTH9u4nd xujQ== MIME-Version: 1.0 References: In-Reply-To: From: "Christian Biesinger via gdb" Reply-To: Christian Biesinger Date: Sun, 29 Sep 2019 15:48: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/msg00033.txt.bz2 On Sun, Sep 29, 2019 at 1:48 AM Jeffrey Walton wrote: > > 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? I'm using Debian. GCC 8.3.0 and GDB built from git as well as 8.2.1 (both work). Christian