Re: [patch] Speed up find_pc_section

Paul Pluzhnikov
2009-08-20T17:58:01Z

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

On Tue, Aug 18, 2009 at 5:23 AM, Ulrich
Weigand<Ulrich.Weigand@de.ibm.com> wrote:

> For overlay sections, find_pc_section would
> delegate its work to find_pc_mapped_section anyway:

Thanks, I understand how that works now.

> I'd be happy to test patches on the SPU ...

Could you please test attached patch?

I believe it is correct to simply not insert any overlay sections into
the section map. Tested on Linux/x86_64 with no new failures.

Thanks,
--
Paul Pluzhnikov

2009-08-20 Paul Pluzhnikov <ppluzhnikov@google.com>

* objfiles.c (update_section_map): Skip overlay sections.

[-- Attachment #2: gdb-find_pc_section-20090820.txt --]
[-- Type: text/plain, Size: 729 bytes --]

Index: objfiles.c
===================================================================
RCS file: /cvs/src/src/gdb/objfiles.c,v
retrieving revision 1.92
diff -u -p -u -r1.92 objfiles.c
--- objfiles.c 17 Aug 2009 11:16:13 -0000 1.92
+++ objfiles.c 20 Aug 2009 17:47:56 -0000
@@ -837,9 +837,10 @@ update_section_map (struct obj_section *
map = *pmap;
xfree (map);

-#define insert_p(objf, sec) \
- ((bfd_get_section_flags ((objf)->obfd, (sec)->the_bfd_section) \
- & SEC_THREAD_LOCAL) == 0)
+#define insert_p(objf, sec) \
+ (section_is_mapped (sec) == 0 && \
+ ((bfd_get_section_flags ((objf)->obfd, (sec)->the_bfd_section) \
+ & SEC_THREAD_LOCAL) == 0))

map_size = 0;
ALL_OBJSECTIONS (objfile, s)