Skip to content

Conversation

@simark
Copy link
Contributor

@simark simark commented Sep 4, 2025

This doesn't work:

$ isolate-gpu -d 2 ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.rocm/simple/simple -ex "with breakpoint pending on -- break do_an_addition"
Excess command line arguments ignored. (pending ...)
Reading symbols from testsuite/outputs/gdb.rocm/simple/simple...
/home/smarchi/build/binutils-gdb-amd-staging/gdb/breakpoint: No such file or directory.
Missing arguments.
(gdb)

The argument "with breakpoint ..." gets split along the way. Fix it by using bash-specific array substitution to avoid it. Arrays are a bash specific feature, so change the shebang to bash (which IMO is fine, it's rare not to have bash installed).

Change the "else" portion just to match the style of the "if" section.

With this patch, I get the expected:

$ isolate-gpu -d 2 ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.rocm/simple/simple -ex "with breakpoint pending on -- break do_an_addition"
Reading symbols from testsuite/outputs/gdb.rocm/simple/simple...
Function "do_an_addition" not defined.
Breakpoint 1 (do_an_addition) pending.
(gdb)

@simark
Copy link
Contributor Author

simark commented Sep 5, 2025

Also, regarding the use of bash: it is already used in entrypoint.sh.

Copy link
Owner

@palves palves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch. Definitely a "doh" on my end to use "$*" here. A couple comments.

@palves
Copy link
Owner

palves commented Sep 6, 2025

Also, regarding the use of bash: it is already used in entrypoint.sh.

But it isn't? I guess you really meant isolate-gpu.

This doesn't work:

    $ isolate-gpu -d 2 ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.rocm/simple/simple -ex "with breakpoint pending on -- break do_an_addition"
    Excess command line arguments ignored. (pending ...)
    Reading symbols from testsuite/outputs/gdb.rocm/simple/simple...
    /home/smarchi/build/binutils-gdb-amd-staging/gdb/breakpoint: No such file or directory.
    Missing arguments.
    (gdb)

The argument `"with breakpoint ..."` gets split along the way.  Fix it
by using "$@", which doesn't split the args that contain spaces.

Change the "else" portion just to match the style of the "if" section.

With this patch, I get the expected:

    $ isolate-gpu -d 2 ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.rocm/simple/simple -ex "with breakpoint pending on -- break do_an_addition"
    Reading symbols from testsuite/outputs/gdb.rocm/simple/simple...
    Function "do_an_addition" not defined.
    Breakpoint 1 (do_an_addition) pending.
    (gdb)
@simark
Copy link
Contributor Author

simark commented Sep 7, 2025

Also, regarding the use of bash: it is already used in entrypoint.sh.

But it isn't? I guess you really meant isolate-gpu.

Yeah that's what I meant.

@simark
Copy link
Contributor Author

simark commented Sep 7, 2025

Force pushed.

@palves palves merged commit b65ed0d into palves:main Sep 7, 2025
@palves
Copy link
Owner

palves commented Sep 7, 2025

Merged, released, and pushed to docker hub. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants