binutils-gdb/gdb/testsuite/gdb.dwarf2
Tom Tromey 5bd1ef568c Fix PR symtab/15391
PR symtab/15391 is a failure with the DW_OP_GNU_implicit_pointer
feature.

I tracked it down to a logic error in read_pieced_value.  The code
truncates this_size_bits according to the type size and offset too
early -- it should do it after taking bits_to_skip into account.

This patch fixes the bug.

While testing this, I also tripped across a latent bug because
indirect_pieced_value does not sign-extend where needed.  This patch
fixes this bug as well.

Finally, Pedro pointed out that a previous version implemented sign
extension incorrectly.  This version introduces a new gdb_sign_extend
function for this.  A couple of notes on this function:

* It has the gdb_ prefix to avoid clashes with various libraries that
  felt free to avoid proper namespacing.  There is a "sign_extend"
  function in a Tile GX header, in an SOM-related BFD header (and in
  sh64-tdep.c and as a macro in arm-wince-tdep.c, but those are
  ours...)

* I looked at all the sign extensions in gdb and didn't see ones that
  I felt comfortable converting to use this function; in large part
  because I don't have a good way to test the conversion.

Built and regtested on x86-64 Fedora 18.  New test cases included;
this required a minor addition to the DWARF assembler.  Note that the
DWARF CU made by implptrpiece.exp uses a funny pointer size in order
to show the sign-extension bug on all platforms.

	* dwarf2loc.c (read_pieced_value): Truncate this_size_bits
	after taking bits_to_skip into account.  Sign extend byte_offset.
	* utils.h (gdb_sign_extend): Declare.
	* utils.c (gdb_sign_extend): New function.

	* gdb.dwarf2/implptrpiece.exp: New file.
	* gdb.dwarf2/implptrconst.exp (d): New variable.
	Print d.
	* lib/dwarf2.exp (Dwarf::_location): Handle DW_OP_piece.
2013-06-18 18:11:19 +00:00
..
Makefile.in Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
callframecfa.S Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
callframecfa.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
clztest.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
clztest.c gdb 2011-05-13 18:54:59 +00:00
clztest.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dup-psym.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dup-psym.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-ada-ffffffff.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-ada-ffffffff.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-anon-mptr.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-anon-mptr.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-anonymous-func.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-anonymous-func.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-bad-parameter-type.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-bad-parameter-type.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-basic.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-basic.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-canonicalize-type.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-canonicalize-type.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-case-insensitive-debug.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-case-insensitive.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-case-insensitive.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-common-block.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-common-block.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-compdir-oldgcc.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-compdir-oldgcc.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-compressed.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-compressed.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-const.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-const.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-cp-infcall-ref-static-main.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-cp-infcall-ref-static.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-cp-infcall-ref-static.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-cu-size.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-cu-size.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-dir-file-name.c Update some copyright years. 2013-02-12 18:27:29 +00:00
dw2-dir-file-name.exp * gdb.dwarf2/dw2-dir-file-name.exp: Don't use brace expansion, 2013-05-21 07:25:51 +00:00
dw2-dos-drive.S gdb/ 2013-01-17 20:40:44 +00:00
dw2-dos-drive.exp gdb/ 2013-01-17 20:40:44 +00:00
dw2-double-set-die-type.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-double-set-die-type.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-empty-namespace.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-empty-namespace.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-empty-pc-range.S Update some copyright years. 2013-02-12 18:27:29 +00:00
dw2-empty-pc-range.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-entry-value-main.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-entry-value.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-entry-value.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-error.S Update some copyright years. 2013-02-12 18:27:29 +00:00
dw2-error.c Update some copyright years. 2013-02-12 18:27:29 +00:00
dw2-error.exp * gdb.dwarf2/dw2-error.exp: Pass test name to "file" test. 2013-01-23 21:04:45 +00:00
dw2-filename.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-filename.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-icc-opaque.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-icc-opaque.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-ifort-parameter-debug.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-ifort-parameter.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-ifort-parameter.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-inheritance.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-inheritance.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-inline-break.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-inline-break.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-inline-param-main.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-inline-param.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-inline-param.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-intercu.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-intercu.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-intermix.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-intermix.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-linkage-name-trust-main.cc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-linkage-name-trust.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-linkage-name-trust.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-minsym-in-cu.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-minsym-in-cu.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-modula2-self-type.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-modula2-self-type.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-namespaceless-anonymous.S Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-namespaceless-anonymous.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dw2-noloc-main.c Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-noloc.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-noloc.exp gdb/testsuite/ 2013-03-15 01:41:29 +00:00
dw2-objfile-overlap-inner.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-objfile-overlap-outer.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-objfile-overlap.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-op-call.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-op-call.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-op-out-param.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-op-out-param.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-op-stack-value.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-op-stack-value.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-param-error-main.c Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-param-error.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-param-error.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-producer.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-producer.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-ranges.c Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
dw2-ranges.exp gdb/testsuite/ 2013-03-14 13:34:06 +00:00
dw2-ranges2.c Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
dw2-ranges3.c Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
dw2-ref-missing-frame-func.c Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-ref-missing-frame-main.c Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-ref-missing-frame.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-ref-missing-frame.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-restore.S Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
dw2-restore.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-restrict.S Update some copyright years. 2013-02-12 18:27:29 +00:00
dw2-restrict.c Update some copyright years. 2013-02-12 18:27:29 +00:00
dw2-restrict.exp Update some copyright years. 2013-02-12 18:27:29 +00:00
dw2-simple-locdesc.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-simple-locdesc.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-skip-prologue.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-skip-prologue.c Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-skip-prologue.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-stack-boundary.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-stack-boundary.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-strp.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-strp.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-unresolved-main.c Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-unresolved.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-unresolved.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-var-zero-addr.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw2-var-zero-addr.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw4-sig-type-unused.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw4-sig-type-unused.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw4-sig-types-b.cc PR symtab/11942 2010-08-25 00:09:14 +00:00
dw4-sig-types.cc PR symtab/11942 2010-08-25 00:09:14 +00:00
dw4-sig-types.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
dw4-sig-types.h PR symtab/11942 2010-08-25 00:09:14 +00:00
file1.txt
fission-base.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
fission-base.c Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
fission-base.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
fission-loclists.S * dwarf2loc.c (dwarf2_find_location_expression): Don't add base address 2013-01-28 18:02:48 +00:00
fission-loclists.exp * dwarf2loc.c (dwarf2_find_location_expression): Don't add base address 2013-01-28 18:02:48 +00:00
fission-reread.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
fission-reread.exp * dwarf2read.c (free_dwo_file): Remove assert. 2013-01-29 19:26:22 +00:00
implptr-64bit.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
implptr-64bit.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
implptr-optimized-out.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
implptr-optimized-out.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
implptr.S gdb/ 2011-07-19 20:25:14 +00:00
implptr.c Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
implptr.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
implptrconst.c * dwarf2loc.c (invalid_synthetic_pointer): Move earlier. 2013-05-06 19:44:04 +00:00
implptrconst.exp Fix PR symtab/15391 2013-06-18 18:11:19 +00:00
implptrpiece.exp Fix PR symtab/15391 2013-06-18 18:11:19 +00:00
mac-fileno.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
mac-fileno.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
main.c Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
member-ptr-forwardref.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
member-ptr-forwardref.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
method-ptr.cc PR c++/14998: 2013-01-31 17:41:09 +00:00
method-ptr.exp * lib/dwarf.exp (Dwarf): New variable _abbrev_section. 2013-05-20 22:11:37 +00:00
missing-sig-type.exp * lib/dwarf.exp (Dwarf): New variable _abbrev_section. 2013-05-20 22:11:37 +00:00
nostaticblock.exp * lib/dwarf.exp (Dwarf): New variable _abbrev_section. 2013-05-20 22:11:37 +00:00
pieces.S Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
pieces.c Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
pieces.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
pr10770.c gdb 2010-01-20 18:06:16 +00:00
pr10770.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
pr11465.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
pr11465.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
pr13961.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
pr13961.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
subrange.exp * lib/dwarf.exp (Dwarf): New variable _abbrev_section. 2013-05-20 22:11:37 +00:00
trace-crash.S PR c++/14999: 2013-01-18 18:32:35 +00:00
trace-crash.exp PR c++/14999: 2013-01-18 18:32:35 +00:00
typeddwarf-amd64.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
typeddwarf.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
typeddwarf.c gdb 2011-07-22 15:31:52 +00:00
typeddwarf.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
valop.S Fix formating in copyright headers. 2013-06-07 14:39:33 +00:00
valop.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
watch-notconst.c Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
watch-notconst.exp Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
watch-notconst2.S Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00
watch-notconst2.c Update years in copyright notice for the GDB files. 2013-01-01 06:41:43 +00:00