Axd debugging experience in arm ads

Source: Internet
Author: User
1. Set the target of the axd connection.

In the configure target... Option. Select mutiice or armul.

Armul is an ARM Simulator. You can debug general algorithms or programs that do not need to deal with devices such as hardware interruptions. It is easy to use.

Generally, we use mutiice to debug the board. When you have just installed the system, there is no mutiice in the menu. You need to manually add:

Click the Add button and select "C:/program files/ARM/Multi-ice/Muti-ICE.dll" in the pop-up file browser (if installed by default ). Click "OK ". In this way, the mutiice debugging interface is installed.

2. How to save the current debugging site.

During debugging, we often need to set breakpoints, set watchpoint, or open many source files in different places. However, once we close axd, all the work will be wasted. After we open the axd again, we still get the debugging environment that only opens one entry file without any breakpoints. Here we will introduce a method to automatically save the last debugging scene (the register data is saved ).

Options-> General tab. Check that the SAVE and load default sessions options are selected. Open the session file and make sure that the rselect target and reload images options are selected.

After saving the settings, after the axd is disabled and restarted, the last image is automatically loaded and the register is restored.

 

If you need to save multiple scenes, select Save session in the File menu after saving settings. However, note that the saved path cannot contain spaces or special characters. It is best to save it on clearcase. When you need to restore the site, you only need to load the session and everything is OK. All the breakpoints and watchpoints you have worked hard to set have been returned.

 

3. What should I do if I cannot set a breakpoint?

When a breakpoint cannot be set, I only know several solutions. Here is an example:

A: Clear the vector catch of the CPU.

Clear in options-> Configure process.

B: run it and pause immediately.

This method is suitable for low-requirement breakpoints (such as setting breakpoints on the app Layer. Convenience.

C: Clear the previous breakpoint.

Generally, flash debugging occurs. First, clear the previous breakpoint before you can set a new breakpoint.

D: Command Line spp vector_catch 0

In fact, it is the same as. If it is written in the boot script, you can automatically eliminate the possibility of resumable startup.

E: Use the-Debug parameter when starting the axd, so that you can add an automatic breakpoint on main.

4. How can I re-start debugging without reload the image.

In many cases, we need to re-run the code to reproduce a bug. However, in general, it is a reload. If the image is small, it can be tolerated, but if you want a giant image of around 660 MB, this price is not too big. Here we will introduce several methods I know. You can start debugging from scratch:

A: set the current Register.

Click process register-> current. Set PC to 0 and CPSR to SVC. Disable thumb mode. Then F5 can be run.

B: run the script.

This method is faster and more convenient. .

Setpc 0

Sreg CPSR 0xd3

 
5. How to jump unconditionally?

In general, it is best to use this function when a certain statement jumps to another statement unconditionally. It is best not to use cross-function (otherwise there is a stack error and it is difficult to query)

 

Right-click the code to jump to and select execute-> set next statement.

6. Does axd have any auxiliary tools?

Yes.

 

Ida pro, a very good axf parsing tool. You can count functions, global variables, and call relationships in the axf file. The interface is very friendly. The Code interface clearly shows the function reference relationship, initial variable statements, variable reference, and modification statistics.

Ida pro is an assembly-level Source insight. You can download and use the latest version on the Internet.

7. How to debug the code to be loaded to flash

My experience is as follows:

1. Download a version on the board with a JTAG debug port.

2. Select File-> load debug symbols. Select the axf generated by release on codewarrior.

3,Now you can debug the Flash program. It is exactly the same as debug. However, in this case, you can set only two breakpoints.

8. Use the fromelf command

The fromelf command can be used to perform further operations on the axf file we generated.

 

For example:

Extract the binary code from the axf file: fromelf-bin-Output A. Bin A. axf

Extract the binary code from the axf file: fromelf-M32-Output A. s32 A. axf

9. FAQs

Q: What tools should I use to debug the Redboot compiled Ram-based Redboot image file generated in Ram mode.

The ADS debugging tool can only load files in. axf format.

A: using ads, you can also load binfiles (file-> load memory from memory...). You can use the ads command line or script to initialize SDRAM.

The load address must be specified when loading the binfile. For the value of b0x, it is usually 0x0c040000, that is, the address specified in the corresponding LDI File
Section_rom_vectors (RAM, 0x0c040000, lma_eq_vma)

After load the bin program, change the PC pointer to 0x0c040000.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.