- It is possible to debug the same * .out (created by iar 7.10) with the ozone project created by v2.70, but the ozone project created by v3.10 is wrong.
- The screenshot below shows that they got a different PC and v2.70 got the right PC.
- The source code shows different content inside the two projects.
- Elf.GetEntryPointPC (), this api cannot get the correct initial pc, at least * .out created by iar 7.10.
C Source Code
- void AfterTargetDownload (void) {
- unsigned int SP;
- unsigned int PC;
- unsigned int VectorTableAddr;
- VectorTableAddr = Elf.GetBaseAddr();
- if (VectorTableAddr == 0xFFFFFFFF) {
- Util.Log("Project file error: failed to get program base");
- } else {
- SP = Target.ReadU32(VectorTableAddr);
- Target.SetReg("SP", SP);
- PC = Target.ReadU32(VectorTableAddr + 4);
- Target.SetReg("PC", PC);
- }
- }
C Source Code
- void AfterTargetDownload (void) {
- unsigned int SP;
- unsigned int PC;
- unsigned int VectorTableAddr;
- VectorTableAddr = Elf.GetBaseAddr();
- if (VectorTableAddr != 0xFFFFFFFF) {
- SP = Target.ReadU32(VectorTableAddr);
- Target.SetReg("SP", SP);
- } else {
- Util.Log("Project file error: failed to get program base");
- }
- PC = Elf.GetEntryPointPC();
- if (PC != 0xFFFFFFFF) {
- Target.SetReg("PC", PC);
- } else if (VectorTableAddr != 0xFFFFFFFF) {
- PC = Target.ReadU32(VectorTableAddr + 4);
- Target.SetReg("PC", PC);
- }
- }