Patent ID: 9086899
Filing Date: 2015-07-21
Classification: G06F

Abstract:
1. A debugging method, wherein, the method is applied to an Advanced RISC Machine (ARM) compiler system, the method comprises: comparing a sequence of input segments during a process of loading a relocatable program into a memory with a sequence of input segments in an ARM image file; when the sequence of the input segments during a process of loading the relocatable program into a memory and the sequence of the input segments in the ARM image file are the same, directly loading the loadable sections in the relocatable program into the memory; when the sequence of the input segments during a process of loading the relocatable program into a memory and the sequence of the input segments in the ARM image file are different, modifying the sequence of the input segments during the process of loading the relocatable program into the memory according to the sequence of the input segments of the ARM image file; modifying a linking process parameters setting of an ARM compiler and linker and then compiling and linking the loaded relocatable program by using the ARM compiler and linker to generate an executable file, wherein modifying the linking process parameters setting of the ARM compiler and linker comprises: setting a not scanning option in the ARM compiler and linker, for not scanning C/C++ runtime libraries during a linking; setting an undefined symbol option, for directing all undefined symbols to a same existing symbol; setting a no removing option, for reserving all segments during the linking; and setting an entry of a generated image file, setting an address value ro_base as a loaded address of an output segment that has a read-only attribute, and setting an address value rw_base as a loaded address of an output segment that has a read-write attribute; wherein, the value of ro_base is set either as an actual loaded address of a text segment of the relocatable program loaded into the memory or as a default value; when an actual loaded address of a data segment is different from an address of an executable data segment of the executable file, the value of rw_base is set as the actual loaded address of the data segment of the relocatable program loaded into the memory; loading the executable file into a debugging tool, to realize debugging of the relocatable program, wherein loading the executable file into the debugging tool comprises: loading the relocatable program into the memory, and determining actual loaded addresses of the relocatable program, including an actual loaded address of a text segment and the actual loaded address of the data segment; loading the executable file into the debugging tool after a loading address for the executable file to be loaded into the debugging tool is determined according to the following mode: the loading address of a data segment of the executable file being the value of rw_base, when the value of ro_base was set as default value, or as the actual loaded address of the text segment, the value of a loaded offset address of the text segment of the executable file is the actual loaded address of the text segment minus the value of ro_base.