cprint with pointer-variable with resolving address
When doing a cprint
to a pointer variable there is currently no hint where it may point to, even not with cprint /d
.
Compare:
(gdb) cp /d PT02-PRGM-PTR-H (PRGM-IDX)
Name: 05 PT02-PRGM-PTR-H/PT02-PRGM-PTR-TAB/PROG(283) [W-S]
OCCURS: min: 1 max: 580
Subscripts: (PRGM-IDX); resolves to (283)
Display: 0x00007fc1651c19a3
Hex: 0x00 0x00 0x7f 0xc1 0x65 0x1c 0x19 0xa3
Field: f_1523
Base: b_1522 ( 0x7fc165a2f320 )
RefOffset: 0
data_offset: 0
TableOffset: 2256
Length: 8
DataLoc: 0x7fc165a2fbf0
Attr: a_70
AttrType: 17 (0x11) NUMERIC_BINARY
AttrDigits: 17
AttrScale: 0
AttrFlags: 0x80 IS_POINTER
Data: (HEX) [ a3 19 1c 65 c1 7f 00 00 ]
Data: (ASCII) "\243\031\034e\301\177\000\000"
With how this would look like with gdb:
(gdb) p (char[]*)0x7fc1651c19a3
$11 = (char (*)[]) 0x7fc1651c19a3 <PROG500>
and
(gdb) cp /d address of MY-VAR
0x7fc165a30541
(gdb) p (char[]*)0x7fc165a30541
$10 = (char (*)[]) 0x7fc165a30541 <b_1517+1>
Could we get that info "where does the pointer point to" from GDB and present it to the user?
Really cool would be of course to even resolve the data items, like:
(gdb) cp MY-POINTER
0x7fc165a30541 <MY-RECORD+1>
But showing what GDB commonly does would be a worthy update in any case, and help a lot - especially with PROCEDURE-POINTER
s.