From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105375 invoked by alias); 9 Oct 2019 21:52:54 -0000 Mailing-List: contact gdb-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: gdb-cvs-owner@sourceware.org List-Subscribe: Sender: gdb-cvs-owner@sourceware.org Received: (qmail 105331 invoked by uid 9882); 9 Oct 2019 21:52:54 -0000 Date: Wed, 09 Oct 2019 21:52:00 -0000 Message-ID: <20191009215254.105329.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/target] Fix pretty-printer for MPX bnd registers X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 6a25e8a290eb5453d1464f68889c9c9a1084191a X-Git-Newrev: cff32449e888c9ccb3c7e5fee7a0c14c5dcc4178 X-SW-Source: 2019-10/txt/msg00091.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cff32449e888c9ccb3c7e5fee7a0c14c5dcc4178 commit cff32449e888c9ccb3c7e5fee7a0c14c5dcc4178 Author: Tom de Vries Date: Wed Oct 9 23:52:46 2019 +0200 [gdb/target] Fix pretty-printer for MPX bnd registers I'm seeing this failure: ... (gdb) print /x $bnd0 = {0x10, 0x20}^M $23 = {lbound = 0x10, ubound = 0x20}^M (gdb) FAIL: gdb.arch/i386-mpx.exp: verify size for bnd0 ... The test expects a pretty printer to be actived printing 'size 17': ... set test_string ".*\\\: size 17.*" gdb_test "print /x \$bnd0 = {0x10, 0x20}" "$test_string" "verify size for bnd0" ... but that doesn't happen. The pretty printer is for the type of the $bnd0 register, which is created here in i386_bnd_type: ... t = arch_composite_type (gdbarch, "__gdb_builtin_type_bound128", TYPE_CODE_STRUCT); append_composite_type_field (t, "lbound", bt->builtin_data_ptr); append_composite_type_field (t, "ubound", bt->builtin_data_ptr); TYPE_NAME (t) = "builtin_type_bound128"; ... And the pretty-printer is registered here in gdb/python/lib/gdb/printer/bound_registers.py: ... gdb.printing.add_builtin_pretty_printer ('mpx_bound128', '^__gdb_builtin_type_bound128', MpxBound128Printer) ... Fix the pretty printer by changing the regexp argument of add_builtin_pretty_printer to match "builtin_type_bound128", the TYPE_NAME. Tested on x86_64-linux. gdb/ChangeLog: 2019-10-09 Tom de Vries * python/lib/gdb/printer/bound_registers.py: Use '^builtin_type_bound128' as regexp argument for add_builtin_pretty_printer. Diff: --- gdb/ChangeLog | 6 ++++++ gdb/python/lib/gdb/printer/bound_registers.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2a39ab2..9402ba4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2019-10-09 Tom de Vries + + * python/lib/gdb/printer/bound_registers.py: Use + '^builtin_type_bound128' as regexp argument for + add_builtin_pretty_printer. + 2019-10-09 Christian Biesinger * guile/guile.c (guile_extension_script_ops): Remove forward diff --git a/gdb/python/lib/gdb/printer/bound_registers.py b/gdb/python/lib/gdb/printer/bound_registers.py index f39d220..1e8a3cc 100644 --- a/gdb/python/lib/gdb/printer/bound_registers.py +++ b/gdb/python/lib/gdb/printer/bound_registers.py @@ -39,5 +39,5 @@ class MpxBound128Printer: return result gdb.printing.add_builtin_pretty_printer ('mpx_bound128', - '^__gdb_builtin_type_bound128', + '^builtin_type_bound128', MpxBound128Printer)