This is the mail archive of the gdb-patches@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]

[PATCH] gdb/fortran Fixed printing of logical true values for Flang


Hi all,

I request you all to please review the patch. Below are the details.

Problem Description:

gdb is not able to print logical true values for Flang compiler.
    actual result
    --------------
    (gdb) p l
    $1 = 4294967295
    --------------
    expected result
    --------------
    (gdb) p l
    $1 = .TRUE.
    --------------

Root cause:

    This is due to GDB expecting representation of true value being 1.
    The fortran standard doesnt specify how LOGICAL types are represented.
    Different compilers use different non zero values to represent LOGICAL
    TRUE. The gfortran compiler uses 1 to represent LOGICAL TRUE and flang
    compiler uses -1. GDB should accept all the non zero values as TRUE.

Resolution:

    Now function 'generic_val_print_bool' is modified to be able to print
    true logical value for the Flang compiler.

Testing:

- No regression seen

Please let me know your comments.

Regards,
Alok

Attachment: 0001-gdb-fortran-Fixed-printing-of-logical-true-values-fo.patch
Description: 0001-gdb-fortran-Fixed-printing-of-logical-true-values-fo.patch


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