Reopening binary using "do" via HTTP makes binary stdout lost.
Check out this log:
[0x7f0c3b34fcd0]> =h
Starting http server...
open http://localhost:9090/
r2 -C http://localhost:9090/cmd/
[HTTP] 127.0.0.1:58752 /cmd/db%20main
[HTTP] 127.0.0.1:58754 /cmd/dc;dcr
hit breakpoint at: 400536
Debugging pid = 25437, tid = 1 now
Test...
hit breakpoint at: 400544
[HTTP] 127.0.0.1:58756 /cmd/do
Wait event received by different pid 25437
Process with PID 25443 started...
File dbg://./a.out reopened in read-write mode
Debugging pid = 25443, tid = 25443 now
Assuming filepath ./a.out
Attached debugger to pid = 25443, tid = 25443
[HTTP] 127.0.0.1:58758 /cmd/dc;dcr
hit breakpoint at: 400536
Debugging pid = 25443, tid = 1 now
hit breakpoint at: 400544
The debugged binary was just puts("Test...") in main - so it should print it. In the first time, continuing until return from main did it, but when later I issued do (reopen binary) and requested same commands, no string was printed. This happens only in HTTP mode - this is equivalent log from radare2 usual console:
[0x7fef51610cd0]> db main
[0x7fef51610cd0]> dc; dcr
hit breakpoint at: 400536
Debugging pid = 25495, tid = 1 now
Test...
hit breakpoint at: 400544
[0x00400536]> do
Wait event received by different pid 25495
Process with PID 25496 started...
File dbg://./a.out reopened in read-write mode
Debugging pid = 25496, tid = 25496 now
Assuming filepath ./a.out
Attached debugger to pid = 25496, tid = 25496
[0x7f604f4becd0]> dc;dcr
hit breakpoint at: 400536
Debugging pid = 25496, tid = 1 now
Test...
hit breakpoint at: 400544
As expected, "Test..." is printed twice, one time for each instance of binary ran.
confirmed. i can reproduce this issue
On 14 Jan 2016, at 21:02, akrasuski1 [email protected] wrote:
Check out this log:
[0x7f0c3b34fcd0]> =h Starting http server... open http://localhost:9090/ r2 -C http://localhost:9090/cmd/ [HTTP] 127.0.0.1:58752 /cmd/db%20main [HTTP] 127.0.0.1:58754 /cmd/dc;dcr hit breakpoint at: 400536 Debugging pid = 25437, tid = 1 now Test... hit breakpoint at: 400544 [HTTP] 127.0.0.1:58756 /cmd/do Wait event received by different pid 25437 Process with PID 25443 started... File dbg://./a.out reopened in read-write mode Debugging pid = 25443, tid = 25443 now Assuming filepath ./a.out Attached debugger to pid = 25443, tid = 25443 [HTTP] 127.0.0.1:58758 /cmd/dc;dcr hit breakpoint at: 400536 Debugging pid = 25443, tid = 1 now hit breakpoint at: 400544 The debugged binary was just puts("Test...") in main - so it should print it. In the first time, continuing until return from main did it, but when later I issued do (reopen binary) and requested same commands, no string was printed. This happens only in HTTP mode - this is equivalent log from radare2 usual console:
[0x7fef51610cd0]> db main [0x7fef51610cd0]> dc; dcr hit breakpoint at: 400536 Debugging pid = 25495, tid = 1 now Test... hit breakpoint at: 400544 [0x00400536]> do Wait event received by different pid 25495 Process with PID 25496 started... File dbg://./a.out reopened in read-write mode Debugging pid = 25496, tid = 25496 now Assuming filepath ./a.out Attached debugger to pid = 25496, tid = 25496 [0x7f604f4becd0]> dc;dcr hit breakpoint at: 400536 Debugging pid = 25496, tid = 1 now Test... hit breakpoint at: 400544 As expected, "Test..." is printed twice, one time for each instance of binary ran.
— Reply to this email directly or view it on GitHub https://github.com/radare/radare2/issues/3956.
This issue has been automatically marked as stale because it has not had recent activity. Considering a lot has changed since its creation, we kindly ask you to check again if the issue you reported is still relevant in the current version of radare2. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions.