From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0BC713858410 for ; Wed, 25 Jan 2023 12:01:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0BC713858410 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674648109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oJlN8Ro0d76o8I1BowISrc0ji2muY3P3IgKsPHSNfdI=; b=QGtjbp94HGsbPWx0yqlpBxFI2x+zuhYeVYepDR3wkP1xwR/5RYaLy5Xq2U4bKIkZ2H2W+Y AvuukB0SwqREwOzXHI24fuh527lyfGafO40ghRxua/kJh2wTmeOxgFve5VhBxVLCUdNw2k Umr+aQlHNfU2/SQAKIiiruUA7dsMS80= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-601-KtfFJLejOqW5fqty7LLu7g-1; Wed, 25 Jan 2023 07:01:47 -0500 X-MC-Unique: KtfFJLejOqW5fqty7LLu7g-1 Received: by mail-qv1-f71.google.com with SMTP id px22-20020a056214051600b00537657b0449so2877516qvb.23 for ; Wed, 25 Jan 2023 04:01:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oJlN8Ro0d76o8I1BowISrc0ji2muY3P3IgKsPHSNfdI=; b=cOi8/Me6xBXCfnnFH4lX3dVI6HEemDMMrPgbEXiboK2jyAzCMf9R+NUBSTL/5OQPLN VT6HPbs8vaKCJ5gmlYXOj47j7YN9KyIf7+S9iznjNs+5TLj5Ufk80wffphwOdgZ8fmU9 c6KVyU+Y5Y+TN+6eTu57DtTFIvQJPiH/rPfEFtZ4BKyUBqPC4ibHi238opaEhe1ycrx+ tT6sNiQYT2mJh7Tpl2BDO9lc1z934GN9FJyilzZz7gJ63yyFXUwh8aJz+pkX5NUDkcXa QNrsRwzkgVYSxfw519j2Wll9qVyrRNI6c4z3uEuabseEwVVBLHUPeRS2t5W2IjnLJ7KM f/Bg== X-Gm-Message-State: AO0yUKXDor8k1FbqYSnc2hfiUPrfbRHk/HWdAmrrameWkEcVc80IiviI 7qq+C0sHiAtAA9co03TZhnPpPxo9KvVFjf+g9O7NJOESy47uTFVdPgaXe2FNOhlbAON3tOiqKOG pYDO90vNyiYjqe9aQPWi9LfzneRzjwbJu++dxTdE0BSjfD1dbvrG+wtZoYZIuOJSnDJM0VdduXA == X-Received: by 2002:a05:622a:5d4:b0:3a7:ec99:56e4 with SMTP id d20-20020a05622a05d400b003a7ec9956e4mr3396563qtb.39.1674648107055; Wed, 25 Jan 2023 04:01:47 -0800 (PST) X-Google-Smtp-Source: AK7set8HrrRLPkErq0J+OwrOdn2rt+g1aRKSWIv9W24i+buHZRF5oflh/vcRr8F+fMaxzNVtLSDg8Q== X-Received: by 2002:a05:622a:5d4:b0:3a7:ec99:56e4 with SMTP id d20-20020a05622a05d400b003a7ec9956e4mr3396539qtb.39.1674648106745; Wed, 25 Jan 2023 04:01:46 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id t37-20020a05622a182500b003b63c9c59easm3223603qtc.97.2023.01.25.04.01.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 04:01:46 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: Re: [PATCH 15/15] gdb/tui: make use of a scoped_restore In-Reply-To: <086366914f866559bc26512dfc67cf1f9fae2964.1673000632.git.aburgess@redhat.com> References: <086366914f866559bc26512dfc67cf1f9fae2964.1673000632.git.aburgess@redhat.com> Date: Wed, 25 Jan 2023 12:01:44 +0000 Message-ID: <878rhqx1p3.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 List-Id: Andrew Burgess writes: > Make use of a scoped_restore object in tui_mld_read_key instead of > doing a manual save/restore. > > I don't think the existing code can throw an exception, so this is > just a cleanup rather than a bug fix. > > There should be no user visible changes after this commit. I've gone ahead and pushed this patch. Thanks, Andrew > --- > gdb/tui/tui-io.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c > index 2f39e34df2f..a17cf38a1f2 100644 > --- a/gdb/tui/tui-io.c > +++ b/gdb/tui/tui-io.c > @@ -773,14 +773,10 @@ tui_mld_getc (FILE *fp) > static int > tui_mld_read_key (const struct match_list_displayer *displayer) > { > - rl_getc_func_t *prev = rl_getc_function; > - int c; > - > /* We can't use tui_getc as we need NEWLINE to not get emitted. */ > - rl_getc_function = tui_mld_getc; > - c = rl_read_key (); > - rl_getc_function = prev; > - return c; > + scoped_restore restore_getc_function > + = make_scoped_restore (&rl_getc_function, tui_mld_getc); > + return rl_read_key (); > } > > /* TUI version of rl_completion_display_matches_hook. > -- > 2.25.4