This is the mail archive of the gdb-patches@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]

Re: [patch] Speed up find_pc_section


I wrote:
> Paul Pluzhnikov wrote:
> 
> > 2009-08-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
> > 
> >         * objfiles.c (qsort_cmp): Remove assert.
> >         (preferred_obj_section): New function.
> >         (update_section_map): Filter duplicates.
> 
> This patch breaks overlay support:

This part also doesn't really work with overlay sections:

static int
qsort_cmp (const void *a, const void *b)
{
  const struct obj_section *sect1 = *(const struct obj_section **) a;
  const struct obj_section *sect2 = *(const struct obj_section **) b;
  const CORE_ADDR sect1_addr = obj_section_addr (sect1);
  const CORE_ADDR sect2_addr = obj_section_addr (sect2);

  if (sect1_addr < sect2_addr)
    {
      gdb_assert (obj_section_endaddr (sect1) <= sect2_addr);
      return -1;
    }
  else if (sect1_addr > sect2_addr)
    {
      gdb_assert (sect1_addr >= obj_section_endaddr (sect2));
      return 1;
    }

Section can partially overlap with overlays ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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