Bug 22779 - "show mpx bound" command fails
Summary: "show mpx bound" command fails
Status: UNCONFIRMED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 8.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-03 13:25 UTC by Bruno Haible
Modified: 2018-02-03 13:29 UTC (History)
0 users

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build: x86_64-pc-linux-gnu
Last reconfirmed:


Attachments
test program (135 bytes, text/x-csrc)
2018-02-03 13:25 UTC, Bruno Haible
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno Haible 2018-02-03 13:25:56 UTC
Created attachment 10781 [details]
test program

While debugging a program compiled with "gcc -mmpx -fcheck-pointer-bounds", I wish to see the bounds a of variable, as documented in https://sourceware.org/gdb/onlinedocs/gdb/i386.html

But the "show mpx bound <variable>" command fails:

(gdb) show mpx bound mem
Invalid bounds directory entry at 0x7fff773e7030.

This happens although the process itself does proper bounds checking.

How to reproduce:
$ gcc -mmpx -fcheck-pointer-bounds -ggdb foo.c
$ gdb a.out
(gdb) break main
(gdb) run
(gdb) next
(gdb) next
(gdb) next
(gdb) show mpx bound mem
(gdb) show mpx bound p
(gdb) continue
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00000000004005c8 in main () at foo.c:9
9         p[-2] = 'x';
Comment 1 Bruno Haible 2018-02-03 13:29:00 UTC
As a workaround, I can use
(gdb) print $bnd0
but this is pretty low-level debugging.