![]() You must use a 'static base' register (for example, r9 as u-boot does). However, gcc does not support this code generation option (at least on ARM). Ie, many lower-to-middle scale embedded devices. This is desirable with NOR flash that is XIP (execute-in-place) as the memory devices for. If you have a case where the code is relocated, but data is absolute, you need to link twice and choose the relocated elf files (symbols only are relocated and code is the same). You can then switch symbol files to a relocated run address to use the first answer. OFF is an optional offset which is added to each section address. Load symbol table from executable file FILE. ![]() Use symbol-file with an offset for the runtime address.You can use generating gcc debug symbols. Use the GDB's file command to select the one with proper symbol locations. You need to create multiple elf files, one for each possible target location. To combine the answers above for PIC code on an embedded cross system, When run under GNU Emacs mode, the info line command causes the arrow to point to the line specified. The debug information that gdb depends on (where routines start/end) is not present in a random binary chunk. You can use the command info line to map source lines to program addresses (and vice versa), and the command disassemble to display a range of addresses as machine instructions. So, it appears that the 'x /i' (examine as code) is the best option. For the cross debug case, gdb would have to look at memory on the remote which could be expensive. Alternatively you can use apktool to extract and disassemble resources. Special command like 'disassemble' will actually look at the binary on the host. From the powerful tools shipping with the SDK to the wide range of available. ![]() The issue gdb has with this is 'file foo.elf' is showing that code is in the first range. However, I have programmed the binary to 0x80040200 (two NOR flash sectors away) and wish to debug there. The normal boot address is 0x8000000, with a 0x200 vector table. ![]() I have an STM32 and I have relocated the code with PIC. With an appropriately meaningless hex address. Read no further is you don't wish to understand why it is correct. (its been a while since I last tried to make a system call in assembly. I don't see your system interrupt call however. Line 3 of "main.c" starts at address 0x401050 and ends at 0x401075 : push %ebp Do you only want to disassemble your actual main? If so try this: (gdb) info line main ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |