Skip to content

Simulator: native-app log() output never reaches get_log_buffer() #10

Description

@jeffory

Problem

tramp_sys_log in simulator/unicorn_trampolines.c (~line 1132) — the trampoline that services log() calls from a native ELF app — prints directly to the simulator process's own stdout and never calls sim_log_append().

By contrast, the Lua path does call it: l_sys_log in src/os/lua_bridge_sys.c calls sim_log_append(msg) when built with PICOS_SIMULATOR defined.

Impact

get_log_buffer() / wait_for_log() (the simulator RPCs e2e tests use to observe app output) can never see anything a native app logs, no matter how long a test waits. Every e2e test targeting a native ELF app has to scrape the subprocess's raw stdout/stderr pipes instead of using the log-buffer RPCs that Lua-app tests get to use — an inconsistent and more fragile testing surface depending on app type.

Suggested direction

Call sim_log_append() from tramp_sys_log, mirroring what l_sys_log already does for Lua apps, so both app types report through the same channel.

Context

Surfaced while implementing Stage 0/1 of the C-Dogs asset-memory redesign (local specs, not tracked in this repo) — C-Dogs is a native ELF app. Parent commits e9b1622e..21a9b389.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions