public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
Cc: insight@sourceware.org, Keith Seitz <keiths@redhat.com>
Subject: Re: [OBV] Fix Build gdbtk-cmds.c get error
Date: Sat, 19 Jun 2010 15:46:00 -0000	[thread overview]
Message-ID: <AANLkTinR3ucqzT6_AFbL7ztconXZONT-DSWQMrCfzr-R@mail.gmail.com> (raw)
In-Reply-To: <4426260533430796929@unknownmsgid>

In i386-linux, it is OK.  Thanks.

Hui

On Sat, Jun 19, 2010 at 06:24, Pierre Muller
<pierre.muller@ics-cnrs.unistra.fr> wrote:
>
>
>> -----Message d'origine-----
>> De : insight-owner@sourceware.org [mailto:insight-owner@sourceware.org]
>> De la part de Hui Zhu
>> Envoyé : Thursday, June 17, 2010 4:18 AM
>> À : insight@sourceware.org
>> Objet : Re: Build gdbtk-cmds.c get error
>>
>> Ping.
>
> I checked the following in:
>  Note that it fixes the val_print problem
> and also cygwin specific problems to
> allow compilation with both 1.5 and 1.7 cygwin...
>
>  For the cygwin_conv_path function,
> I used the same macros as in gdb/windows-nat.c source.
>
>  Please feel free to suggest better
> fixes.
>  I 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  Pierre Muller  <muller@ics.u-strasbg.fr>
>
>        * generic/gdbtk-cmds.c: Add cygwin macros to allow compilation
>        with old or recent cygwin version.
>        (gdb_path_conv): Use cygwin_conv_path function.
>        (gdb_eval): Adapt to new field in val_print.
>        * generic/gdbtk-register.c (get_register): Likewise.
>        * generic/gdbtk-wrapper.c (wrap_val_print): Likewise.
>        * generic/gdbtk.c (_initialize_gdbtk): Use
> cygwin_attach_handle_to_fd
>        call to allow compilation with old and new cygwin version.
>
> Index: generic/gdbtk-cmds.c
> ===================================================================
> 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        12 Mar 2010 18:34:12 -0000      1.117
> +++ generic/gdbtk-cmds.c        18 Jun 2010 22:13:12 -0000
> @@ -74,6 +74,20 @@
>
>  #ifdef __CYGWIN__
>  #include <sys/cygwin.h>                /* for
> cygwin_conv_to_full_win32_path */
> +#include <cygwin/version.h>
> +# if
> CYGWIN_VERSION_DLL_MAKE_COMBINED(CYGWIN_VERSION_API_MAJOR,CYGWIN_VERSION_API
> _MINOR) >= 181
> +#   define __USEWIDE
> +# else
> +#   define CCP_POSIX_TO_WIN_A 0
> +#   define CCP_POSIX_TO_WIN_W 1
> +#   define CCP_WIN_A_TO_POSIX 2
> +#   define CCP_WIN_W_TO_POSIX 3
> +#   define cygwin_conv_path(op, from, to, size)  \
> +         (op == CCP_WIN_A_TO_POSIX) ? \
> +         cygwin_conv_to_full_posix_path (from, to) : \
> +         cygwin_conv_to_win32_path (from, to)
> +#   define CW_SET_DOS_FILE_WARNING -1  /* no-op this for older Cygwin */
> +# endif
>  #endif
>
>  #ifdef HAVE_CTYPE_H
> @@ -640,7 +654,7 @@ gdb_eval (ClientData clientData, Tcl_Int
>   make_cleanup_ui_file_delete (stb);
>   val_print (value_type (val), value_contents (val),
>             value_embedded_offset (val), value_address (val),
> -            stb, 0, &opts, current_language);
> +            stb, 0, val, &opts, current_language);
>   result = ui_file_xstrdup (stb, &dummy);
>   Tcl_SetObjResult (interp, Tcl_NewStringObj (result, -1));
>   xfree (result);
> @@ -2874,8 +2888,8 @@ gdb_path_conv (ClientData clientData, Tc
>   {
>     char pathname[256], *ptr;
>
> -    cygwin_conv_to_full_win32_path (Tcl_GetStringFromObj (objv[1], NULL),
> -                                     pathname);
> +    cygwin_conv_path (CCP_POSIX_TO_WIN_A, Tcl_GetStringFromObj (objv[1],
> NULL),
> +                     pathname, 256);
>     for (ptr = pathname; *ptr; ptr++)
>       {
>        if (*ptr == '\\')
> Index: generic/gdbtk-register.c
> ===================================================================
> 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    7 Jul 2009 12:38:56 -0000       1.38
> +++ generic/gdbtk-register.c    18 Jun 2010 22:13:12 -0000
> @@ -343,11 +343,11 @@ get_register (int regnum, map_arg arg)
>                      gdbarch_register_name (get_current_arch (), regnum))
> == 0))
>        {
>          val_print (FIELD_TYPE (TYPE_FIELD (reg_vtype, 0)), buffer, 0, 0,
> -                    stb, 0, &opts, current_language);
> +                    stb, 0, NULL, &opts, current_language);
>        }
>       else
>        val_print (reg_vtype, buffer, 0, 0,
> -                  stb, 0, &opts, current_language);
> +                  stb, 0, NULL, &opts, current_language);
>     }
>
>   res = ui_file_xstrdup (stb, &dummy);
> Index: generic/gdbtk-wrapper.c
> ===================================================================
> 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     15 Dec 2008 18:06:12 -0000      1.18
> +++ generic/gdbtk-wrapper.c     18 Jun 2010 22:13:12 -0000
> @@ -218,7 +218,7 @@ wrap_val_print (char *a)
>   recurse = (*args)->args[6].integer;
>   opts.pretty = (enum val_prettyprint) (*args)->args[7].integer;
>
> -  val_print (type, valaddr, 0, address, stream, recurse, &opts,
> +  val_print (type, valaddr, 0, address, stream, recurse, NULL, &opts,
>              current_language);
>   return 1;
>  }
> Index: generic/gdbtk.c
> ===================================================================
> 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     6 Apr 2009 23:33:32 -0000       1.50
> +++ generic/gdbtk.c     18 Jun 2010 22:13:13 -0000
> @@ -709,15 +709,15 @@ _initialize_gdbtk ()
>          break;
>        default:
>          AllocConsole ();
> -         cygwin32_attach_handle_to_fd ("/dev/conin", 0,
> -                                       GetStdHandle (STD_INPUT_HANDLE),
> -                                       1, GENERIC_READ);
> -         cygwin32_attach_handle_to_fd ("/dev/conout", 1,
> -                                       GetStdHandle (STD_OUTPUT_HANDLE),
> -                                       0, GENERIC_WRITE);
> -         cygwin32_attach_handle_to_fd ("/dev/conout", 2,
> -                                       GetStdHandle (STD_ERROR_HANDLE),
> -                                       0, GENERIC_WRITE);
> +         cygwin_attach_handle_to_fd ("/dev/conin", 0,
> +                                     GetStdHandle (STD_INPUT_HANDLE),
> +                                     1, GENERIC_READ);
> +         cygwin_attach_handle_to_fd ("/dev/conout", 1,
> +                                     GetStdHandle (STD_OUTPUT_HANDLE),
> +                                     0, GENERIC_WRITE);
> +         cygwin_attach_handle_to_fd ("/dev/conout", 2,
> +                                     GetStdHandle (STD_ERROR_HANDLE),
> +                                     0, GENERIC_WRITE);
>          break;
>        }
>     }
>
>

      parent reply	other threads:[~2010-06-19 15:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14  9:55 Hui Zhu
2010-06-17  2:18 ` Hui Zhu
2010-06-18 22:24   ` [OBV] Fix " Pierre Muller
2010-06-19 18:01     ` Keith Seitz
     [not found]   ` <4426260533430796929@unknownmsgid>
2010-06-19 15:46     ` Hui Zhu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinR3ucqzT6_AFbL7ztconXZONT-DSWQMrCfzr-R@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=insight@sourceware.org \
    --cc=keiths@redhat.com \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).