From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123878 invoked by alias); 21 Apr 2018 20:57: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 123861 invoked by uid 89); 21 Apr 2018 20:57:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=sk:gccgcc, libsupc, absence, Hx-languages-length:1662 X-HELO: mail-wr0-f179.google.com Received: from mail-wr0-f179.google.com (HELO mail-wr0-f179.google.com) (209.85.128.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 21 Apr 2018 20:57:52 +0000 Received: by mail-wr0-f179.google.com with SMTP id p5-v6so3406498wre.12 for ; Sat, 21 Apr 2018 13:57:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=2hLsqAnh1YiRmgtWpZFEYEgW3nUIaqmKSlMxH7oXAHc=; b=TTHEJX35w8gIWBaLgYWRXMFusDXvOxuyibK2y9yvqBlZB5QS1LakQ9bmK1eXFwBAnt VRfmvBZyeOBr0EP8bLTy2unxYUJobxONDX5YQ2qIiBUWg+vPRn2nwLiHx+yIcgU+yCRh cMohqh0ZbMFylb+Ig0miHTCR2itEtRaokhI3YX7qN1IxSoWRlB5+aMESv+0jBX9Zwd2Y 8pfWcL7cOyRuhe0miwz8GIPMEL3Ry3pZHhbYtKS5tX+/k02xUwIaZ1PFwgOXAo/WZjvF +GqYCQZM6yrXL2nWslTi6fTJqFJZS5T7dVqxRvDVP+cQgBVUqs2wMVO5s/06KEU9w3gP bCEw== X-Gm-Message-State: ALQs6tDEYzPMyVhyHPjWY1HFnJ+JyfuePYyWxU2VzSHLHGBfjCpC1Yqe FbN3bjJKZBYRNFQIQw2EYyQJnBxB X-Google-Smtp-Source: AIpwx48r47lgfwq9f3Fo4wdpKkdmnLFbvArX4NJRRuSxLyElzIc0YxAV4NIR2/lv0m5Jfj+OfrUD5g== X-Received: by 10.80.174.70 with SMTP id c64mr21156199edd.166.1524344269820; Sat, 21 Apr 2018 13:57:49 -0700 (PDT) Received: from jvdlux ([185.51.72.244]) by smtp.gmail.com with ESMTPSA id c5sm5902515ede.63.2018.04.21.13.57.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Apr 2018 13:57:48 -0700 (PDT) From: Jason Vas Dias To: gdb@sourceware.org Subject: Re: 'b ::new' causes gdb 8.1 to coredump ? References: <4lk4tj1i.fsf@gmail.com> Date: Sat, 21 Apr 2018 22:52:00 -0000 In-Reply-To: <4lk4tj1i.fsf@gmail.com> (Jason Vas Dias's message of "Sat, 21 Apr 2018 20:13:13 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00013.txt.bz2 RE: > start ... > (gdb) b ::new > cp-namespace.c:177: internal-error: block_symbol cp_lookup_bare_symbol(const language_defn*, const char*, const block*, domain_enum, int): Assertion `strstr (name, "::") == NULL' failed. > A problem internal to GDB has been detected, This occurs both when I built & linked the program with the 5.4.0 compiler , with '-Wl,-rpath=${PATH_TO_5_4_0_LIBS},-rpath-link=${PATH_TO_5_4_0_LIBS}' , while GDB 8.1.11 is built with GCC 7.3.1 , and when built with GCC 7.3.1, with '-Wl,-rpath=${PATH_TO_7_3_1_LIBS},-rpath-link=${PATH_TO_7_3_1_LIBS}' , (the two paths are quite different in my setup). In both cases, GDB coredumps on 'b ::new' (after starting), and fails to resolve any of: 'b ::new(std::size_t)' 'b operator ::new(std::size_t)' 'b "operator::new(std::size_t)" 'b extern "C++" "operator::new(::std::size_t)" So how is one able to break on libstd++ C++ symbols in GDB ? Especially 'operator ::new' - I can break on any of { ::malloc, ::posix_memalign, ::memalign, ::sbrk .. } but not any form of new() . Why ? new is a proper symbol in libstdc++ : $ nm -C /usr/lib64/gcc/x86_64-pc-linux-gnu/7.3.1/libstdc++.so.6.0.24 | grep 'new' ... 0000000000097680 T operator new(unsigned long) Aha! It was the '::' namespace colons! (gdb) b "operator new(std::size_t)" Breakpoint 2 at 0x155554c30680: file ../../../../gcc-gcc-7-branch/libstdc++-v3/libsupc++/new_op.cc, line 43. (gdb) q But I don't think the presence or absence of leading global namespace '::' colons should cause GDB to coredump or fail to resolve operator new() . Doesn't GDB understand C++ namespaces ? Thanks, Jason