class FfxDebugAgentBridge

Defined at line 28 of file ../../src/developer/debug/e2e_tests/ffx_debug_agent_bridge.h

This class is to RAII the sub-process for FFX that will spawn the socket

connections the host side of the debugger needs in order to speak to the FIDL

protocol implemented in DebugAgent.

Specifically, this will:

1. Create a UNIX pipe with two file descriptors.

2. Fork the process and exec `ffx debug connect --agent-only`.

3. The write end of the pipe will go to the child and dup STDOUT.

4. The read end of the pipe will go to the parent.

5. Close both the read and write ends of the pipe in the parent.

6. Close both the read and write ends of the pipe in the child.

7. After all tests have run, this will be destructed and issue a SIGTERM to

the ffx command to clean up the DebugAgent socket and files.

Public Methods

std::string_view GetDebugAgentSocketPath ()

Defined at line 45 of file ../../src/developer/debug/e2e_tests/ffx_debug_agent_bridge.h

void FfxDebugAgentBridge ()

Defined at line 181 of file ../../src/developer/debug/e2e_tests/ffx_debug_agent_bridge.cc

void ~FfxDebugAgentBridge ()

Defined at line 186 of file ../../src/developer/debug/e2e_tests/ffx_debug_agent_bridge.cc

void Cleanup ()

Unconditionally shutdown the bridge, and cleanup the child process. This function is signal

safe and can be called from a signal handler.

Defined at line 240 of file ../../src/developer/debug/e2e_tests/ffx_debug_agent_bridge.cc

Err Init ()

It is expected that this method is called once per test executable, and that many test cases

can be run with this object constructed before all cases and destructed after all cases.

Calling this method will involve fork-ing and exec-ing `ffx debug connect --agent-only`

with additional necessary parameters in infra builds to determine the proper target from the

environment. Locally, it is assumed that `fx set-device` has been used to configure which

device to use.

Defined at line 149 of file ../../src/developer/debug/e2e_tests/ffx_debug_agent_bridge.cc

FfxDebugAgentBridge * Get ()

Get the global instance or nullptr.

Defined at line 188 of file ../../src/developer/debug/e2e_tests/ffx_debug_agent_bridge.cc