Skip to content

fix(gdb): fix regression that fails to generate command names #1101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

akinomyoga
Copy link
Collaborator

The current version fails to generate any command names for the first word after the command name "gdb". This is a regression introduced in #1086 and pointed out in the comment: 73c5292#r138406647.

The current version fails to generate any command names for the first
word after the command name "gdb".  This is a regression introduced in

scop#1086

and pointed out in the comment:

scop@73c5292#r138406647

Co-authored-by: Grisha Levit <grishalevit@gmail.com>
Copy link
Owner

@scop scop left a comment

Choose a reason for hiding this comment

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

Thanks!

@scop scop merged commit ca8e240 into scop:master Feb 8, 2024
@akinomyoga akinomyoga deleted the fix-gdb-cmdname branch February 8, 2024 09:21
@akinomyoga
Copy link
Collaborator Author

Thank you! However, the CI doesn't seem to pass actually. In making the test, I assumed that awk would be always found in PATH, but it doesn't seem to work in the alpine container. I'll later take a look.

@akinomyoga
Copy link
Collaborator Author

but it doesn't seem to work in the alpine container. I'll later take a look.

_comp_compgen_split -o plusdirs -- "$(
find ${path_array[@]+"${path_array[@]}"} . -mindepth 1 \
-maxdepth 1 -not -type d -executable -printf '%f\n' \
2>/dev/null
)"

The find command in the alpine container doesn't have the operator -printf. According to POSIX [1], -mindepth is not POSIX, -maxdepth is not POSIX, -not is not POSIX, -executable is not POSIX, and -printf is not POSIX. Only -type out of the six operators used in this implementation is POSIX-compatible.

It didn't cause an error before because it's never been tested.

@scop
Copy link
Owner

scop commented Feb 8, 2024

I suppose we could use require_cmd=True and gdb as the test command.

@akinomyoga
Copy link
Collaborator Author

I suppose we could use require_cmd=True and gdb as the test command.

Ah, yeah. That is clever.

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