Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM Visual debugger issue #322

Closed
Fuzion24 opened this issue Nov 8, 2013 · 4 comments
Closed

ARM Visual debugger issue #322

Fuzion24 opened this issue Nov 8, 2013 · 4 comments

Comments

@Fuzion24
Copy link

Fuzion24 commented Nov 8, 2013

I am trying to debug a hello world app

 r2 -dcVpp ./hello_world

I get the following.. Am I doing something wrong or is this a bug?
I am running this on a beagle bone black:

ubuntu@beaglebone:~$ uname -a
Linux beaglebone 3.8.13-bone20 #1 SMP Wed May 29 06:14:59 UTC 2013 armv7l armv7l armv7l GNU/Linux
ubuntu@beaglebone:~$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"
NAME="Ubuntu"
VERSION="13.04, Raring Ringtail"

armScreenshot

@radare
Copy link
Collaborator

radare commented Nov 8, 2013

Cant reproduce on rpi :/

Try running in console mode and paste the errors you see. Looks like it is unable to read regs/mem from target process.

$ r2 -d ls

dr=
pd 10
x@sp

Also . By looking at your screenshot it is trying to run a program named 't', not 'hello_world'.. And looks like it cant set debug mode because that file doesnt exist? Strange..

Are you running latest version from git?

On 08 Nov 2013, at 17:38, Ryan Welton notifications@github.com wrote:

I am trying to debug a hello world app

r2 -dcVpp ./hello_world
I get the following.. Am I doing something wrong or is this a bug?
I am running this on a beagle bone black:

ubuntu@beaglebone:$ uname -a
Linux beaglebone 3.8.13-bone20 #1 SMP Wed May 29 06:14:59 UTC 2013 armv7l armv7l armv7l GNU/Linux
ubuntu@beaglebone:
$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"
NAME="Ubuntu"
VERSION="13.04, Raring Ringtail"


Reply to this email directly or view it on GitHub.

@Fuzion24
Copy link
Author

Fuzion24 commented Nov 9, 2013

I got it building from source, but it looks like it's segfaulting, now.

ubuntu@beaglebone:~$ cat hello_world.c
#include <stdio.h>

int main(int argc, char * argv[]){
  printf("Hello, there");
  return 0;
}
ubuntu@beaglebone:~$ gcc hello_world.c -o h
ubuntu@beaglebone:~$ r2 -d h
Process with PID 26967 started...
PID = 26967
r_debug_select: 26967 26967
 -- Warning, your trial license is about to expire
[0xb6f6bc30]>  dr=
  lr 0x00000000      pc 0xb6f6bc30      r0 0x00000000      r1 0xbecbf5f6
  r2 0x00000000      r3 0x00000000      r4 0x00000000      r5 0x00000000
  r6 0x00000000      r7 0x00000000      r8 0x00000000      r9 0x00000000
 r10 0x00000000     r11 0x00000000     r12 0x00000000     r13 0xbecbf4e0
 r14 0x00000000     r15 0xb6f6bc30     r16 0x00000030     r17 0x00000000
[0xb6f6bc30]> pd 10
            ;-- r15:
            0xb6f6bc30    dff868a0     ldrdge pc, [r8], -143; <UNPREDICTABLE>
            0xb6f6bc34    dff86840     ldrdmi pc, [r8], -143; <UNPREDICTABLE>
            0xb6f6bc38    684602f0     ; <UNDEFINED> 0xf0024668
            0xb6f6bc3c    2bfe17a6     ldrge pc, [r7], -fp, lsr 28
            0xb6f6bc40    b2445af8     ; <UNDEFINED> 0xf85a44b2
            0xb6f6bc44    04400646     strmi r4, [r6], -r4
            0xb6f6bc48    009901aa     bge 0xb6fd2050
            0xb6f6bc4c    002c0bd1     tstle fp, r0, lsl 24
            0xb6f6bc50    02eb8103     orreq lr, r1, 2048
            0xb6f6bc54    03f10403     movweq pc, 16643; <UNPREDICTABLE>
[0xb6f6bc30]> x@sp
Invalid address (sp)
[0xb6f6bc30]> ds
[+] signal 11 aka SIGSEGV received
[0xb6f7a4a6]>
[0xb6a08706]> do
Process with PID 26969 started...
PID = 26969
File dbg://./h reopened in read-write mode
r_debug_select: 26969 26969
[0xb6a08706]> dc
Hello, there
==> Process finished

r_debug_select: -1 -1
[0xb6f0ec30]>

@Fuzion24 Fuzion24 closed this as completed Nov 9, 2013
@Fuzion24 Fuzion24 reopened this Nov 9, 2013
@radare
Copy link
Collaborator

radare commented Nov 14, 2013

The way to seek to 'sp' to watch the stack is sr sp;x... or x@\dr?sp``.

But it looks like stepping is broken on ARM ..

@radare
Copy link
Collaborator

radare commented Dec 14, 2013

Everything looks fine now

@radare radare closed this as completed Dec 14, 2013
yossizap pushed a commit to yossizap/radare2 that referenced this issue Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants