This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/15683] New: breakpoint adjustment warning truncates addresses


http://sourceware.org/bugzilla/show_bug.cgi?id=15683

            Bug ID: 15683
           Summary: breakpoint adjustment warning truncates addresses
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: palves at redhat dot com

$ 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 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);
}

on a 32-bit hosts x 64-bit target scenario, those casts truncate the addresses
to 32-bit.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]