Bug 13073 - TUI doesn't display registers in layout reg
Summary: TUI doesn't display registers in layout reg
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: tui (show other bugs)
Version: 7.3
: P2 normal
Target Milestone: 7.4
Assignee: Pedro Alves
URL:
Keywords:
: 13340 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-10 15:43 UTC by wmealing
Modified: 2014-05-28 19:45 UTC (History)
1 user (show)

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


Attachments
Rubbish code i was messing with. (564 bytes, application/octet-stream)
2011-08-10 15:43 UTC, wmealing
Details
fix (367 bytes, patch)
2011-08-10 16:28 UTC, Pedro Alves
Details | Diff
fix-2 (1.18 KB, patch)
2011-08-10 18:29 UTC, Pedro Alves
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description wmealing 2011-08-10 15:43:43 UTC
Created attachment 5891 [details]
Rubbish code i was messing with.

As the subject says, it doesn't look like the registers are showing on this system.

Dual core system:

cpu family      : 6
model           : 15
model name      : Intel(R) Core(TM)2 Duo CPU     T7500  @ 2.20GHz
stepping        : 11

Compiled with:

# gcc -O0 -S -g -m32 -nostdlib binsearch.s -o binsearch

# gdb binsearch
GNU gdb (GDB) Fedora (7.3-41.fc15)
<snip>

(gdb) layout regs
(gdb) break 1
Breakpoint 1 at	0x4000b0: file binsearch.s, line 1.
(gdb) run
Starting program: /home/wmealing/Documents/workspace/asm/binsearch 
Register 57 is not available
Register 57 is not available
(gdb) i r

rax    	       0x0	0
rbx    	       0x0	0
rcx    	       0x0	0
rdx    	       0x0	0
rsi    	       0x0	0
rdi    	       0x0	0
rbp    	       0x0	0x0
rsp    	       0x7fffffffe1a0	0x7fffffffe1a0
r8     	       0x0	0
r9     	       0x0	0
r10    	       0x0	0
r11    	       0x200	512
r12    	       0x0	0
r13    	       0x0	0

etc.. etc


Interestingly it also gives 

"Warning: the current language does not match this frame"

I expected registers to appear as i step through the assembly code.

gdb-7.3-41.fc15.x86_64
glibc-common-2.14-4.x86_64
glibc-2.14-4.i686
glibc-2.14-4.x86_64

I'm going to attach the simple , unfinished code that i was playing around in.
Comment 1 Pedro Alves 2011-08-10 16:28:05 UTC
Created attachment 5893 [details]
fix
Comment 2 Pedro Alves 2011-08-10 16:28:45 UTC
Please try the patch I just attached and let me know how it goes.
Comment 3 Pedro Alves 2011-08-10 18:29:55 UTC
Created attachment 5894 [details]
fix-2

That wasn't enough.  There were other places with the same problem.
Here's a hopefully complete fix.
Comment 4 wmealing 2011-08-11 16:44:34 UTC
I can confirm that this fixes the problem mentioned.
Comment 5 cvs-commit@gcc.gnu.org 2011-08-12 17:04:36 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	palves@sourceware.org	2011-08-12 17:04:32

Modified files:
	gdb            : ChangeLog 
	gdb/tui        : tui-regs.c 

Log message:
	2011-08-12  Pedro Alves  <pedro@codesourcery.com>
	
	PR tui/13073
	
	gdb/
	* tui/tui-regs.c (tui_show_register_group): Skip registers with an
	empty name.
	(tui_show_register_group): Don't store a byte buffer in the data
	element's value.
	(tui_register_format): Skip registers with an empty name.
	(tui_get_register): Store a struct value in the data element's
	value field instead of a byte buffer holding the raw register
	contents.  Account for optimized-out and unavailable registers
	when comparing register contents.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.13264&r2=1.13265
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/tui/tui-regs.c.diff?cvsroot=src&r1=1.44&r2=1.45
Comment 6 cvs-commit@gcc.gnu.org 2011-08-12 17:06:29 UTC
CVSROOT:	/cvs/src
Module name:	src
Branch: 	gdb_7_3-branch
Changes by:	palves@sourceware.org	2011-08-12 17:06:26

Modified files:
	gdb            : ChangeLog 
	gdb/tui        : tui-regs.c 

Log message:
	2011-08-12  Pedro Alves  <pedro@codesourcery.com>
	
	PR tui/13073
	
	* tui/tui-regs.c (tui_show_register_group): Skip registers with an
	empty name.
	(tui_show_register_group): Don't store a byte buffer in the data
	element's value.
	(tui_register_format): Skip registers with an empty name.
	(tui_get_register): Store a struct value in the data element's
	value field instead of a byte buffer holding the raw register
	contents.  Account for optimized-out and unavailable registers
	when comparing register contents.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.12887.2.66&r2=1.12887.2.67
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/tui/tui-regs.c.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.44&r2=1.44.2.1
Comment 7 Pedro Alves 2011-08-12 17:18:48 UTC
Thanks.  Fix applied on mainline and on the 7.3 branch.
Comment 8 Tristan Moody 2011-10-26 20:21:41 UTC
*** Bug 13340 has been marked as a duplicate of this bug. ***
Comment 9 Jackie Rosen 2014-02-16 18:27:55 UTC Comment hidden (spam)