From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by sourceware.org (Postfix) with ESMTPS id 72E5738B67B7 for ; Mon, 13 Nov 2023 14:09:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 72E5738B67B7 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 72E5738B67B7 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699884567; cv=none; b=G2pRf3LJPq7Yi+d//584EcbmO07jNBG8DcVJpmzxVxPhscQxbcHtvDIfD+xSPWToBazMH9a8AD+6p/jjB+Gdf9ib3mZgxea/5eZvapNEVaL8E8YsvK8QHaAvQXdaWFbLGy3kTiABne6Vr5nPqQrD7KPv+a4v/maEoIrI82tC9kM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699884567; c=relaxed/simple; bh=oOyIhU0JlVnPfgyMeq1Yfp2EA7qCHgrqF3/7YsPNLkk=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=I5nGPr3d9J7JfxB9AlQmkI8sTzT5XRIN6rH2Bjhn2f9DeqtRltcxnH7JCPICL/9hmPsHyqeZFOD6jnJqejNibFKPh5dagQLuH4lcgy4uXBr68K9jN4WQ659P9UZrQDIxypPhsAKbmbN7zMatUnvsxef3BiVVRrmqpDUwWOkTTFw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-32fdc5be26dso2714729f8f.2 for ; Mon, 13 Nov 2023 06:09:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699884564; x=1700489364; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hGIPR/uHpjXw+wQTwDfek/qqo7ZZ25m24FYXNKuB24w=; b=n0DsRzxFXk68lS2jSCPd4dhkdMCYikF3AczR/9m/DZo86PsgocfZlPxE2S2qVPwGFG Sbn0Hd2Q2K14jYclvL7y3t7ccSeeorWfFX1+sopyccHc88//f6dji4fSrVlEWgWhHWew 4qLnqw3li7V8g/c890TlNk8G0VbmNMorNg1svM44EyW7A39B/AwH166PvVgi3EmW+ymz BE36YEWM8EuB6XpFoRgE3yNApvYNL8cc6QR12+h+vHTcUOisSpCKDFeOJ64sYY2/nN+2 4/xrxC69D2sc1YTNyYuMczCIOQCQxguV2Su+qbphw4jQiNx3Gw1NWJLwELBLeSbasruX 82VA== X-Gm-Message-State: AOJu0Yxx7zTg7CEFNazmStNNhWcPgRtaRljZ+uq66O0J0Zk9SKmqYkax Frlpj17H7uGr7qTYv0FxdAFCccrsxmE= X-Google-Smtp-Source: AGHT+IE4Zz8VydBRbMiMsCq8LrKepaKpLXR+ArU/5v0hEDZ8rBMpM3axvJfJtvmBVAlH1tofhgsWEg== X-Received: by 2002:adf:a35a:0:b0:32f:bf1e:cf1f with SMTP id d26-20020adfa35a000000b0032fbf1ecf1fmr3515390wrb.18.1699884564022; Mon, 13 Nov 2023 06:09:24 -0800 (PST) Received: from ?IPV6:2001:8a0:f91e:1a00:8060:1e54:fb28:9635? ([2001:8a0:f91e:1a00:8060:1e54:fb28:9635]) by smtp.gmail.com with ESMTPSA id w7-20020adff9c7000000b0032fbd0c7d04sm5525593wrr.55.2023.11.13.06.09.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Nov 2023 06:09:23 -0800 (PST) Message-ID: <711f9c6f-704c-4ab9-9e7c-38e985085fd9@palves.net> Date: Mon, 13 Nov 2023 14:09:23 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 13/31] Add test for stepping over clone syscall Content-Language: en-US To: Andrew Burgess , gdb-patches@sourceware.org References: <20221212203101.1034916-1-pedro@palves.net> <20221212203101.1034916-14-pedro@palves.net> <8735331856.fsf@redhat.com> From: Pedro Alves In-Reply-To: <8735331856.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_SHORT,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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-06-07 18:42, Andrew Burgess wrote: > Pedro Alves writes: >> +++ b/gdb/testsuite/gdb.threads/stepi-over-clone.c >> @@ -0,0 +1,90 @@ >> +/* This testcase is part of GDB, the GNU debugger. >> + >> + Copyright 2021-2022 Free Software Foundation, Inc. > > lets see if we can land this in 2023! Fixed. :-) >> --- /dev/null >> +++ b/gdb/testsuite/gdb.threads/stepi-over-clone.exp >> @@ -0,0 +1,392 @@ >> +# Copyright 2021-2022 Free Software Foundation, Inc. > > Date range again. Fixed. > >> + >> +# This program is free software; you can redistribute it and/or modify >> +# it under the terms of the GNU General Public License as published by >> +# the Free Software Foundation; either version 3 of the License, or >> +# (at your option) any later version. >> +# >> +# This program is distributed in the hope that it will be useful, >> +# but WITHOUT ANY WARRANTY; without even the implied warranty of >> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> +# GNU General Public License for more details. >> +# >> +# You should have received a copy of the GNU General Public License >> +# along with this program. If not, see . >> + >> +# Test performing a 'stepi' over a clone syscall instruction. >> + >> +# This test relies on us being able to spot syscall instructions in >> +# disassembly output. For now this is only implemented for x86-64. >> +if { ![istarget x86_64-*-* ] } { >> + return >> +} > > This will need updating to the new 'require' mechanism. Done. > >> + >> +standard_testfile >> + >> +if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ >> + {debug pthreads additional_flags=-static}] } { >> + return >> +} >> + >> +if {![runto_main]} { >> + return >> +} >> + >> +# Arrange to catch the 'clone' syscall, run until we catch the >> +# syscall, and try to figure out the address of the actual syscall >> +# instruction so we can place a breakpoint at this address. >> + >> +gdb_test_multiple "catch syscall clone" "" { >> + -re "The feature \'catch syscall\' is not supported.*\r\n$gdb_prompt $" { >> + set supported 0 >> + pass $gdb_test_name >> + return > > I know the mistakes here are mine rather than yours, but ... > > ... the 'set supported 0' appears to be pointless. And given we are > returning here due to some feature not being supported, I think we > should drop the 'pass $gdb_test_name' and instead do something like > 'unsupported "unable to catch clone syscall"' before the return. > I changed it to this: gdb_test_multiple "catch syscall group:process" "catch process syscalls" { -re "The feature \'catch syscall\' is not supported.*\r\n$gdb_prompt $" { unsupported $gdb_test_name return } -re ".*$gdb_prompt $" { pass $gdb_test_name } } ... so we have the same message for unsupported/pass. > Otherwise, LGTM. > > Reviewed-By: Andrew Burgess Thanks!