|
From: Philipp K. K. <pk...@sp...> - 2017-05-10 21:03:10
|
Am 10.05.2017 um 22:59 schrieb Philipp Klaus Krause: > Am 10.05.2017 um 22:56 schrieb Åke Rehnman: >> On 2017-05-10 22:49, Philipp Klaus Krause wrote: >>> Am 10.05.2017 um 22:16 schrieb Åke Rehnman: >>>> >>>> So to make debugging work with CFA the first job would be to clean up >>>> the code and move the stack operations into a few well defined places >>>> similar to hc08. Since that work involves a lot of changes I was a bit >>>> hesitant to make those changes since that would result in quite >>>> difficult merges whenever the stm8 gen code change. >>>> >>>> /Ake >>> I assume that changing the push / pop behaviour in stm8 codegen would >>> come at a price in code size, speed and memory usage. I don't think that >>> is acceptable for SDCC users. >>> >>> Any alternatives? >>> >>> Philipp >>> >> No what I mean is those places in gen.c where registers are pushed and >> popped should use a function call to pushReg() and popReg() in the same >> way hc08 gen does. That way we don't have to litter the code with >> updateCFA() calls.... >> > > Sound like push() at line 1023 of src/stm8/gen.c, pop () at line 1051 > and adjustStack() at line 1176. > Actually, codegen also needs to keep track of the offsets of variables from the stack pointer. It does so in G.stack.pushed. Besides the three functions listed above, the only places in stm8 codegen where G.stack.pushed is written is in genFunction() and genCmpEQorNE(). So we just place calls to updateCFA() wherever we update G.stack.pushed? Philipp |