1 Gdb/Armulator 源代码分析作者 Email: Anti_******@to malloc a ARMul_state stuct which saves the armulator ’s states and initialize it .And the ARMul_MemoryInit() will malloc 4m ram for you. #1 static void #2 init () #3 2 #4 static int done; #5 if (!done) #6{ #7 ARMul_EmulatEinit (); file://Call this routine once to set up the emulator ’s tables. #8 state = ARMul_NewState (); #9 state-bigendSig = (big_endian ? HIGH : LOW); #10 RMul_MemoryInit (state, mem_size); file:// 原始代码中的内存初始, 但现在无用#11 ARMul_OSInit (state); file:// 预装系统初始化#12 ARMul_CoProInit (state); file:// 协处理器初始#13 state-verbose = verbosity; #14 done = 1; #15 file://the below is added for AT91 #16 ARMul_SelectProcessor(state, ARM600); #17 ARMul_SetCPSR(state, USER32MODE); #18 ARMul_Reset(state); #19 } #20 }DoProg() 的区别就是一个单步执行, 一个连续执行指令. ARMul_DoProg() 又不停的判断 state-Emulate 是否为 3 STOP, 如果是, 模拟器又将停下等待 Gdb 的调试. 4
Gdb-Armulator 源代码分析 来自淘豆网www.taodocs.com转载请标明出处.