From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26872 invoked by alias); 27 May 2005 01:31:37 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 26744 invoked by uid 22791); 27 May 2005 01:31:06 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 27 May 2005 01:31:06 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j4R1V4vG010378 for ; Thu, 26 May 2005 21:31:04 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j4R1V4O23416; Thu, 26 May 2005 21:31:04 -0400 Received: from localhost.localdomain (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j4R1V322006128; Thu, 26 May 2005 21:31:03 -0400 Subject: Re: [patch] updates gdbtk to use lbasename() do to shared lib header tweaks. From: Keith Seitz To: Paul Schlie Cc: "insight@sources.redhat.com" In-Reply-To: References: Content-Type: multipart/mixed; boundary="=-G/ia3Iao7YsWzRjTZ9uA" Date: Fri, 27 May 2005 01:31:00 -0000 Message-Id: <1117157462.4456.117.camel@lindt.uglyboxes.com> Mime-Version: 1.0 X-SW-Source: 2005-q2/txt/msg00097.txt.bz2 --=-G/ia3Iao7YsWzRjTZ9uA Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 1085 On Thu, 2005-05-26 at 19:09 -0400, Paul Schlie wrote: > (patch enclosed as an attachment, so don't know if it's visible on boards) Hmm. For some reason, I could not apply your patch. Goofy. Fortunately, it was simple enough. I have also take the opportunity to remove a few other compiler warnings stemming from some gdb "API" changes from char* to gdb_byte*. I tried to run this through the testsuite, but I see that varobj.c is throwing an internal error trying to run c_variable.exp. :-( I've attached the patch I committed. Thanks, Keith ChangeLog 2005-05-26 Keith Seitz * generic/gdbtk-cmds.c (gdb_set_mem): target_write_memory now takes gdb_byte* instead of char*. * generic/gdbtk-register.c (get_register): frame_register and val_print take gdb_byte* instead of char*. * generic/gdbtk-wrapper.c: Ditto the val_print part. From Paul Schlie : * generic/gdbtk-bp.c (gdb_set_bp): Use lbasename instead of basename. * generic/gdbtk-cmds.c (gdb_listfiles): Likewise. --=-G/ia3Iao7YsWzRjTZ9uA Content-Disposition: inline; filename=gdbtk.patch Content-Type: text/x-patch; name=gdbtk.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 4938 Index: generic/gdbtk-bp.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-bp.c,v retrieving revision 1.24 diff -u -p -r1.24 gdbtk-bp.c --- generic/gdbtk-bp.c 2 Jul 2004 22:00:56 -0000 1.24 +++ generic/gdbtk-bp.c 27 May 2005 01:21:29 -0000 @@ -535,7 +535,7 @@ gdb_set_bp (ClientData clientData, Tcl_I b->thread = thread; /* FIXME: this won't work for duplicate basenames! */ - xasprintf (&buf, "%s:%d", basename (Tcl_GetStringFromObj (objv[1], NULL)), + xasprintf (&buf, "%s:%d", lbasename (Tcl_GetStringFromObj (objv[1], NULL)), line); b->addr_string = xstrdup (buf); free(buf); Index: generic/gdbtk-cmds.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v retrieving revision 1.88 diff -u -p -r1.88 gdbtk-cmds.c --- generic/gdbtk-cmds.c 17 Feb 2005 07:15:50 -0000 1.88 +++ generic/gdbtk-cmds.c 27 May 2005 01:21:30 -0000 @@ -1120,12 +1120,13 @@ gdb_listfiles (ClientData clientData, Tc struct objfile *objfile; struct partial_symtab *psymtab; struct symtab *symtab; - char *lastfile, *pathname = NULL, **files; + const char *lastfile, *pathname = NULL; + const char **files; int files_size; int i, numfiles = 0, len = 0; files_size = 1000; - files = (char **) xmalloc (sizeof (char *) * files_size); + files = (const char **) xmalloc (sizeof (char *) * files_size); if (objc > 2) { @@ -1140,14 +1141,14 @@ gdb_listfiles (ClientData clientData, Tc if (numfiles == files_size) { files_size = files_size * 2; - files = (char **) xrealloc (files, sizeof (char *) * files_size); + files = (const char **) xrealloc (files, sizeof (char *) * files_size); } if (psymtab->filename) { if (!len || !strncmp (pathname, psymtab->filename, len) - || !strcmp (psymtab->filename, basename (psymtab->filename))) + || !strcmp (psymtab->filename, lbasename (psymtab->filename))) { - files[numfiles++] = basename (psymtab->filename); + files[numfiles++] = lbasename (psymtab->filename); } } } @@ -1157,14 +1158,14 @@ gdb_listfiles (ClientData clientData, Tc if (numfiles == files_size) { files_size = files_size * 2; - files = (char **) xrealloc (files, sizeof (char *) * files_size); + files = (const char **) xrealloc (files, sizeof (char *) * files_size); } if (symtab->filename && symtab->linetable && symtab->linetable->nitems) { if (!len || !strncmp (pathname, symtab->filename, len) - || !strcmp (symtab->filename, basename (symtab->filename))) + || !strcmp (symtab->filename, lbasename (symtab->filename))) { - files[numfiles++] = basename (symtab->filename); + files[numfiles++] = lbasename (symtab->filename); } } } @@ -2278,7 +2279,7 @@ gdb_set_mem (ClientData clientData, Tcl_ int objc, Tcl_Obj *CONST objv[]) { CORE_ADDR addr; - char buf[128]; + gdb_byte buf[128]; char *hexstr; int len, size; @@ -2303,7 +2304,7 @@ gdb_set_mem (ClientData clientData, Tcl_ /* Convert hexstr to binary and write */ if (hexstr[0] == '0' && hexstr[1] == 'x') hexstr += 2; - size = hex2bin (hexstr, buf, strlen (hexstr)); + size = hex2bin (hexstr, (char *) buf, strlen (hexstr)); if (size < 0) { /* Error in input */ Index: generic/gdbtk-register.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-register.c,v retrieving revision 1.27 diff -u -p -r1.27 gdbtk-register.c --- generic/gdbtk-register.c 31 Oct 2004 10:05:09 -0000 1.27 +++ generic/gdbtk-register.c 27 May 2005 01:21:30 -0000 @@ -265,7 +265,7 @@ get_register (int regnum, void *arg) CORE_ADDR addr; enum lval_type lval; struct type *reg_vtype; - char buffer[MAX_REGISTER_SIZE]; + gdb_byte buffer[MAX_REGISTER_SIZE]; int optim, format; struct cleanup *old_chain = NULL; struct ui_file *stb; Index: generic/gdbtk-wrapper.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-wrapper.c,v retrieving revision 1.11 diff -u -p -r1.11 gdbtk-wrapper.c --- generic/gdbtk-wrapper.c 18 Jan 2005 00:14:39 -0000 1.11 +++ generic/gdbtk-wrapper.c 27 May 2005 01:21:30 -0000 @@ -192,7 +192,7 @@ wrap_val_print (char *a) { struct gdb_wrapper_arguments **args = (struct gdb_wrapper_arguments **) a; struct type *type; - char *valaddr; + const gdb_byte *valaddr; CORE_ADDR address; struct ui_file *stream; int format; @@ -201,7 +201,7 @@ wrap_val_print (char *a) enum val_prettyprint pretty; type = (struct type *) (*args)->args[0]; - valaddr = (char *) (*args)->args[1]; + valaddr = (gdb_byte *) (*args)->args[1]; address = *(CORE_ADDR *) (*args)->args[2]; stream = (struct ui_file *) (*args)->args[3]; format = (int) (*args)->args[4]; --=-G/ia3Iao7YsWzRjTZ9uA--