debugging arm executable with gdb

OP #3131803
Rate this post
• ▲ useful
▼ not useful
Hi,

I have compiled linux kernel with arm-eabi toolchain on Ubuntu. The 
kernel is working. Now I'd like to debug it with gdb.
I tried this command: arm-eabi-gdb vmlinux

My questions:
Which gdb should I use?
There is a gdb in the arm-eabi (downloaded with android) toolchain. This 
will good?
I have tried that but I have got Don't know how to run. Try "help 
target" error message.
I tried to set breakpoint to __init_begin, this works but when I tried 
to start the debug with *start, run, cont* I have got this error 
message.
1
attila@attila-desktop:~/Upload$ arm-eabi-gdb vmlinux
2
GNU gdb (GDB) 7.1-android-gg2
3
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-elf-linux".
4
Reading symbols from /home/attila/Upload/vmlinux...(no debugging symbols found)...done.
5
(gdb) break __init_begin
6
Breakpoint 1 at 0xc0008000
7
(gdb) load vmlinux
8
You can't do that when your target is `exec'
9
(gdb) start
10
Function "main" not defined.
11
Make breakpoint pending on future shared library load? (y or [n]) n
12
Starting program: /home/attila/Upload/vmlinux 
13
Don't know how to run.  Try "help target".
14
(gdb) cont
15
The program is not being run.
16
(gdb) run
17
Starting program: /home/attila/Upload/vmlinux 
18
Don't know how to run.  Try "help target".

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.