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 more #488

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

Commits on Feb 28, 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 28, 2024
    Configuration menu
    Copy the full SHA
    473b019 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 28, 2024
    Configuration menu
    Copy the full SHA
    27d56ea 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 28, 2024
    Configuration menu
    Copy the full SHA
    e347004 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 28, 2024
    Configuration menu
    Copy the full SHA
    0aaef30 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 28, 2024
    Configuration menu
    Copy the full SHA
    d54ad49 View commit details
    Browse the repository at this point in the history