Repository navigation
n64sym: run objdump without a shell - #2
Closed
soft-circles wants to merge 1 commit into
Closed
soft-circles wants to merge 1 commit into
soft-circles wants to merge 1 commit into
Conversation
n64sym ran objdump through popen() with the N64_INST prefix and the ELF path pasted unquoted into a shell command line, so a space (or any shell metacharacter) in either one broke symbol generation, eg: sh: /path/with/spaced: No such file or directory Error: objdump failed Run objdump through subprocess_create() with an argument vector, as the addr2line workers already are. objdump's error output is still forwarded to stderr, and the generated .sym files are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Closing: this was opened prematurely on our side. Apologies for the noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
n64sym runs objdump through
popen(), with$N64_INSTand the ELF path pasted unquoted into the command line. Aspace (or any other shell metacharacter) in either one breaks symbol generation:
addr2line was already run through
subprocess_create()with an argument vector, so only the two objdump calls(
-tand-d) were affected.This PR runs objdump the same way, through two small helpers:
objdump_start()andobjdump_finish().popen().file format not recognizedstill reach the user.__MINGW32__branch aroundpclose().-v, theRunning:lines are unchanged.Testing was done on macOS with Apple clang. The tools build with
-Werror. Each check ran on this branch and onc79a52b42..symoutput is byte-identical to the unfixed tool on three ROM ELFs. Each ELF was checked with the defaultoptions,
--all,--no-inlinesand--all --no-inlines.N64_INSTand a relative or absolute spaced ELF path. The outputmatches and stderr is empty.
N64_INSTworks, for exampleN64_INST=sdk.$(...)and quotes works.Error: cannot run: .../mips64-elf-objdump.Error: objdump failed.Windows (MinGW) was not built or tested. subprocess.h already handles argument quoting there for addr2line.
🤖 Generated with Claude Code