In the breakpoint do a step into (f7) and ser the exact line that crashes

Luiz
Em 22/06/2015 14:03, "Bo Berglund" <[email protected]> escreveu:

> On Mon, 22 Jun 2015 13:29:07 -0300, luiz americo pereira camara
> <[email protected]> wrote:
>
> >In my experince sigsegv occurs mostly when a field or variable is accessed
> >before initialization.
> >
> >Try to set a breakpoint in dongle.initkey call. And evaluate the dongle
> >field (open debugger evaluate window)
> >
> >Look for dongle or one of the tsentinel fields being nil
> >
>
> I have already a breakpoint in the on-click event handler for the
> button. The code is:
>
> procedure TfrmMain.btnFindKeyClick(Sender: TObject);
> var
>   SerialNo: word;
> begin
>   //Code to check for the dongle and if found display its contents
>   Dongle.InitKey;  <-- Breakpoint here
>   Dongle.AppNumber := 1;
>   if Dongle.CheckKey then
>   begin
>     SerialNo := Dongle.SerialNo;
>     stxSerialNo.Caption := IntToStr(SerialNo);
>   end;
> end;
>
> When Lazarus stops and I hover over the Dongle variable (which was
> created in the form's OnCreate event) I see all fields of the Dongle
> object and they seem to be normal, except for the FSentinelPacket.
>
> This is supposed to be an array of char [1..1028] but it says
> FSENTINELPACKET=#0#0#0#0Truncated 1027->1000####
>
> Does this imply that the size of the packet has been initialized
> erroneously?
> It is defined thus: ARRAY [1..1028] OF CHAR;
> Can the indexing be a problem? The packet is defined with a starting
> index of 1 rather than 0...
>
>
> --
> Bo Berglund
> Developer in Sweden
>
>
> --
> _______________________________________________
> Lazarus mailing list
> [email protected]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to