From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by sourceware.org (Postfix) with ESMTPS id 1FE103858404 for ; Thu, 13 Oct 2022 11:21:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1FE103858404 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-wr1-f53.google.com with SMTP id bv10so2322664wrb.4 for ; Thu, 13 Oct 2022 04:21:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xhNEiNXasz0JHvINpMZZlzWyDN8EvGBSHoMOxPywoMY=; b=FRanXmOZiLCJWGjygbfE/k1zygK6dmv9LtqiqEfpE9rFvxPRTD3j4l4oQCh7hifSqY tN07/1+veyjaOzewW6rTdSyKTbf5WTFORJhpBhfhxQak9/Ws9soTOMUoSkDyrZT8Zddj hMC0xOGeVTz0KmuVF9knn94dSDxE3Xcb3GGOA3qPU/k6MFPVZVSZ585Q8f/UMhSjBEeQ g/Oryph43DFUI4hyfoiN9FoDYk3RzCZX0/ie0i7IpGABUjxlXID3nOwLyiH54bWyQ5hE 6LKOTbB7KNPG+PbrC+KTO+B6A3cIplC5VjdPmJoTpxUrePDBpPN7G5m3Wg75HGzDUqCz ud4w== X-Gm-Message-State: ACrzQf171mn8TYFgdcdwlT0hfPZIinmWepWlOm5Bkbv/SmFuUnwKa+EA YmiKdcLFa7dTraY2+ufilRh0qUULPmqEEWRX X-Google-Smtp-Source: AMsMyM6JCUY6TS0ELDmTdKyfcFanKYZjnkoQoNB/mvGBa2+lTnumnRTOCJUt5lXQyKRISZRdNI63zg== X-Received: by 2002:adf:e64a:0:b0:22c:db6c:5b72 with SMTP id b10-20020adfe64a000000b0022cdb6c5b72mr22421837wrn.356.1665660108080; Thu, 13 Oct 2022 04:21:48 -0700 (PDT) Received: from ?IPv6:2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653? ([2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653]) by smtp.gmail.com with ESMTPSA id k8-20020a05600c1c8800b003b47e75b401sm4094395wms.37.2022.10.13.04.21.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 13 Oct 2022 04:21:47 -0700 (PDT) Subject: Re: [PATCH v2] gdb/arm: Stop unwinding on error, but do not assert To: =?UTF-8?Q?Torbj=c3=b6rn_SVENSSON?= , gdb-patches@sourceware.org References: <20221013091740.645783-1-torbjorn.svensson@foss.st.com> From: Pedro Alves Message-ID: <9cc66b68-94b4-ed24-f4b5-93a441b8a70d@palves.net> Date: Thu, 13 Oct 2022 12:21:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20221013091740.645783-1-torbjorn.svensson@foss.st.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.6 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, 13 Oct 2022 11:21:51 -0000 On 2022-10-13 10:17 a.m., Torbjörn SVENSSON via Gdb-patches wrote: > + /* Unwind of this frame is not possible. Return outer_frame_id to stop the > + unwinding. */ > + if (cache == NULL) > + { > + *this_id = outer_frame_id; > + return; > + } Please let's not add more uses of outer_frame_id if we can avoid it. We're getting close to eliminating it. Can a cache object still be returned, and then a frame id be successfully computed? You can stop the unwinding in some other way. For example, arm_m_exception_cache has a few of these: /* Terminate any further stack unwinding by referring to self. */ arm_cache_set_active_sp_value (cache, tdep, sp); return cache; (Not sure exactly how that works.) Alternatively, you can implement a frame_unwind::stop_reason callback and return UNWIND_OUTERMOST, which is already done in arm-tdep.c in other scenarios too.