public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-jankratochvil-entryval: Fix gdb.dwarf2/implptr.exp regression.
@ 2011-07-14 20:26 jkratoch
0 siblings, 0 replies; only message in thread
From: jkratoch @ 2011-07-14 20:26 UTC (permalink / raw)
To: archer-commits
The branch, archer-jankratochvil-entryval has been updated
via 4798be10a061a69a99d80a6b57994659ce3acf86 (commit)
from 8adc27eb7807830847ea94a5e21971f503fbaa89 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 4798be10a061a69a99d80a6b57994659ce3acf86
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Thu Jul 14 22:25:47 2011 +0200
Fix gdb.dwarf2/implptr.exp regression.
-----------------------------------------------------------------------
Summary of changes:
gdb/dwarf2loc.c | 2 +-
gdb/valops.c | 22 +++++++++++-----------
gdb/value.c | 11 ++++++-----
gdb/value.h | 7 ++++---
4 files changed, 22 insertions(+), 20 deletions(-)
First 500 lines of diff:
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 566dd94..6abae25 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -1606,7 +1606,7 @@ indirect_pieced_value (struct value *value)
LONGEST byte_offset;
struct cleanup *back_to;
- type = value_type (value);
+ type = check_typedef (value_type (value));
if (TYPE_CODE (type) != TYPE_CODE_PTR)
return NULL;
diff --git a/gdb/valops.c b/gdb/valops.c
index 802ee27..652c9a7 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1743,22 +1743,22 @@ value_ind (struct value *arg1)
base_type = check_typedef (value_type (arg1));
- if (VALUE_LVAL (arg1) == lval_computed)
+ if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
{
- const struct lval_funcs *funcs = value_computed_funcs (arg1);
+ struct type *enc_type;
- if (funcs->indirect)
+ if (VALUE_LVAL (arg1) == lval_computed)
{
- struct value *result = funcs->indirect (arg1);
+ const struct lval_funcs *funcs = value_computed_funcs (arg1);
- if (result)
- return result;
- }
- }
+ if (funcs->indirect)
+ {
+ struct value *result = funcs->indirect (arg1);
- if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
- {
- struct type *enc_type;
+ if (result)
+ return result;
+ }
+ }
/* We may be pointing to something embedded in a larger object.
Get the real type of the enclosing object. */
diff --git a/gdb/value.c b/gdb/value.c
index d83f51f..54cddeb 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -3077,6 +3077,9 @@ coerce_ref (struct value *arg)
{
struct type *value_type_arg_tmp = check_typedef (value_type (arg));
+ if (TYPE_CODE (value_type_arg_tmp) != TYPE_CODE_REF)
+ return arg;
+
if (VALUE_LVAL (arg) == lval_computed)
{
const struct lval_funcs *funcs = value_computed_funcs (arg);
@@ -3090,11 +3093,9 @@ coerce_ref (struct value *arg)
}
}
- if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF)
- arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp),
- unpack_pointer (value_type (arg),
- value_contents (arg)));
- return arg;
+ return value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp),
+ unpack_pointer (value_type (arg),
+ value_contents (arg)));
}
struct value *
diff --git a/gdb/value.h b/gdb/value.h
index 3233d76..143ccc1 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -177,9 +177,10 @@ struct lval_funcs
/* If non-NULL, this is used to implement pointer and/or reference
indirection for this value. This method may return NULL, in which case
- value_ind will fall back to ordinary indirection. The method should check
- VALUE's type is TYPE_CODE_PTR or TYPE_CODE_REF depending on which types it
- supports. */
+ value_ind will fall back to ordinary indirection.
+
+ TYPE_CODE (check_typedef (value)) specifies which operation should be
+ done. It is always either TYPE_CODE_PTR or TYPE_CODE_REF. */
struct value *(*indirect) (struct value *value);
/* If non-NULL, this is used to determine whether the indicated bits
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-07-14 20:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-14 20:26 [SCM] archer-jankratochvil-entryval: Fix gdb.dwarf2/implptr.exp regression jkratoch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).