From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cPktDmICiGeANhAAWB0awg (envelope-from ) for ; Wed, 15 Jan 2025 13:45:54 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=default header.b=tyyNnur4; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 36CEF1E100; Wed, 15 Jan 2025 13:45:54 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A5B371E05C for ; Wed, 15 Jan 2025 13:45:53 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 52A223851AB4 for ; Wed, 15 Jan 2025 18:45:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 52A223851AB4 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=default header.b=tyyNnur4 Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 6A48F3851AAF for ; Wed, 15 Jan 2025 18:45:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6A48F3851AAF Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6A48F3851AAF Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736966716; cv=none; b=oPh9szjhI+AvXzBjXiyJK8plgbPmFzwq21iKuqqGcXTNVMjdryupamYrd0iDn4u5DbxbrkMlpbkLCIF4cv8ICj8RKaDXyWT28eHNJK+8KiVxZiLyIfUKUAQeRrtLrMWDxX6FzVq8J+wlA5LmXmsRIErVaj/HnEfDQMmNFi2TVDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736966716; c=relaxed/simple; bh=NZKLMyUQoPkb9oSouV6kymq6CRP37HBIAB/kfXFRiE8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=wQjZ3BnfemDUzCpkDPhusKIVW9QDdrJoC3ncNtoRCFHRWI/wkcuwoP9qbew1UYlm45nMb3j6wagzCYAMqngB/Lgfu33iEAwR/XNoc0xQMgd/+l3nMJW2srcSdNVJjVFdkcP2ZoHraS10sgJrOrpb7ezyKWZh8P/c5uqdEvffXg0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A48F3851AAF Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 50FIjB0w000714 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Jan 2025 13:45:15 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 50FIjB0w000714 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1736966716; bh=A5cJ0ms6VTMEwvdiMeYSKcplHDCGa0FvtGYUQFHWW0I=; h=Date:Subject:To:Cc:From:In-Reply-To:From; b=tyyNnur4YVA7KN9kVmtQUdMQplKCiu9xmtjbp6vpLLSld9dU2TSfhH6Bb9Vuyg178 wewyGK1oH75/fSmqmwYMZF/PJ3anERxMXqCRgDuI+K8yIPEdFjPHEQ8185/r1SFlqc z53+JIRsrx20IU2f0AP8dGtlU45iS5rnmpLCx/xI= Received: by simark.ca (Postfix, from userid 112) id 10C701E105; Wed, 15 Jan 2025 13:45:11 -0500 (EST) Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id AEB691E05C; Wed, 15 Jan 2025 13:45:09 -0500 (EST) Message-ID: <9018b77a-df87-49d5-ad26-2d84fe4789f7@polymtl.ca> Date: Wed, 15 Jan 2025 13:45:09 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] gdb/amd-dbgapi: add displaced stepping support To: Lancelot SIX , gdb-patches@sourceware.org Cc: Simon Marchi References: <20250114191818.2393132-1-simon.marchi@polymtl.ca> <20250114191818.2393132-4-simon.marchi@polymtl.ca> <8097b8ac-7d99-4472-bc59-599a358e8ede@amd.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <8097b8ac-7d99-4472-bc59-599a358e8ede@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 15 Jan 2025 18:45:11 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >> diff --git a/gdb/testsuite/gdb.rocm/displaced-stepping.exp b/gdb/testsuite/gdb.rocm/displaced-stepping.exp >> new file mode 100644 >> index 000000000000..6b26e1adfd7a >> --- /dev/null >> +++ b/gdb/testsuite/gdb.rocm/displaced-stepping.exp >> @@ -0,0 +1,54 @@ >> +# Copyright 2024 Free Software Foundation, Inc. > > Should probably 2025. 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 displaced stepping on AMD GPUs. >> + >> +load_lib rocm.exp >> + >> +standard_testfile simple.cpp > > I though the usage in GDB testsuite was to not share the .cpp across multiple testcases. Should there be a displaced-stepping.cpp? For "hello world" style programs (which this one is) I don't really mind. But I will add displaced-stepping.cpp. > >> + >> +require allow_hipcc_tests >> + >> +# Since GDB doesn't yet understand DWARF expressions generated by the HIP >> +# compiler, purposefully generate the binary without debug info. >> +if {[build_executable "failed to prepare" $testfile $srcfile {hip}]} { >> + return >> +} >> + >> +proc do_test {} { >> + clean_restart $::binfile >> + >> + with_rocm_gpu_lock { >> + if ![runto_main] { >> + return >> + } >> + >> + gdb_test "with breakpoint pending on -- break do_an_addition" \ >> + "Breakpoint $::decimal \\(do_an_addition\\) pending." >> + >> + gdb_test "continue" \ >> + "Thread $::decimal hit Breakpoint $::decimal, $::hex in do_an_addition.*" >> + >> + gdb_test_no_output "set debug displaced on" >> + >> + gdb_test "stepi" "displaced_step_prepare_throw: prepared successfully.*$::hex in do_an_addition.*" > > Just to reduce the noise in the gdb.log file when running the continue, this could be > > gdb_test "with debug displaced on -- stepi" ... Good idea, I never remember to use "with". Done. > >> + >> + gdb_test "continue" \ >> + "Inferior 1 .* exited normally.*" \ >> + "continue to end" >> + } >> +} >> + >> +do_test >> -- >> 2.47.1 >> > > With those minor comments addressed, and given that it only touches amdgpu related code, > Approved-By: Lancelot Six (amdgpu) Thanks, added. Simon