* [PING][Patch RFC] ARI changes for p-valprint.c
@ 2007-09-07 10:12 Pierre Muller
2007-09-07 11:58 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Pierre Muller @ 2007-09-07 10:12 UTC (permalink / raw)
To: gdb-patches
<> I got no comments on this email :(
<> Should I check it in nevertheless?
<>
<> Original message starts here:
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
<> I updated the diff to the current cvs.
ChangeLog entry
2007-09-07 Pierre Muller <muller@ics.u-strasbg.fr>
* p-valprint.c: Fix 7 ARI reported problems.
$ cvs diff -up p-valprint.c
Index: p-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/p-valprint.c,v
retrieving revision 1.50
diff -u -p -r1.50 p-valprint.c
--- p-valprint.c 23 Aug 2007 18:08:36 -0000 1.50
+++ p-valprint.c 7 Sep 2007 10:04:47 -0000
@@ -85,8 +85,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'))
@@ -164,7 +164,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
@@ -217,7 +217,7 @@ pascal_val_print (struct type *type, con
int is_this_fld;
if (msymbol != NULL)
- wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol),
block,
+ wsym = lookup_symbol ((msymbol)->ginfo.name, block,
VAR_DOMAIN, &is_this_fld, NULL);
if (wsym)
@@ -252,11 +252,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);
}
@@ -530,14 +528,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 */
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PING][Patch RFC] ARI changes for p-valprint.c 2007-09-07 10:12 [PING][Patch RFC] ARI changes for p-valprint.c Pierre Muller @ 2007-09-07 11:58 ` Daniel Jacobowitz 2007-09-07 12:18 ` Pierre Muller 0 siblings, 1 reply; 5+ messages in thread From: Daniel Jacobowitz @ 2007-09-07 11:58 UTC (permalink / raw) To: Pierre Muller; +Cc: gdb-patches On Fri, Sep 07, 2007 at 12:12:20PM +0200, Pierre Muller wrote: > 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. Yes, more details are needed. It should have a function-level description of changes, except when you're making huge mechanical changes. > - deprecated_print_address_numeric (addr, 1, stream); > + fputs_filtered (paddress(addr), stream); Space before parentheses, please. > @@ -217,7 +217,7 @@ pascal_val_print (struct type *type, con > int is_this_fld; > > if (msymbol != NULL) > - wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), > block, > + wsym = lookup_symbol ((msymbol)->ginfo.name, block, > VAR_DOMAIN, &is_this_fld, NULL); > > if (wsym) No, please don't use the members directly. Replace this with one of the other SYMBOL_*_NAME macros. Originally, this used to be SYMBOL_NAME; then the others were introduced, and this one was deprecated because it did not make clear what sort of name was wanted. Since it is being passed to lookup_symbol, SYMBOL_LINKAGE_NAME is probably best. > + fputs_filtered (paddress( Space again. Looks fine otherwise. Sorry for not getting to it before. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PING][Patch RFC] ARI changes for p-valprint.c 2007-09-07 11:58 ` Daniel Jacobowitz @ 2007-09-07 12:18 ` Pierre Muller 2007-09-07 12:20 ` 'Daniel Jacobowitz' 0 siblings, 1 reply; 5+ messages in thread From: Pierre Muller @ 2007-09-07 12:18 UTC (permalink / raw) To: 'Daniel Jacobowitz', gdb-patches Thanks for your comments Daniel, Here is a new version of the patch, together with a more precise ChangeLog entry. OK to commit? Pierre ChangeLog entry 2007-09-07 Pierre Muller <muller@ics.u-strasbg.fr> * p-valprint.c: Fix 7 ARI reported problems. (pascal_val_print): Fix one operator at end of line issue. Use paddress function to remove use of deprecated_print_address_numeric function (2 times). Use SYMBOL_LINKAGE_NAME instead of DEPRECATED_SYMBOL_NAME. (pascal_value_print): Fix 3 operator at end of line issues. $ cvs diff -up p-valprint.c Index: p-valprint.c =================================================================== RCS file: /cvs/src/src/gdb/p-valprint.c,v retrieving revision 1.50 diff -u -p -r1.50 p-valprint.c --- p-valprint.c 23 Aug 2007 18:08:36 -0000 1.50 +++ p-valprint.c 7 Sep 2007 12:08:26 -0000 @@ -85,8 +85,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')) @@ -164,7 +164,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 @@ -217,7 +217,7 @@ pascal_val_print (struct type *type, con int is_this_fld; if (msymbol != NULL) - wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block, + wsym = lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol), block, VAR_DOMAIN, &is_this_fld, NULL); if (wsym) @@ -252,11 +252,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); } @@ -530,14 +528,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 */ > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] On Behalf Of Daniel Jacobowitz > Sent: Friday, September 07, 2007 1:59 PM > To: Pierre Muller > Cc: gdb-patches@sourceware.org > Subject: Re: [PING][Patch RFC] ARI changes for p-valprint.c > > On Fri, Sep 07, 2007 at 12:12:20PM +0200, Pierre Muller wrote: > > 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. > > Yes, more details are needed. It should have a function-level > description of changes, except when you're making huge mechanical > changes. > > > - deprecated_print_address_numeric (addr, 1, stream); > > + fputs_filtered (paddress(addr), stream); > > Space before parentheses, please. > > > @@ -217,7 +217,7 @@ pascal_val_print (struct type *type, con > > int is_this_fld; > > > > if (msymbol != NULL) > > - wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME > (msymbol), > > block, > > + wsym = lookup_symbol ((msymbol)->ginfo.name, > block, > > VAR_DOMAIN, &is_this_fld, > NULL); > > > > if (wsym) > > No, please don't use the members directly. Replace this with one of > the other SYMBOL_*_NAME macros. Originally, this used to be > SYMBOL_NAME; then the others were introduced, and this one was > deprecated because it did not make clear what sort of name was > wanted. Since it is being passed to lookup_symbol, > SYMBOL_LINKAGE_NAME is probably best. > > > + fputs_filtered (paddress( > > Space again. > > Looks fine otherwise. Sorry for not getting to it before. > > -- > Daniel Jacobowitz > CodeSourcery ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PING][Patch RFC] ARI changes for p-valprint.c 2007-09-07 12:18 ` Pierre Muller @ 2007-09-07 12:20 ` 'Daniel Jacobowitz' 2007-09-07 12:36 ` Pierre Muller 0 siblings, 1 reply; 5+ messages in thread From: 'Daniel Jacobowitz' @ 2007-09-07 12:20 UTC (permalink / raw) To: Pierre Muller; +Cc: gdb-patches On Fri, Sep 07, 2007 at 02:18:07PM +0200, Pierre Muller wrote: > Thanks for your comments Daniel, > > Here is a new version of the patch, > together with a more precise ChangeLog entry. > OK to commit? Yep. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PING][Patch RFC] ARI changes for p-valprint.c 2007-09-07 12:20 ` 'Daniel Jacobowitz' @ 2007-09-07 12:36 ` Pierre Muller 0 siblings, 0 replies; 5+ messages in thread From: Pierre Muller @ 2007-09-07 12:36 UTC (permalink / raw) To: 'Daniel Jacobowitz'; +Cc: gdb-patches Committed, (does that really take two t letters?) Thanks for the fast replies, Pierre Muller > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] On Behalf Of 'Daniel Jacobowitz' > Sent: Friday, September 07, 2007 2:20 PM > To: Pierre Muller > Cc: gdb-patches@sourceware.org > Subject: Re: [PING][Patch RFC] ARI changes for p-valprint.c > > On Fri, Sep 07, 2007 at 02:18:07PM +0200, Pierre Muller wrote: > > Thanks for your comments Daniel, > > > > Here is a new version of the patch, > > together with a more precise ChangeLog entry. > > OK to commit? > > Yep. > > -- > Daniel Jacobowitz > CodeSourcery ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-09-07 12:36 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2007-09-07 10:12 [PING][Patch RFC] ARI changes for p-valprint.c Pierre Muller 2007-09-07 11:58 ` Daniel Jacobowitz 2007-09-07 12:18 ` Pierre Muller 2007-09-07 12:20 ` 'Daniel Jacobowitz' 2007-09-07 12:36 ` Pierre Muller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox