From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27935 invoked by alias); 11 Oct 2013 14:10:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27921 invoked by uid 89); 11 Oct 2013 14:10:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Oct 2013 14:10:30 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1VUdQ9-00040P-CO from Luis_Gustavo@mentor.com ; Fri, 11 Oct 2013 07:10:25 -0700 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 11 Oct 2013 07:10:25 -0700 Received: from [172.30.8.57] ([172.30.8.57]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 11 Oct 2013 07:10:24 -0700 Message-ID: <525806C8.8040108@codesourcery.com> Date: Fri, 11 Oct 2013 14:10:00 -0000 From: Luis Machado Reply-To: lgustavo@codesourcery.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: "'gdb-patches@sourceware.org'" , Jan Kratochvil Subject: [PATCH] Fix calling gcore when gdb is not in $PATH. Content-Type: multipart/mixed; boundary="------------010709060100080306030903" X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00386.txt.bz2 This is a multi-part message in MIME format. --------------010709060100080306030903 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 868 Hi, Currently, the generated gcore scripts assume the gdb binary they need to call is present in $PATH, but this may not always be true. If you want to call the gcore scripts from a relative directory, for example, it will fail to locate the gdb binary. The attached patch fixes this. Before the patch: $ /tmp/gdb_test_install/bin/gcoreblahbleh 20000 /tmp/gdb_test_install/bin/gcoreblahbleh: 54: /tmp/gdb_test_install/bin/gcoreblahbleh: gdbblahbleh: not found gcoreblahbleh: failed to create core.20000 After the patch: $ /tmp/gdb_test_install/bin/gcoreblahbleh 20000 warning: unable to open /proc file '/proc/20000/status' warning: unable to open /proc file '/proc/20000/status' ptrace: No such process. You can't do that without a process to debug. The program is not being run. gcoreblahbleh: failed to create core.20000 How does it look? Regards, Luis --------------010709060100080306030903 Content-Type: text/x-patch; name="gcore.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gcore.diff" Content-length: 654 2013-10-11 Luis Machado * gcore.in: Call gdb using the full path to the gcore script. diff --git a/gdb/gcore.in b/gdb/gcore.in index 9c5b14d..b82479c 100644 --- a/gdb/gcore.in +++ b/gdb/gcore.in @@ -51,7 +51,7 @@ for pid in $* do # `