Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ramana Radhakrishnan" <ramana.radhakrishnan@codito.com>
To: "Daniel Jacobowitz" <drow@false.org>
Cc: "Ramana Radhakrishnan" <ramana.radhakrishnan@codito.com>,
	gdb-patches@sources.redhat.com, cagney@gnu.org
Subject: Re: [PATCH] Fix for PR exp/1821
Date: Mon, 06 Dec 2004 03:51:00 -0000	[thread overview]
Message-ID: <32820.203.212.198.34.1102305828.squirrel@webmail.codito.com> (raw)
In-Reply-To: <20041205191152.GA20357@nevyn.them.org>

[-- Attachment #1: Type: text/plain, Size: 628 bytes --]

Hi Daniel,

>
> Yes, this is OK, with a couple of formatting corrections (see below).
> Do you think you could add a testcase for this problem?


Corrected the formatting errors and added a testcase for this.
gdb.base/gdb1821.c / gdb1821.exp .

Ok to commit ?

regards
Ramana


ChangeLog:

2004-12-06  Ramana Radhakrishnan  <ramana.radhakrishnan@codito.com>

	PR exp/1821
	* cp_valprint.c(cp_print_value_fields): Include language.h .
	Pass current_language to fprintf_symbol_filtered
	* testsuite/gdb.base/gdb1821.c: New test file
	* testsuite/gdb.base/gdb1821.exp: New test file



----
Ramana Radhakrishnan
Codito Technologies

[-- Attachment #2: gdb1821patch --]
[-- Type: application/octet-stream, Size: 4054 bytes --]

--- /dev/null	2003-09-15 19:10:47.000000000 +0530
+++ testsuite/gdb.base/gdb1821.exp	2004-12-06 09:07:46.925182104 +0530
@@ -0,0 +1,49 @@
+# Copyright 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+
+# Tests for PR gdb/1821.
+# 2004-12-06  Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
+
+# This file is part of the gdb testsuite.
+
+if $tracelevel then {
+        strace $tracelevel
+        }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "gdb1821"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_load ${binfile}
+
+if ![runto main] then {
+    perror "couldn't run to breakpoint"
+    continue
+} 
+gdb_test "print /x bar" "{x__0 = 0x0, y__0 = 0x0, z__1 = 0x0}" 
+
--- /dev/null	2003-09-15 19:10:47.000000000 +0530
+++ testsuite/gdb.base/gdb1821.c	2004-12-06 09:08:45.644255448 +0530
@@ -0,0 +1,25 @@
+/* Test printing of structure member names in gdb. PR exp/1821
+
+   Copyright 2004, Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+struct foo { double x__0, y__0, z__1; } bar;
+
+
+int main(void) { return 0; }
--- cp-valprint.c.~1.27.~	2004-12-06 02:26:31.000000000 +0530
+++ cp-valprint.c	2004-12-06 08:39:29.487231896 +0530
@@ -35,6 +35,7 @@
 #include "target.h"
 #include "cp-abi.h"
 #include "valprint.h"
+#include "language.h"
 
 int vtblprint;			/* Controls printing of vtbl's */
 int objectprint;		/* Controls looking up an object's derived type
@@ -317,11 +318,11 @@
 	      if (TYPE_FIELD_STATIC (type, i))
 		fputs_filtered ("static ", stream);
 	      fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
-				       language_cplus,
+				       current_language->la_language,
 				       DMGL_PARAMS | DMGL_ANSI);
 	      fputs_filtered ("\" \"", stream);
 	      fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
-				       language_cplus,
+				       current_language->la_language,
 				       DMGL_PARAMS | DMGL_ANSI);
 	      fputs_filtered ("\") \"", stream);
 	    }
@@ -332,7 +333,7 @@
 	      if (TYPE_FIELD_STATIC (type, i))
 		fputs_filtered ("static ", stream);
 	      fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
-				       language_cplus,
+				       current_language->la_language ,
 				       DMGL_PARAMS | DMGL_ANSI);
 	      annotate_field_name_end ();
 	      /* do not print leading '=' in case of anonymous unions */

  reply	other threads:[~2004-12-06  3:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-05 19:12 Ramana Radhakrishnan
2004-12-05 19:37 ` Daniel Jacobowitz
2004-12-06  3:51   ` Ramana Radhakrishnan [this message]
2005-02-10  8:33     ` Daniel Jacobowitz
2005-02-10 10:32       ` Ramana Radhakrishnan
2005-02-10 11:02         ` [PATCH] resubmit " Ramana Radhakrishnan
2005-02-10 20:53           ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32820.203.212.198.34.1102305828.squirrel@webmail.codito.com \
    --to=ramana.radhakrishnan@codito.com \
    --cc=cagney@gnu.org \
    --cc=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox