From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens-Christian Lache To: gdb@sources.redhat.com Subject: a small bug in the arm simulator Date: Fri, 23 Feb 2001 07:50:00 -0000 Message-id: <0102231647190K.28931@lab04> X-SW-Source: 2001-02/msg00316.html Hi everybody! Some time ago I have complained, that the arm simulator does not know software traps. I am able to simulate them now with the following steps: 1.) Step until the "swi" instruction, but do not execute it (grap the register window from insight) 2.) Set mode bits in cpsr to b00011 for example 0x800000d0 -> 0x800000d3 3.) Set pc to 0x8 4.) stepi 5.) (we should now be in the swi_wrapper) set lr to the value from the swi +4 6.) if somewhere the spsr should be read into a gp reg, adjust this value to the old cpsr This should work fine. I use the same way to simlulate interrupts. If I compile my project for the simulator, I load the address of the interrupt wrapper directly instead obtaining it from the AIC. It looks the following 1.) Run prog to an arbitry location and grap the reg window from insight 2.) Set mode bits in cpsr to b00010 3.) Set pc to 0x18 4.) stepi 5.) (we should now be in the tc0_interrupt_handler) set lr to the value from the last instruction + 4 6.) if somewhere the spsr should be read into a gp reg, adjust this value to the old cpsr This work fine so far. The assembler interrupt handler sets lr to interrupt_end_os_schedule_0 in my case and jumps to the approriate C++ function. When this function is done it jumps to the value of lr. This looks the following: - 0x201aa80 : ldmia sp!, {r1, r2, r3, r12,lr} - 0x201aa84 : mrs r0,CPSR - 0x201aa88 : bic r0,r0, #31; 0x1f - 0x201aa8c : orr r0, r0, #146 ; 0x92 - 0x201aa90 : msr CPSR_fc, r0 The bug is located in 0x201aa90. It is not writing anything at all to the cpsr. Can anybody explain my, how to compile gdb with debug symbols turned on? Regards, Jens-Christian -- Jens-Christian Lache Technische Universitaet Hamburg-Harburg www.tu-harburg.de/~sejl1601 Mail: lache@tu-harburg.de lache@ngi.de Tel.: +0491759610756