This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH]: Address ARI problems in ada-* files
- From: Paul Hilfinger <hilfingr at gnat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 1 Jul 2004 06:15:25 -0400 (EDT)
- Subject: [PATCH]: Address ARI problems in ada-* files
As Andrew suggested, I committed the following patch fixing problems
reported by gdb_ari.sh.
Since we are not asking for it to be reviewed yet, and every indication is
that we will want to revise it greatly anyway, I will remove ada-tasks.c
from the repository in a day or so (also as Andrew suggested).
Paul Hilfinger
2004-07-01 Paul N. Hilfinger <Hilfinger@gnat.com>
Address complaints from gdb_ari.sh:
* ada-exp.y: Include gdb_string.h rather than string.h.
(convert_char_literal): Reformat declaration.
* ada-lang.h: Include opaque struct declaration for struct frame_info.
* ada-lex.l: Change use of free to xfree (the macro would do so
anyway, but this is harmless).
Include gdb_string.h rather than string.h.
* ada-valprint.c (ada_val_print_stub): Change PTR => void*.
* ada-lang.c (parse): Remove K&Rism in parameter list.
(is_name_suffix): Correct Linux => GNU/Linux in comment.
Index: gdb/ada-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/ada-exp.y,v
retrieving revision 1.9
diff -u -p -r1.9 ada-exp.y
--- gdb/ada-exp.y 2 Jun 2004 09:55:36 -0000 1.9
+++ gdb/ada-exp.y 1 Jul 2004 10:03:34 -0000
@@ -38,7 +38,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg
%{
#include "defs.h"
-#include <string.h>
+#include "gdb_string.h"
#include <ctype.h>
#include "expression.h"
#include "value.h"
@@ -125,8 +125,7 @@ static void write_object_renaming (struc
static void write_var_from_name (struct block *, struct name_info);
-static LONGEST
-convert_char_literal (struct type *, LONGEST);
+static LONGEST convert_char_literal (struct type *, LONGEST);
%}
%union
Index: gdb/ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.44
diff -u -p -r1.44 ada-lang.c
--- gdb/ada-lang.c 28 Jun 2004 23:59:27 -0000 1.44
+++ gdb/ada-lang.c 1 Jul 2004 10:03:36 -0000
@@ -2596,9 +2596,9 @@ resolve_subexp (struct expression **expp
break;
case OP_STRING:
- (*pos) += 3
- + BYTES_TO_EXP_ELEM (longest_to_int (exp->elts[pc + 1].longconst) +
- 1);
+ (*pos) += 3
+ + BYTES_TO_EXP_ELEM (longest_to_int (exp->elts[pc + 1].longconst)
+ + 1);
break;
case TERNOP_SLICE:
@@ -4755,7 +4755,8 @@ ada_lookup_symbol_nonlocal (const char *
names (e.g., XVE) are not included here. Currently, the possible suffixes
are given by either of the regular expression:
- (__[0-9]+)?\.[0-9]+ [nested subprogram suffix, on platforms such as Linux]
+ (__[0-9]+)?\.[0-9]+ [nested subprogram suffix, on platforms such
+ as GNU/Linux]
___[0-9]+ [nested subprogram suffix, on platforms such as HP/UX]
(X[nb]*)?((\$|__)[0-9](_?[0-9]+)|___(LJM|X([FDBUP].*|R[^T]?)))?$
*/
@@ -10098,7 +10099,7 @@ emit_char (int c, struct ui_file *stream
}
static int
-parse ()
+parse (void)
{
warnings_issued = 0;
return ada_parse ();
Index: gdb/ada-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.h,v
retrieving revision 1.9
diff -u -p -r1.9 ada-lang.h
--- gdb/ada-lang.h 16 Jun 2004 08:18:06 -0000 1.9
+++ gdb/ada-lang.h 1 Jul 2004 10:03:36 -0000
@@ -22,6 +22,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg
#define ADA_LANG_H 1
struct partial_symbol;
+struct frame_info;
#include "value.h"
#include "gdbtypes.h"
Index: gdb/ada-lex.l
===================================================================
RCS file: /cvs/src/src/gdb/ada-lex.l,v
retrieving revision 1.4
diff -u -p -r1.4 ada-lex.l
--- gdb/ada-lex.l 2 Jun 2004 09:55:36 -0000 1.4
+++ gdb/ada-lex.l 1 Jul 2004 10:03:36 -0000
@@ -331,7 +331,7 @@ xor { return XOR; }
%%
#include <ctype.h>
-#include <string.h>
+#include "gdb_string.h"
/* Initialize the lexer for processing new expression */
void
@@ -724,7 +724,7 @@ name_lookup (char *name0, char *err_name
strlen (renaming) + len0
- yylval.ssym.stoken.length + 1);
strcpy (new_name, renaming);
- free (renaming);
+ xfree (renaming);
strcat (new_name, name0 + yylval.ssym.stoken.length);
result = name_lookup (new_name, err_name, token_type, depth - 1);
if (result > segments)
Index: gdb/ada-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-valprint.c,v
retrieving revision 1.10
diff -u -p -r1.10 ada-valprint.c
--- gdb/ada-valprint.c 2 Jun 2004 09:55:36 -0000 1.10
+++ gdb/ada-valprint.c 1 Jul 2004 10:03:36 -0000
@@ -69,7 +69,7 @@ static void val_print_packed_array_eleme
static void adjust_type_signedness (struct type *);
-static int ada_val_print_stub (PTR args0);
+static int ada_val_print_stub (void *args0);
static int ada_val_print_1 (struct type *, char *, int, CORE_ADDR,
struct ui_file *, int, int, int,
@@ -563,7 +563,7 @@ ada_val_print (struct type *type, char *
/* Helper for ada_val_print; used as argument to catch_errors to
unmarshal the arguments to ada_val_print_1, which does the work. */
static int
-ada_val_print_stub (PTR args0)
+ada_val_print_stub (void *args0)
{
struct ada_val_print_args *argsp = (struct ada_val_print_args *) args0;
return ada_val_print_1 (argsp->type, argsp->valaddr0,