gnupic: gplink and gpsim
Subject:
gplink and gpsim
From:
juan ####@####.####
Date:
1 Feb 2016 02:01:03 -0000
Message-Id: <56aebc5d.87f08c0a.fd49b.1691@mx.google.com>
One of the basic functions of a tool like gpsim is to allow
users to look at program variables, that is, memory locations
associated with names.
As far as I can tell, there's no easy way to do that if you are
linking with gplink and want to watch local registers/variables
using gpsim.
The problem arises because the .cod file that gplink generates
only contains references to global symbols. Since the
names of the local registers are not written to the .cod file,
they don't show up in gpsim's global symbol table. And so they
can't be added by name to the watch window.
It is still possible to add any register by address through the
"register view(RAM)" window, but the user has to look up the
names/addresses himself and when added the registers appear as
REGxxx in the watch window - the original names are lost.
Which isn't exactly helpful.
So...after trying to find a workaround in gpsim, I found that
the simplest solution is to modify gplink so that it writes
local registers to the .cod file. The gplink 'patch' is 10 lines
long if anybody is interested.
J.