From patchwork Tue Apr 5 19:57:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunlian Jiang X-Patchwork-Id: 11640 Received: (qmail 121341 invoked by alias); 5 Apr 2016 19:57:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 121329 invoked by uid 89); 5 Apr 2016 19:57:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f41.google.com Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 05 Apr 2016 19:57:51 +0000 Received: by mail-wm0-f41.google.com with SMTP id l6so37627126wml.1 for ; Tue, 05 Apr 2016 12:57:51 -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; bh=G3mBpekMUazc8MZf49fPFnsb9AhuxOAOrffJa2BsT1E=; b=ZwMc1aVAdbtfHOMRms5ZyoTNUdcIN3udFNfzYgdQUjmy2ONvMVb5886a3Tjc0AtiOt HvLzTkH9bqqwrbrYLYnTkmTe4NPYoP6wEzGjIv0NeS9iw0Cqf2am+5dGq+q80uecsIcX pdNvwzSUlohfAlI6uwwHfGA46bVWhbMcxMJiR4VLUszChn+BvDkW0HuXpd7zgiO3uKRz 7kU0WUUcpGo4eiwLa/J5uYw/xrYOdzFHxFKp+NWeTbAiHpAXI9HmVFxHLQJ09dmDlMq+ zw39brRV677icJtRy72H7PyPZHhGZUmaXKuwwrkO5zUm7joCa1/4IXXaVxzaCx4SwzaS HyUQ== X-Gm-Message-State: AD7BkJKtrCGuQSgz064TPwEhlk8UOIQ6kzcXJHPylnab5zXnm3z1yUZS62YbD2Q3y1u40VJwUaILfEmOAIDcrLQE MIME-Version: 1.0 X-Received: by 10.28.61.8 with SMTP id k8mr20256326wma.7.1459886268951; Tue, 05 Apr 2016 12:57:48 -0700 (PDT) Received: by 10.28.141.207 with HTTP; Tue, 5 Apr 2016 12:57:48 -0700 (PDT) Date: Tue, 5 Apr 2016 12:57:48 -0700 Message-ID: Subject: [PATCH] fix PR gdb/19914 From: Yunlian Jiang To: gdb-patches@sourceware.org X-IsSubscribed: yes Hi. This tries to fix PR gdb/19914. When the object file is not a binary but a .debug file, the function to try to find the .dwp file in the debug directory does not work. This one tries to solve this problem. 2016-04-05 Yunlian Jiang * gdb/dwarf2read.c: Try to find .dwp for .debug diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index dcd49e3..551376a 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -10854,6 +10854,18 @@ open_and_init_dwp_file (void) dbfd = open_dwp_file (dwp_name); } + if (dbfd == NULL && strlen(dwp_name) > 10) + { + /* Try to find .dwp for the debug file. */ + if (!strcmp(dwp_name + strlen(dwp_name) - 10, ".debug.dwp")) + { + dwp_name[strlen(dwp_name) - 10] = '\0'; + dwp_name = xstrprintf ("%s.dwp", dwp_name); + make_cleanup (xfree, dwp_name); + dbfd = open_dwp_file (dwp_name); + } + } + if (dbfd == NULL) { if (dwarf_read_debug)