gdb 7.6: Fix info mem command for 32 bits host/64 bits target

Tom Tromey tromey@redhat.com
Wed Jun 26 17:11:00 GMT 2013


Pedro> static void
Pedro> breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr,
Pedro>                                int bnum, int have_bnum)
Pedro> {
Pedro>   /* The longest string possibly returned by hex_string_custom
Pedro>      is 50 chars.  These must be at least that big for safety.  */
Pedro>   char astr1[64];
Pedro>   char astr2[64];

Pedro>   strcpy (astr1, hex_string_custom ((unsigned long) from_addr, 8));
Pedro>   strcpy (astr2, hex_string_custom ((unsigned long) to_addr, 8));

These strcpy calls are also bogus.
hex_string_custom uses the "cell" mechanism, so this code can assume
that these calls don't interfere.

Tom



More information about the Gdb-patches mailing list