From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by sourceware.org (Postfix) with ESMTPS id B14173858401 for ; Thu, 17 Mar 2022 16:26:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B14173858401 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f48.google.com with SMTP id q20so3429224wmq.1 for ; Thu, 17 Mar 2022 09:26:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=2hDJM5Lw29A6hKWOXOkk9mgcTPM1rbJ3IBE2yuc+DHs=; b=l0VhmqH3m8odBsgHJd0J64IVOZCyH7u75rZ15iSqw6n3Tj5Ht0S4lHLdHWt0FvhZd1 39+HRYISSAnRR6kcNbICegjI4Z5BTlbSrR0DsjrIeAW2K1LNUFVWZ/9DFjh0XG51sXEq OBaLpblSWtDWZvzDlTXkj/nWV1YA/SA67D+4rNUKnhjA3KLyhId2NfxOi6zfxxGmw3Iz PDoIo1Py2VuGenHn9ZWu8AxPl7l83dNslq0ea0PoAoXb0XJp5ns7Vm3NWHjiKUe/07vY x9PrqxiD3odUPu0sxAnG+BxLf2a9F8N4ThO9VUQJDFybvBYVmG4yTa1sBDH1d/rXOZmJ BWgw== X-Gm-Message-State: AOAM533le3oyzRKJTUPcLxUK5ghXvB6UJTO7J9zGrFmQnNkPcpjmSvj3 Y19mq8bhlIVvZG6MpNPaqM7IYADYGFqqwA== X-Google-Smtp-Source: ABdhPJz2x6T70q+3pjukPypGE8/S4wFxs4veRHLgMnmLBG1sUUsSbAEl1HtolpIeZqaQDRhpQNVO5w== X-Received: by 2002:a05:600c:1e1f:b0:38b:d7ea:99b9 with SMTP id ay31-20020a05600c1e1f00b0038bd7ea99b9mr4752467wmb.8.1647534368543; Thu, 17 Mar 2022 09:26:08 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id l12-20020a05600c4f0c00b0038be825b774sm5241095wmq.45.2022.03.17.09.26.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Mar 2022 09:26:07 -0700 (PDT) Message-ID: Date: Thu, 17 Mar 2022 16:26:06 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] Avoid harmful fall throughs in core_target::xfer_partial. Content-Language: en-US To: John Baldwin , gdb-patches@sourceware.org References: <20220316193604.89477-1-jhb@FreeBSD.org> <6c760756-3cc9-f024-f40a-f8b4a13e4418@FreeBSD.org> From: Pedro Alves In-Reply-To: <6c760756-3cc9-f024-f40a-f8b4a13e4418@FreeBSD.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2022 16:26:13 -0000 On 2022-03-17 16:23, John Baldwin wrote: > On 3/17/22 9:06 AM, Pedro Alves wrote: >> On 2022-03-16 19:36, John Baldwin wrote: >>> The cases for TARGET_OBJECT_LIBRARIES and TARGET_OBJECT_LIBRARIES_AIX >>> can try to fetch different data objects (such as >>> TARGET_OBJECT_SIGNAL_INFO) if gdbarch methods for the requested data >>> aren't present.  Replace case fallthroughs with an explicit goto to >>> the default case. >> >> This is OK.  I mean, I think it would be reasonable to instead return >> TARGET_XFER_E_IO -- it's what the other cases do (notice even TARGET_OBJECT_SIGNAL_INFO >> doesn't fallback to the beneath target if there's no gdbarch method installed), and the targets >> beneath (file and dummy) won't be returning any library anyhow.  OTOH, maybe some day we will >> teach GDB to read the list of libraries the program is linked with and load those before >> the program starts, and it's conceivable that we would do that at the file_stratum layer. > > I'm happy to do whichever.  I was trying to preserve the intent from when > TARGET_OBJECT_LIBRARIES was first added.  If there are no beneath targets that > handle these objects, then I think it probably is cleaner to just fail with > TARGET_XFER_E_IO for now and let explicit fall through logic be added in the > future when it is needed. Fine with me. Consider it pre-approved. Thanks.