This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[Patch RFC] ARI changes for p-valprint.c
- From: "Pierre Muller" <muller at ics dot u-strasbg dot fr>
- To: <gdb-patches at sourceware dot org>
- Date: Fri, 27 Jul 2007 11:15:07 +0200
- Subject: [Patch RFC] ARI changes for p-valprint.c
I looked at the ARI failures of pascal specific
files and tried to fix them.
Here is a first bunch related to the
input file p-valprint.c:
it fixes three deprecated and four operators at end of line
problems detected in ARI.
I could commit these as pascal maintainer,
but I would like to have feedback,
especially about how to phrase the ChangeLog entry,
I put a minimal here, but would like to know if more details are needed.
Pierre Muller
Chargé de recherches
Institut Charles Sadron
6, rue Boussingault
F 67083 Strasbourg Cedex
Tél.?: +(33)3-88-41-40-07
Email?: pierre.muller@ics.u-strasbg.fr
ChangeLog entry
2007-07-27 Pierre Muller <muller@ics.u-strasbg.fr>
* p-valprint.c: Fix 7 ARI reported problems.
$ cvs diff -u -p p-valprint.c
Index: p-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/p-valprint.c,v
retrieving revision 1.49
diff -u -p -r1.49 p-valprint.c
--- p-valprint.c 13 Jun 2007 17:30:01 -0000 1.49
+++ p-valprint.c 27 Jul 2007 09:11:06 -0000
@@ -87,8 +87,8 @@ pascal_val_print (struct type *type, con
print_spaces_filtered (2 + 2 * recurse, stream);
}
/* For an array of chars, print with string syntax. */
- if (eltlen == 1 &&
- ((TYPE_CODE (elttype) == TYPE_CODE_INT)
+ if (eltlen == 1
+ && ((TYPE_CODE (elttype) == TYPE_CODE_INT)
|| ((current_language->la_language == language_m2)
&& (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
&& (format == 0 || format == 's'))
@@ -166,7 +166,7 @@ pascal_val_print (struct type *type, con
if (addressprint && format != 's')
{
- deprecated_print_address_numeric (addr, 1, stream);
+ fputs_filtered (paddress(addr), stream);
}
/* For a pointer to char or unsigned char, also print the string
@@ -219,7 +219,7 @@ pascal_val_print (struct type *type, con
int is_this_fld;
if (msymbol != NULL)
- wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol),
bloc
k,
+ wsym = lookup_symbol ((msymbol)->ginfo.name, block,
VAR_DOMAIN, &is_this_fld, NULL);
if (wsym)
@@ -254,11 +254,9 @@ pascal_val_print (struct type *type, con
{
fprintf_filtered (stream, "@");
/* Extract the address, assume that it is unsigned. */
- deprecated_print_address_numeric
- (extract_unsigned_integer (valaddr + embedded_offset,
- gdbarch_ptr_bit (current_gdbarch)
- / HOST_CHAR_BIT),
- 1, stream);
+ fputs_filtered (paddress(
+ extract_unsigned_integer (valaddr + embedded_offset,
+ gdbarch_ptr_bit (current_gdbarch) / HOST_CHAR_BIT)), stream);
if (deref_ref)
fputs_filtered (": ", stream);
}
@@ -532,14 +530,14 @@ pascal_value_print (struct value *val, s
Object pascal: if it is a member pointer, we will take care
of that when we print it. */
- if (TYPE_CODE (type) == TYPE_CODE_PTR ||
- TYPE_CODE (type) == TYPE_CODE_REF)
+ if (TYPE_CODE (type) == TYPE_CODE_PTR
+ || TYPE_CODE (type) == TYPE_CODE_REF)
{
/* Hack: remove (char *) for char strings. Their
type is indicated by the quoted string anyway. */
- if (TYPE_CODE (type) == TYPE_CODE_PTR &&
- TYPE_NAME (type) == NULL &&
- TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL
+ if (TYPE_CODE (type) == TYPE_CODE_PTR
+ && TYPE_NAME (type) == NULL
+ && TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL
&& strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char") == 0)
{
/* Print nothing */