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 gdb/15161] New: symfile.c:struct load_section_data::load_offsetis "unsigned long" but should be wider.


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

             Bug #: 15161
           Summary: symfile.c:struct load_section_data::load_offset is
                    "unsigned long" but should be wider.
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: palves@redhat.com
    Classification: Unclassified


symfile.c has:

/* Opaque data for load_section_callback.  */
struct load_section_data {
  unsigned long load_offset;
  struct load_progress_data *progress_data;
  VEC(memory_write_request_s) *requests;
};

static void
load_section_callback (bfd *abfd, asection *asec, void *data)
{
  struct memory_write_request *new_request;
...
  new_request->begin = bfd_section_lma (abfd, asec) + args->load_offset;
...

void
generic_load (char *args, int from_tty)
{
...
      cbdata.load_offset = strtoul (argv[1], &endptr, 0);


"unsigned long" is not wide enough in the cases of 32-bit gdb x 64-bit target,
or LLP64 (like Windows 64-bit).  load_offset should be ULONGEST or CORE_ADDR.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]