Skip to content

Conversation

vrukesh
Copy link
Contributor

@vrukesh vrukesh commented Jun 5, 2025

Update run_fvp and run_qemu scripts, to capture and return the stdout and stderr to the calling functions.
This can also be useful for automation, and viewing the error strings.

@vrukesh vrukesh force-pushed the vrukesh_atfe_data_error branch from 9e05623 to 519ddef Compare July 15, 2025 12:19
@vrukesh vrukesh requested a review from a team as a code owner July 15, 2025 12:19
@vrukesh vrukesh force-pushed the vrukesh_atfe_data_error branch from 519ddef to 917487c Compare July 15, 2025 12:21
@@ -212,4 +212,4 @@ def run_fvp(
result_stdout = result.stdout

sys.stdout.buffer.write(result_stdout)
return result.returncode
return result.returncode, result.stdout.decode(), result.stderr.decode() if result.stderr != None else ""
Copy link
Contributor

Choose a reason for hiding this comment

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

In this kind of situation it's a good idea to add the errors='replace' argument to the decode calls. Then any bytes that aren't legal UTF-8 will be turned into a Unicode replacement character � instead of causing an exception.

If the program under test does emit invalid UTF-8, we still want to see in the log file what it was, so that we can get a clue about what went wrong. A Python exception that stops the script from showing us the useful detail isn't good for anyone.

@vrukesh vrukesh force-pushed the vrukesh_atfe_data_error branch from 917487c to cc8e173 Compare July 28, 2025 12:54
@vrukesh vrukesh force-pushed the vrukesh_atfe_data_error branch from cc8e173 to 4efbe39 Compare August 7, 2025 14:32
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