[PATCH] h8300 "info registers" broken

Yoshinori Sato ysato@users.sourceforge.jp
Sat Feb 8 18:36:00 GMT 2014


At Wed, 5 Feb 2014 18:59:00 +0100 (CET),
Mark Kettenis wrote:
> 
> > Date: Thu, 06 Feb 2014 02:51:11 +0900
> > From: Yoshinori Sato <ysato@users.sourceforge.jp>
> > > Can you explain the patch to me a little bit more, please?
> > > It's not obvious to me at all what the register names
> > > have to with the proposed change.
> > 
> > Current h8300-tdep have two problems.
> > 1. Size mismatch in pseudo register vs raw register.
> >    So overflow on register cache.
> 
> That doesn't make sense.  Pseudo registers don't live in the register
> cache.  Instead they are synthesised from the contents of the register
> cache.
> 
> > 2. Undisplay pseudo regsters.
> 
> Not sure what you're trying to say here.  But if you don't want to
> show a pseudo register, why do you have it in the first place?

OK.
I trying latest version.
I got result bellow.

ysato@sa76r4:~/dev/binutils-gdb/h8300$ LANG=C gdb gdb/gdb
GNU gdb (GDB) 7.6.2 (Debian 7.6.2-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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/ysato/dev/binutils-gdb/h8300/gdb/gdb...done.
warning: File "/home/ysato/dev/binutils-gdb/h8300/gdb/gdb-gdb.gdb" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
	add-auto-load-safe-path /home/ysato/dev/binutils-gdb/h8300/gdb/gdb-gdb.gdb
line to your configuration file "/home/ysato/.gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/ysato/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"
(gdb) r test
Starting program: /home/ysato/dev/binutils-gdb/h8300/gdb/gdb test
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
GNU gdb (GDB) 7.7.50.20140208-cvs
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 "--host=x86_64-unknown-linux-gnu --target=h8300-elf".
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 test...(no debugging symbols found)...done.
(gdb) target sim
Connected to the simulator.
(gdb) load
Loading section .text, size 0x4 vma 0x100
Start address 0x100
Transfer rate: 32 bits in <1 sec.
(gdb) b *0x100
Breakpoint 1 at 0x100
(gdb) r
Starting program: /home/ysato/dev/binutils-gdb/h8300/test 

Breakpoint 1, 0x00000100 in start ()
(gdb) si
0x00000102 in start ()
(gdb) 
0x00000102 in start ()
(gdb) info registers 
r0             0x00000000  0
r1             0x00000000  0
r2             0x00000000  0
r3             0x00000000  0
r4             0x00000000  0
r5             0x00000000  0
r6             0x00000000  0
sp             0x00000000  0
memory clobbered past end of allocated block

Program received signal SIGABRT, Aborted.
0x00007ffff6aaf1d5 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56	../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff6aaf1d5 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff6ab2388 in __GI_abort () at abort.c:90
#2  0x00007ffff6aea7bb in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff6be4bee "%s")
    at ../sysdeps/unix/sysv/linux/libc_fatal.c:199
#3  0x00007ffff6aea89e in __GI___libc_fatal (
    message=0x7ffff6be8328 "memory clobbered past end of allocated block\n")
    at ../sysdeps/unix/sysv/linux/libc_fatal.c:210
#4  0x00007ffff6afaca5 in mabort (status=<optimized out>) at mcheck.c:364
#5  0x00007ffff6afad6b in checkhdr (hdr=<optimized out>) at mcheck.c:115
#6  checkhdr (hdr=<optimized out>) at mcheck.c:86
#7  0x00007ffff6afb0f5 in freehook (ptr=0xd90040, 
    caller=0x49fedc <value_free+60>) at mcheck.c:188
#8  0x000000000049fedc in value_free (val=0xd90440) at ../../gdb/value.c:1437
#9  0x00000000005b919f in frame_register_unwind (frame=<optimized out>, 
    regnum=regnum@entry=13, optimizedp=optimizedp@entry=0x7fffffffe088, 
    unavailablep=0x7fff00000003, unavailablep@entry=0x7fffffffe08c, 
    lvalp=lvalp@entry=0x7fffffffe094, addrp=addrp@entry=0x7fffffffe098, 
    realnump=realnump@entry=0x7fffffffe090, bufferp=0x7fffffffe0b0 "")
    at ../../gdb/frame.c:1032
#10 0x00000000005b954e in frame_unwind_register (frame=<optimized out>, 
    regnum=13, buf=<optimized out>) at ../../gdb/frame.c:1064
---Type <return> to continue, or q <return> to quit--- 
#11 0x00000000005b960c in frame_unwind_register_signed (frame=0xd453f0, 
    regnum=regnum@entry=13) at ../../gdb/frame.c:1162
#12 0x00000000005b963c in get_frame_register_signed (
    frame=frame@entry=0xd454b0, regnum=regnum@entry=13)
    at ../../gdb/frame.c:1169
#13 0x0000000000408c9b in h8300_print_register (
    gdbarch=gdbarch@entry=0xd768c0, file=file@entry=0xd66eb0, 
    frame=frame@entry=0xd454b0, regno=13) at ../../gdb/h8300-tdep.c:1007
#14 0x00000000004090d8 in h8300_print_registers_info (gdbarch=0xd768c0, 
    file=0xd66eb0, frame=0xd454b0, regno=8, cpregs=<optimized out>)
    at ../../gdb/h8300-tdep.c:1082
#15 0x00000000005af307 in execute_command (p=<optimized out>, 
    p@entry=0xcbe3a0 "info registers ", from_tty=1) at ../../gdb/top.c:458
#16 0x00000000004faf11 in command_handler (command=0xcbe3a0 "info registers ")
    at ../../gdb/event-top.c:435
#17 0x00000000004fb37c in command_line_handler (rl=<optimized out>)
    at ../../gdb/event-top.c:632
#18 0x0000000000615980 in rl_callback_read_char ()
    at ../../readline/callback.c:220
#19 0x00000000004faf79 in rl_callback_read_char_wrapper (
    client_data=<optimized out>) at ../../gdb/event-top.c:164
#20 0x00000000004f9c43 in process_event () at ../../gdb/event-loop.c:342
#21 0x00000000004f9f97 in gdb_do_one_event () at ../../gdb/event-loop.c:406
---Type <return> to continue, or q <return> to quit---
#22 0x00000000004fa1b7 in start_event_loop () at ../../gdb/event-loop.c:431
#23 0x00000000004f3b23 in captured_command_loop (data=data@entry=0x0)
    at ../../gdb/main.c:266
#24 0x00000000004f134a in catch_errors (
    func=func@entry=0x4f3b10 <captured_command_loop>, 
    func_args=func_args@entry=0x0, errstring=errstring@entry=0x68cdb5 "", 
    mask=mask@entry=RETURN_MASK_ALL) at ../../gdb/exceptions.c:524
#25 0x00000000004f4826 in captured_main (data=data@entry=0x7fffffffe490)
    at ../../gdb/main.c:1054
#26 0x00000000004f134a in catch_errors (
    func=func@entry=0x4f3e00 <captured_main>, 
    func_args=func_args@entry=0x7fffffffe490, 
    errstring=errstring@entry=0x68cdb5 "", mask=mask@entry=RETURN_MASK_ALL)
    at ../../gdb/exceptions.c:524
#27 0x00000000004f4cfb in gdb_main (args=args@entry=0x7fffffffe490)
    at ../../gdb/main.c:1062
#28 0x0000000000407815 in main (argc=<optimized out>, argv=<optimized out>)
    at ../../gdb/gdb.c:33
(gdb) 

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>



More information about the Gdb-patches mailing list