- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, I'm on to debugging apps under linux.
I tried to follow (and adapt) the wiki directions for using gdb: http://www.nioswiki.com/operatingsystems/uclinux/debugapps I'm using the gdbserver and nios2-linux-gnu-gdb from the tarball on: http://www.nioswiki.com/linux I can run gdbserver on my board. When I run gdb on my host and execute the "target remote" command, it doesn't seem to have any idea about what is going on. It seems to think the program is already running. I have some questions about the DebugApps page, and how to apply it to Linux with MMU:- Is the "-elf2flt" option a compile option or a link option? And do I need it?
- Where does the file "hello.gdb" come from? Is it generated by the compiler?
Link Copied
9 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just one thing I already seem to know:
-elf2flat is used only for the noMMU architecture. With an MMU you don't need it as the elf executable format is natively used. -Michael- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
--- Quote Start --- I'm using the gdbserver and nios2-linux-gnu-gdb from the tarball on: http://www.nioswiki.com/linux I have some questions about the DebugApps page, and how to apply it to Linux with MMU:- Is the "-elf2flt" option a compile option or a link option? And do I need it?
- Where does the file "hello.gdb" come from? Is it generated by the compiler?
(gdb) symbol-file <your program>
(gdb) tb main
(gdb) c
(gdb) list
<your program list>
int main(....
(gdb)
is a normal tour course of gdb. Kazu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have followed the guide of nioswiki about:"Debug user space " but I have some doubts. The first one is with this command: --- Quote Start --- set solib-absolute-prefix ~/nios2-linux/toolchain-mmu/x86-linux2/nios2-wrs-linux-gnu/libc --- Quote End --- I mean "nios2-wrs-linux-gnu" is the same as "nios2-linux-gnu"?, because I haven't found the folder "nios2-wrs-linux-gnu". The other problem that I met is when I have to generate the .gdb file. With the binary tool chain of nioswiki I have to use this command to create de .gdb file. --- Quote Start --- nios2-linux-uclibc-gcc -g VGA.c -o VGA -elf2flt --- Quote End --- But can I create .gdb file with the toolchain-mmu?. I have read that I have to compiled again my application with -g , I have checked with :"nios2-linux-gnu-gcc -g ..." but I didn't go. If someone can suggest me any ideas. Many thanks- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
--- Quote Start --- I have followed the guide of nioswiki about:"Debug user space " but I have some doubts. The first one is with this command: I mean "nios2-wrs-linux-gnu" is the same as "nios2-linux-gnu"?, because I haven't found the folder "nios2-wrs-linux-gnu". --- Quote End --- The command
set solib-absolute-prefix ~/nios2-linux/toolchain-mmu/x86-linux2/nios2-wrs-linux-gnu/libc
indicates the search path of dynamic-link libraries to 'gdb'. And you don't need to set this if you don't want to debug the inside of libraries. But you should have the folder 'nios2-wrs-linux-gnu'. Maybe something is wrong. --- Quote Start --- The other problem that I met is when I have to generate the .gdb file. With the binary tool chain of nioswiki I have to use this command to create de .gdb file. But can I create .gdb file with the toolchain-mmu?. I have read that I have to compiled again my application with -g , I have checked with :"nios2-linux-gnu-gcc -g ..." but I didn't go. If someone can suggest me any ideas. --- Quote End --- Don't worry about it. The executable 'elf' file has all debug information in it by typing
nios2-wrs-linux-gnu-gcc -g -O0 -o <your_executable_file> <your_source_file>
. Kazu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Many thanks for the reply. These days I have been looking for the folder "nios2-wrs-linux-gnu" that you commented that I have to had. I have download and updated the tarball of 1.7GB of the nioswiki(uClinux with MMU) to be sure that I haven't erased something, and I haven't found this folder inside it. But in the web http://www.niosftp.com/pub/gnutools/ there is a folder(Maby I wrong but I think it is a cross-compiler) with the same name as you have commented . Both things the tarball and this folder have been uploaded in similar dates. Have you installed this folder after you installed the tarball ,if so do you recommend me to do it? Many Thanks- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
--- Quote Start --- Have you installed this folder after you installed the tarball ,if so do you recommend me to do it? --- Quote End --- I only followed the instruction of http://www.nioswiki.com/linux/downloading_linux_distribution . Kazu- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Many thanks Kazu for your patience- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I would like to know why I have these errors when I try to debug.Program exited normally.
(gdb) target remote 192.168.1.10:9999
Remote debugging using 192.168.1.10:9999
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x2aaa8784 in ?? ()
(gdb) break 9
Breakpoint 5 at 0x1550: file /home/garcia/Escritorio/nios2-linux/uClinux-dist/user/Switchos/Switchos.c, line 9.
(gdb) c
Continuing.
Error while mapping shared library sections:
"/lib/libc.so.6": not in executable format: File format not recognized.
Error while mapping shared library sections:
/lib/ld.so.1: No such file or directory.
Error while reading shared library symbols:
"/lib/libc.so.6": can't read symbols: File format not recognized.
I know that I could debug although these errors, but I think that I have indicated the path of shared library with this command: set solib-absolute-prefix ~/Escritorio/nios2-linux/toolchain-mmu/x86-linux2/nios2-linux-gnu/libc/lib
If someone can suggest me any clue about these errors, I work with Ubuntu 9.04 and uClinux with MMU. Many thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I comment the solution that I have found for someone that could met with the same trouble. I write two commands in the archive .gdbinit, these are:
set solib-absolute-prefix /home/garcia/Escritorio/nios2-linux/toolchain-mmu/x86-linux2/nios2-linux-gnu/libc/lib
set solib-search-path /home/garcia/Escritorio/nios2-linux/toolchain-mmu/x86-linux2/nios2-linux-gnu/libc/lib

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page