[hatari-devel] Profiling support to Hatari debugger

Laurent Sallafranque laurent.sallafranque at free.fr
Sun May 9 22:00:57 CEST 2010


 > I'm sure to understand your question.

OOOOPS, you must read :

I'm NOT sure to understand your question.

Regards

Laurent


Le 09/05/2010 21:58, Laurent Sallafranque a écrit :
>>  So the debugger gets previous instruction cycles, but that doesn't 
>> matter
>>  because PC (used both py new profile code and existing breakpoint code)
>>  is also pointing to previous instruction?
>
> I'm sure to understand your question.
>
> Actually, DSP code doest this :
>
> 1) execute current instruction at PC address
> 2) update the PC pointer
> 3) compute interrupts
>
> In 1 bis (between 1 and 2), I would add : compute current instruction 
> cycles.
>
>
> So, when you've called "dsp56k_execute_instruction();", you're in the 
> following state :
>
> 1) instruction has been executed
> 2) cycles for this instruction have been computed
> 3) interrupts have been managed
> 4) PC register is updated to the next instruction to execute (next 
> instruction, jmp, rts, ... or an interrupt vector)
>
> Does this reply to your question ?
>
> Laurent
>
>
>
> Le 09/05/2010 21:49, Eero Tamminen a écrit :
>> Hi,
>>
>> On Sunday 09 May 2010, Laurent Sallafranque wrote:
>>> I've added the DSP cycles counter directly in the code (there was no
>>> other choice, because instructions cycles vary whereas a register or a
>>> memory address is used, (and cycles are higher with external memory
>>> access), and if there's a parallel move or not.
>>>
>>> Have a look at  "DSP_DisasmAddress(Uint16 lowerAdr, Uint16 
>>> UpperAdr)" in
>>> dsp.c
>>>
>>> After the "        dsp56k_execute_instruction();" , you can get the
>>> cycles used by the instruction like this :
>>>
>>> cycles = dsp_core.instr_cycle;
>> Hm. dsp.c does this:
>>          if (unlikely(bDspDebugging)) {
>>                  while (i>  dsp_cycle)
>>                  {
>>                          DebugDsp_Check();
>>                          dsp56k_execute_instruction();
>>                          dsp_cycle += dsp_core.instr_cycle;
>>                  }
>>
>> So the debugger gets previous instruction cycles, but that doesn't 
>> matter
>> because PC (used both py new profile code and existing breakpoint code)
>> is also pointing to previous instruction?
>>
>>
>>     - Eero
>> _______________________________________________
>> hatari-devel mailing list
>> hatari-devel at lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/hatari-devel
>>
>>
>




More information about the hatari-devel mailing list