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



Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.68
diff -u -p -r1.68 dwarf2read.c
--- dwarf2read.c 9 Oct 2002 04:43:49 -0000 1.68
+++ dwarf2read.c 16 Oct 2002 00:15:07 -0000
@@ -683,6 +683,10 @@ static struct complaint dwarf2_invalid_a
{
"invalid attribute class or form for '%s' in '%s'", 0, 0
};
+static struct complaint dwarf2_invalid_pointer_size = +{
+ "invalid pointer size %d", 0, 0
+};
Please use the new complaint() interface.

+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?

+F:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:char *name, int *type_flags_ptr:name, type_flags_ptr
EOF
}
Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.59
diff -u -p -r1.59 gdbtypes.c
--- gdbtypes.c 2 Oct 2002 22:01:53 -0000 1.59
+++ gdbtypes.c 16 Oct 2002 00:15:10 -0000
@@ -397,11 +397,15 @@ lookup_function_type (struct type *type)
extern int
address_space_name_to_int (char *space_identifier)
{
+ int type_flags;
/* Check for known address space delimiters. */
if (!strcmp (space_identifier, "code"))
return TYPE_FLAG_CODE_SPACE;
else if (!strcmp (space_identifier, "data"))
return TYPE_FLAG_DATA_SPACE;
+ else if (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P ()
+ && ADDRESS_CLASS_NAME_TO_TYPE_FLAGS (space_identifier, &type_flags))
+ return type_flags;
else
error ("Unknown address space specifier: \"%s\"", space_identifier);
}
@@ -416,6 +420,9 @@ address_space_int_to_name (int space_fla
return "code";
else if (space_flag & TYPE_FLAG_DATA_SPACE)
return "data";
+ else if ((space_flag & TYPE_FLAG_ADDRESS_CLASS_ALL)
+ && ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P ())
+ return ADDRESS_CLASS_TYPE_FLAGS_TO_NAME (space_flag);
else
return NULL;
}
Is there a lurking bug here? Is something like:

@short @data

valid (I think so) yet, the above can only print one of those names. Similarly should something like:

@code @data

be rejected?

Looking at the use of these functions. Everything is refering to ``address space'' vis:

address_space_id = address_space_int_to_name (TYPE_INSTANCE_FLAGS (type));
if (address_space_id)
{
if (did_print_modifier || need_pre_space)
fprintf_filtered (stream, " ");
fprintf_filtered (stream, "@%s", address_space_id);
did_print_modifier = 1;
}

yet with this patch, that is definitly no longer true! I think the calling code needs to be updated so that it uses a more meaningful name.

How would code use this to add an ``@io'' pointer?

Andrew



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