This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

(update)Would you please help me about arm-elf-gdb. (fwd)


Wrong list...

---------- Forwarded message ----------
Date: 20 Apr 2001 04:02:37 -0000
From: song_qianghua@990.net
To: insight@sourceware.cygnus.com
Cc: song.qiang-hua@inventec-inc.com
Subject: (update)Would you please help me about arm-elf-gdb.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]