]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/expprint.c
Treat OP_F77_UNDETERMINED_ARGLIST as OP_FUNCALL
authorYao Qi <yao.qi@linaro.org>
Tue, 6 Feb 2018 17:12:12 +0000 (17:12 +0000)
committerYao Qi <yao.qi@linaro.org>
Tue, 6 Feb 2018 17:12:12 +0000 (17:12 +0000)
commitbca65a2394ce11bb4a0b001b8a986961c2e84881
tree1b6bba16f4654112dcd43c6894f0df6679263b9d
parent583e3f90612f50fc9792a5a68fa16f7924ac94d9
Treat OP_F77_UNDETERMINED_ARGLIST as OP_FUNCALL

When I debug some fortran expression parsing, I got

(gdb) set debug expression 1
(gdb) p intvla(5,5,5)
Dump of expression @ 0x205fa80, before conversion to prefix form:
Language fortran, 19 elements, 16 bytes each.
Index                Opcode         Hex Value  String Value
    0          OP_VAR_VALUE  40  (...............
    1    <unknown 31863232>  31863232  .1..............
....
   14             BINOP_REM  5  ................
   15               OP_LONG  38  &...............
   16  OP_F77_UNDETERMINED_ARGLIST  48  0...............
   17             BINOP_MUL  3  ................
   18  OP_F77_UNDETERMINED_ARGLIST  48  0...............
Dump of expression @ 0x205fa80, after conversion to prefix form:
Expression: `Invalid expression
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This patch fixes this problem by handling OP_F77_UNDETERMINED_ARGLIST in
the same way as handling OP_FUNCALL.  With this patch applied, the output
looks better,

(gdb) p intvla (5,5,5)
Dump of expression @ 0x2d75590, before conversion to prefix form:
Language fortran, 19 elements, 16 bytes each.
Index                Opcode         Hex Value  String Value
    0          OP_VAR_VALUE  40  (...............
....
   16  OP_F77_UNDETERMINED_ARGLIST  48  0...............
   17             BINOP_MUL  3  ................
   18  OP_F77_UNDETERMINED_ARGLIST  48  0...............
Dump of expression @ 0x2d75590, after conversion to prefix form:
Expression: `vla_primitives::intvla (5, 5, 5)'
Language fortran, 19 elements, 16 bytes each.

    0  OP_F77_UNDETERMINED_ARGLIST  Number of args: 3
    3    OP_VAR_VALUE          Block @0x297e1c0, symbol @0x297cd50 (intvla)
    7    OP_LONG               Type @0x2976900 (int), value 5 (0x5)
   11    OP_LONG               Type @0x2976900 (int), value 5 (0x5)
   15    OP_LONG               Type @0x2976900 (int), value 5 (0x5)

gdb:

2018-02-06  Yao Qi  <yao.qi@linaro.org>

* expprint.c (print_subexp_standard): Handle
OP_F77_UNDETERMINED_ARGLIST.
(dump_subexp_body_standard): Likewise.
gdb/ChangeLog
gdb/expprint.c