* [RFA] nuke CONST_PTR
@ 2002-02-13 6:44 Michael Elizabeth Chastain
2002-02-13 7:19 ` Kevin Buettner
2002-02-13 8:15 ` Michael Snyder
0 siblings, 2 replies; 11+ messages in thread
From: Michael Elizabeth Chastain @ 2002-02-13 6:44 UTC (permalink / raw)
To: gdb-patches
This patch removes CONST_PTR from the gdb source, fulfilling
PR gdb/92.
http://sources.redhat.com/cgi-bin/gnatsweb.pl?database=gdb&cmd=view&pr=92
Nuke CONST_PTR
I'm not sure that gdb is ready for this patch yet. Here is some
history.
CONST_PTR was introduced in 1996:
# ChangeLog-1996
* defs.h: Define CONST_PTR as blank if compiling with Microsoft
C, else it's `const'.
In gdb 4.18 and gdb 5.0, CONST_PTR was conditionally defined as nothing
if MSC_VER was defined, and "const" otherwise. In gdb 5.1 and gdb 5.1.1,
CONST_PTR is always defined to "const". So CONST_PTR has been
unconditionally defined for only a few months.
However, in gdb 4.18, gdb 5.0, gdb 5.1, and gdb 5.1, c-lang.c has also
contained this line:
struct type **const (cplus_builtin_types[]) =
So this form has been in gdb source code for four releases already
without drawing complaint.
Testing: I built this on native i686-pc-linux-gnu and ran the test suite.
Okay to apply?
Michael Elizabeth Chastain
<mailto:mec@shout.net>
"love without fear"
===
2002-02-12 Michael Chastain <mec@shout.net>
* defs.h: Kill CONST_PTR.
* c-lang.h (c_builtin_types): Change CONST_PTR to simple "const".
* c-lang.c (c_builtin_types): Likewise.
* ch-lang.c (ch_builtin_types): Likewise.
* f-lang.c (f_builtin_types): Likewise.
* language.c (unknown_builtin_types): Likewise.
* m2-lang.c (m2_builtin_types): Likewise.
* p-lang.c (pascal_builtin_types): Likewise.
* scm-lang.c (c_builtin_types): Likewise.
Index: c-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/c-lang.c,v
retrieving revision 1.9
diff -c -3 -p -r1.9 c-lang.c
*** c-lang.c 2001/12/19 06:29:18 1.9
--- c-lang.c 2002/02/12 10:11:25
***************
*** 1,5 ****
/* C language support routines for GDB, the GNU debugger.
! Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
Free Software Foundation, Inc.
This file is part of GDB.
--- 1,5 ----
/* C language support routines for GDB, the GNU debugger.
! Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002
Free Software Foundation, Inc.
This file is part of GDB.
*************** const struct op_print c_op_print_tab[] =
*** 385,391 ****
{NULL, 0, 0, 0}
};
\f
! struct type **CONST_PTR (c_builtin_types[]) =
{
&builtin_type_int,
&builtin_type_long,
--- 385,391 ----
{NULL, 0, 0, 0}
};
\f
! struct type **const (c_builtin_types[]) =
{
&builtin_type_int,
&builtin_type_long,
Index: c-lang.h
===================================================================
RCS file: /cvs/src/src/gdb/c-lang.h,v
retrieving revision 1.3
diff -c -3 -p -r1.3 c-lang.h
*** c-lang.h 2001/03/06 08:21:06 1.3
--- c-lang.h 2002/02/12 10:11:25
***************
*** 1,5 ****
/* C language support definitions for GDB, the GNU debugger.
! Copyright 1992, 1994, 1995, 1996, 1997, 1998, 2000
Free Software Foundation, Inc.
This file is part of GDB.
--- 1,5 ----
/* C language support definitions for GDB, the GNU debugger.
! Copyright 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2002
Free Software Foundation, Inc.
This file is part of GDB.
*************** extern void c_printstr (struct ui_file *
*** 51,57 ****
extern struct type *c_create_fundamental_type (struct objfile *, int);
! extern struct type **CONST_PTR (c_builtin_types[]);
/* These are in c-typeprint.c: */
--- 51,57 ----
extern struct type *c_create_fundamental_type (struct objfile *, int);
! extern struct type **const (c_builtin_types[]);
/* These are in c-typeprint.c: */
Index: ch-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ch-lang.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 ch-lang.c
*** ch-lang.c 2001/12/25 22:24:38 1.8
--- ch-lang.c 2002/02/12 10:11:26
***************
*** 1,5 ****
/* Chill language support routines for GDB, the GNU debugger.
! Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001
Free Software Foundation, Inc.
This file is part of GDB.
--- 1,5 ----
/* Chill language support routines for GDB, the GNU debugger.
! Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
*************** struct type *builtin_type_chill_long;
*** 322,328 ****
struct type *builtin_type_chill_ulong;
struct type *builtin_type_chill_real;
! struct type **CONST_PTR (chill_builtin_types[]) =
{
&builtin_type_chill_bool,
&builtin_type_chill_char,
--- 322,328 ----
struct type *builtin_type_chill_ulong;
struct type *builtin_type_chill_real;
! struct type **const (chill_builtin_types[]) =
{
&builtin_type_chill_bool,
&builtin_type_chill_char,
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.77
diff -c -3 -p -r1.77 defs.h
*** defs.h 2002/02/10 04:08:41 1.77
--- defs.h 2002/02/12 10:11:29
*************** typedef struct ptid ptid_t;
*** 986,993 ****
#include "fopen-same.h"
#endif
- #define CONST_PTR const
-
/* Defaults for system-wide constants (if not defined by xm.h, we fake it).
FIXME: Assumes 2's complement arithmetic */
--- 986,991 ----
Index: f-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/f-lang.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 f-lang.c
*** f-lang.c 2001/03/06 08:21:07 1.8
--- f-lang.c 2002/02/12 10:11:30
***************
*** 1,5 ****
/* Fortran language support routines for GDB, the GNU debugger.
! Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Contributed by Motorola. Adapted from the C parser by Farooq Butt
(fmbutt@engage.sps.mot.com).
--- 1,5 ----
/* Fortran language support routines for GDB, the GNU debugger.
! Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Contributed by Motorola. Adapted from the C parser by Farooq Butt
(fmbutt@engage.sps.mot.com).
*************** static const struct op_print f_op_print_
*** 429,435 ****
{NULL, 0, 0, 0}
};
\f
! struct type **CONST_PTR (f_builtin_types[]) =
{
&builtin_type_f_character,
&builtin_type_f_logical,
--- 429,435 ----
{NULL, 0, 0, 0}
};
\f
! struct type **const (f_builtin_types[]) =
{
&builtin_type_f_character,
&builtin_type_f_logical,
Index: language.c
===================================================================
RCS file: /cvs/src/src/gdb/language.c,v
retrieving revision 1.21
diff -c -3 -p -r1.21 language.c
*** language.c 2002/02/05 04:37:21 1.21
--- language.c 2002/02/12 10:11:33
***************
*** 1,5 ****
/* Multiple source language support for GDB.
! Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Contributed by the Department of Computer Science at the State University
of New York at Buffalo.
--- 1,5 ----
/* Multiple source language support for GDB.
! Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Contributed by the Department of Computer Science at the State University
of New York at Buffalo.
*************** unk_lang_value_print (struct value *val,
*** 1444,1450 ****
error ("internal error - unimplemented function unk_lang_value_print called.");
}
! static struct type **CONST_PTR (unknown_builtin_types[]) =
{
0
};
--- 1444,1450 ----
error ("internal error - unimplemented function unk_lang_value_print called.");
}
! static struct type **const (unknown_builtin_types[]) =
{
0
};
Index: m2-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/m2-lang.c,v
retrieving revision 1.6
diff -c -3 -p -r1.6 m2-lang.c
*** m2-lang.c 2001/03/06 08:21:09 1.6
--- m2-lang.c 2002/02/12 10:11:34
***************
*** 1,5 ****
/* Modula 2 language support routines for GDB, the GNU debugger.
! Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000
Free Software Foundation, Inc.
This file is part of GDB.
--- 1,5 ----
/* Modula 2 language support routines for GDB, the GNU debugger.
! Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2002
Free Software Foundation, Inc.
This file is part of GDB.
*************** struct type *builtin_type_m2_card;
*** 398,404 ****
struct type *builtin_type_m2_real;
struct type *builtin_type_m2_bool;
! struct type **CONST_PTR (m2_builtin_types[]) =
{
&builtin_type_m2_char,
&builtin_type_m2_int,
--- 398,404 ----
struct type *builtin_type_m2_real;
struct type *builtin_type_m2_bool;
! struct type **const (m2_builtin_types[]) =
{
&builtin_type_m2_char,
&builtin_type_m2_int,
Index: p-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/p-lang.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 p-lang.c
*** p-lang.c 2001/11/09 09:48:09 1.4
--- p-lang.c 2002/02/12 10:11:35
***************
*** 1,5 ****
/* Pascal language support routines for GDB, the GNU debugger.
! Copyright 2000 Free Software Foundation, Inc.
This file is part of GDB.
--- 1,5 ----
/* Pascal language support routines for GDB, the GNU debugger.
! Copyright 2000, 2002 Free Software Foundation, Inc.
This file is part of GDB.
*************** const struct op_print pascal_op_print_ta
*** 407,413 ****
{NULL, 0, 0, 0}
};
\f
! struct type **const /* CONST_PTR v 4.17 */ (pascal_builtin_types[]) =
{
&builtin_type_int,
&builtin_type_long,
--- 407,413 ----
{NULL, 0, 0, 0}
};
\f
! struct type **const (pascal_builtin_types[]) =
{
&builtin_type_int,
&builtin_type_long,
Index: scm-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/scm-lang.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 scm-lang.c
*** scm-lang.c 2002/01/04 05:20:08 1.7
--- scm-lang.c 2002/02/12 10:11:36
*************** static void scm_printstr (struct ui_file
*** 41,47 ****
unsigned int length, int width,
int force_ellipses);
! extern struct type **CONST_PTR (c_builtin_types[]);
struct type *builtin_type_scm;
--- 41,47 ----
unsigned int length, int width,
int force_ellipses);
! extern struct type **const (c_builtin_types[]);
struct type *builtin_type_scm;
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] nuke CONST_PTR
2002-02-13 6:44 [RFA] nuke CONST_PTR Michael Elizabeth Chastain
@ 2002-02-13 7:19 ` Kevin Buettner
2002-02-13 8:15 ` Michael Snyder
1 sibling, 0 replies; 11+ messages in thread
From: Kevin Buettner @ 2002-02-13 7:19 UTC (permalink / raw)
To: Michael Elizabeth Chastain, gdb-patches
On Feb 13, 8:44am, Michael Elizabeth Chastain wrote:
> 2002-02-12 Michael Chastain <mec@shout.net>
>
> * defs.h: Kill CONST_PTR.
> * c-lang.h (c_builtin_types): Change CONST_PTR to simple "const".
> * c-lang.c (c_builtin_types): Likewise.
> * ch-lang.c (ch_builtin_types): Likewise.
> * f-lang.c (f_builtin_types): Likewise.
> * language.c (unknown_builtin_types): Likewise.
> * m2-lang.c (m2_builtin_types): Likewise.
> * p-lang.c (pascal_builtin_types): Likewise.
> * scm-lang.c (c_builtin_types): Likewise.
I proofread your patch and it looks okay to me. I'm not the
maintainer of any of the files in question, but I think this one ought
to go in under the "obvious" fix rule. (Just wait a couple of days
for objections first...)
Kevin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] nuke CONST_PTR
2002-02-13 6:44 [RFA] nuke CONST_PTR Michael Elizabeth Chastain
2002-02-13 7:19 ` Kevin Buettner
@ 2002-02-13 8:15 ` Michael Snyder
2002-02-13 9:30 ` Andrew Cagney
1 sibling, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2002-02-13 8:15 UTC (permalink / raw)
To: Michael Elizabeth Chastain; +Cc: gdb-patches
Michael Elizabeth Chastain wrote:
>
> This patch removes CONST_PTR from the gdb source, fulfilling
> PR gdb/92.
>
> http://sources.redhat.com/cgi-bin/gnatsweb.pl?database=gdb&cmd=view&pr=92
> Nuke CONST_PTR
>
> I'm not sure that gdb is ready for this patch yet. Here is some
> history.
>
> CONST_PTR was introduced in 1996:
>
> # ChangeLog-1996
> * defs.h: Define CONST_PTR as blank if compiling with Microsoft
> C, else it's `const'.
>
> In gdb 4.18 and gdb 5.0, CONST_PTR was conditionally defined as nothing
> if MSC_VER was defined, and "const" otherwise. In gdb 5.1 and gdb 5.1.1,
> CONST_PTR is always defined to "const". So CONST_PTR has been
> unconditionally defined for only a few months.
>
> However, in gdb 4.18, gdb 5.0, gdb 5.1, and gdb 5.1, c-lang.c has also
> contained this line:
>
> struct type **const (cplus_builtin_types[]) =
>
> So this form has been in gdb source code for four releases already
> without drawing complaint.
>
> Testing: I built this on native i686-pc-linux-gnu and ran the test suite.
>
> Okay to apply?
Your reasoning seems good, but your testing doesn't.
Seems to me you need to test this when building with Microsoft C.
OTOH, do we ever build with Microsoft C any more?
Is there any reason to support it? Cygwin and Djgcc
are both self-hosting, aren't they?
I'll bet this was originally introduced so that we could
build the old "win-gdb" for windows. That host has been
dead for a long time.
So the discussion (if there still is one) is (I think)
"do we still support building with Microsoft C?"
> Michael Elizabeth Chastain
> <mailto:mec@shout.net>
> "love without fear"
>
> ===
>
> 2002-02-12 Michael Chastain <mec@shout.net>
>
> * defs.h: Kill CONST_PTR.
> * c-lang.h (c_builtin_types): Change CONST_PTR to simple "const".
> * c-lang.c (c_builtin_types): Likewise.
> * ch-lang.c (ch_builtin_types): Likewise.
> * f-lang.c (f_builtin_types): Likewise.
> * language.c (unknown_builtin_types): Likewise.
> * m2-lang.c (m2_builtin_types): Likewise.
> * p-lang.c (pascal_builtin_types): Likewise.
> * scm-lang.c (c_builtin_types): Likewise.
>
> Index: c-lang.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/c-lang.c,v
> retrieving revision 1.9
> diff -c -3 -p -r1.9 c-lang.c
> *** c-lang.c 2001/12/19 06:29:18 1.9
> --- c-lang.c 2002/02/12 10:11:25
> ***************
> *** 1,5 ****
> /* C language support routines for GDB, the GNU debugger.
> ! Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
> Free Software Foundation, Inc.
>
> This file is part of GDB.
> --- 1,5 ----
> /* C language support routines for GDB, the GNU debugger.
> ! Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002
> Free Software Foundation, Inc.
>
> This file is part of GDB.
> *************** const struct op_print c_op_print_tab[] =
> *** 385,391 ****
> {NULL, 0, 0, 0}
> };
>
> ! struct type **CONST_PTR (c_builtin_types[]) =
> {
> &builtin_type_int,
> &builtin_type_long,
> --- 385,391 ----
> {NULL, 0, 0, 0}
> };
>
> ! struct type **const (c_builtin_types[]) =
> {
> &builtin_type_int,
> &builtin_type_long,
> Index: c-lang.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/c-lang.h,v
> retrieving revision 1.3
> diff -c -3 -p -r1.3 c-lang.h
> *** c-lang.h 2001/03/06 08:21:06 1.3
> --- c-lang.h 2002/02/12 10:11:25
> ***************
> *** 1,5 ****
> /* C language support definitions for GDB, the GNU debugger.
> ! Copyright 1992, 1994, 1995, 1996, 1997, 1998, 2000
> Free Software Foundation, Inc.
>
> This file is part of GDB.
> --- 1,5 ----
> /* C language support definitions for GDB, the GNU debugger.
> ! Copyright 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2002
> Free Software Foundation, Inc.
>
> This file is part of GDB.
> *************** extern void c_printstr (struct ui_file *
> *** 51,57 ****
>
> extern struct type *c_create_fundamental_type (struct objfile *, int);
>
> ! extern struct type **CONST_PTR (c_builtin_types[]);
>
> /* These are in c-typeprint.c: */
>
> --- 51,57 ----
>
> extern struct type *c_create_fundamental_type (struct objfile *, int);
>
> ! extern struct type **const (c_builtin_types[]);
>
> /* These are in c-typeprint.c: */
>
> Index: ch-lang.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/ch-lang.c,v
> retrieving revision 1.8
> diff -c -3 -p -r1.8 ch-lang.c
> *** ch-lang.c 2001/12/25 22:24:38 1.8
> --- ch-lang.c 2002/02/12 10:11:26
> ***************
> *** 1,5 ****
> /* Chill language support routines for GDB, the GNU debugger.
> ! Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001
> Free Software Foundation, Inc.
>
> This file is part of GDB.
> --- 1,5 ----
> /* Chill language support routines for GDB, the GNU debugger.
> ! Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001, 2002
> Free Software Foundation, Inc.
>
> This file is part of GDB.
> *************** struct type *builtin_type_chill_long;
> *** 322,328 ****
> struct type *builtin_type_chill_ulong;
> struct type *builtin_type_chill_real;
>
> ! struct type **CONST_PTR (chill_builtin_types[]) =
> {
> &builtin_type_chill_bool,
> &builtin_type_chill_char,
> --- 322,328 ----
> struct type *builtin_type_chill_ulong;
> struct type *builtin_type_chill_real;
>
> ! struct type **const (chill_builtin_types[]) =
> {
> &builtin_type_chill_bool,
> &builtin_type_chill_char,
> Index: defs.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/defs.h,v
> retrieving revision 1.77
> diff -c -3 -p -r1.77 defs.h
> *** defs.h 2002/02/10 04:08:41 1.77
> --- defs.h 2002/02/12 10:11:29
> *************** typedef struct ptid ptid_t;
> *** 986,993 ****
> #include "fopen-same.h"
> #endif
>
> - #define CONST_PTR const
> -
> /* Defaults for system-wide constants (if not defined by xm.h, we fake it).
> FIXME: Assumes 2's complement arithmetic */
>
> --- 986,991 ----
> Index: f-lang.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/f-lang.c,v
> retrieving revision 1.8
> diff -c -3 -p -r1.8 f-lang.c
> *** f-lang.c 2001/03/06 08:21:07 1.8
> --- f-lang.c 2002/02/12 10:11:30
> ***************
> *** 1,5 ****
> /* Fortran language support routines for GDB, the GNU debugger.
> ! Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
> Free Software Foundation, Inc.
> Contributed by Motorola. Adapted from the C parser by Farooq Butt
> (fmbutt@engage.sps.mot.com).
> --- 1,5 ----
> /* Fortran language support routines for GDB, the GNU debugger.
> ! Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
> Free Software Foundation, Inc.
> Contributed by Motorola. Adapted from the C parser by Farooq Butt
> (fmbutt@engage.sps.mot.com).
> *************** static const struct op_print f_op_print_
> *** 429,435 ****
> {NULL, 0, 0, 0}
> };
>
> ! struct type **CONST_PTR (f_builtin_types[]) =
> {
> &builtin_type_f_character,
> &builtin_type_f_logical,
> --- 429,435 ----
> {NULL, 0, 0, 0}
> };
>
> ! struct type **const (f_builtin_types[]) =
> {
> &builtin_type_f_character,
> &builtin_type_f_logical,
> Index: language.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/language.c,v
> retrieving revision 1.21
> diff -c -3 -p -r1.21 language.c
> *** language.c 2002/02/05 04:37:21 1.21
> --- language.c 2002/02/12 10:11:33
> ***************
> *** 1,5 ****
> /* Multiple source language support for GDB.
> ! Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
> Free Software Foundation, Inc.
> Contributed by the Department of Computer Science at the State University
> of New York at Buffalo.
> --- 1,5 ----
> /* Multiple source language support for GDB.
> ! Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
> Free Software Foundation, Inc.
> Contributed by the Department of Computer Science at the State University
> of New York at Buffalo.
> *************** unk_lang_value_print (struct value *val,
> *** 1444,1450 ****
> error ("internal error - unimplemented function unk_lang_value_print called.");
> }
>
> ! static struct type **CONST_PTR (unknown_builtin_types[]) =
> {
> 0
> };
> --- 1444,1450 ----
> error ("internal error - unimplemented function unk_lang_value_print called.");
> }
>
> ! static struct type **const (unknown_builtin_types[]) =
> {
> 0
> };
> Index: m2-lang.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/m2-lang.c,v
> retrieving revision 1.6
> diff -c -3 -p -r1.6 m2-lang.c
> *** m2-lang.c 2001/03/06 08:21:09 1.6
> --- m2-lang.c 2002/02/12 10:11:34
> ***************
> *** 1,5 ****
> /* Modula 2 language support routines for GDB, the GNU debugger.
> ! Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000
> Free Software Foundation, Inc.
>
> This file is part of GDB.
> --- 1,5 ----
> /* Modula 2 language support routines for GDB, the GNU debugger.
> ! Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2002
> Free Software Foundation, Inc.
>
> This file is part of GDB.
> *************** struct type *builtin_type_m2_card;
> *** 398,404 ****
> struct type *builtin_type_m2_real;
> struct type *builtin_type_m2_bool;
>
> ! struct type **CONST_PTR (m2_builtin_types[]) =
> {
> &builtin_type_m2_char,
> &builtin_type_m2_int,
> --- 398,404 ----
> struct type *builtin_type_m2_real;
> struct type *builtin_type_m2_bool;
>
> ! struct type **const (m2_builtin_types[]) =
> {
> &builtin_type_m2_char,
> &builtin_type_m2_int,
> Index: p-lang.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/p-lang.c,v
> retrieving revision 1.4
> diff -c -3 -p -r1.4 p-lang.c
> *** p-lang.c 2001/11/09 09:48:09 1.4
> --- p-lang.c 2002/02/12 10:11:35
> ***************
> *** 1,5 ****
> /* Pascal language support routines for GDB, the GNU debugger.
> ! Copyright 2000 Free Software Foundation, Inc.
>
> This file is part of GDB.
>
> --- 1,5 ----
> /* Pascal language support routines for GDB, the GNU debugger.
> ! Copyright 2000, 2002 Free Software Foundation, Inc.
>
> This file is part of GDB.
>
> *************** const struct op_print pascal_op_print_ta
> *** 407,413 ****
> {NULL, 0, 0, 0}
> };
>
> ! struct type **const /* CONST_PTR v 4.17 */ (pascal_builtin_types[]) =
> {
> &builtin_type_int,
> &builtin_type_long,
> --- 407,413 ----
> {NULL, 0, 0, 0}
> };
>
> ! struct type **const (pascal_builtin_types[]) =
> {
> &builtin_type_int,
> &builtin_type_long,
> Index: scm-lang.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/scm-lang.c,v
> retrieving revision 1.7
> diff -c -3 -p -r1.7 scm-lang.c
> *** scm-lang.c 2002/01/04 05:20:08 1.7
> --- scm-lang.c 2002/02/12 10:11:36
> *************** static void scm_printstr (struct ui_file
> *** 41,47 ****
> unsigned int length, int width,
> int force_ellipses);
>
> ! extern struct type **CONST_PTR (c_builtin_types[]);
>
> struct type *builtin_type_scm;
>
> --- 41,47 ----
> unsigned int length, int width,
> int force_ellipses);
>
> ! extern struct type **const (c_builtin_types[]);
>
> struct type *builtin_type_scm;
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] nuke CONST_PTR
2002-02-13 8:15 ` Michael Snyder
@ 2002-02-13 9:30 ` Andrew Cagney
2002-02-13 10:04 ` Michael Snyder
0 siblings, 1 reply; 11+ messages in thread
From: Andrew Cagney @ 2002-02-13 9:30 UTC (permalink / raw)
To: Michael Snyder; +Cc: Michael Elizabeth Chastain, gdb-patches
> In gdb 4.18 and gdb 5.0, CONST_PTR was conditionally defined as nothing
>> if MSC_VER was defined, and "const" otherwise. In gdb 5.1 and gdb 5.1.1,
>> CONST_PTR is always defined to "const". So CONST_PTR has been
>> unconditionally defined for only a few months.
>>
>> However, in gdb 4.18, gdb 5.0, gdb 5.1, and gdb 5.1, c-lang.c has also
>> contained this line:
>>
>> struct type **const (cplus_builtin_types[]) =
>>
>> So this form has been in gdb source code for four releases already
>> without drawing complaint.
>>
>> Testing: I built this on native i686-pc-linux-gnu and ran the test suite.
>>
>> Okay to apply?
>
>
> Your reasoning seems good, but your testing doesn't.
> Seems to me you need to test this when building with Microsoft C.
>
> OTOH, do we ever build with Microsoft C any more?
> Is there any reason to support it? Cygwin and Djgcc
> are both self-hosting, aren't they?
Not since '98! The line:
>> struct type **const (cplus_builtin_types[]) =
was added in '98 so ever since then GDB hasn't been able to build with
the MSC compiler CONST_PTR was working around. As Michael pointed out,
we've had 4 releases since then.
enjoy,
Andrew
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] nuke CONST_PTR
2002-02-13 9:30 ` Andrew Cagney
@ 2002-02-13 10:04 ` Michael Snyder
2002-02-13 10:56 ` Christopher Faylor
2002-02-13 11:05 ` Andrew Cagney
0 siblings, 2 replies; 11+ messages in thread
From: Michael Snyder @ 2002-02-13 10:04 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Michael Elizabeth Chastain, gdb-patches
Andrew Cagney wrote:
>
> > In gdb 4.18 and gdb 5.0, CONST_PTR was conditionally defined as nothing
> >> if MSC_VER was defined, and "const" otherwise. In gdb 5.1 and gdb 5.1.1,
> >> CONST_PTR is always defined to "const". So CONST_PTR has been
> >> unconditionally defined for only a few months.
> >>
> >> However, in gdb 4.18, gdb 5.0, gdb 5.1, and gdb 5.1, c-lang.c has also
> >> contained this line:
> >>
> >> struct type **const (cplus_builtin_types[]) =
> >>
> >> So this form has been in gdb source code for four releases already
> >> without drawing complaint.
> >>
> >> Testing: I built this on native i686-pc-linux-gnu and ran the test suite.
> >>
> >> Okay to apply?
> >
> >
> > Your reasoning seems good, but your testing doesn't.
> > Seems to me you need to test this when building with Microsoft C.
> >
> > OTOH, do we ever build with Microsoft C any more?
> > Is there any reason to support it? Cygwin and Djgcc
> > are both self-hosting, aren't they?
>
> Not since '98! The line:
>
> >> struct type **const (cplus_builtin_types[]) =
>
> was added in '98 so ever since then GDB hasn't been able to build with
> the MSC compiler CONST_PTR was working around. As Michael pointed out,
> we've had 4 releases since then.
OK, then this change seems safe. Maybe we can also
start yanking out other #if MSC code...
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] nuke CONST_PTR
2002-02-13 10:04 ` Michael Snyder
@ 2002-02-13 10:56 ` Christopher Faylor
2002-02-13 11:05 ` Andrew Cagney
1 sibling, 0 replies; 11+ messages in thread
From: Christopher Faylor @ 2002-02-13 10:56 UTC (permalink / raw)
To: gdb-patches
On Wed, Feb 13, 2002 at 09:58:42AM -0800, Michael Snyder wrote:
>>was added in '98 so ever since then GDB hasn't been able to build with
>>the MSC compiler CONST_PTR was working around. As Michael pointed out,
>>we've had 4 releases since then.
>
>OK, then this change seems safe. Maybe we can also start yanking out
>other #if MSC code...
IIRC, we've already decided to do this. I think I've already yanked
some stuff.
I think the last time this was mentioned there was some consternation
from people who wanted a non-cygwin version of gdb for Windows but
no one was willing to actually support the code.
So, since it doesn't actually work, and I'm the maintainer, I think
it makes sense to remove the MSC code. If someone wants to add support
later, then they should probably start from a "clean slate".
cgf
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] nuke CONST_PTR
2002-02-13 10:04 ` Michael Snyder
2002-02-13 10:56 ` Christopher Faylor
@ 2002-02-13 11:05 ` Andrew Cagney
2002-02-13 11:08 ` Christopher Faylor
1 sibling, 1 reply; 11+ messages in thread
From: Andrew Cagney @ 2002-02-13 11:05 UTC (permalink / raw)
To: Michael Snyder; +Cc: Michael Elizabeth Chastain, gdb-patches
> was added in '98 so ever since then GDB hasn't been able to build with
>> the MSC compiler CONST_PTR was working around. As Michael pointed out,
>> we've had 4 releases since then.
>
>
> OK, then this change seems safe. Maybe we can also
> start yanking out other #if MSC code...
Ah, they went some time ago! :-)
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] nuke CONST_PTR
2002-02-13 11:05 ` Andrew Cagney
@ 2002-02-13 11:08 ` Christopher Faylor
0 siblings, 0 replies; 11+ messages in thread
From: Christopher Faylor @ 2002-02-13 11:08 UTC (permalink / raw)
To: gdb-patches
On Wed, Feb 13, 2002 at 02:05:00PM -0500, Andrew Cagney wrote:
>>was added in '98 so ever since then GDB hasn't been able to build with
>>>the MSC compiler CONST_PTR was working around. As Michael pointed out,
>>>we've had 4 releases since then.
>>
>>OK, then this change seems safe. Maybe we can also start yanking out
>>other #if MSC code...
>
>Ah, they went some time ago! :-)
Ah. I thought I'd left a couple. I don't see them, so I guess not.
cgf
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] nuke CONST_PTR
2002-02-13 9:06 Michael Elizabeth Chastain
@ 2002-02-13 11:43 ` Eli Zaretskii
0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2002-02-13 11:43 UTC (permalink / raw)
To: mec; +Cc: msnyder, gdb-patches
> Date: Wed, 13 Feb 2002 11:06:46 -0600
> From: Michael Elizabeth Chastain <mec@shout.net>
>
> ms> OTOH, do we ever build with Microsoft C any more?
> ms> Is there any reason to support it? Cygwin and Djgcc
> ms> are both self-hosting, aren't they?
>
> I don't know about Microsoft C. I do know that I build Cygwin gdb
> using Cygwin gcc. I don't know about djgpp.
Yes, DJGPP is self-hosting. But I don't see how is that relevant
here, since the compiler is GCC, and GCC supports `const' since time
immemoriam.
I also find it hard to believe that MSC doesn't support `const' these
days; and on top of that, as others said, we removed all MSC ifdefs.
So I think the change is safe.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] nuke CONST_PTR
@ 2002-02-13 10:49 Michael Elizabeth Chastain
0 siblings, 0 replies; 11+ messages in thread
From: Michael Elizabeth Chastain @ 2002-02-13 10:49 UTC (permalink / raw)
To: gdb-patches
Committed.
Michael C
===
2002-02-12 Michael Chastain <mec@shout.net>
* defs.h: Kill CONST_PTR.
* c-lang.h (c_builtin_types): Change CONST_PTR to simple "const".
* c-lang.c (c_builtin_types): Likewise.
* ch-lang.c (ch_builtin_types): Likewise.
* f-lang.c (f_builtin_types): Likewise.
* language.c (unknown_builtin_types): Likewise.
* m2-lang.c (m2_builtin_types): Likewise.
* p-lang.c (pascal_builtin_types): Likewise.
* scm-lang.c (c_builtin_types): Likewise.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFA] nuke CONST_PTR
@ 2002-02-13 9:06 Michael Elizabeth Chastain
2002-02-13 11:43 ` Eli Zaretskii
0 siblings, 1 reply; 11+ messages in thread
From: Michael Elizabeth Chastain @ 2002-02-13 9:06 UTC (permalink / raw)
To: msnyder; +Cc: gdb-patches
Hi Michael,
ms> Your reasoning seems good, but your testing doesn't.
ms> Seems to me you need to test this when building with Microsoft C.
I think I already addressed this point:
mec> However, in gdb 4.18, gdb 5.0, gdb 5.1, and gdb 5.1, c-lang.c has also
mec> contained this line:
mec>
mec> struct type **const (cplus_builtin_types[]) =
mec>
mec> So this form has been in gdb source code for four releases already
mec> without drawing complaint.
Also, the CONST_PTR macro has been unconditionally "struct type **const"
since 5.1, which admittedly is not much time.
ms> OTOH, do we ever build with Microsoft C any more?
ms> Is there any reason to support it? Cygwin and Djgcc
ms> are both self-hosting, aren't they?
I don't know about Microsoft C. I do know that I build Cygwin gdb
using Cygwin gcc. I don't know about djgpp.
ms> So the discussion (if there still is one) is (I think)
ms> "do we still support building with Microsoft C?"
I don't know.
The second half of the question is "and does Microsoft C still have
a problem with struct type **const".
If we do support building with Microsoft C, and if Microsoft C has
a problem with "struct type **const", then gdb 4.18, 5.0, 5.1, and
5.1.1 are all broken in one spot. Maybe that is not a good reason for
breaking it in other spots. But one instance of "struct type **const"
has been in released versions of gdb for 34 months now and I don't see
complaints coming in.
Michael C
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2002-02-13 19:43 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-13 6:44 [RFA] nuke CONST_PTR Michael Elizabeth Chastain
2002-02-13 7:19 ` Kevin Buettner
2002-02-13 8:15 ` Michael Snyder
2002-02-13 9:30 ` Andrew Cagney
2002-02-13 10:04 ` Michael Snyder
2002-02-13 10:56 ` Christopher Faylor
2002-02-13 11:05 ` Andrew Cagney
2002-02-13 11:08 ` Christopher Faylor
2002-02-13 9:06 Michael Elizabeth Chastain
2002-02-13 11:43 ` Eli Zaretskii
2002-02-13 10:49 Michael Elizabeth Chastain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox