[coldfire-gnu-discuss] Debugging with cache enabled

Seymour David David.Seymour at freescale.com
Wed Apr 2 15:03:54 UTC 2008


Hi Tom,

First I haven't tried this so I am going by gut knowledge.

I suspect that when you set the soft breakpoints that the instruction
opcode (or just the 16-bits of the opcode) is being replaced with the
HALT (0x4ac8) instruction.  Since it is actually in the code space, it
probably is getting cached.  When the debugger HALTs, it probably
replaces the HALT with the real opcode BUT the cache is not updated
(i.e. self modifying code is bad for cache).  If the cache is flushed
(if in copy-back mode) or invalidated (for write thru mode) then when
you re-start code execution the cache will be updated properly.

I may have some of the details incorrect but think the general
description is correct.

I typically do not enable cache when debugging as a rule of thumb.  Some
dev tools are better than others at supporting debugging while cache
enabled.  I just don't know the exact state of GDB for this.

Regards, 

David 

 

David E Seymour

Come to FTF 2008 June 16th through the 19th in Orlando

http://www.freescale.com/ftf 

________________________________

From: TDannemiller at peco2.com [mailto:TDannemiller at peco2.com] 
Sent: Wednesday, April 02, 2008 8:23 AM
To: coldfire-gnu-discuss at codesourcery.com
Subject: [coldfire-gnu-discuss] Debugging with cache enabled

 


I'm trying G++ Lite with a Coldfire MC5485 target. When using a gdb soft
breakpoint (break, tbreak) while processor cache is enabled, I always
get an exception when trying to continue (or advance) after the
breakpoint. The exception is vector 11, "Unimplemented line-f opcode".
The single step (source line "step") also does not work when cache is
enabled. 

Is this normal? I haven't seen any comments about this on this or the
Freescale forums. 

The breakpoints (and step) work fine if processor cache is disabled, but
my program doesn't run fast enough unless cache is enabled, and so I
can't debug this way. 

Any suggestions? I'm aware of the hardware breakpoint, but it's not as
versatile as the soft breaks (advance, until, step, etc). 

Thanks, 
Tom 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/coldfire-gnu-discuss/attachments/20080402/4b350621/attachment.html>


More information about the coldfire-gnu-discuss mailing list