Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix for PR exp/1821
@ 2004-12-05 19:12 Ramana Radhakrishnan
  2004-12-05 19:37 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Ramana Radhakrishnan @ 2004-12-05 19:12 UTC (permalink / raw)
  To: gdb-patches; +Cc: cagney, dk

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

Hi ,

I was looking at PR 1821 today and realized that the problem is because 
cplus_print_value_fields is shared between c-valprint.c and 
cp-valprint.c . fprintf_symbol_filtered is called with language_cplus 
automatically while it should be dependent on the current language .


This patch attempts to use current_language->la_language to pass to 
fprintf_symbol_filtered so that the correct demangler is used. Tested 
with i686-pc-linux-gnu using gcc 3.3.4 (Debian) and no extra regressions.

Ok to commit ?

cheers
Ramana


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

         Fix PR exp/1821
         * cp-valprint.c(cp_print_value_fields): Pass current language to
	fprintf_symbol_filtered.

[-- Attachment #2: gdbpr1821patch --]
[-- Type: text/plain, Size: 2612 bytes --]

Index: cp-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/cp-valprint.c,v
retrieving revision 1.27
diff -c -3 -p -r1.27 cp-valprint.c
*** cp-valprint.c	12 Nov 2004 21:45:06 -0000	1.27
--- cp-valprint.c	5 Dec 2004 18:23:27 -0000
***************
*** 35,41 ****
  #include "target.h"
  #include "cp-abi.h"
  #include "valprint.h"
! 
  int vtblprint;			/* Controls printing of vtbl's */
  int objectprint;		/* Controls looking up an object's derived type
  				   using what we find in its vtables.  */
--- 35,41 ----
  #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
  				   using what we find in its vtables.  */
*************** cp_print_value_fields (struct type *type
*** 317,327 ****
  	      if (TYPE_FIELD_STATIC (type, i))
  		fputs_filtered ("static ", stream);
  	      fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
! 				       language_cplus,
  				       DMGL_PARAMS | DMGL_ANSI);
  	      fputs_filtered ("\" \"", stream);
  	      fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
! 				       language_cplus,
  				       DMGL_PARAMS | DMGL_ANSI);
  	      fputs_filtered ("\") \"", stream);
  	    }
--- 317,327 ----
  	      if (TYPE_FIELD_STATIC (type, i))
  		fputs_filtered ("static ", stream);
  	      fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
! 				       current_language->la_language,
  				       DMGL_PARAMS | DMGL_ANSI);
  	      fputs_filtered ("\" \"", stream);
  	      fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
! 				       current_language->la_language,
  				       DMGL_PARAMS | DMGL_ANSI);
  	      fputs_filtered ("\") \"", stream);
  	    }
*************** cp_print_value_fields (struct type *type
*** 332,338 ****
  	      if (TYPE_FIELD_STATIC (type, i))
  		fputs_filtered ("static ", stream);
  	      fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
! 				       language_cplus,
  				       DMGL_PARAMS | DMGL_ANSI);
  	      annotate_field_name_end ();
  	      /* do not print leading '=' in case of anonymous unions */
--- 332,338 ----
  	      if (TYPE_FIELD_STATIC (type, i))
  		fputs_filtered ("static ", stream);
  	      fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
! 				       current_language->la_language,
  				       DMGL_PARAMS | DMGL_ANSI);
  	      annotate_field_name_end ();
  	      /* do not print leading '=' in case of anonymous unions */

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-02-10 18:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-05 19:12 [PATCH] Fix for PR exp/1821 Ramana Radhakrishnan
2004-12-05 19:37 ` Daniel Jacobowitz
2004-12-06  3:51   ` Ramana Radhakrishnan
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox