Records

Functions

  • fbl::unique_fd OpenPidfd (int pid)

    Wrapper around pidfd_open.

    Defined at line 72 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • std::optional<user_regs_struct> ReadGeneralRegisters (int pid)

    Defined at line 74 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • zx_status_t WriteGeneralRegisters (int pid, const user_regs_struct & regs)

    Defined at line 86 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • std::vector<MapEntry> ParseMaps (const std::string & contents)

    Parse/read the given Linux maps file.

    Defined at line 95 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • std::vector<MapEntry> GetMaps (int pid)

    Defined at line 133 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • std::map<std::string, std::string> ParseStatus (const std::string & contents)

    Parse/read the given Linux status file (this is "status" with key/value pairs and not the "stat"

    file that's just numbers). Returns an empty may on failure (the process doesn't exist or

    something).

    Defined at line 135 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • std::map<std::string, std::string> GetStatus (int pid)

    Defined at line 168 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • std::string GetExe (int pid)

    Returns the executable file name as defined in /proc/

    <pid

    >/exe. Empty on failure.

    Defined at line 172 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • std::vector<std::string> GetCommandLine (int pid)

    Returns the command line for the given process. Will be empty on failure.

    Defined at line 184 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • uint64_t GetLdSoLoadAddress (int pid)

    Returns the load address of the ld.so for the given process ID. Returns 0 on failure.

    Defined at line 190 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • std::optional<LdSoInfo> GetLdSoInfo (int pid)

    Defined at line 192 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • uint64_t GetLdSoDebugAddress (int pid)

    Returns the ld.so debug address in memory for the given process. Returns 0 if not found.

    Defined at line 204 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • uint64_t GetLdSoBreakpointAddress (int pid)

    Returns the address at which to set a breakpoint to observe load events for the given process.

    Returns 0 if not found.

    Defined at line 214 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • std::map<uint64_t, uint64_t> ReadAuxv (int pid)

    Reads the contents of /proc/

    <pid

    >/auxv and returns the key/value store. The keys are AT_*

    constants from

    <linux

    /auxvec.h>. Returns the empty map on failure.

    Defined at line 224 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • std::optional<ThreadHandle::State> ThreadStateFromLinuxState (const std::string & linux_state)

    Decodes the value of a /proc/status "State" line. Returns nullopt if parsing failed.

    Defined at line 237 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • std::vector<int> GetDirectoryPids (const std::filesystem::path & path)

    Returns a vector of all numeric subdirectories in the given path. The path is specifyable to

    support enumerating the "task" subdirectory of a process as well as the toplevel processes.

    Defined at line 271 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • std::string SignalToString (int signal, bool include_number)

    Returns the string for the given signal name. If include_number is set, this also includes the

    numeric signal number.

    Defined at line 284 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • uint64_t GetLdSoDebugRelativeAddress (const std::string & ld_so_path)

    Given a local path to the dynamic loader on disk, returns the address (relative to the beginning

    of the module in memory) of the debug address or load breakpoint address.

    The Fuchsia loader does not expose these symbols which is why they're in a Linux-specific file.

    Defined at line 331 of file ../../src/developer/debug/debug_agent/linux_utils.cc

  • uint64_t GetLdSoBreakpointRelativeAddress (const std::string & ld_so_path)

    Defined at line 344 of file ../../src/developer/debug/debug_agent/linux_utils.cc