This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: wrong section when using find_pc_section
- From: freenix <van dot freenix at gmail dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb at sourceware dot org
- Date: Tue, 13 Aug 2013 19:58:42 +0800
- Subject: Re: wrong section when using find_pc_section
- References: <5204D68E dot 6060107 at gmail dot com> <87txiyu3ca dot fsf at fleche dot redhat dot com> <5205A5E5 dot 3090000 at gmail dot com> <87zjsmrb9a dot fsf at fleche dot redhat dot com>
On 08/13/2013 02:53 AM, Tom Tromey wrote:
I traced the code and found that it did remove the overlapped sections.
it this a must to remove the overlapped sections? I want to use the
overlapped
sections, but not remove it. Is there any way that can return the
overlapped sections?
I don't really know for sure. I suspect you will run into problems,
though mostly of the "mystery" kind. For example, whether fixup_section
gives the right answer or not will most likely depend on the ordering of
sections in the objfile -- stuff like that.
Thanks for the reply.
I removed the filter_overlapping_sections function in order not to
remove the
overlapped sections. And do not use bsearch to find the correct section
but using
a sequential search to find the section whose start address is nearest
to pc passed to
find_pc_section. Using this way, find_pc_section can return the
overlapped section,
and gdb can correctly disas.
But not sure whether this is a good way or not, because I think this is
specific to my platform.
Thanks.
Peng
Tom