0
votes

I have cross compiled /bin/ls NetBSD utility for ARM platform. While executing the same I see that application crashed. Tried decoding the same using gdb. I see the following errors.

GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5_5.2) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /home/subrahmanyam/crash/ls...(no debugging symbols found)...done.

no core file handler recognizes format, using default Can't fetch registers from this type of core file Can't fetch registers from this type of core file Core was generated by `sh'. Program terminated with signal 4, Illegal instruction. Can't fetch registers from this type of core file Can't fetch registers from this type of core file

disassemble No function contains program counter for selected frame. (gdb)

Can you please help in decoding the core file.

1
Well, an i386 GDB isn't going to understand ARM code. Since you cross-compiled, you should probably have a matching cross-GDB as part of that toolchain.Notlikethat
Yes. Even used cross-GDB but couldn't get the stack trace even with that. GNU gdb 6.5 Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i686-pc-linux-gnu --target=armv7eb--netbsdelf"...(no debugging symbols found) (gdb) bt No stack.user5992213
You're not indenting you cut&paste text so it's not exactly clear what commands you're typing, on which machine(s), and where the files you're feeding them are located.Greg A. Woods

1 Answers

0
votes

It seems there is a bug in GDB which causes the cross-target version to be unable to properly recognize the format of core file from the intended target host. (Possibly this has something to do with the fact that it is impossible to do set osabi NetBSD ELF.)

Perhaps you can install and use the ARM GDB built for the NetBSD target system.

Note that the default binaries installed on NetBSD will not have debug symbols, so you may have to build and copy the debug data files to the target host as well. You can do this with the following settings in the mk.conf file you use for your cross-build:

MKDEBUG =   yes
MKDEBUGLIB =    yes

The debug files will end up in $DESTDIR/usr/libdata/debug