* [PATCH] gdb_regnames should take regnum as parameter
@ 2001-07-17 16:16 Keith Seitz
0 siblings, 0 replies; only message in thread
From: Keith Seitz @ 2001-07-17 16:16 UTC (permalink / raw)
To: Insight Maling List
Hi,
I've committed the following patch, which fixes a long standing bug:
(gdb) tk llength [gdb_regnames 0]
23
(In case it's not obvious, "gdb_regnames 0" should return the name for
register 0 ONLY, i.e., llength should be 1.)
I've also taken the liberty to whack the STREQ in this function, too.
Keith
ChangeLog
2001-07-17 Keith Seitz <keiths@redhat.com>
* generic/gdbtk-register.c (gdb_regnames): Don't skip
past the argument unless it is "-numbers"
Use strncmp instead of STREQ.
Patch
Index: gdbtk/generic/gdbtk-register.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-register.c,v
retrieving revision 1.1
diff -u -p -r1.1 gdbtk-register.c
--- gdbtk-register.c 2001/05/10 18:04:23 1.1
+++ gdbtk-register.c 2001/07/17 23:12:46
@@ -156,11 +156,14 @@ gdb_regnames (clientData, interp, objc,
if (objc >= 1)
{
- char *s = Tcl_GetStringFromObj (objv[0], NULL);
- if (STREQ (s, "-numbers"))
- numbers = 1;
- objc--;
- objv++;
+ int len;
+ char *s = Tcl_GetStringFromObj (objv[0], &len);
+ if (strncmp (s, "-numbers", len) == 0)
+ {
+ numbers = 1;
+ objc--;
+ objv++;
+ }
}
return map_arg_registers (objc, objv, get_register_name, &numbers);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-07-17 16:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-17 16:16 [PATCH] gdb_regnames should take regnum as parameter Keith Seitz
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).