From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13531 invoked by alias); 7 Sep 2011 13:14:33 -0000 Received: (qmail 13520 invoked by uid 22791); 7 Sep 2011 13:14:33 -0000 X-SWARE-Spam-Status: No, hits=1.0 required=5.0 tests=AWL,BAYES_00,BOTNET,RDNS_NONE,TO_NO_BRKTS_NORDNS,TW_RG X-Spam-Check-By: sourceware.org Received: from Unknown (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Sep 2011 13:14:15 +0000 Received: (qmail 16955 invoked from network); 7 Sep 2011 13:14:15 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 7 Sep 2011 13:14:15 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFC] Support of Lion (darwin 11) Date: Wed, 07 Sep 2011 13:28:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.0; x86_64; ; ) Cc: Tristan Gingold References: <201109071409.06452.pedro@codesourcery.com> In-Reply-To: <201109071409.06452.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201109071414.13487.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2011-09/txt/msg00118.txt.bz2 On Wednesday 07 September 2011 14:09:06, Pedro Alves wrote: > On Wednesday 07 September 2011 13:28:41, Tristan Gingold wrote: > > Hi, > > > > with the latest mac OS X, executables are now pie by default and their load address is random. This obviously needs to be considered by gdb, and the easiest method is to disable the randomization. I should add that being able to disable the randomization on its own is an acceptable patch. There's "set disable-randomization" on linux native already to do the same thing, and it disables randomization by default. You could re-use the same user visible setting. It just so happens that you'd get Lion half working for free. :-) > > This leaves out attaching to already running programs. We support PIE on > linux/svr4 now. Would it be hard to impossible to support it on Lion? > > > I also did some cleanup in this function: use alloca instead of xmalloc for argv to avoid a memory leak, and moved the code that allocate shell_command within the if (shell) block. I also factorized the gdb_flush/_exit code used in case on error. > > How about splitting these out into a separate, preparatory patch? > > -- Pedro Alves