aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKung Hsu <kung@cygnus>1993-10-19 21:20:37 +0000
committerKung Hsu <kung@cygnus>1993-10-19 21:20:37 +0000
commitdcd8fd8c17c0e3b6d178a5254c7b71db380bcc8c (patch)
tree246ae2c94246b0d37c561ffde8df2b81f7086e52 /gdb
parentfd1aec331c5d3e3540c92039b04f4a26f0fc1842 (diff)
downloadgdb-dcd8fd8c17c0e3b6d178a5254c7b71db380bcc8c.zip
gdb-dcd8fd8c17c0e3b6d178a5254c7b71db380bcc8c.tar.gz
gdb-dcd8fd8c17c0e3b6d178a5254c7b71db380bcc8c.tar.bz2
Modified Files:
values.c eval.c * values.c (value_virtual_fn_field): Fix the offset calculation when calling virtual functions. (gdb.t22/virtfunc.exp). * eval.c (evaluate_subexp): same as above.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/values.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gdb/values.c b/gdb/values.c
index f8a059e..d36bfcd 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -811,8 +811,9 @@ value_fn_field (arg1p, f, j, type, offset)
*arg1p = value_ind (value_cast (lookup_pointer_type (type),
value_addr (*arg1p)));
- /* Move the `this' pointer according to the offset. */
+ /* Move the `this' pointer according to the offset.
VALUE_OFFSET (*arg1p) += offset;
+ */
}
return v;
@@ -876,8 +877,9 @@ value_virtual_fn_field (arg1p, f, j, type, offset)
a virtual function. */
entry = value_subscript (vtbl, vi);
- /* Move the `this' pointer according to the virtual function table. */
- VALUE_OFFSET (arg1) += value_as_long (value_field (entry, 0)) + offset;
+ /* Move the `this' pointer according to the virtual function table. */
+ VALUE_OFFSET (arg1) += value_as_long (value_field (entry, 0))/* + offset*/;
+
if (! VALUE_LAZY (arg1))
{
VALUE_LAZY (arg1) = 1;
@@ -962,7 +964,7 @@ value_headof (in_arg, btype, dtype)
* But we leave it in for future use, when we will hopefully
* have optimizes the vtable to use thunks instead of offsets. */
/* Use the name of vtable itself to extract a base type. */
- demangled_name += 4; /* Skip _vt$ prefix. */
+ demangled_name += 4; /* Skip vt$ prefix. */
}
else
{
@@ -1019,10 +1021,10 @@ vb_match (type, index, basetype)
if (*name != '_')
return 0;
- /* gcc 2.4 uses _vb$. */
+ /* gcc 2.4 uses vb$. */
if (name[1] == 'v' && name[2] == 'b' && name[3] == CPLUS_MARKER)
field_class_name = name + 4;
- /* gcc 2.5 will use __vb_. */
+ /* gcc 2.5 will use _vb_. */
if (name[1] == '_' && name[2] == 'v' && name[3] == 'b' && name[4] == '_')
field_class_name = name + 5;