Bug 22301 - [AARCH64] can't place breakpoint on STP of double registers
Summary: [AARCH64] can't place breakpoint on STP of double registers
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: breakpoints (show other bugs)
Version: 7.11.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-16 04:26 UTC by Isaac
Modified: 2017-10-16 05:45 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Core dump (1.54 MB, application/octet-stream)
2017-10-16 04:28 UTC, Isaac
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Isaac 2017-10-16 04:26:50 UTC
On aarch64 (the armv8-a version), gdb fails to place breakpoints on STP instruction with double registers as operands, e.g:

```
.globl main
main:
        STP D9, D8, [SP,#-16]!
        RET
```

When compiled with gcc, and run through gdb:
```
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./a.out...(no debugging symbols found)...done.
(gdb) b main
/build/gdb-g58BK_/gdb-7.11.1/gdb/aarch64-tdep.c:334: internal-error: aarch64_analyze_prologue: Assertion `inst.operands[0].type == AARCH64_OPND_Rt' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

This is a bug, please report it.  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

/build/gdb-g58BK_/gdb-7.11.1/gdb/aarch64-tdep.c:334: internal-error: aarch64_analyze_prologue: Assertion `inst.operands[0].type == AARCH64_OPND_Rt' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) y
Aborted (core dumped)
```
Comment 1 Isaac 2017-10-16 04:28:15 UTC
Created attachment 10531 [details]
Core dump
Comment 2 Isaac 2017-10-16 04:31:10 UTC
Interestingly, adding a breakpoint to the actual first instruction of main works, but using 'si' after breaking dosn't:

```
(gdb) b *&main
Breakpoint 1 at 0x400570
(gdb) r
Starting program: /home/isaacg/a.out

Breakpoint 1, 0x0000000000400570 in main ()
(gdb) si
/build/gdb-g58BK_/gdb-7.11.1/gdb/aarch64-tdep.c:334: internal-error: aarch64_analyze_prologue: Assertion `inst.operands[0].type == AARCH64_OPND_Rt' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

This is a bug, please report it.  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

/build/gdb-g58BK_/gdb-7.11.1/gdb/aarch64-tdep.c:334: internal-error: aarch64_analyze_prologue: Assertion `inst.operands[0].type == AARCH64_OPND_Rt' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) y
Aborted (core dumped)
```
Comment 3 Isaac 2017-10-16 05:45:25 UTC
It seems it is fixed in version '8.0.1', sorry about the pointless bug report.