From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66217 invoked by alias); 26 Jul 2015 20:49:12 -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 66208 invoked by uid 89); 26 Jul 2015 20:49:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 26 Jul 2015 20:49:10 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 39838341ADF for ; Sun, 26 Jul 2015 20:49:09 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6QKn68U025591 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 26 Jul 2015 16:49:08 -0400 Date: Sun, 26 Jul 2015 20:49:00 -0000 From: Jan Kratochvil To: gdb@sourceware.org Subject: Isn't it OK to drop 'set write'? Message-ID: <20150726204905.GA18543@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00057.txt.bz2 Hi, GDB 'set write on' currently does not work, it has regressed in 7.9: "set write on" or "--write" corrupt the binary file https://sourceware.org/bugzilla/show_bug.cgi?id=18168 due to a485e98ea0cbb61ea9da1e7858da545e0bcf1a46 is the first bad commit Author: Alan Modra Move ELF section headers to end of object file $ echo 'int foo=10;int main(){}'|gcc -g -x c - $ cp -p a.out a.out-orig $ gdb -q -ex 'set trace-commands on' -ex 'set write on' -ex 'file a.out' -ex 'set foo=20' -ex q +set write on +file a.out Reading symbols from a.out...done. +set foo=20 +q Segmentation fault $ cmp a.out a.out-orig && echo unchanged unchanged It is already unsupported for: writing into executable files is not supported for target: sysroots I cannot much imagine when it is useful. For updates of too big binaries there is gold incremental linking. Personally I have also never considered it safe enough to use it myself, hexedit is there if one needs to create a weird testfile. Either there is some use case for that and so the fix should be 7.10 blocker. Or the feature is no longer useful and it could be dropped which would significantly simplify me a build-id patchset being prepared. Jan