This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] eval.c: reverse minsym and sym


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3e5ef9a4de7919971130f7f2ca3052898a069e76

commit 3e5ef9a4de7919971130f7f2ca3052898a069e76
Author: Pedro Alves <palves@redhat.com>
Date:   Sun Mar 25 18:02:43 2018 +0100

    eval.c: reverse minsym and sym
    
    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.

Diff:
---
 gdb/ChangeLog | 5 +++++
 gdb/eval.c    | 8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d9d408e..57f4f77 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/eval.c b/gdb/eval.c
index b2032c3..021503e 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]