This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH RFA/RFC] Address class support


On Oct 21,  7:49pm, Andrew Cagney wrote:

> > +F:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:char *:address_class_type_flags_to_name:int type_flags:type_flags
> Is it possible to ``const char *'' propogate this 
> (address_space_int_to_name()) would need to be changed?

Yes.  I've just committed the patch below.

	* gdbarch.sh (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME)
	(ADDRESS_CLASS_NAME_TO_TYPE_FLAGS): Use ``const char *'' instead of
	``char *'' for return and parameter types.
	* gdbarch.h, gdbarch.c: Regenerate.
	* gdbtypes.h, gdbtypes.c (address_space_int_to_name): Change
	return type from ``char *'' to ``const char *''.
	* c-typeprint.c (c_type_print_modifier): Make ``address_space_id''
	const.

Index: c-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-typeprint.c,v
retrieving revision 1.23
diff -u -p -r1.23 c-typeprint.c
--- c-typeprint.c	14 Oct 2002 22:58:28 -0000	1.23
+++ c-typeprint.c	11 Dec 2002 20:13:08 -0000
@@ -300,7 +300,7 @@ c_type_print_modifier (struct type *type
 		       int need_pre_space, int need_post_space)
 {
   int did_print_modifier = 0;
-  char *address_space_id;
+  const char *address_space_id;
 
   /* We don't print `const' qualifiers for references --- since all
      operators affect the thing referenced, not the reference itself,
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.184
diff -u -p -r1.184 gdbarch.sh
--- gdbarch.sh	11 Dec 2002 02:26:35 -0000	1.184
+++ gdbarch.sh	11 Dec 2002 20:13:10 -0000
@@ -676,8 +676,8 @@ v::NAME_OF_MALLOC:const char *:name_of_m
 v::CANNOT_STEP_BREAKPOINT:int:cannot_step_breakpoint::::0:0::0
 v::HAVE_NONSTEPPABLE_WATCHPOINT:int:have_nonsteppable_watchpoint::::0:0::0
 F:2:ADDRESS_CLASS_TYPE_FLAGS:int:address_class_type_flags:int byte_size, int dwarf2_addr_class:byte_size, dwarf2_addr_class
-M:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:char *:address_class_type_flags_to_name:int type_flags:type_flags:
-M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:char *name, int *type_flags_ptr:name, type_flags_ptr
+M:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:const char *:address_class_type_flags_to_name:int type_flags:type_flags:
+M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:const char *name, int *type_flags_ptr:name, type_flags_ptr
 # Is a register in a group
 m:::int:register_reggroup_p:int regnum, struct reggroup *reggroup:regnum, reggroup:::default_register_reggroup_p::0
 EOF
Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.62
diff -u -p -r1.62 gdbtypes.c
--- gdbtypes.c	25 Oct 2002 22:25:55 -0000	1.62
+++ gdbtypes.c	11 Dec 2002 20:13:11 -0000
@@ -416,7 +416,7 @@ address_space_name_to_int (char *space_i
 /* Identify address space identifier by integer flag as defined in 
    gdbtypes.h -- return the string version of the adress space name. */
 
-extern char *
+const char *
 address_space_int_to_name (int space_flag)
 {
   struct gdbarch *gdbarch = current_gdbarch;
Index: gdbtypes.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.h,v
retrieving revision 1.38
diff -u -p -r1.38 gdbtypes.h
--- gdbtypes.h	11 Nov 2002 00:55:34 -0000	1.38
+++ gdbtypes.h	11 Dec 2002 20:13:11 -0000
@@ -1096,7 +1096,7 @@ extern void replace_type (struct type *,
 
 extern int address_space_name_to_int (char *);
 
-extern char *address_space_int_to_name (int);
+extern const char *address_space_int_to_name (int);
 
 extern struct type *make_type_with_address_space (struct type *type, 
 						  int space_identifier);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]