From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98991 invoked by alias); 8 Mar 2015 22:57:56 -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 98977 invoked by uid 89); 8 Mar 2015 22:57:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-ig0-f172.google.com Received: from mail-ig0-f172.google.com (HELO mail-ig0-f172.google.com) (209.85.213.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 08 Mar 2015 22:57:54 +0000 Received: by igjz20 with SMTP id z20so16423807igj.4 for ; Sun, 08 Mar 2015 15:57:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=jJ3cRH2hZh4RNcqiZk20JMBUENdwD0pqzj2X/EdHn/k=; b=lpTKL1XJEUDCR6tAN9mIw22XajO49l1H6TXNMsoMwbDUuYHpsuSfxbJdSIazlqJh7c zoBx7y1s7bp2HPGcOBVeTNmj4z/wWrE0G29jrMnGSu15rvERIR1+PRC8JHPO0bSB0/hb OZhO+E/c/v0/+6QuMW3IYrOocORwV9QSchrurKsOGpsFaKIJrz26jpyDbHuMnlPZoSk2 S1zmy+te9Y6W3FaZSHaa9KUypdacD8SYbPMSbvbkN7sf3j38eM4tm9Vt9cPEgFCQVH1N pYMjVXpApIIWDwVYZdWffzTrtvCDzu2gg9fYdGno6kJ9CAH5fg7z3uLTW+37DosaDR/H OCEg== X-Gm-Message-State: ALoCoQldOOMnL1iH1d5RiyB4kPKAR1fgIVcVkuURr7ouD4PNahnHKVnTg6wbNGM2tboOQE6HTlLG MIME-Version: 1.0 X-Received: by 10.107.130.16 with SMTP id e16mr23708173iod.80.1425855472262; Sun, 08 Mar 2015 15:57:52 -0700 (PDT) Received: by 10.107.142.22 with HTTP; Sun, 8 Mar 2015 15:57:52 -0700 (PDT) Date: Sun, 08 Mar 2015 22:57:00 -0000 Message-ID: Subject: Trying to get GDB to find PE symbol file via build-id From: Benjamin Gilbert To: gdb@sourceware.org Cc: jon.turney@dronecode.org.uk Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00008.txt.bz2 [re-sent due to Gmail HTMLification] Hi all, I'm trying to build a Win32 DLL with separate debug symbols, but I can't seem to get GDB to automatically load a symbol file using the PE build-id support added in ld 2.25. I'm running on Fedora 21 x86_64, with a gdb built from binutils-gdb HEAD (3e95021) and configured with "--target=i686-w64-mingw32". What I'm doing: 1. Cross-build the DLL with MinGW-w64 and LDFLAGS="-Wl,--build-id". 2. Create stripped DLL with "i686-w64-mingw32-objcopy -S unstripped.dll stripped.dll". 3. Create symbol file with "i686-w64-mingw32-objcopy --only-keep-debug unstripped.dll debug/.build-id/MM/NNNN.debug", where "MMNNNN" is the hex string returned by "i686-w64-mingw32-objdump -p unstripped.dll | grep signature". 4. In i686-w64-mingw32-gdb, run "set debug-file-directory debug" and "file stripped.dll". Result: "Reading symbols from stripped.dll...(no debugging symbols found)...done." An strace of the gdb process shows that it doesn't try to access any .debug files in debug/, so the problem isn't that I used the wrong filename. Manually loading the symbol file with "symbol-file debug/.build-id/MM/NNNN.debug" does work. Advice? Am I going about this wrong? Thanks, --Benjamin Gilbert