binutils-gdb/gdb/python
Tom de Vries cff32449e8 [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  <tdevries@suse.de>

	* python/lib/gdb/printer/bound_registers.py: Use
	'^builtin_type_bound128' as regexp argument for
	add_builtin_pretty_printer.
2019-10-09 23:52:46 +02:00
..
lib/gdb [gdb/target] Fix pretty-printer for MPX bnd registers 2019-10-09 23:52:46 +02:00
py-all-events.def
py-arch.c Rename gdb exception types 2019-04-08 09:05:40 -06:00
py-auto-load.c Change boolean options to bool instead of int 2019-09-18 09:35:12 +09:00
py-block.c Add block['var'] accessor 2019-08-05 13:06:18 -05:00
py-bpevent.c
py-breakpoint.c "catch catch/throw/rethrow", breakpoint -> catchpoint 2019-07-09 19:34:18 +01:00
py-cmd.c Rename gdb exception types 2019-04-08 09:05:40 -06:00
py-continueevent.c
py-event-types.def
py-event.c
py-event.h
py-events.h
py-evtregistry.c
py-evts.c
py-exitedevent.c
py-finishbreakpoint.c Rename gdb exception types 2019-04-08 09:05:40 -06:00
py-frame.c Rename gdb exception types 2019-04-08 09:05:40 -06:00
py-framefilter.c Introduce metadata style 2019-10-01 15:12:40 -06:00
py-function.c
py-gdb-readline.c Rename gdb exception types 2019-04-08 09:05:40 -06:00
py-inferior.c Fix use-after-move bug in add_thread_object 2019-07-11 09:15:18 -06:00
py-infevents.c
py-infthread.c Reduce manual reference counting in py-inferior.c 2019-07-10 12:24:22 -06:00
py-instruction.c
py-instruction.h
py-lazy-string.c Rename gdb exception types 2019-04-08 09:05:40 -06:00
py-linetable.c Rename gdb exception types 2019-04-08 09:05:40 -06:00
py-newobjfileevent.c
py-objfile.c Remove make_hex_string 2019-09-25 09:37:56 -06:00
py-param.c Change boolean options to bool instead of int 2019-09-18 09:35:12 +09:00
py-prettyprint.c Introduce metadata style 2019-10-01 15:12:40 -06:00
py-progspace.c Rename gdb exception types 2019-04-08 09:05:40 -06:00
py-record-btrace.c Don't include gdbarch.h from defs.h 2019-07-10 14:53:53 -06:00
py-record-btrace.h
py-record-full.c
py-record-full.h
py-record.c Rename gdb exception types 2019-04-08 09:05:40 -06:00
py-record.h
py-ref.h Rename common to gdbsupport 2019-07-09 07:45:38 -06:00
py-signalevent.c
py-stopevent.c
py-stopevent.h
py-symbol.c [PR/24474] Add gdb.lookup_static_symbol to the python API 2019-07-30 11:04:37 -05:00
py-symtab.c More block constification 2019-03-24 23:32:08 -06:00
py-threadevent.c
py-type.c Do not expose stub types to Python 2019-09-26 08:26:12 -06:00
py-unwind.c Rename internal Python functions to start with an underscore 2019-08-15 14:21:57 -05:00
py-utils.c Make exception handling more efficient 2019-04-25 12:59:35 -06:00
py-value.c Change boolean options to bool instead of int 2019-09-18 09:35:12 +09:00
py-varobj.c
py-xmethods.c
python-config.py
python-internal.h [PR/24474] Add gdb.lookup_static_symbol to the python API 2019-07-30 11:04:37 -05:00
python.c Change boolean options to bool instead of int 2019-09-18 09:35:12 +09:00
python.h