Bug 14428 - Make `info register' uniform across platforms
Summary: Make `info register' uniform across platforms
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-01 20:54 UTC by Sergio Durigan Junior
Modified: 2012-08-28 09:09 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Durigan Junior 2012-08-01 20:54:28 UTC
Currently `info registers' does not output uniformely on all platforms, e.g.:

On x86*, the output of `info register pc fp' is:

    info register pc fp
    pc: 0x400520
    fp: 0x7fffffffc490

On ppc64/s390x, it is:

    info register pc fp
    pc             0x10000658       0x10000658 <main+20>
    fp: 0xfffffffd120

On m68k-linux, it is:

    info register pc fp
    pc             0x8000042c       0x8000042c <main+4>
    fp             0xefae83e4       0xefae83e4

It would be nice to have these commands output the same pattern.
Comment 1 Pedro Alves 2012-08-01 21:48:20 UTC
See also <http://sourceware.org/ml/gdb-patches/2012-08/msg00039.html>.
Comment 2 Pedro Alves 2012-08-27 17:42:35 UTC
Proposed patch:

http://sourceware.org/ml/gdb-patches/2012-08/msg00812.html
Comment 3 Sourceware Commits 2012-08-28 09:05:42 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	palves@sourceware.org	2012-08-28 09:05:35

Modified files:
	gdb            : ChangeLog infcmd.c 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.base: pc-fp.exp 

Log message:
	2012-08-28  Pedro Alves  <palves@redhat.com>
	
	PR gdb/14428
	
	gdb/
	* infcmd.c (default_print_one_register_info): New, factored out
	from default_print_registers_info.
	(default_print_registers_info): Use it.  Mark value unavailable if
	necessary.
	(registers_info): Print user registers with
	default_print_one_register_info.
	
	gdb/testsuite/
	* gdb.base/pc-fp.exp: Adjust expected output of 'info registers pc fp'.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14637&r2=1.14638
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/infcmd.c.diff?cvsroot=src&r1=1.311&r2=1.312
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3357&r2=1.3358
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/pc-fp.exp.diff?cvsroot=src&r1=1.21&r2=1.22
Comment 4 Pedro Alves 2012-08-28 09:09:12 UTC
Patch checked in.