From: Keith Seitz <keiths@redhat.com>
To: Paul Schlie <schlie@comcast.net>
Cc: "insight@sources.redhat.com" <insight@sources.redhat.com>
Subject: Re: [patch] updates gdbtk to use lbasename() do to shared lib header tweaks.
Date: Fri, 27 May 2005 01:31:00 -0000 [thread overview]
Message-ID: <1117157462.4456.117.camel@lindt.uglyboxes.com> (raw)
In-Reply-To: <BEBBCF77.A49F%schlie@comcast.net>
[-- Attachment #1: Type: text/plain, Size: 1085 bytes --]
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 <keiths@redhat.com>
* 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 <schlie@comcast.net>:
* generic/gdbtk-bp.c (gdb_set_bp): Use lbasename instead of basename.
* generic/gdbtk-cmds.c (gdb_listfiles): Likewise.
[-- Attachment #2: gdbtk.patch --]
[-- Type: text/x-patch, Size: 4938 bytes --]
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];
next prev parent reply other threads:[~2005-05-27 1:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-26 23:09 Paul Schlie
2005-05-27 1:31 ` Keith Seitz [this message]
2005-05-27 4:48 ` Paul Schlie
2005-05-27 6:07 ` Keith Seitz
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=1117157462.4456.117.camel@lindt.uglyboxes.com \
--to=keiths@redhat.com \
--cc=insight@sources.redhat.com \
--cc=schlie@comcast.net \
/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).