How does H/W and S/W Breakpoints work?
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
How does H/W and S/W Breakpoints work?

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System
Author Message
#define
Guest





Posted: Wed Dec 14, 2005 5:15 pm    Post subject: How does H/W and S/W Breakpoints work? Reply with quote

Hello,

Please help me to understand how does debuggers work in embedded
scenarios? Especially software and hardware breakpoints?

Also, the differences in compiler outputs DEBUG and RELEASE modes?

If u can suggest any books or websites, it'll be great!!!

Thanks in advance,

Best Regards,

#define.
Back to top
Paul Burke
Guest





Posted: Wed Dec 14, 2005 11:16 pm    Post subject: Re: How does H/W and S/W Breakpoints work? Reply with quote

#define wrote:

Quote:
Please help me to understand how does debuggers work in embedded
scenarios? Especially software and hardware breakpoints?


If you're debugging in RAM, the old fashioned method was to replace the
breakpoint address code with a software interrupt. The breakpoint
restored the opcode before continuing.

There also used to be a sort of halfway- house available using EPROM
emulators, which could often add breakpoints etc. in the RAM which
replaced the EPROM memory, but these have rather dropped out since most
embedded systems started to use on-chip flash.

These days, it's common to use an on-chip hardware comparator to
activate the breakpoint, which has the advantage that you can work
directly on the program memory, but often has the downside that the
number of breakpoints available is limited.

If the IC hasn't got this built-in, you have to either use an in-
circuit emulator (usually $$$) or flash an LED, output strings etc. to
find out what's gone awry.

Quote:
Also, the differences in compiler outputs DEBUG and RELEASE modes?


DEBUG mode includes information to allow the debugger to display the C
(etc.) code for the instruction being executed. In the old days, we
generally had to output an assembler listing from the high level code,
and bash through that to see where things had gone wrong. The worst sort
listed the C and assembler separately, and it was a devil to see where
you were up to.

Paul Burke
#undefine
Back to top
Scott Moore
Guest





Posted: Thu Dec 15, 2005 1:15 am    Post subject: Re: How does H/W and S/W Breakpoints work? Reply with quote

#define wrote On 12/14/05 08:55,:
Quote:
Hello,

Please help me to understand how does debuggers work in embedded
scenarios? Especially software and hardware breakpoints?


A breakpoint is an interrupt that goes to a debugger, which then
does whatever it needs to do to compensate the program counter or
other registers to make it appear as if the software magically halted
at the breakpoint. It does not matter whether software or hardware
caused the interrupt, although typically with software interrupts,
the debugger must place, then remove, a interrupt causing instruction.

Quote:
Also, the differences in compiler outputs DEBUG and RELEASE modes?


Usually, just the number of symbols included with the program. Hard
to answer unless you give a specific system.

Quote:
If u can suggest any books or websites, it'll be great!!!

Thanks in advance,

Best Regards,

#define.
Back to top
pats@etoolsmiths.com
Guest





Posted: Thu Dec 15, 2005 5:15 pm    Post subject: Re: How does H/W and S/W Breakpoints work? Reply with quote

Debug mode, turns on the debug switch in the compiler: for example in
GCC (the free GNU compiler) the switch is "-g" Turning this switch on
causes the compiler to include:
line number information
variable adress and type information
module/local scope information (when locals are "alive")

This lets a source level debugger show your source by referencing this
debug file.

Hardware break points are typically on-chip these days and can be code
execution type (stop when an address is executed) and data type (stop
when data location is accessed)
So chips even have options for stop on a data value. Hardware breaks
are good for debugging code in FLASH, or in cases where the place in
memory that contains the inserted instruction for a software break
could be overwritten. Two examples would be a boot loader that copies
itself from FLASH to RAM, or a LINUX loadable module, that must be
loaded by linux, then run
hope this helps

Pat
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB