This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: gdb 7.6: Fix info mem command for 32 bits host/64 bits target
- From: Pedro Alves <palves at redhat dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Cc: Udma Catalin-Dan-B32721 <B32721 at freescale dot com>
- Date: Wed, 26 Jun 2013 17:07:50 +0100
- Subject: Re: gdb 7.6: Fix info mem command for 32 bits host/64 bits target
- References: <FE751157F0442848A159F3AB4CB1F55B3D9FE8 at 039-SN1MPN1-001 dot 039d dot mgd dot msft dot net> <51CB116D dot 7060009 at redhat dot com>
BTW,
$ grep hex_string_custom * | grep long
finds:
breakpoint.c: /* The longest string possibly returned by hex_string_custom
breakpoint.c: strcpy (astr1, hex_string_custom ((unsigned long) from_addr, 8));
breakpoint.c: strcpy (astr2, hex_string_custom ((unsigned long) to_addr, 8));
Those casts are likewise bogus:
static void
breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr,
int bnum, int have_bnum)
{
/* The longest string possibly returned by hex_string_custom
is 50 chars. These must be at least that big for safety. */
char astr1[64];
char astr2[64];
strcpy (astr1, hex_string_custom ((unsigned long) from_addr, 8));
strcpy (astr2, hex_string_custom ((unsigned long) to_addr, 8));
if (have_bnum)
warning (_("Breakpoint %d address previously adjusted from %s to %s."),
bnum, astr1, astr2);
else
warning (_("Breakpoint address adjusted from %s to %s."), astr1, astr2);
}
--
Pedro Alves