From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11361 invoked by alias); 19 Jun 2010 15:46:51 -0000 Received: (qmail 11344 invoked by uid 22791); 19 Jun 2010 15:46:48 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_BT,TW_DB X-Spam-Check-By: sourceware.org Received: from mail-pw0-f41.google.com (HELO mail-pw0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 19 Jun 2010 15:46:42 +0000 Received: by pwi7 with SMTP id 7so2256719pwi.0 for ; Sat, 19 Jun 2010 08:46:40 -0700 (PDT) Received: by 10.142.66.35 with SMTP id o35mr1774760wfa.300.1276962400431; Sat, 19 Jun 2010 08:46:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.32.8 with HTTP; Sat, 19 Jun 2010 08:46:20 -0700 (PDT) In-Reply-To: <4426260533430796929@unknownmsgid> References: <4426260533430796929@unknownmsgid> From: Hui Zhu Date: Sat, 19 Jun 2010 15:46:00 -0000 Message-ID: Subject: Re: [OBV] Fix Build gdbtk-cmds.c get error To: Pierre Muller Cc: insight@sourceware.org, Keith Seitz Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2010-q2/txt/msg00030.txt.bz2 In i386-linux, it is OK. Thanks. Hui On Sat, Jun 19, 2010 at 06:24, Pierre Muller wrote: > > >> -----Message d'origine----- >> De=A0: insight-owner@sourceware.org [mailto:insight-owner@sourceware.org] >> De la part de Hui Zhu >> Envoy=E9=A0: Thursday, June 17, 2010 4:18 AM >> =C0=A0: insight@sourceware.org >> Objet=A0: Re: Build gdbtk-cmds.c get error >> >> Ping. > > I checked the following in: > =A0Note that it fixes the val_print problem > and also cygwin specific problems to > allow compilation with both 1.5 and 1.7 cygwin... > > =A0For the cygwin_conv_path function, > I used the same macros as in gdb/windows-nat.c source. > > =A0Please feel free to suggest better > fixes. > =A0I didn't dare to change > GDB_val_print function, as this could have implications > for tcl/tk scripts... Am I right on this? > > > Pierre > > PS: I only fixed compilation and I am still unable to > really test cygwin insight :( > > > 2010-06-18 =A0Pierre Muller =A0 > > =A0 =A0 =A0 =A0* generic/gdbtk-cmds.c: Add cygwin macros to allow compila= tion > =A0 =A0 =A0 =A0with old or recent cygwin version. > =A0 =A0 =A0 =A0(gdb_path_conv): Use cygwin_conv_path function. > =A0 =A0 =A0 =A0(gdb_eval): Adapt to new field in val_print. > =A0 =A0 =A0 =A0* generic/gdbtk-register.c (get_register): Likewise. > =A0 =A0 =A0 =A0* generic/gdbtk-wrapper.c (wrap_val_print): Likewise. > =A0 =A0 =A0 =A0* generic/gdbtk.c (_initialize_gdbtk): Use > cygwin_attach_handle_to_fd > =A0 =A0 =A0 =A0call to allow compilation with old and new cygwin version. > > Index: generic/gdbtk-cmds.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v > retrieving revision 1.117 > diff -u -p -r1.117 gdbtk-cmds.c > --- generic/gdbtk-cmds.c =A0 =A0 =A0 =A012 Mar 2010 18:34:12 -0000 =A0 = =A0 =A01.117 > +++ generic/gdbtk-cmds.c =A0 =A0 =A0 =A018 Jun 2010 22:13:12 -0000 > @@ -74,6 +74,20 @@ > > =A0#ifdef __CYGWIN__ > =A0#include =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* for > cygwin_conv_to_full_win32_path */ > +#include > +# if > CYGWIN_VERSION_DLL_MAKE_COMBINED(CYGWIN_VERSION_API_MAJOR,CYGWIN_VERSION_= API > _MINOR) >=3D 181 > +# =A0 define __USEWIDE > +# else > +# =A0 define CCP_POSIX_TO_WIN_A 0 > +# =A0 define CCP_POSIX_TO_WIN_W 1 > +# =A0 define CCP_WIN_A_TO_POSIX 2 > +# =A0 define CCP_WIN_W_TO_POSIX 3 > +# =A0 define cygwin_conv_path(op, from, to, size) =A0\ > + =A0 =A0 =A0 =A0 (op =3D=3D CCP_WIN_A_TO_POSIX) ? \ > + =A0 =A0 =A0 =A0 cygwin_conv_to_full_posix_path (from, to) : \ > + =A0 =A0 =A0 =A0 cygwin_conv_to_win32_path (from, to) > +# =A0 define CW_SET_DOS_FILE_WARNING -1 =A0/* no-op this for older Cygwi= n */ > +# endif > =A0#endif > > =A0#ifdef HAVE_CTYPE_H > @@ -640,7 +654,7 @@ gdb_eval (ClientData clientData, Tcl_Int > =A0 make_cleanup_ui_file_delete (stb); > =A0 val_print (value_type (val), value_contents (val), > =A0 =A0 =A0 =A0 =A0 =A0 value_embedded_offset (val), value_address (val), > - =A0 =A0 =A0 =A0 =A0 =A0stb, 0, &opts, current_language); > + =A0 =A0 =A0 =A0 =A0 =A0stb, 0, val, &opts, current_language); > =A0 result =3D ui_file_xstrdup (stb, &dummy); > =A0 Tcl_SetObjResult (interp, Tcl_NewStringObj (result, -1)); > =A0 xfree (result); > @@ -2874,8 +2888,8 @@ gdb_path_conv (ClientData clientData, Tc > =A0 { > =A0 =A0 char pathname[256], *ptr; > > - =A0 =A0cygwin_conv_to_full_win32_path (Tcl_GetStringFromObj (objv[1], N= ULL), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= pathname); > + =A0 =A0cygwin_conv_path (CCP_POSIX_TO_WIN_A, Tcl_GetStringFromObj (objv= [1], > NULL), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 pathname, 256); > =A0 =A0 for (ptr =3D pathname; *ptr; ptr++) > =A0 =A0 =A0 { > =A0 =A0 =A0 =A0if (*ptr =3D=3D '\\') > Index: generic/gdbtk-register.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-register.c,v > retrieving revision 1.38 > diff -u -p -r1.38 gdbtk-register.c > --- generic/gdbtk-register.c =A0 =A07 Jul 2009 12:38:56 -0000 =A0 =A0 =A0= 1.38 > +++ generic/gdbtk-register.c =A0 =A018 Jun 2010 22:13:12 -0000 > @@ -343,11 +343,11 @@ get_register (int regnum, map_arg arg) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0gdbarch_register_name (get_cur= rent_arch (), regnum)) > =3D=3D 0)) > =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0val_print (FIELD_TYPE (TYPE_FIELD (reg_vtype, 0)), buf= fer, 0, 0, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0stb, 0, &opts, current_language); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0stb, 0, NULL, &opts, current_lan= guage); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 else > =A0 =A0 =A0 =A0val_print (reg_vtype, buffer, 0, 0, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0stb, 0, &opts, current_language); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0stb, 0, NULL, &opts, current_languag= e); > =A0 =A0 } > > =A0 res =3D ui_file_xstrdup (stb, &dummy); > Index: generic/gdbtk-wrapper.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-wrapper.c,v > retrieving revision 1.18 > diff -u -p -r1.18 gdbtk-wrapper.c > --- generic/gdbtk-wrapper.c =A0 =A0 15 Dec 2008 18:06:12 -0000 =A0 =A0 = =A01.18 > +++ generic/gdbtk-wrapper.c =A0 =A0 18 Jun 2010 22:13:12 -0000 > @@ -218,7 +218,7 @@ wrap_val_print (char *a) > =A0 recurse =3D (*args)->args[6].integer; > =A0 opts.pretty =3D (enum val_prettyprint) (*args)->args[7].integer; > > - =A0val_print (type, valaddr, 0, address, stream, recurse, &opts, > + =A0val_print (type, valaddr, 0, address, stream, recurse, NULL, &opts, > =A0 =A0 =A0 =A0 =A0 =A0 =A0current_language); > =A0 return 1; > =A0} > Index: generic/gdbtk.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk.c,v > retrieving revision 1.50 > diff -u -p -r1.50 gdbtk.c > --- generic/gdbtk.c =A0 =A0 6 Apr 2009 23:33:32 -0000 =A0 =A0 =A0 1.50 > +++ generic/gdbtk.c =A0 =A0 18 Jun 2010 22:13:13 -0000 > @@ -709,15 +709,15 @@ _initialize_gdbtk () > =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0default: > =A0 =A0 =A0 =A0 =A0AllocConsole (); > - =A0 =A0 =A0 =A0 cygwin32_attach_handle_to_fd ("/dev/conin", 0, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 GetStdHandle (STD_INPUT_HANDLE), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 1, GENERIC_READ); > - =A0 =A0 =A0 =A0 cygwin32_attach_handle_to_fd ("/dev/conout", 1, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 GetStdHandle (STD_OUTPUT_HANDLE), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 0, GENERIC_WRITE); > - =A0 =A0 =A0 =A0 cygwin32_attach_handle_to_fd ("/dev/conout", 2, > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 GetStdHandle (STD_ERROR_HANDLE), > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 0, GENERIC_WRITE); > + =A0 =A0 =A0 =A0 cygwin_attach_handle_to_fd ("/dev/conin", 0, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= GetStdHandle (STD_INPUT_HANDLE), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= 1, GENERIC_READ); > + =A0 =A0 =A0 =A0 cygwin_attach_handle_to_fd ("/dev/conout", 1, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= GetStdHandle (STD_OUTPUT_HANDLE), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= 0, GENERIC_WRITE); > + =A0 =A0 =A0 =A0 cygwin_attach_handle_to_fd ("/dev/conout", 2, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= GetStdHandle (STD_ERROR_HANDLE), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= 0, GENERIC_WRITE); > =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0} > =A0 =A0 } > >