From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113939 invoked by alias); 25 Jan 2016 15:56:58 -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 113913 invoked by uid 89); 25 Jan 2016 15:56:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1467, Besides, corefile X-HELO: mail-wm0-f48.google.com Received: from mail-wm0-f48.google.com (HELO mail-wm0-f48.google.com) (74.125.82.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 25 Jan 2016 15:56:56 +0000 Received: by mail-wm0-f48.google.com with SMTP id u188so71583128wmu.1 for ; Mon, 25 Jan 2016 07:56:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=eIqKdqWpDfsuR5hpMNehcQ6emSQSTSZCHBRhZGe6lTE=; b=fcub7AOIo6rzwkX/mE1QprlcWD9DpF6fZKgzByhNg+2yFjmAd/V9u+ICbfvp0QP8rP bk3XARSwVQ7CdLDzzusLV1VZtWuMAnQDeoCYPS3JCh4nIloT80xK4UwePcx/MzdDWpUA SSNO/pg8MvBGRBF8962nBm6JAdFdZRzitTQlVBq1HT+UCwV3ibZErfI15L9UjHrLVjje DsL07oHtiEPFdtrnAay9bHXbPJhBMVUsLMXaeun9YE19msmjXeWplA9f73kIkEgrxO7u V3j0HOgxnKw76b5RN+54v2z2TwnXLEKEG7r/9mtvjdALSvMxnU9vU51jsCtWA/dlKj7u 2q1A== X-Gm-Message-State: AG10YORr+OBrz4vdT0VDM3wbc189JweueF1NYvX347Tbry8Ak8ut9X0sgu5RLPv1yf6iybSKbkuXFHuynT5ZBw== MIME-Version: 1.0 X-Received: by 10.194.111.232 with SMTP id il8mr21007124wjb.150.1453737413342; Mon, 25 Jan 2016 07:56:53 -0800 (PST) Received: by 10.194.166.162 with HTTP; Mon, 25 Jan 2016 07:56:53 -0800 (PST) In-Reply-To: <20160125142226.GA5665@host1.jankratochvil.net> References: <20160125142226.GA5665@host1.jankratochvil.net> Date: Mon, 25 Jan 2016 15:56:00 -0000 Message-ID: Subject: Re: Adding a missing NT_FILES note to a core file so gdb can load solibs for it From: Bogdan Harjoc To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00052.txt.bz2 Thanks, a comment in elf_locate_base() confirms NT_FILES wouldn't work: /* Look for DT_MIPS_RLD_MAP first. MIPS executables use this instead of DT_DEBUG [...] */ Solib loading apparently fails here: #0 read_memory_typed_address (info->debug_base + lmo->r_map_offset) the map #1 solib_svr4_r_map because read_memory...() reads 0x0 from info->debug_base + lmo->r_map_offset. What I can't figure out is where the rld map should be in the core file. Thanks. On Mon, Jan 25, 2016 at 4:22 PM, Jan Kratochvil wrote: > On Mon, 25 Jan 2016 15:06:05 +0100, Bogdan Harjoc wrote: >> So I'd like to ask whether this has any chance of working. > > No. GDB does not support NT_FILE reading. GDB follows DT_DEBUG: > readelf -d execbinary|grep -w DEBUG > > Besides that it would not be completely correct, depending on the point of > view. mmap()ped shared library will be present in NT_FILE but GDB will not > shows it as it was not dlopen()ed (either by a call or via DT_NEEDED). > > When GDB cannot read shared libraries it usually means your executable does > not exactly match the one that was core dumped. To make them matching one > should match build-id from the core file with that of the executable: > eu-unstrip -n --core=corefile > readelf -n execbinary|grep -A1 NT_GNU_BUILD_ID > IIRC ld-linux.so also needs to match, I cannot remember why now. > > > Jan