Skip to content

dev: Expose serial terminal listen address to Python#3205

Open
OmeletWithoutEgg wants to merge 1 commit into
gem5:developfrom
OmeletWithoutEgg:develop
Open

dev: Expose serial terminal listen address to Python#3205
OmeletWithoutEgg wants to merge 1 commit into
gem5:developfrom
OmeletWithoutEgg:develop

Conversation

@OmeletWithoutEgg
Copy link
Copy Markdown

This patch adds a getListenerOutput() interface to the Terminal object to retrieve the actual bound address after potential runtime increments.

This allows external tools to accurately detect serial terminals regardless of TCP or UNIX socket usage.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a C++/Python-accessible accessor to retrieve the current serial terminal listener output, enabling external inspection/debugging of terminal capture state.

Changes:

  • Added Terminal::getListenerOutput() to surface listener output as a std::string.
  • Implemented the new method by streaming listener output into a std::stringstream.
  • Exposed the method on the Python Terminal SimObject via @cxxMethod.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/dev/serial/terminal.hh Declares new getListenerOutput() API on Terminal.
src/dev/serial/terminal.cc Implements getListenerOutput() by collecting listener output into a string.
src/dev/serial/Terminal.py Exposes getListenerOutput() to Python via cxxMethod.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +362 to +364
if (!listener) {
return "not listening";
}
Comment on lines +366 to +368
std::stringstream ss;
listener->output(ss);
return ss.str();
///////////////////////
// Terminal Interface

std::string getListenerOutput() const;
@erin-le erin-le added the dev General gem5 development code. Found in "src/dev" label Jun 4, 2026
This patch adds a `getListenerOutput()` interface to the Terminal object
to retrieve the actual bound address after potential runtime increments.

This allows external tools to accurately detect serial terminals regardless
of TCP or UNIX socket usage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev General gem5 development code. Found in "src/dev"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants