This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Would you please help me about arm-elf-gdb.
- To: insight at sourceware dot cygnus dot com
- Subject: Would you please help me about arm-elf-gdb.
- From: song_qianghua at 990 dot net
- Date: 20 Apr 2001 03:45:19 -0000
- Reply-To: song_qianghua at 990 dot net
Thank you very much for your arm-elf-gdb, it is very useful when I
debug my arm source code.
But now I want to add a 10 micro second timer interrupt in my arm source
code, I can't find the timer interrupt process in arm-elf-gdb source
code, does it surport timer interrupt.
If not, would you please give me some sugesstion for how to add a
timer interrupt.
Now I have done it as following:
In file "armemu.c"
ARMword
ARMul_Emulate32 (register ARMul_State * state)
{
ARMword interrupt_pc;
/* "ProTimerInterrupt()" will check the time of my computer, if 10 micro second
passed, then it returns the address of timer interrupt function, otherwise
return 0 */
interrupt_pc = ProTimerInterrupt();
if( interrupt_pc!=0 )
{
state->Reg[14] = state->Reg[15]; /*back up current pc*/
state->Reg[15] = intpc; /*pointer pc to the timer interrup function */
//state->NextInstr = RESUME;
state->NextInstr |= PRIMEPIPE;
}
}
It seems can run the timer interrupt function, and return correctly,
but until now I have found two problems.
1. when in function "return -1;", it will not return -1, but return 0; sometimes.
if I disable timer interrupt, it will return -1 correctly.
I think when run "return -1;" and one timer interrupt occured, the register 0
will change to 0.
example:
int _get_tick( void )
{
...
if(..)
{
return tick; //will not stop at here
}
return -1; //will return from here, but sometimes return 0;
}
//call position
int ti;
ti = _get_tick();
if( ti!=-1 )
{
... //sometimes ti is not -1, and stop here
}
//end
2. In a function, it will return before function end and return sentence.
I set the break at all return point in the function, but it will not stop, but
returned, I'm not sure where does it return.
If I disable timer interrupt, it runs all right, If i run it next by next, it
runs all right.
example:
int _get_timer( void )
{
...
if(..)
{
...
return 0; //will not stop here but returned
}
else
{
...
}
return x; //will not stop here but returned I'm not sure where it returned
}
//end
__________________________________________________
欢迎使用金陵热线免费电子邮件系统http://www.990.net