public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "keiths at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug breakpoints/18144] [aarch64] the skip prologue functionality doesn't work well for same assembly functions
Date: Thu, 19 Mar 2015 18:36:00 -0000	[thread overview]
Message-ID: <bug-18144-4717-wF7WWjOKZk@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-18144-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=18144

Keith Seitz <keiths at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |keiths at redhat dot com
          Component|tdep                        |breakpoints
           Severity|normal                      |enhancement

--- Comment #1 from Keith Seitz <keiths at redhat dot com> ---
In the attachment is a reproducer:

---- from readme.txt in the attachment ----
1) The command line to compile the assembly file with debug information
aarch64-none-elf-gcc -O0 -g -nostartfiles -o main.elf main.S

2) You can see below the steps in order to reproduce the aarch64 gdb problem.
aarch64-none-elf-gdb main.elf
(gdb) b _start
Breakpoint 1 at 0x400028: file main.S, line 4.

Observed:
The breakpoint was set at the second nop instruction. 
Expected:
The breakpoint should be set at the first nop instruction.
---- end readme.txt ----

The problem here is that when you use the break command and give it a linespec
location, it *will* attempt to skip prologue instructions. Always.

However, if you give it an address location instead, gdb will *not* attempt to
skip the prologue. I guess some of us old-timers have the proper idiom hammered
into our fingers already.

Using "break *_start" should better suit your needs when debugging assembler
source files.

I am recategorizing this to "enhancement" because I think it might be desirable
to change the behavior based on the source language, e.g., if the source
language of a breakpoint location is assembler, do not do prologue-skipping. I
can see arguments both ways for this, so I will wait for maintainers to weigh
in on the issue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


      parent reply	other threads:[~2015-03-19 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 11:16 [Bug tdep/18144] New: " mihail.nistor at freescale dot com
2015-03-19 13:18 ` [Bug tdep/18144] [aarch64] " mihail.nistor at freescale dot com
2015-03-19 18:36 ` keiths at redhat dot com [this message]

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=bug-18144-4717-wF7WWjOKZk@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).