@@ -1078,18 +1078,19 @@ def attach(target, gdbscript = '', exe = None, gdb_args = None, ssh = None, sysr
1078
1078
b'This will be echoed back\n'
1079
1079
>>> io.close()
1080
1080
1081
- As for attaching to remote gdbserver, assuming you have a socat server delivering
1082
- gdbserver: ``socat TCP-LISTEN:1336,reuseaddr,fork 'EXEC:"gdbserver :1337 /bin/bash"'``,
1083
- we can connect to gdbserver and attach to it: (Note that when connection with gdbserver
1084
- established, ``/bin/bash`` will stop at _start, waiting our gdb to attach.)
1085
-
1086
- >>> io = remote('127.0.0.1', 1336)
1087
- >>> _ = gdb.attach(('127.0.0.1', 1337), exe='/bin/bash')
1081
+ To attach to remote gdbserver, assume you have a socat server delivering gdbserver
1082
+ with ``socat TCP-LISTEN:1336,reuseaddr,fork 'EXEC:"gdbserver :1337 /bin/bash"'``,
1083
+ then you can connect to gdbserver and attach to it by:
1084
+ (When connection with gdbserver established, ``/bin/bash`` will pause at ``_start``,
1085
+ waiting for our gdb to attach.)
1086
+
1087
+ >>> io = remote('127.0.0.1', 1336) # doctest: +SKIP
1088
+ >>> _ = gdb.attach(('127.0.0.1', 1337), exe='/bin/bash') # doctest: +SKIP
1088
1089
>>> # press 'c' in gdb then
1089
- >>> io.sendline(b'echo Hello')
1090
- >>> io.recvline()
1090
+ >>> io.sendline(b'echo Hello') # doctest: +SKIP
1091
+ >>> io.recvline() # doctest: +SKIP
1091
1092
b'Hello\n'
1092
- >>> io.close()
1093
+ >>> io.close() # doctest: +SKIP
1093
1094
"""
1094
1095
if context .noptrace :
1095
1096
log .warn_once ("Skipping debug attach since context.noptrace==True" )
0 commit comments