[solved]Debug as Dll failed ? Why I cannot set variabiles integer =0 lazarus / 12-Debugger ---------------------------------------------------------------------- d2010 · 2025-08-19 07:26 Even I forced to initilalize with three methods, All 3 methods, the  "PsizeWizInc36" still remain 998521728 and not 000000 Code: [Select]    fillchar(PsizeWizInc36,sizeof(PsizeWizInc36),0);     asm mov eax,PsizeWizInc36         xor eax,eax         mov PsizeWizInc36,eax     end;     PsizeWizInc36:=000; C:Q1=Stil remain eCannot Calculate the address of  PsizeWizInc36? At Line 55 and 56, I need dynamic array of integer; and PsizeWizInc36 is --incremental index for fill PsizeWizRes with length(1c). When PsizeWizInc36> length(PsizeWizRes) then I try resize to bigger sizeof PsizeWizRes. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Library cozipinc;{$IFDEF FPC}  {$MODE Delphi}{..$optimization autoInline}{..$inline on}{$modeswitch advancedrecords}  {$H+}{$ENDIF}{$UNDEFINE base64nop}uses  windows,sysutils,classes,     fphttpclient,     h_types in 'D:\Vlaxcompil\Srcincpa\h_types.pas',   h_aduiport in 'D:\Vlaxcompil\Srcincpa\h_aduiport.pas',     hc_exprecon in 'D:\vlaxcompil\srcincpa\hc_exprecon.pas',     hc_Masks in 'D:\Vlaxcompil\srcincpa\hc_Masks.pas',     LazFileUtils,     md5, Clipbrd,     FileUtil,     zipper;(* assert_cod(090,'0');   assert_cod(036,'0');*)Const RTSkipBat=5300;      RT3DONE  =5203;Var cpkunzip_han_openttd:Thandle=00;    nccdos:array[0..7] of char='B0000='#00#00;    odutWcMatch:shortstring='*';    sumo:integer=0;    AdCharFmt2c:Ansistring='rem:comtine toate sursele Bats';    AdCharFmt1c:string='rem:contine .DFN';    AllttRootNames:string='';    AllttBatsNames:string='(prompt "Fara subdir si cucuBats")';    WRegio5AllNames:string='(prompt "contine toate numele fisiere , trebuie pastrat pentru disk32add")';    WCount5AllNames:record root,deep:integer;end;    AcZipBoot16Han:handwait=0;    ABrchiveFileName:String='';    kVerbatim_endfmt1c:integer=00;    netdrv:integer=000; //(<000.You set libCValx from NetDrvPath);    scho_a:string='';    cntCozipinc_disk32add:integer=RTCAN;    cntlbop:record x,y,z:integer;end;    cntBatmeter:tpoint;    extmin:tpoint_xyz;    ret_disk32add:string='';    ret_base64dec:string='';    typ_base64dec:char=#00;    regtokenames:string='';    ret_prefixtoken:tap_char255psicnt;    libPK:record hostname,namef1,namef2:shortstring;                 name_of_library:string;                 han32:handwait;               maskingset:word;          end;Var PFeedWizRes3:array of record x10,y13:integer;end;    PsizeWizInc36:integer;    PsizeWizRes3:array of integer;    CancelFeedBack:array[char] of integer;    cntDoIteratorEachFilezip3Stream:integer=00;  At Line=27, bellow, I cannot set 00, still remain at PsizeWizInc36 is 88585885. Already I reset him to 000, but nothing.  PFeedWizRes3[PsizeWizInc36] Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Var ret_DoIteratorEachFilezip3Stream:integer=000;procedure Tform1.DoIteratorEachFilezip3Stream(Sender: TObject; var AStream:TStream;  AItem: TFullZipFileEntry);Var lena,addc:integer; Astr:string; kRegionBatFile:char;   Asho:AnsiSTring;   dwg,nth,cnt:integer; begin  dwg:=00; nth:=00; cnt:=00;    assert_adu(068,'0');    AStream.Position:=0;    lena:=length(AdCharFmt1c);    if (lena<01) then lena:=01;    inc(cntDoIteratorEachFilezip3Stream);    Astr:='';    addc:=000;    astr:=lowercase(Aitem.ArchiveFileName);    Asho:=extractfileext(astr);    if (asho='.bat') then kRegionBatFile:='b' else kRegionBatFile:='a';   Case kRegionBatFile of'a':   with Tstringlist.Create do        Begin          LoadFromStream(Astream);          Add(''); Add('');          Add(''); Add('');          Add(''); Add('');          Add(''); Add('');        inc(CancelFeedBack[#13],08);          inc(CancelFeedBack[#10],08);        PFeedWizRes3[PsizeWizInc36].y13:=CancelFeedBack[#13];          PFeedWizRes3[PsizeWizInc36].x10:=CancelFeedBack[#10];          Astr:=GetText;          Addc:=Astream.Size;          Free;          dwg:=length(AdCharFmt1c);          AdCharFmt1c:=AdCharFmt1c+Astr;        for nth:=01 to length(Astr) do inc(CancelFeedBack[astr[nth]]);        lena:=length(AdCharFmt1c)*sizeof(char);          Asho:=copy(AdCharFmt1c,dwg,253);          PsizeWizRes3[PsizeWizInc36]:=lena+001;        end;'b': with TStringList.create do      Begin        Addc:=Astream.Size;        LoadFromStream(Astream);        insert(0,Aitem.ArchiveFileName);      insert(0,'#region');        insert(0,'');        Add('%batmeter='+Aitem.ArchiveFileName);        Add('#endregion');      inc(cntBatmeter.x);        Add('');        Add(';; ,');        Add(';;/,`\');        Add(';;` | \____\\');        Add(';; _(      ) \');        Add(';; \-\~~~_|\  \');        Add(';;    \ `   \  `');      Add(';;    `     `');        Asho:=GetText;        Free;        AdCharFmt2c:=AdCharFmt2c+Asho;      End;  end;    if (addc>03) then  Case kRegionBatFile of'b':inc(cntlbop.x);'a': Begin inc(cntlbop.x);;inc(PsizeWizInc36);End       else dec(cntlbop.y);     End;// Eu multumesc tie ArsenieBoca   Astream.free;   setlength(astr,15);   if (length(asho)>2) then setlength(aSho,003);End; ---------------------------------------------------------------------- Martin_fr · 2025-08-19 09:30 This runs on Windows? This is for an Intel (or AMD) CPU? (the asm example looks like 32bit CPU?) When / where in your code is the "fillchar" or "PsizeWizInc36:=000;" called? Have you set a breakpoint and made sure it is called before the other code? Is that initialization called inside the library? Or in the main program? "procedure Tform1.DoIteratorEachFilezip3Stream" is in your main program? (not in the library)? Have you added Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i writeln(PsizeWizInc36)to confirm the value of the variable? QuoteCannot Calculate the address of  PsizeWizInc36 That is an error you see in the debugger (when you run the app)? E.g. in the "hint" to see the value? Or in the watches window? Which debugger are you using? Menu: Tools > Options > Debugger > Debugger Backend: Does it say "FpDebug" or "GDB" ? Have you compiled the library with debug info? Have you compiled the library with optimization off (or with -O1)? I am not sure, if the debugger shows variables from the library, when you are paused in the main app. It may be that you must be paused in a procedure of the library. But as I said, not sure... ---------------------------------------------------------------------- Zvoni · 2025-08-19 09:47 PsizeWizInc36:integer; Could someone please explain in simple words, why you want to use FillChar on an Integer? ---------------------------------------------------------------------- d2010 · 2025-08-20 07:21 Quote from: Martin_fr on August 19, 2025, 11:30:48 am Y:Q1=This runs on Windows?  => Win8.1 x32 or win7 as 32Trial Y:Q2=A1This is for an Intel (or AMD) CPU? ( => Inteli3 Y:Q3="procedure Tform1.DoIteratorEachFilezip3Stream" is in your main program? (not in the library)? =>Library cozipinc; or cozipinc.dll Y:Q4=Have you added  "writeln"? =>No I don~t not Y:Q5=E.g. in the "hint" to see the value? Or in the watches window? =>watches window=yes Y:Q6=Which debugger are you using? ==>"FpDebug", Please, my firefox.exe don~t upload capture the 2x snaphot.gif? Please Why I cannot upload as attachment or inside.zip? Y:Q7=Have you compiled the library with debug info? ==>I hope yes. Y:Q8=Have you compiled the library with optimization off (or with -O1)? ==>No, Code: [Select]Menu: Tools > Options > Debugger > Debugger Backend: Does it say "FpDebug" or "GDB" ? Please, You wait 1-2 day/s after the tomorrow, I cannot have  "Internet-Connection" after tomorrow. ---------------------------------------------------------------------- Thaddy · 2025-08-20 07:29 mov PsizeWizInc36,[eax] ? Your code 8887787788  suggests a pointer, not a value. Not tested, but may help. May need decoration, e.g. dword ptr ---------------------------------------------------------------------- d2010 · 2025-08-20 07:40 Quote from: Thaddy on August 20, 2025, 09:29:00 ammov PsizeWizInc36,[eax] ? Your code 998521728  suggests a pointer, not a value. Not tested, but may help. May need decoration, e.g. dword ptr I good result , You see "stdresult.txt" The number 998521728  is inside "Watches Windows" and inside the "Hint" but , today is writeln(0...996) ,. I attached std*.txt