eval.c: reverse minsym and sym
authorPedro Alves <palves@redhat.com>
Sun, 25 Mar 2018 17:02:43 +0000 (18:02 +0100)
committerPedro Alves <palves@redhat.com>
Sun, 25 Mar 2018 17:56:58 +0000 (18:56 +0100)
I noticed that in evaluate_funcall, where we handle
OP_VAR_MSYM_VALUE/OP_VAR_VALUE to figure out the symbol's name gets
the minimal_symbol/symbol backwards.  Happens to be harmless in
practice because the symbol name is recorded in the common initial
sequence (in the general_symbol_info field).

gdb/ChangeLog:
2018-03-25  Pedro Alves  <palves@redhat.com>

* eval.c (evaluate_funcall): Swap OP_VAR_MSYM_VALUE/OP_VAR_VALUE
if then/else bodies in var_func_name extraction.

gdb/ChangeLog
gdb/eval.c

index d9d408edef81108049d286205353a3fab5a52f4f..57f4f77c8fcba53ab1e7c80a0ae71e3c4588a608 100644 (file)
@@ -1,3 +1,8 @@
+2018-03-25  Pedro Alves  <palves@redhat.com>
+
+       * eval.c (evaluate_funcall): Swap OP_VAR_MSYM_VALUE/OP_VAR_VALUE
+       if then/else bodies in var_func_name extraction.
+
 2018-03-23  Weimin Pan  <weimin.pan@oracle.com>
 
        * minsyms.c (lookup_minimal_symbol_and_objfile): Use
index b2032c35f1d818a7f0105f1306802cc8b1c99e24..021503e9dd94f7b481e3e96952a5699a0efa961b 100644 (file)
@@ -1039,13 +1039,13 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
        {
          if (op == OP_VAR_MSYM_VALUE)
            {
-             symbol *sym = exp->elts[*pos + 2].symbol;
-             var_func_name = SYMBOL_PRINT_NAME (sym);
+             minimal_symbol *msym = exp->elts[*pos + 2].msymbol;
+             var_func_name = MSYMBOL_PRINT_NAME (msym);
            }
          else if (op == OP_VAR_VALUE)
            {
-             minimal_symbol *msym = exp->elts[*pos + 2].msymbol;
-             var_func_name = MSYMBOL_PRINT_NAME (msym);
+             symbol *sym = exp->elts[*pos + 2].symbol;
+             var_func_name = SYMBOL_PRINT_NAME (sym);
            }
 
          argvec[0] = evaluate_subexp_with_coercion (exp, pos, noside);