Home | History | Annotate | Download | only in gdbrunner

Lines Matching refs:device

28     """ArgumentParser subclass that provides adb device selection."""
36 group = self.add_argument_group(title="device selection")
39 "-a", action="store_const", dest="device", const="-a",
42 "-d", action="store_const", dest="device", const="-d",
43 help="directs commands to the only connected USB device")
45 "-e", action="store_const", dest="device", const="-e",
49 help="directs commands to device/emulator with the given serial")
67 if result.device == "-a":
68 result.device = adb.get_device(adb_path=adb_path)
69 elif result.device == "-d":
70 result.device = adb.get_usb_device(adb_path=adb_path)
71 elif result.device == "-e":
72 result.device = adb.get_emulator_device(adb_path=adb_path)
74 result.device = adb.get_device(result.serial, adb_path=adb_path)
76 # Don't error out if we can't find a device.
77 result.device = None
93 def get_processes(device):
94 """Return a dict from process name to list of running PIDs on the device."""
100 # Perform the check for this on the device to avoid an adb roundtrip
115 output, _ = device.shell([ps_script])
136 def get_pids(device, process_name):
137 processes = get_processes(device)
141 def start_gdbserver(device, gdbserver_local_path, gdbserver_remote_path,
146 device: ADB device to start gdbserver on.
148 gdbserver_remote_path: Device path to push gdbserver to.
149 target_pid: PID of device process to attach to.
150 run_cmd: Command to run on the device.
151 debug_socket: Device path to place gdbserver unix domain socket.
153 user: Device user to run gdbserver as.
163 device.push(gdbserver_local_path, gdbserver_remote_path)
174 device.forward("tcp:{}".format(port),
176 atexit.register(lambda: device.forward_remove("tcp:{}".format(port)))
184 return device.shell_popen(gdbserver_cmd, stdout=gdbclient_output,
188 def find_file(device, executable_path, sysroot, user=None):
189 """Finds a device executable file.
193 downloading the stripped file from the device.
196 device: the AndroidDevice object to use.
213 # First look locally to avoid shelling into the device if possible.
219 target = device.shell(['readlink', '-e', '-n', executable_path])[0]
224 # Last, download the stripped executable from the device if necessary.
231 device.shell(cmd)
234 "device".format(executable_path))
235 device.pull(remote_temp_path, local_path)
244 def find_binary(device, pid, sysroot, user=None):
245 """Finds a device executable file corresponding to |pid|."""
246 return find_file(device, "/proc/{}/exe".format(pid), sysroot, user)