Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Tom Tromey <tom@tromey.com>
Cc: "Sharma, Alok Kumar" <AlokKumar.Sharma@amd.com>,
	"George, Jini Susan" <JiniSusan.George@amd.com>,
	"Achra, Nitika" <Nitika.Achra@amd.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix for incorrect breakpoint set in case of flang compiled binary
Date: Wed, 19 Aug 2020 14:05:25 +0100	[thread overview]
Message-ID: <20200819130525.GM853475@embecosm.com> (raw)
In-Reply-To: <87pn7puhbs.fsf@tromey.com>

* Tom Tromey <tom@tromey.com> [2020-08-17 14:51:19 -0600]:

> >>>>> ">" == Sharma, Alok Kumar <AlokKumar.Sharma@amd.com> writes:
> 
> >> +	          || startswith(COMPUNIT_PRODUCER(cust), " F90 Flang"))))
> 
> Space before "(".
> 
> Does it really start with a space?  That seems weird.
> 
> >>  # Check if not allocated VLA in type does not break
> >>  # the debugger when accessing it.
> >> -gdb_breakpoint [gdb_get_line_number "before-allocated"]
> >> -gdb_continue_to_breakpoint "before-allocated"
> >> +# break main for Flang compiler already breaks here
> 
> Do you know why?

The line marked 'before-allocated' is the first line that should be
considered after the prologue.

Due to GCC not really marking the end of prologue correctly we rely on
the prologue scanner for GCC, while for Flang we can use the line
table to spot the end of prologue.

On Flang this leaves us in the correct place, the 'before-allocated'
line.

On GCC the prologue scanner aborts early because the prologue contains
a small control flow loop  to initialise some of the local variables.
As a result on GCC we stop part way through the prologue.

We could improve the prologue scanner to handle this case on GCC, but
that's obviously a separate issue.

... or GCC could start marking the end of prologue.

Thanks,
Andrew


  reply	other threads:[~2020-08-19 13:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-17 15:17 Sharma, Alok Kumar
2020-08-17 20:51 ` Tom Tromey
2020-08-19 13:05   ` Andrew Burgess [this message]
2020-08-18 10:29 ` Andrew Burgess
2020-08-18 12:53   ` Sharma, Alok Kumar
2020-08-19 13:09     ` Andrew Burgess
2020-08-19 15:25       ` Sharma, Alok Kumar
2020-08-18 19:21   ` Tom Tromey

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=20200819130525.GM853475@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=AlokKumar.Sharma@amd.com \
    --cc=JiniSusan.George@amd.com \
    --cc=Nitika.Achra@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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