Bug 15837 - GDB prints entry values for locals
Summary: GDB prints entry values for locals
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 7.6
: P2 normal
Target Milestone: ---
Assignee: Yao Qi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-14 09:32 UTC by Yao Qi
Modified: 2013-08-14 11:55 UTC (History)
0 users

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 Yao Qi 2013-08-14 09:32:04 UTC
Only arguments have entry values, local variables don't.  It is wrong to print entry values for local variables.

-gdb-set print entry-values both^M
^done
-stack-list-locals --simple-values
^done,locals=[{name="array",type="unsigned char [2]"},{name="i",type="int",value="<unavailable>"},{name="i@entry",type="int",value="<optimized out>"}]
Comment 1 Yao Qi 2013-08-14 09:35:16 UTC
Patch http://sourceware.org/ml/gdb-patches/2013-08/msg00231.html was committed to  mainline, but 7.6 branch needs this patch too.  I'll post it.
Comment 2 cvs-commit@gcc.gnu.org 2013-08-14 11:53:13 UTC
CVSROOT:	/cvs/src
Module name:	src
Branch: 	gdb_7_6-branch
Changes by:	qiyao@sourceware.org	2013-08-14 11:53:11

Modified files:
	gdb            : ChangeLog frame.h stack.c 
	gdb/mi         : mi-cmd-stack.c 

Log message:
	gdb/
	
	PR gdb/15837:
	* frame.h (read_frame_local): Declare.
	* mi/mi-cmd-stack.c (list_args_or_locals): Call
	read_frame_local.
	* stack.c (read_frame_local): New.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.15260.2.57&r2=1.15260.2.58
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/frame.h.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.208&r2=1.208.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/stack.c.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.267&r2=1.267.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/mi/mi-cmd-stack.c.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.67&r2=1.67.2.1
Comment 3 Yao Qi 2013-08-14 11:55:45 UTC
Patch is committed to 7.6 branch.