USI Home | Downloads | Config-Files | Reg Def Files | Tech-Support | ToolFinder | eStore
 
SPRT Home
FAQ
Submit a question
Favorites
Categories
BDI Commands (01-03) (3)
BDI Setup (02-10) (9)
BDM-JTAG Communication (01-02) (2)
Cables & AC Power Supply (4)
Config & Regdef Files (01-06) (6)
Connecting to Target (01-06) (6)
CPU Specific (28)
Flash Memory Programming (01-08) (8)
GCC-GDB (01-04) (4)
Host & Network Communication (01) (1)
Linux Kernel Debugging (01-04) (4)
Linux Module Debugging (01) (1)
LinuxScope (01-03) (3)
Miscellaneous (01-06) (6)
TFTP Server (01-02) (2)
U-Boot (0)
Search Articles
Advanced Search
Frequently Asked Questions
Search our FAQ to find resolutions to common issues.
Main Page
A304 - Why can't I hit breakpoints in my Kernel, Uboot or program?
Breakpoints are not immediately set when you put a "bi" command in the BDI or a "break" in GDB. They are set as soon as you hit "go" and are cleared as soon as you stop. This way they do not influence debugging. You will never see the breakpoints in the DBCR0 or DBCR1 registers. For debugging Linux kernels, set the initial breakpoint after Uboot has booted up and before the kernel is loaded. This way Uboot will not clear the kernel breakpoint during its startup.

As a basic test to see if breakpoints are working, you can single step from the bootvector by doing, "BDI> ti", "BDI> ti", "BDI> ti". Then do a "BDI> i" and note the current PC. Restart the processor, "BDI> res", and set a breakpoint at this PC location, "BDI> bi 0x00000105". You can now let the processor run until it hits the instruction, "BDI> go". The processor should execute until this breakpoint is hit. If this does not work then some setting on the target is not correct.

There are a few reasons you could be missing breakpoints:

1) If you are debugging a bootloader or program from flash you must use hardware breakpoints. Software breakpoints do not work in flash because of the way flash is accessed. In your config file add BREAKMODE HARD in the target section.

2) When using hardware breakpoints be aware of how many breakpoints are available to you on your processor, If you exceed the amount that are available you will start missing breakpoints. You can clear older break points by doing a "CI" from the BDI telnet prompt.

3) The Linux kernel could be modifying the debug registers and clearing the breakpoints you set. Use the CONFIG_BDI_SWITCH in the Linux configuration to disable writing to debug registers or set up the switch in your sources so that when it is set the debug registers are not written to by software. Use "make menuconfig" and under "kernel hacking" select the CONFIG_BDI_SWITCH.

4) Similarly Uboot is known to clear debug registers. If you can't hit breakpoints with Uboot or any boot loader, set a very early breakpoint about 1 or 2 instructions from the reset vector to test. Try the procedure described in paragraph 2 above. If it does hit this breakpoint then your task is to find where the debug registers are written to in the source and add a CONFIG_BDI_SWITCH to disable it.

5) If register initializations in your config file conflict with your bootloader then your will end up with problems that may rear themselves when you are debugging. Trying to connect with GDB and set breakpoints results in unexpected behavior. For debugging your bootloader the config file should be as small as possible and should only bring up the board enough to where it can stop successfully at the bootvector.

6) Also as a test you can create a loop at the first line of "main" and set a break point inside the loop. That way the processor will be stuck looping and will not execute any other code before it hits the breakpoint. This is a good way of checking if you can hit breakpoints at all and if the debug registers get cleared later on.

7) If you keep breaking on unhandled exceptions or interrupts you probably need to enable VECTOR CATCH in your BDI2000 config file. Use STARTUP RESET to let the BDI setup vector catching on startup.

8) For software breakpoints to work, the kernel code pages need to be writeable. If the MMU is setup for read only on kernel page tables, then the BDI will not be able to modify the memory here to put in the TRAP instruction. Modify pgtable.c to enable writing to the kernel code pages, "f l=_PAGE_WRENABLE".

9) Use objdump -x on the elf executable to see all the program symbols in the source and make sure that the address you are breaking at is correct.

Article ID: 10010 Article Created: 05-12-2008 15:16 PM

Print  Email  Save  Notify Me  Add to Favorites 

How well did this article answer your question? 100% 75% 50% 25% 0%

Most Recently Viewed Articles
P207 - JTAG Exits Check Failed, JTAG Bypass Check Failed
If you get a JTAG Exits check failed message after a JTAG Bypass check message then it means the JTAG Chain is disabled for some reason. The BDI tries to read the bypass register but can't. The message will appear in this sequence In the BDI Telnet prompt....
P310 - When I try and connect GDB to the BDI, I get the error message saying "remote packet too long"
If you try and use the default GDB on your host system to connect to the BDI you will get this error. This is because GDB on your Linux or Cygwin system is trying to read x86 registers from the target, your target is not X86....
03 - On the BDI startup, I keep getting the message "waiting for target stop failed" or “check stopped state failed” and "Break at Boot Vector Failed, Freeze Forced"
During startup the BDI sets a hardware breakpoint at the Boot Vector. If you have a boot monitor on your board try and use STARTUP RUN in your config file and the BDI will not try and set a breakpoint and will bring up your boot monitor. ...
C303 - GDB does not find the source files after I load the symbol file
There are several reasons you could be experiencing this behavior from GDB....
02 - Where can I get config files for the BDI Probe?
The BDI Probe gets shipped with a few config files that were used during the firmware development of the BDI and are located in the firmware directory. ...
01 - When I debug a Linux application should I turn off the MMU?
The BDI Probe cannot be used to debug Linux applications running in user-space....
X407 - Can I use your USB to RS232 cable assembly to access the BDI Telnet Interface?
With bdiGDB (and bdiWind) you can only use Ethernet to access the Telnet interface (command interface)....
P402 - Having problems bringing up my bootmonitor with the BDI2000 attached. Program counter is at an exception vector 0x00000800. TQM8260
Try and change STARTUP mode to RUN to try and bring up the boot monitor by default. An issue has been identified with certain TQM8260 boards (TQM8260-AG) where the HRCW is not set correctly, which causes the bootmonitor to hose while the BDI is connected....
P202 - Error: JTAG instruction stuff overrun
When in debug mode the PPC4xx fetches normal PPC instructions from the JTAG port. The error "# PPC: JTAG instruction stuff overrun" is raised when the processor stops fetching from the JTAG port, possibly because the processor hangs at an un-terminated memory transfer. ...
013 - PC Stepping Backwards
On our PowerPC processor the PC seems to start stepping backwards either during debugging or at system startup?...
Powered by Omnistar Kbase