From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42529 invoked by alias); 30 Jun 2018 17:41:36 -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 42513 invoked by uid 89); 30 Jun 2018 17:41:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,KAM_NUMSUBJECT,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=sk:startup, forget, stackoverflow X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 30 Jun 2018 17:41:34 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BC6E6406E8C4; Sat, 30 Jun 2018 17:41:32 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 28C112156880; Sat, 30 Jun 2018 17:41:31 +0000 (UTC) Subject: Re: [RFC] Make "run" work on macOS 10.13 To: Tom Tromey , gdb-patches@sourceware.org References: <20180629205532.25377-1-tom@tromey.com> From: Pedro Alves Message-ID: Date: Sat, 30 Jun 2018 17:41:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180629205532.25377-1-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-06/txt/msg00761.txt.bz2 On 06/29/2018 09:55 PM, Tom Tromey wrote: > I would like some feedback on this patch. > > On macOS 10.13.5, "run" does not work in gdb. There are two cases: > > 1. If I forget to "set startup-with-shell off", then gdb will fail due > to the system integrity protection feature. I believe this happens > because gdb is not allowed to debug the shell. > > You can find many sites advocating "set startup-with-shell off", > but it seems to me that it is friendlier for gdb to simply do it by > default. Judging from stackoverflow, input redirection is a common-ish thing for users to do. Maybe we could reuse Eli's input redirection emulation for Windows here: https://sourceware.org/ml/gdb-patches/2016-10/msg00832.html Doesn't have to be you or in this patch of course. Just a suggestion. > > One option here might be to do this conditionally based on the > version of the OS. > > 2. I found that gdb was setting the solib breakpoint incorrectly, > causing a failure. Adding the load address to the notifier address > makes this work for me. I suspect this would regress earlier > versions of macOS, but I have no way to test that; one idea might > be to only do this when gdb_dyld_all_image_infos::version == 15. 14 vs 15 behaving differently does sound consistent with: https://sourceware.org/ml/gdb-patches/2018-06/msg00167.html Thanks, Pedro Alves