Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
23 Views

debugging literals

Is it possible to observe the memory locations of 'literals'(e.g. Fortran PARAMETERs, etc.) in debug? Specifically, can the memory location of '(2(1PG11.4)' in

WRITE(string,'(2(1PG11.4)) x, y

be found (e.g. in an assembly listing and map) and observed using the Memory tool in Visual Studio in debug?

This possibility (among others) was raised in response to CVF17831.
0 Kudos
1 Reply
Highlighted
23 Views

It depends. In the particular case you describe, the FORMAT is "compiled" and passed to the run-time library in compiled form, so you can't see it in anything that is recognizeable. In other cases, the compiler never "materializes" constants into memory. But if it does, you should be able to find them in a machine code list and then look at a link map for the base address of the image section they're in. This is a lot of work, though.

As for your original problem report, I don't think your format string is being overwritten because constants are allocated in read-only image sections (and since you're using Windows 2000, they are indeed read-only.) My guess is that your program is corrupting data elsewhere.

Steve
Retired 12/31/2016
0 Kudos