public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* (update)Would you please help me about arm-elf-gdb.
@ 2001-04-19 20:57 song_qianghua
  0 siblings, 0 replies; only message in thread
From: song_qianghua @ 2001-04-19 20:57 UTC (permalink / raw)
  To: insight; +Cc: song.qiang-hua

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2593 bytes --]


Hi,
I'm Song QiangHua from China,

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 */
	if( state->NextInstr!=SEQ && state->NextInstr!=NONSEQ &&
		state->NextInstr!=PCINCEDSEQ && state->NextInstr!=PCINCEDNONSEQ)
	{
		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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-19 20:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-19 20:57 (update)Would you please help me about arm-elf-gdb song_qianghua

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).