This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/4] python support for fetching separate debug files: have_debug_info
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org, palves at redhat dot com, sergiodj at redhat dot com
- Date: Sat, 22 Nov 2014 10:04:52 +0200
- Subject: Re: [PATCH 2/4] python support for fetching separate debug files: have_debug_info
- Authentication-results: sourceware.org; auth=none
- References: <yjt2d28ho9cw dot fsf at ruffy dot mtv dot corp dot google dot com> <837fyp57bu dot fsf at gnu dot org> <CADPb22QZckwEWPVrXZassarcAftT7aATy=vqsm_3-9qa967BLQ at mail dot gmail dot com> <83d28gtjr5 dot fsf at gnu dot org> <CADPb22S8A_bwAqUF6wpShQXyBQ62M0kfdCUG2vZsNASODyN0fg at mail dot gmail dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Fri, 21 Nov 2014 12:22:23 -0800
> From: Doug Evans <dje@google.com>
> Cc: gdb-patches <gdb-patches@sourceware.org>, Pedro Alves <palves@redhat.com>,
> Sergio Durigan Junior <sergiodj@redhat.com>
>
> >> The problem that needs to be solved is for Python code to be able to tell
> >> whether to spend time fetching separate debug files, as the latter can take
> >> a significant amount of time. Also, a program may use a large number of
> >> shared libraries and the user may wish (or not wish) debug info to be
> >> fetched for each one. So we want, IMO, a simple and cheap initial
> >> test for whether we need to fetch debug files.
> >
> > Why not make that test part of the method that fetches the debug info?
>
> This is Python code. What did you mean by "method" ?
The method, which we expose to Python programs, which fetches debug
info.
> >> For the use-case in question, another way to look at the attribute is
> >> "Has debug info been stripped or not?".
> >
> > But there's no reliable way to determine that, either, is there?
>
> Beyond detecting the absence of the requisite debug sections (in
> dwarf: .debug_info, et.al.) ?
> Or were you thinking of something else?
I still don't understand what good will it make to have this
attribute. It seems you would like it to allow an optimization,
whereby some clever Python extension to GDB might examine this
attribute and decide not to try to fetch the debug info. But then why
not do that automatically all the time? why burden the Python
programmer with this?