binutils-gdb/gdb/python
Yao Qi 3fff9862d5 Create subobject value in pretty printer
Nowadays, we create a value of subobject in pretty printer with 'address'
being used,

  value = value_from_contents_and_address (type, valaddr + embedded_offset,
					   address + embedded_offset);

  set_value_component_location (value, val);
  /* set_value_component_location resets the address, so we may
     need to set it again.  */
  if (VALUE_LVAL (value) != lval_internalvar
      && VALUE_LVAL (value) != lval_internalvar_component
      && VALUE_LVAL (value) != lval_computed)
    set_value_address (value, address + embedded_offset);

value_from_contents_and_address creates a value from memory, but the
value we are pretty-printing may not from memory at all.

Instead of using value_from_contents_and_address, we create a value
of subobject with the same location as object's but different offset.
We avoid using address in this way.  As a result, parameter 'address'
in apply_val_pretty_printer is no longer needed, we can remove it in
next step.

We've already had the location of the 'whole' value, so it is safe
to assume we can create a value of 'component' or 'suboject' value
at the same location but with different offset.

gdb:

2016-11-21  Yao Qi  <yao.qi@linaro.org>

	* guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer):
	Don't call value_from_contents_and_address and
	set_value_address.  Call value_from_component.
	* python/py-prettyprint.c (gdbpy_apply_val_pretty_printer):
	Likewise.
	* value.c (value_from_component): New function.
	* value.h (value_from_component): Likewise.
	* valarith.c (value_subscripted_rvalue): Call
	value_from_component.
2016-11-21 14:15:06 +00:00
..
lib/gdb PR python/19293 - invalidate frame cache when unwinders change 2016-07-12 13:56:07 -06:00
py-arch.c Use ui_file_as_string in gdb/python/ 2016-11-08 15:26:45 +00:00
py-auto-load.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-block.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-bpevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-breakpoint.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
py-cmd.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
py-continueevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-event.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-event.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-events.h PR python/15620, PR python/18620 - breakpoint events in Python 2016-07-13 13:59:55 -06:00
py-evtregistry.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-evts.c PR python/15620, PR python/18620 - breakpoint events in Python 2016-07-13 13:59:55 -06:00
py-exitedevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-finishbreakpoint.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-frame.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
py-framefilter.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
py-function.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
py-gdb-readline.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-inferior.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-infevents.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-infthread.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
py-lazy-string.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-linetable.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-newobjfileevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-objfile.c Make symfile_add_flags and objfile->flags strongly typed 2016-10-26 16:47:10 +01:00
py-param.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
py-prettyprint.c Create subobject value in pretty printer 2016-11-21 14:15:06 +00:00
py-progspace.c Fix PR python/19438, PR python/18393 - initialize dictionaries 2016-05-23 10:08:34 -06:00
py-signalevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-stopevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-stopevent.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-symbol.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-symtab.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
py-threadevent.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-type.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
py-unwind.c Make gdb.PendingFrame.read_register handle "user" registers. 2016-11-16 11:38:44 -07:00
py-utils.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
py-value.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
py-varobj.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
py-xmethods.c PR python/19819 - remove unused globals from py-xmethods.c 2016-06-09 14:29:21 -06:00
python-config.py Add support for Python 3. 2012-12-12 16:47:30 +00:00
python-internal.h Remove apply_val_pretty_printer parameter valaddr 2016-11-11 08:38:31 +00:00
python.c Use unique_xmalloc_ptr in Python code 2016-11-09 19:40:12 -07:00
python.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00