Is to build a simulator that can run the firmware without any hacks. Rebuilding the firmware with (little-instruction + little-data) or (little-instruction + big-data) is not an option. Please feel free to ask if you need more information.įYI, the compiled code has already been tested to run on the actual hardware with JTAG debugger. I’ll really appreciate if someone can provide a clue about what is going on here or what am I doing wrong. qemu_gdb.png - Object file loaded in Qemu and connected to linaro-gdb. linaro_gdb.png - Object file directly opened in linaro-gdb and disassembled.ģ. GHS_toolchain.png - Object file opened in GHS toolchain.Ģ. I am attaching 3 screenshots to help understand the issue-ġ. So, my question is, if GDB inherently has the capability of understanding big-endian instructions and Qemu has been modified to understand them as well, why is debugging in Qemu is still having the same problem. Without requiring any change/settings/options. If you use gcc to build your guest binary, make sure you build using the old debug symbols. On top of that, if I open the same object file in Linaro-gdb, it actually reads the instructions(big-endian) properly, It is probably due to MPU config in the startup code or in the memory layout of the board and this is where I needĮven though Qemu now executes the instruction properly, GDB still shows wrong information. However, it fails after executing a few instructions. Unsigned int insn = arm_ldl_code(env, dc->pc, 1)Īfter this change, Qemu started reading the instructions properly. Unsigned int insn = arm_ldl_code(env, dc->pc, dc->bswap_code) As a temporary work-around, inside the function gen_intermediate_code_internal() in translate.c, I changed the line. However, when I load the R4 code, it decodes the instructions all wrong due to big-endian insn config. We have another ASIC with Cortex-A9 configured for BE8, also running ThreadX. However, I expected that it’ll at least be able to do assembly level debugging. I understand that out of the box, GDB will not be able toĭo source code debugging. To un-pause emulation, connect to QEMU using GDB and use the continue command. This can allow you to debug the boot sequence of your virtual machine. The firmware is compiled for Cortex-R4, runs ThreadX OS and is configured to use both instructions and data in big-endian (BE32 ?) format. Makes QEMUs GDB server listen on host hostname on port port and makes emulation start in a paused state. Here is an issue I am facing while trying to debug firmware (host) with GDB on Qemu (invoked with options -s -S).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |