From a95098580b445c560a03f6c2f39648a6c3db7d3e Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Sun, 17 May 2020 10:50:10 +0200 Subject: [PATCH] Use STRUCTOP_PTR instead of STRUCTOP_STRUCT for dot exps. With the later, you must do (*exp).foo() in order to call member functions of an object located in memory. --- gdb/d-exp.y | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb/d-exp.y b/gdb/d-exp.y index ddd98c5306..db72645b06 100644 --- a/gdb/d-exp.y +++ b/gdb/d-exp.y @@ -346,20 +346,20 @@ PostfixExpression: | PostfixExpression '.' COMPLETE { struct stoken s; pstate->mark_struct_expression (); - write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); + write_exp_elt_opcode (pstate, STRUCTOP_PTR); s.ptr = ""; s.length = 0; write_exp_string (pstate, s); - write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); } + write_exp_elt_opcode (pstate, STRUCTOP_PTR); } | PostfixExpression '.' IDENTIFIER - { write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); + { write_exp_elt_opcode (pstate, STRUCTOP_PTR); write_exp_string (pstate, $3); - write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); } + write_exp_elt_opcode (pstate, STRUCTOP_PTR); } | PostfixExpression '.' IDENTIFIER COMPLETE { pstate->mark_struct_expression (); - write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); + write_exp_elt_opcode (pstate, STRUCTOP_PTR); write_exp_string (pstate, $3); - write_exp_elt_opcode (pstate, STRUCTOP_STRUCT); } + write_exp_elt_opcode (pstate, STRUCTOP_PTR); } | PostfixExpression '.' SIZEOF_KEYWORD { write_exp_elt_opcode (pstate, UNOP_SIZEOF); } | PostfixExpression INCREMENT