Skip to content
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

FW/child_debug: use std::string #482

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Feb 15, 2024

  1. FW/Logging: make log_message_preformatted() public

    So we can use it where no formatting is needed elsewhere in the
    framework.
    
    Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
    thiagomacieira committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    ea88ef9 View commit details
    Browse the repository at this point in the history
  2. FW/child_debug: Use the new std::string-based API for dumping context

    This removes `open_memstream()` on Unix systems and more importantly,
    removes the need for an actual temporary file on Windows.
    
    Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
    thiagomacieira committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    9cc9b7b View commit details
    Browse the repository at this point in the history
  3. FW/child_debug: use std::string for gdb communication too

    We were using a plain file descriptor because that allowed us to use
    `splice()` straight from the pipe to the backing file, in case the
    backtrace was big. But that's really unnecessary and was a source of
    bugs because the non-Linux code was never tested.
    
    Replace with direct std::string and move up the location where we call
    the logging functions to outside of the GDB communication loop.
    
    Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
    thiagomacieira committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    5e96b99 View commit details
    Browse the repository at this point in the history
  4. FW/child_debug: also use std::string for running ps

    This removes the last user of LoggingStream.
    
    Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
    thiagomacieira committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    a3c998e View commit details
    Browse the repository at this point in the history
  5. FW/Logging: remove LoggingStream class

    All its uses have been replaced with `log_message_preformatted()`.
    That's slighty less efficient because we must read into our own buffers
    before writing to the log file, something we are going to do anyway. But
    it simplifies the codebase and reduces the number of system calls.
    
    Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
    thiagomacieira committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    3ad6253 View commit details
    Browse the repository at this point in the history