This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug corefiles/16054] New: gdb built w/ --enable-targets=all confused by core files generated by Linux kernel on ARM


https://sourceware.org/bugzilla/show_bug.cgi?id=16054

            Bug ID: 16054
           Summary: gdb built w/ --enable-targets=all confused by core
                    files generated by Linux kernel on ARM
           Product: gdb
           Version: 7.6
            Status: NEW
          Severity: normal
          Priority: P2
         Component: corefiles
          Assignee: unassigned at sourceware dot org
          Reporter: naesten at gmail dot com
            Target: arm-linux-gnueabihf

This happens in two forms.

In the following, gdb is a typical native debugger, and gdb-multiarch has been
built the same way, except with "--enable-64-bit-bfd --enable-targets=all"
added to the configure command line.

On an ARM machine, it goes like this:

vvvvvvvv
$ uname -a
Linux harris 3.2.0-4-mx5 #1 Debian 3.2.51-1 armv7l GNU/Linux
$ gdb --version
GNU gdb (GDB) 7.6.1 (Debian 7.6.1-1)
Copyright (C) 2013 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 "arm-linux-gnueabihf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
$ cat test.c
#include <stdlib.h>

int main() {
    abort();
}
$ gcc -g test.c -o test
$ (ulimit -c unlimited && ! ./test && mv core test.kernel-core)
$ gdb -batch test test.kernel-core
[New LWP 27843]
Core was generated by `./test'.
Program terminated with signal 6, Aborted.
#0  0xb6f0d6e6 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
$ gdb-multiarch -batch test test.kernel-core
[New process 27843]

warning: wrong size gregset struct in core file
Core was generated by `./test'.
Program terminated with signal 6, Aborted.

warning: wrong size gregset struct in core file
#0  <unavailable> in ?? ()
$
^^^^^^^^

If I copy test and test.kernel-core over to my i386 system and try looking at
the core there, this happens:

vvvvvvvv
$ gdb --version
GNU gdb (GDB) 7.6.1 (Debian 7.6.1-1)
Copyright (C) 2013 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 "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
$ gdb-multiarch -batch test test.kernel-core
"/home/naesten/hacking/bugs/gdb/ambiguous-core/test.kernel-core" is not a core
dump: File format is ambiguous
$ gdb-multiarch -batch -iex 'set gnutarget elf32-littlearm' test
test.kernel-core
[New process 27843]

warning: wrong size gregset struct in core file

warning: Could not load shared library symbols for 2 libraries, e.g.
/lib/arm-linux-gnueabihf/libc.so.6.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `./test'.
Program terminated with signal 6, Aborted.

warning: wrong size gregset struct in core file
#0  <unavailable> in ?? ()
$
^^^^^^^^

As you can see, it fails even harder without 'set gnutarget'; with it, it fails
about the same as on ARM.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]