{"action":"created","issue":{"url":"https://api.github.com/repos/radare/radare2/issues/1934","labels_url":"https://api.github.com/repos/radare/radare2/issues/1934/labels{/name}","comments_url":"https://api.github.com/repos/radare/radare2/issues/1934/comments","events_url":"https://api.github.com/repos/radare/radare2/issues/1934/events","html_url":"https://github.com/radare/radare2/issues/1934","id":53314654,"number":1934,"title":"can not step over using F8 in visual mode and some others...","user":{"login":"naijim","id":1352717,"avatar_url":"https://avatars.githubusercontent.com/u/1352717?v=3","gravatar_id":"","url":"https://api.github.com/users/naijim","html_url":"https://github.com/naijim","followers_url":"https://api.github.com/users/naijim/followers","following_url":"https://api.github.com/users/naijim/following{/other_user}","gists_url":"https://api.github.com/users/naijim/gists{/gist_id}","starred_url":"https://api.github.com/users/naijim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naijim/subscriptions","organizations_url":"https://api.github.com/users/naijim/orgs","repos_url":"https://api.github.com/users/naijim/repos","events_url":"https://api.github.com/users/naijim/events{/privacy}","received_events_url":"https://api.github.com/users/naijim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-03T20:35:16Z","updated_at":"2015-01-03T22:14:14Z","closed_at":null,"body":"It looks like the debugger is not so stable... I encountered some odd problems. I debug program over ssh connection. The program runs in a virtual machine which managed by vagrant. I am not sure if I understand it right. The `do` command is equivalent to the `run` of gdb? I got this:\r\n\r\n```\r\n○ → r2 -d a.out\r\nProcess with PID 9520 started...\r\nPID = 9520\r\npid = 9520 tid = 9520\r\nr_debug_select: 9520 9520\r\nUsing BADDR 400000\r\nbits 64\r\npid = 9520 tid = 9520\r\n -- -bash: r2: command not found\r\n[0x7f0a8a5d4dc0]> do\r\nWait event received by different pid 9520\r\nProcess with PID 9521 started...\r\nPID = 9521\r\nFile dbg://./a.out reopened in read-write mode\r\nr_debug_select: 9521 9521\r\np/debug_native.c:410 ptrace_setoptions: No such process\r\nr_debug_reg: error reading registers\r\nr_debug_reg: error reading registers\r\nr_debug_reg: error reading registers\r\nr_debug_reg: error reading registers\r\nr_debug_reg: error reading registers\r\n[0x7f0a8a5d4dc0]> pd 20@sym.main\r\n           ;-- sym.main:\r\n           0x00400506    0000         add byte [rax], al\r\n           0x00400508    0000         add byte [rax], al\r\n           0x0040050a    0000         add byte [rax], al\r\n           0x0040050c    0000         add byte [rax], al\r\n           0x0040050e    0000         add byte [rax], al\r\n           0x00400510    0000         add byte [rax], al\r\n           0x00400512    0000         add byte [rax], al\r\n           0x00400514    0000         add byte [rax], al\r\n           0x00400516    0000         add byte [rax], al\r\n           0x00400518    66           add byte [rax], al\r\n           0x00400519    07           add byte [rax], al\r\n           0x0040051a    0000         add byte [rax], al\r\n           0x0040051c    1200         adc al, byte [rax]\r\n           0x0040051e    0000         add byte [rax], al\r\n           0x00400520    0000         add byte [rax], al\r\n           0x00400522    0000         add byte [rax], al\r\n           0x00400524    0000         add byte [rax], al\r\n           0x00400526    0000         add byte [rax], al\r\n           0x00400528    0000         add byte [rax], al\r\n           0x0040052a    0000         add byte [rax], al\r\n[0x7f0a8a5d4dc0]> dc\r\nsys.c:480 ptrace-traceme: Operation not permitted\r\nr_debug_reg: error reading registers\r\nr_debug_select: 9521 1\r\nr_debug_reg: error reading registers\r\nr_debug_reg: error reading registers\r\nr_debug_reg: error reading registers\r\nr_debug_reg: error reading registers\r\n[0x7f4c46c9f70f]> pd 20@sym.main\r\n           ;-- sym.main:\r\n           0x00400506    ff\r\n           0x00400507    ff\r\n           0x00400508    ff\r\n           0x00400509    ff\r\n           0x0040050a    ff\r\n           0x0040050b    ff\r\n           0x0040050c    ff\r\n           0x0040050d    ff\r\n           0x0040050e    ff\r\n           0x0040050f    ff\r\n           0x00400510    ff\r\n           0x00400511    ff\r\n           0x00400512    ff\r\n           0x00400513    ff\r\n           0x00400514    ff\r\n           0x00400515    ff\r\n           0x00400516    ff\r\n           0x00400517    ff\r\n           0x00400518    ff\r\n           0x00400519    ff\r\nr_debug_reg: error reading registers\r\n```\r\nAnd for visual mode:\r\n```\r\n○ → r2 -d a.out\r\nProcess with PID 9636 started...\r\nPID = 9636\r\npid = 9636 tid = 9636\r\nr_debug_select: 9636 9636\r\nUsing BADDR 400000\r\nbits 64\r\npid = 9636 tid = 9636\r\n -- rax2 -s 20e296b20ae296b220e296b20a\r\n[0x7fa8de913dc0]> pd 20@sym.main\r\n           ;-- sym.main:\r\n           0x00400506    55           push rbp\r\n           0x00400507    4889e5       mov rbp, rsp\r\n           0x0040050a    4883ec10     sub rsp, 0x10\r\n           0x0040050e    c745fc01000. mov dword [rbp - 4], 1\r\n           0x00400515    8345fc01     add dword [rbp - 4], 1\r\n           0x00400519    bfd4054000   mov edi, 0x4005d4\r\n           0x0040051e    b800000000   mov eax, 0\r\n           0x00400523    e8b8feffff   call sym.imp.printf\r\n              0x004003e0(unk) ; sym.imp.printf\r\n           0x00400528    c745f801000. mov dword [rbp - 8], 1\r\n           0x0040052f    8345f801     add dword [rbp - 8], 1\r\n           0x00400533    bfd8054000   mov edi, 0x4005d8\r\n           0x00400538    b800000000   mov eax, 0\r\n           0x0040053d    e89efeffff   call sym.imp.printf\r\n              0x004003e0() ; sym.imp.printf\r\n           0x00400542    b800000000   mov eax, 0\r\n           0x00400547    c9           leave\r\n           0x00400548    c3           ret\r\n           0x00400549    0f1f8000000. nop dword [rax]\r\n           ;-- sym.__libc_csu_init:\r\n           0x00400550    4157         push r15\r\n           0x00400552    4156         push r14\r\n           0x00400554    4189ff       mov r15d, edi\r\n[0x7fa8de913dc0]> db 0x00400519\r\n[0x7fa8de913dc0]> db\r\n0x00400519 - 0x0040051a 1 --x sw break enabled cmd=\"\"\r\n[0x7fa8de913dc0]> dc\r\nhit breakpoint at: 400519\r\nr_debug_select: 9636 1\r\n[0x00400519]> V\r\n\r\n...[snip]... ; hit F7 2 times to reach this...\r\n\r\n[0x00400519 195 ./a.out]> f tmp;sr s.. @ main+19 # 0x400519\r\n- offset -       0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF\r\n0x7fff8c3c6410  0065 3c8c ff7f 0000 0000 0000 0200 0000  .e<.............\r\n0x7fff8c3c6420  5005 4000 0000 0000 4000 59de a87f 0000  P.@.....@.Y.....\r\n0x7fff8c3c6430  0865 3c8c ff7f 0000 0865 3c8c ff7f 0000  .e<......e<.....\r\n0x7fff8c3c6440  0000 0000 0100 0000 0605 4000 0000 0000  ..........@.....\r\n r15 0x00000000         r14 0x00000000         r13 0x7fff8c3c6500\r\n r12 0x00400410         rbp 0x7fff8c3c6420     rbx 0x00000000\r\n r11 0x7fa8de58ff50     r10 0x00000831          r9 0x7fa8de922660\r\n  r8 0x7fa8de90ee90     rax 0x00000000         rcx 0x00000000\r\n rdx 0x7fff8c3c6518     rsi 0x7fff8c3c6508     rdi 0x004005d4\r\norax 0xffffffffffffffff rip 0x00400523         rflags = 1I\r\n rsp 0x7fff8c3c6410\r\n           0x00400519 b  bfd4054000   mov edi, 0x4005d4 ; \"123\" @ 0x4005d4\r\n           0x0040051e    b800000000   mov eax, 0\r\n           ;-- rip:\r\n           0x00400523    e8b8feffff   call sym.imp.printf ;[1]\r\n              0x004003e0() ; sym.imp.printf\r\n           0x00400528    c745f801000. mov dword [rbp - 8], 1\r\n           0x0040052f    8345f801     add dword [rbp - 8], 1\r\n           0x00400533    bfd8054000   mov edi, 0x4005d8\r\n           0x00400538    b800000000   mov eax, 0\r\n           0x0040053d    e89efeffff   call sym.imp.printf ;[1]\r\n              0x004003e0() ; sym.imp.printf\r\n           0x00400542    b800000000   mov eax, 0\r\n           0x00400547    c9           leave\r\n           0x00400548    c3           ret\r\n           0x00400549    0f1f8000000. nop dword [rax]\r\n           ;-- sym.__libc_csu_init:\r\n           0x00400550    4157         push r15 ; orax\r\n           0x00400552    4156         push r14 ; orax\r\n           0x00400554    4189ff       mov r15d, edi\r\n           0x00400557    4155         push r13 ; orax\r\n           0x00400559    4154         push r12 ; orax\r\n           0x0040055b    4c8d25a6012. lea r12, qword [rip + 0x2001a6]\r\n           0x00400562    55           push rbp ; orax\r\n           0x00400563    488d2da6012. lea rbp, qword [rip + 0x2001a6]\r\n           0x0040056a    53           push rbx ; orax\r\n           0x0040056b    4989f6       mov r14, rsi\r\n```\r\nNow I want to step over the `call`. Hit F8.\r\n```\r\n[0x7fb4972359e9 195 ./a.out]> f tmp;sr s.. @ r11+621209 # 0x7fb4972359e9\r\n- offset -       0 1  2 3  4 5  6 7  8 9  A B  C D  0123456789ABCD\r\n0x7fffbe0c6bc8  ffff ffff ffff ffff ffff ffff ffff  ..............\r\n0x7fffbe0c6bd6  ffff ffff ffff ffff ffff ffff ffff  ..............\r\n0x7fffbe0c6be4  ffff ffff ffff ffff ffff ffff ffff  ..............\r\n0x7fffbe0c6bf2  ffff ffff ffff ffff ffff ffff ffff  ..............\r\n0x7fffbe0c6c00  ffff ffff ffff ffff                 ........\r\n           0x7fb4972359e9    ff\r\n           0x7fb4972359ea    ff\r\n           0x7fb4972359eb    ff\r\n           0x7fb4972359ec    ff\r\n           0x7fb4972359ed    ff\r\n           0x7fb4972359ee    ff\r\n           0x7fb4972359ef    ff\r\n           0x7fb4972359f0    ff\r\n           0x7fb4972359f1    ff\r\n           0x7fb4972359f2    ff\r\n           0x7fb4972359f3    ff\r\n           0x7fb4972359f4    ff\r\n           0x7fb4972359f5    ff\r\n           0x7fb4972359f6    ff\r\n           0x7fb4972359f7    ff\r\n           0x7fb4972359f8    ff\r\n           0x7fb4972359f9    ff\r\n           0x7fb4972359fa    ff\r\n           0x7fb4972359fb    ff\r\n           0x7fb4972359fc    ff\r\n           0x7fb4972359fd    ff\r\n           0x7fb4972359fe    ff\r\n           0x7fb4972359ff    ff\r\n           0x7fb497235a00    ff\r\n           0x7fb497235a01    ff\r\n           0x7fb497235a02    ff\r\n           0x7fb497235a03    ff                                                                                                                                                                 0x7fb497235a04    ff\r\n           0x7fb497235a05    ff\r\n           0x7fb497235a06    ff\r\n           0x7fb497235a07    ff\r\n           0x7fb497235a08    ff\r\n```\r\nI think `step over` should mean `proceeds to the next line in your current scope (i.e. it goes to the next line), without descending into any method calls on the way`. So I should reach the next line of `call`...\r\n\r\nIf I am wrong pls forgive me. I am just a newbie trying to make this tool better. :)"},"comment":{"url":"https://api.github.com/repos/radare/radare2/issues/comments/68611707","html_url":"https://github.com/radare/radare2/issues/1934#issuecomment-68611707","issue_url":"https://api.github.com/repos/radare/radare2/issues/1934","id":68611707,"user":{"login":"naijim","id":1352717,"avatar_url":"https://avatars.githubusercontent.com/u/1352717?v=3","gravatar_id":"","url":"https://api.github.com/users/naijim","html_url":"https://github.com/naijim","followers_url":"https://api.github.com/users/naijim/followers","following_url":"https://api.github.com/users/naijim/following{/other_user}","gists_url":"https://api.github.com/users/naijim/gists{/gist_id}","starred_url":"https://api.github.com/users/naijim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naijim/subscriptions","organizations_url":"https://api.github.com/users/naijim/orgs","repos_url":"https://api.github.com/users/naijim/repos","events_url":"https://api.github.com/users/naijim/events{/privacy}","received_events_url":"https://api.github.com/users/naijim/received_events","type":"User","site_admin":false},"created_at":"2015-01-03T22:14:14Z","updated_at":"2015-01-03T22:14:14Z","body":"Maybe I use r2 wrong. But I have tried visual mode many times... Always the same.\r\nI am running Archlinux x64 and r2 0.9.8.\r\nThe source code:\r\n```\r\n#include <stdio.h>\r\n\r\nint main()\r\n{\r\n  int a = 1;\r\n  a++;\r\n  printf(\"123\");\r\n  int b = 1;\r\n  b++;\r\n  printf(\"456\");\r\n  return 0;\r\n}\r\n```\r\nThe binary: https://mega.co.nz/#!58QEjKoC!0kbbgul81jYXSeO4_OYptxefABb7dyR6kTmI1IuuG14"}}