This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Ignore the first entry returned by svr4_current_sos_via_xfer_libraries for dynamically linked programs
- From: Gary Benson <gbenson at redhat dot com>
- To: Ben Cheng <bccheng at google dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 29 May 2013 11:16:56 +0100
- Subject: Re: [PATCH] Ignore the first entry returned by svr4_current_sos_via_xfer_libraries for dynamically linked programs
- References: <CAPk6zkCTrkS960JAG70PdTaTAE=FQ1y4V2CneiNutSu6CG8rwA at mail dot gmail dot com>
Ben Cheng wrote:
> The first entry in the xml list returned by
> svr4_current_sos_via_xfer_libraries() is the executable itself. For
> dynamically linked programs, the existing code that deals with
> gdbserver that doesn't support svr4_current_sos_via_xfer_libraries
> is ignoring the first entry. This patch applies the same logic on
> the result returned by svr4_current_sos_via_xfer_libraries().
>
> See GDB PR/15507 for more details.
>
> --
>
> 2013-05-28 Ben Cheng <bccheng@android.com>
>
> PR gdb/15507:
> * solib-svr4.c (svr4_current_sos): Ignore the first library list
> entry returned by svr4_current_sos_via_xfer_libraries call for
> dynamically linked programs.
>
> Index: solib-svr4.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/solib-svr4.c,v
> retrieving revision 1.178
> diff -r1.178 solib-svr4.c
> 1285c1285,1291
> < return library_list.head ? library_list.head : svr4_default_sos ();
> ---
> > /* Use the same logic that determines the 'ignore_first' variable
> > below. PR - 15507 */
> > if (exec_bfd && bfd_get_section_by_name (exec_bfd, ".dynamic") == NULL)
> > return library_list.head ? library_list.head : svr4_default_sos ();
> > else
> > return library_list.head && library_list.head->next ?
> > library_list.head->next : svr4_default_sos ();
This seems reasonable to me, though in future please use "diff -u" to
generate patches.
Thanks,
Gary
--
http://gbenson.net/