[binutils-gdb] gas: have print_expr() recognize O_index

Jan Beulich via Binutils-cvs <[email protected]>
Newsgroups gmane.comp.gnu.binutils.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ae8e32dbc67455677437b313e8dc3bbf18bdc7b5

commit ae8e32dbc67455677437b313e8dc3bbf18bdc7b5
Author: Jan Beulich <[email protected]>
Date:   Fri Apr 10 08:41:47 2026 +0200

    gas: have print_expr() recognize O_index
    
    If expr.h is to be trusted, ->X_add_number shouldn't be taken into
    consideration here.

Diff:
---
 gas/symbols.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gas/symbols.c b/gas/symbols.c
index a0f8fcebeb8..42a0779e321 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -3399,6 +3399,16 @@ print_expr_1 (FILE *file, expressionS *exp)
       print_symbol_value_1 (file, exp->X_op_symbol);
       fprintf (file, ">");
       goto maybe_print_addnum;
+    case O_index:
+      indent_level++;
+      fprintf (file, "index\n%*s<", indent_level * 4, "");
+      if (exp->X_add_symbol != NULL)
+	print_symbol_value_1 (file, exp->X_add_symbol);
+      fprintf (file, ">\n%*s<", indent_level * 4, "");
+      print_symbol_value_1 (file, exp->X_op_symbol);
+      fprintf (file, ">");
+      indent_level--;
+      break;
     default:
       fprintf (file, "{unknown opcode %d}", (int) exp->X_op);
       break;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.