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 gdb/18404] New: [8 Regression] gdb fails to handle EM_486/EM_IAMCU binary


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

            Bug ID: 18404
           Summary: [8 Regression] gdb fails to handle EM_486/EM_IAMCU
                    binary
           Product: gdb
           Version: 8.0
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

EM_IAMCU is defined to 6 which was EM_486 and Linux kernel
treat EM_486/EM_IAMCU the same way was EM_386 binary.  Before
EM_IAMCU support was checked into BFD, we got

[hjl@gnu-6 gdb]$ cat x.c
#include <stdio.h>

int
main ()
{
  printf ("hello\n");
  return 0;
}
[hjl@gnu-6 gdb]$ gcc -m32 -g -static x.c
[hjl@gnu-6 gdb]$ elfedit --output-mach=iamcu a.out 
[hjl@gnu-6 gdb]$ file a.out 
a.out: ELF 32-bit LSB executable, Intel 80486, version 1 (GNU/Linux),
statically linked, for GNU/Linux 2.6.32,
BuildID[sha1]=28d75f29adb627aff35327dc12df4c929bfeaea3, not stripped
[hjl@gnu-6 gdb]$ ./a.out 
hello
[hjl@gnu-6 gdb]$ gdb ./a.out 
GNU gdb (GDB) Fedora 7.7.1-21.fc20
Copyright (C) 2014 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 "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./a.out...done.
(gdb) b main
Breakpoint 1 at 0x8048cdd: file x.c, line 6.
(gdb) r
Starting program: /export/home/hjl/bugs/mcu/gdb/a.out 

Breakpoint 1, main () at x.c:6
6         printf ("hello\n");
(gdb) info reg
eax            0x1      1
ecx            0xda77f71a       -629672166
edx            0xffffcf24       -12508
ebx            0x8048190        134513040
esp            0xffffcef0       0xffffcef0
ebp            0xffffcf08       0xffffcf08
esi            0x0      0
edi            0x80e70c4        135164100
eip            0x8048cdd        0x8048cdd <main+9>
eflags         0x286    [ PF SF IF ]
cs             0x23     35
ss             0x2b     43
ds             0x2b     43
es             0x2b     43
fs             0x0      0
gs             0x63     99
(gdb) q
A debugging session is active.

        Inferior 1 [process 16861] will be killed.

Quit anyway? (y or n) y
[hjl@gnu-6 gdb]$

After EM_IAMCU supported was added to BFD, I got

[hjl@gnu-6 gdb]$ ./gdb ./a.out 
GNU gdb (GDB) 7.9.50.20150512-cvs
Copyright (C) 2015 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 "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Architecture of file not recognized.
(gdb) r
Starting program: /export/home/hjl/bugs/mcu/gdb/a.out 
warning: Selected architecture iamcu is not compatible with reported target
architecture i386
warning: Architecture rejected target-supplied description
hello
[Inferior 1 (process 7786) exited normally]
(gdb) b main
Function "main" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (main) pending.
(gdb) r
/export/gnu/import/git/sources/binutils-gdb/gdb/target-descriptions.c:400:
internal-error: Could not remove target-supplied description
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

This is a bug, please report it.  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

/export/gnu/import/git/sources/binutils-gdb/gdb/target-descriptions.c:400:
internal-error: Could not remove target-supplied description
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
[hjl@gnu-6 gdb]$

-- 
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]