Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Lancelot SIX <Lancelot.Six@amd.com>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH 3/3] gdb/amd-dbgapi: add displaced stepping support
Date: Wed, 15 Jan 2025 13:45:09 -0500	[thread overview]
Message-ID: <9018b77a-df87-49d5-ad26-2d84fe4789f7@polymtl.ca> (raw)
In-Reply-To: <8097b8ac-7d99-4472-bc59-599a358e8ede@amd.com>

>> 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 <http://www.gnu.org/licenses/>.
>> +
>> +# 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 <lancelot.six@amd.com> (amdgpu)

Thanks, added.

Simon

  reply	other threads:[~2025-01-15 18:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-14 19:16 [PATCH 0/3] Add displaced stepping support for AMD GPUs simon.marchi
2025-01-14 19:16 ` [PATCH 1/3] gdb/amd-dbgapi: use gdb::unordered_map simon.marchi
2025-01-15 10:55   ` Lancelot SIX
2025-01-15 18:41     ` Simon Marchi
2025-01-15 18:46       ` Simon Marchi
2025-01-15 18:50         ` Guinevere Larsen
2025-01-15 18:55       ` Lancelot SIX
2025-01-14 19:16 ` [PATCH 2/3] gdb: add target displaced stepping support simon.marchi
2025-01-14 19:16 ` [PATCH 3/3] gdb/amd-dbgapi: add " simon.marchi
2025-01-15 11:02   ` Lancelot SIX
2025-01-15 18:45     ` Simon Marchi [this message]
2025-02-25 17:17       ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9018b77a-df87-49d5-ad26-2d84fe4789f7@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=Lancelot.Six@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox