🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #1162

gdb/valprint.c:common_val_print

#1162
From: Morten Welinder
Date: Sat, 08 Sep 2007 00:19
32 lines
3391 bytes
Hi,

I am working on extending gdb's printing capabilities and I have noticed that
sometimes the "valaddr" (+embedded_offset) and "address" arguments to
val_print get out of sync.

To me it looks like common_val_print should add value_offset(val) to the
result of VALUE_ADDRESS, but I could be wrong.

The call in question is the second call print_pair below.  The value type
in question is std::pair<int,std::string> in case it matters.  value_offset is
20 for me; value_embedded_offset is (from memory) zero.

I have been working with gdb 6.5 (on i386), but common_val_print appears
unchanged in 6.6.

Morten


static void
print_pair (struct ui_file *stream, struct value *v,
	    int format, int deref_ref, int recurse, enum val_prettyprint pretty)
{

  fputs_filtered ("<", stream);
  common_val_print (value_struct_elt (&v, NULL, "first", NULL, NULL),
		    stream, format, deref_ref, recurse, pretty);
  fputs_filtered (",", stream);
  common_val_print (value_struct_elt (&v, NULL, "second", NULL, NULL),
		    stream, format, deref_ref, recurse, pretty);
  fputs_filtered (">", stream);
}
Technical Details
Message-ID: <mailman.500.1189248515.18990.bug-gdb@gnu.org>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f5053,a120779231580074,start
X-Google-Attributes: gidf5053,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail
From: "Morten Welinder" <mwelinder@gmail.com>
Newsgroups: gnu.gdb.bug
Subject: gdb/valprint.c:common_val_print
Date: Fri, 7 Sep 2007 20:19:14 -0400
Lines: 34
Approved: bug-gdb@gnu.org
Message-ID: <mailman.500.1189248515.18990.bug-gdb@gnu.org>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1189248515 28088 199.232.76.165 (8 Sep 2007 10:48:35 GMT)
X-Complaints-To: news@news.stanford.edu
To: bug-gdb@gnu.org
Envelope-to: bug-gdb@gnu.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta;
 h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
 bh=RNf25ahcifeLGsJB+MybOXfJAo7o73ZY5XwAz/xuj80=;
 b=R9oZpT6AK9qbOcmgsH8smi6srleCot2O9cvbEMG/XKBjherK4RVzfGcr6vxHREnnavXFmqrSWSTxgtFXUZh9eSQm8Z9tLR47SdMgtCLSkNAQRoPYVmC+baikXqwxzRQxTS3J/g3L0/LxcaZ7STEYuL5tOCEyZEQcEbYwO1slFek=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta;
 h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
 b=ppU9YDlp6CRrsxyZlA16B3Mo8y8D5pG+gn1LcKHjtkx/sfaXV17cwuUKA4PGyJ0wPB5hjjgDi4yhXdSLhGQdJk2WAAho1BXP0eX3mlD+3LxIfBAdMnX3is/80lePlI+w/LDT7FpBc03EDSRsGWuOS1EHs59dkashAe8g/lVG5o4=
Content-Disposition: inline
X-Detected-Kernel: Linux 2.6 (newer, 2)
X-Mailman-Approved-At: Sat, 08 Sep 2007 06:48:33 -0400
X-BeenThere: bug-gdb@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Bug reports for GDB, the GNU debugger" <bug-gdb.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-gdb>
List-Post: <mailto:bug-gdb@gnu.org>
List-Help: <mailto:bug-gdb-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=subscribe>