[hatari-devel] start and break question
Nicolas Pomarède
npomarede at corp.free.fr
Mon Jun 6 10:23:07 CEST 2011
Le 06/06/2011 00:11, Eero Tamminen a écrit :
> Hi,
>
> On maanantai 06 kesäkuu 2011, Nicolas Pomarède wrote:
>>> I think catching the first program instruction would need a new virtual
>>> debugger variable that tracks the OS program basepage and the text
>>> segment address in that. It would be then possible to set a
>>> breakpoint on it and its changes.
>>>
>>> How does that sound and how should I name that variable?
>>
>> What code would you use to get the basepage on any TOS version ?
>
> Info command should already have all the necessary checks for getting
> sysbase/basepage on different TOS version. With the attached patch,
> you can use just:
> b BasepageTextSegment> 0&& pc = BasepageTextSegment
>
> To break on normal program startup.
>
> Currently the variable shows a value althought there's no program running,
> so I was wondering should it return zero until the text segment _size_ is
> also non-zero?
I'm not sure if it's not possible to craft a "wrong" prg header with 0
size and still have the tos to load it (I wonder if some packers are not
changing those values, can't recall).
Maybe you can just check also that :
BasepageTextSegment> 0&& pc = BasepageTextSegment && (pc).w = $601a
It's quite unlikely that you have the header of a prg at basepage other
than if it's a program that was just started.
Nicolas
More information about the hatari-devel
mailing list