Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Bratislav Filipovic <bfilipov@amd.com>, gdb-patches@sourceware.org
Cc: luis.machado.foss@gmail.com, Lancelot.Six@amd.com,
	TankutBaris.Aktemur@amd.com, pedro@palves.net
Subject: Re: [PATCH] gdb: Implement stop-on-solib-events for GPU code objects
Date: Mon, 28 Sep 2026 16:03:10 -0400	[thread overview]
Message-ID: <c377f0e7-5613-4e6b-ac2b-b87f43437e5b@simark.ca> (raw)
In-Reply-To: <20260924130451.89610-1-bfilipov@amd.com>

On 9/24/26 9:04 AM, Bratislav Filipovic wrote:
> GDB's "set stop-on-solib-events 1" setting allows users to stop execution
> when shared libraries are loaded or unloaded, enabling inspection and
> breakpoint placement before library code executes. This feature works for
> CPU shared libraries but is not working for GPU code objects loaded by the
> AMD ROCm runtime.
> 
> This commit implements stop-on-solib-events support for GPU code objects,
> making GPU code object load/unload events behave consistently with CPU
> shared library events.
> 
> The root cause is in amd_dbgapi_target_breakpoint::check_status(), which
> unconditionally sets bs->stop = 0 and bs->print_it = print_it_noop,
> regardless of the stop_on_solib_events setting. This is in contrast to
> internal_breakpoint::check_status() for CPU shared libraries, which
> respects the setting.
> 
> The fix includes:
> 
> 1. Generalize print_solib_event() function to eliminate code duplication
>    between CPU and GPU event printing. The function now accepts parameters
>    for event description, field names, and plural forms. This reduces
>    ~50 lines of duplicated code.

You indeed generalized print_solib_event, but
amd_dbgapi_target_breakpoint::print_it still contains the duplicated
code, and doesn't use print_solib_event.  I guess you are missing a
piece of the change.

Simon

  reply	other threads:[~2026-09-28 20:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 13:04 Bratislav Filipovic
2026-09-28 20:03 ` Simon Marchi [this message]
2026-09-28 20:33 ` 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=c377f0e7-5613-4e6b-ac2b-b87f43437e5b@simark.ca \
    --to=simark@simark.ca \
    --cc=Lancelot.Six@amd.com \
    --cc=TankutBaris.Aktemur@amd.com \
    --cc=bfilipov@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado.foss@gmail.com \
    --cc=pedro@palves.net \
    /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