summaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.h
diff options
context:
space:
mode:
authorBhuvanendra Kumar N <Bhuvanendra.KumarN@amd.com>2022-02-02 17:52:27 +0000
committerAndrew Burgess <aburgess@redhat.com>2022-02-11 15:26:25 +0000
commite951225303b7d0565c985e2d562d3787983ff06f (patch)
treebb924f8f2e8cccb6afb95c0446ff42aa91a2f3e1 /gdb/gdbtypes.h
parent9ab50efc463ff723b8e9102f1f68a6983d320517 (diff)
downloadbinutils-gdb-e951225303b7d0565c985e2d562d3787983ff06f.tar.gz
gdb/fortran: support ptype and print commands for namelist variables
Gfortran supports namelists (a Fortran feature); it emits DW_TAG_namelist and DW_TAG_namelist_item dies. But gdb does not process these dies and does not support 'print' or 'ptype' commands on namelist variables. An attempt to print namelist variables results in gdb bailing out with the error message as shown below. (gdb) print nml No symbol "nml" in current context. This commit is to make the print and ptype commands work for namelist variables and its items. Sample output of these commands is shared below, with fixed gdb. (gdb) ptype nml type = Type nml integer(kind=4) :: a integer(kind=4) :: b End Type nml (gdb) print nml $1 = ( a = 10, b = 20 )
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r--gdb/gdbtypes.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 7238873e4db..5072dc24bfa 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -196,6 +196,19 @@ enum type_code
/* * Fixed Point type. */
TYPE_CODE_FIXED_POINT,
+
+ /* * Fortran namelist is a group of variables or arrays that can be
+ read or written.
+
+ Namelist syntax: NAMELIST / groupname / namelist_items ...
+ NAMELIST statement assign a group name to a collection of variables
+ called as namelist items. The namelist items can be of any data type
+ and can be variables or arrays.
+
+ Compiler emit DW_TAG_namelist for group name and DW_TAG_namelist_item
+ for each of the namelist items. GDB process these namelist dies
+ and print namelist variables during print and ptype commands. */
+ TYPE_CODE_NAMELIST,
};
/* * Some bits for the type's instance_flags word. See the macros