Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: Mike Gulick <mike.gulick@mathworks.com>,
	Simon Marchi	<simon.marchi@polymtl.ca>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [RFC][PATCH] fix gdb segv when objfile can't be opened
Date: Fri, 27 Oct 2017 21:11:00 -0000	[thread overview]
Message-ID: <fdacf82a-15d3-2112-357f-d99cd4ac9354@ericsson.com> (raw)
In-Reply-To: <c17d5f02-1afd-dcdd-2855-531d9725e3c1@mathworks.com>

On 2017-10-23 07:19 PM, Mike Gulick wrote:
> Here is a new version of the patch.  It changes the following from the original
> patch:
> 
> 1) It adds a testsuite which locks down:
>   a) The stack frame is printed when the breakpoint is hit
>   b) 'next' runs without causing a segv
> 2) No longer set descriptor->size in gdb_bfd_map_section when an error is hit.
>    It doesn't look like this is needed as gdb_bfd_map_section is the only place
>    that consumes that descriptor->size field.
> 3) Update the description in gdb_bfd.h to indicate that if there is an error
>    mapping the section, a warning is generated, *SIZE is set to 0, and NULL is
>    returned.
> 
> I considered catching the error in the caller of gdb_bfd_map_section, which is
> dwarf2_read_section in dwarf2read.c.  It didn't seem to make any more sense to
> catch the error here than it would directly in gdb_bfd_map_section.  If
> anything, it would make more sense to catch the error in the caller of
> dwarf2_read_section, which in this case is dwarf2_get_section_info.  However
> there are many callers of dwarf2_read_section.  It doesn't make sense to force
> all of them to add a TRY/CATCH around calling dwarf2_read_section.
> 
> Please let me know thoughts/feedback.
> 
> Also see the note in the test case about not being able to make 'shlib=...'
> work when compiling a shared library that links against another shared
> library.  The workaround I used is kind of ugly.

Hi Mike,

I started looking at your patch and thought I would take a look at this problem.
The problem seems to be that gdb_compile_shlib builds the shared library in two
steps:

  .c -> .o -> .so

because it's not possible to do it in one pass.  As of today, if you pass an
shlib= option to gdb_compile_shlib, it will be passed to both compilation steps,
which means Dejagnu will pass the path to lib1.so while compiling the .c to a .o,
which makes gcc complain like this:

  warning: .../solib-vanish-lib2.so: linker input file unused because linking not done

I think the solution would be not to pass shlib= for this step, only for the final
linking.  I'll try to write a patch about this.

Simon


  reply	other threads:[~2017-10-27 21:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 14:10 Mike Gulick
2017-10-19 15:59 ` Mike Gulick
2017-10-19 17:54   ` Simon Marchi
2017-10-19 19:39     ` Mike Gulick
2017-10-19 20:10       ` Simon Marchi
2017-10-19 22:13         ` Mike Gulick
2017-10-23 23:19     ` Mike Gulick
2017-10-27 21:11       ` Simon Marchi [this message]
2017-10-28  1:19       ` Simon Marchi
2017-10-30 22:14         ` Mike Gulick
2017-10-30 23:38           ` Simon Marchi
2018-01-07 14:09             ` Simon Marchi
2018-01-08  0:45               ` Mike Gulick
2018-01-08  2:50                 ` Simon Marchi
2018-01-08  2:51                   ` Simon Marchi
2018-01-10 20:33                     ` Mike Gulick
2018-01-12  2:44                       ` Simon Marchi
2018-01-12 15:05                         ` Mike Gulick
2018-01-17 18:01                           ` Simon Marchi
2018-01-18 15:30                             ` Mike Gulick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fdacf82a-15d3-2112-357f-d99cd4ac9354@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mike.gulick@mathworks.com \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox