Jump to content

Search the Community

Showing results for tags 'debugger'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 7 results

  1. Hello 🙂 At the beginning: thanks to all of you for many very informative discussions on this forum. When working in D7 in most cases Ctrl+F1 was the right answer to most problems. But now I'm more and more frequently saved by the info provided by members of Delphi-PRAXiS 🙂 And now my actual pain: I'm using Delphi 11 CE ver 28.0. While working with quite simple code I have encountered two strange, fully reproducible problems. The description and related code are below. Additionally all the details and both problems are presented within a short video: https://drive.google.com/file/d/147uSLerfnu-3DZME1jHQ8nsnlAdqtNRi (the code is compiled without optimization). Maybe someone wise can shed some light on the sources of those problems and how to get rid of them (excluding "Embarcadero" problem) ? All the best! --------- >>> The example task: The square matrix TConfusionMatrix = array[0..x,0..x] of Extended is created in two ways (please see the code below): - with primitive functions such as Cmtx33() or Cmtx22() which place the right values in the right cells of the matrix, or - by splitting string representation of the matrix (with function MtxStr2ConfusionMatrix). Example string representation of the 3x3 matrix is: '[0,1,2, 3,4,5, 6,7,8]' (rows concatenation, spaces and brackets do not matter). Created matrices should represent structure "array of rows" and oboth methods should fill the matrix in the same way. For example, if cmtx and cmtx2 are of TConfusionMatrix type then after calls: MtxStr2ConfusionMatrix('[43,0,1,0,45,0,2,0,44]', cmtx, class_cnt); cmtx2:=Cmtx33(43,0,1,0,45,0,2,0,44); variables cmtx and cmtx2 should include the same values in the same elements of matrices (among those which were modified by both functions). Additionally class_cnt will include the size of the row/column of the matrix (in this example class_cnt will be equal 3). It is assumed that strings representing the matrix will always have correct structure and that will include the right number of elements to create a square matrix (so we do not need to think about such things here). >>> Encountered problems: 1.) The first problem ("the inspection problem"): Depending on the order of calls to MtxStr2ConfusionMatrix() and Cmtx33() the results of the former function differ. Sometimes after the call of MtxStr2ConfusionMatrix() the created matrix is displayed in inspection window as it would be (improperly) transposed. But after next call of Cmtx33() the matrix set by MtxStr2ConfusionMatrix() starts to look properly. Further comparison of matrices created with both functions indicate that they are equal and related code execution reacts accordingly. 2.) The second problem ("the wtf problem"): But sometimes - for exactly the same data - the matrix being the result of MtxStr2ConfusionMatrix() permanently stays improperly transposed and the matrices created with both methods are recognised as different. Then this breaks the logic of the code. I'm blind or something but I can't see any obvious reason for such behaviour. Results from primitive functions Cmtx33(), Cmtx22() are always correct and presented properly. ---------- >>> The code: const MAX_CLASSES = 50; type TConfusionMatrix = array[0..MAX_CLASSES,0..MAX_CLASSES] of Extended; //transforms square matrix in the form of string to a table of rows; //cmtx_str = '[0,1,2,3,4,5,6,7,8]' => [[0,1,2][3,4,5][6,7,8]] //(row and column of index=0 are left for other purposes) function MtxStr2ConfusionMatrix(cmtx_str :String; var cmtx :TConfusionMatrix; var class_cnt :Word) :Boolean; var i,j :Word; splittedString : TStringDynArray; res :Boolean; begin res:=True; try RemoveChar(cmtx_str,' '); RemoveChar(cmtx_str,'['); RemoveChar(cmtx_str,']'); class_cnt:=0; splittedString:=SplitString(cmtx_str, ','); if Length(splittedString)<4 then res:=False else begin if Frac(Sqrt(Length(splittedString)))<0.01 then class_cnt:=Round(Sqrt(Length(splittedString))) else res:=False; end; if class_cnt>=2 then begin EraseConfusionMatrix(cmtx,class_cnt,MAX_CLASSES,0); for i:=1 to class_cnt do for j:=1 to class_cnt do cmtx[i,j]:= StrToFloat(splittedString[i+(j-1)*class_cnt - 1]); end; except res:=False; end; result:=res; end; function CompareConfusionMatrices(c1,c2 :TConfusionMatrix; class_cnt :Word) :Boolean; var i,j :Integer; ok :Boolean; begin ok:=True; for i:=1 to class_cnt do for j:=1 to class_cnt do if c1[i,j]<>c2[i,j] then begin ok:=False; break; end; result:=ok; end; function Cmtx33(c11,c12,c13,c21,c22,c23,c31,c32,c33 :LongInt) :TConfusionMatrix; begin cmtx[1,1]:=c11; cmtx[1,2]:=c12; cmtx[1,3]:=c13; cmtx[2,1]:=c21; cmtx[2,2]:=c22; cmtx[2,3]:=c23; cmtx[3,1]:=c31; cmtx[3,2]:=c32; cmtx[3,3]:=c33; result:=cmtx; end; function Cmtx22(c11,c12,c21,c22 :LongInt) :TConfusionMatrix; begin cmtx[1,1]:=c11; cmtx[1,2]:=c12; cmtx[2,1]:=c21; cmtx[2,2]:=c22; result:=cmtx; end; procedure RemoveChar(var s :String; ch :Char); var d :String; i,ls :LongInt; begin d:=''; ls:=Length(s); i:=1; for i:=1 to ls do if s[i]<>ch then d:=d+s[i]; s:=d; end; procedure EraseConfusionMatrix(var cmtx :TConfusionMatrix; num_classes, max_classes :Word; value :Integer); var i,j :Word; begin if num_classes<=max_classes then begin for i:=0 to num_classes do for j:=0 to num_classes do cmtx[i,j]:=value; end else ShowMessage('Confusion Matrix can not be greater than '+IntToStr(max_classes)+'x'+IntToStr(max_classes)); end; ===EOT===
  2. Hi, my first post here. Sorry if this is not the right place, but i feel this is something that should be stated somewhere for others to find. I am running the small danish company Carsoft. We make a quit successful system, called Carsoft Planner for auto workshops, in Delphi. For years I have had the problem, that the main product was debugging fine, but smaller stuff would simply not debug in 64 bit mode! I have googled for hours and tried everything i found - setting firewall, changing all the different paths etc. etc. Now I am in the process of moving Delphi and all my sources to a brand new computer, and a brand new Windows 11. So I installed Delphi 12, moved the sources, and made a very small project "Hello world", just a button and a Showmessage. Put a breakpoint, Pressed F9 and no succes. Breakpoint not found! More googling etc. Finally i found a post somewhere mentioning use of non ascii characters in paths. In Denmark we have three extra letter "æøå" and i have used one of these in the folder name for my "small stuff". Changing my folder name solved the problem completely, everything now works as it should. This might be a well known fact around the world, but I have seen other having the same problem, with no solution, so my hope is this post can help. Best regards Lars
  3. DelphiUdIT

    Parnassus Debugger Issue

    Rad Studio 12. Windows 11 23H2 Parnassus Debugger and Core are installed from GetIt (date 13 November 2023). I have issues with Parnassus debugger like in the past. Create a blank project and start it with debugger. Close the executable and then close the IDE ... an AV is raise multiple times until you end that with task manager. But ... If you close the project (close all) from IDE and then close the IDE then no AV is raised. If none has suggestions i will signal that to QP.
  4. I'm running Delphi XE7, and mysteriously/randomly Delphi XE7 will sometimes ONLY show the CPU view when debugging my 64-bit Windows app, and not let me step through any Pascal source. It will stop on a breakpoint but only show CPU view when the breakpoint is hit, and right click - View Source does nothing. When this occurs, if I go to the Modules view, none of the entry points and addresses are showing up for the program's .EXE itself. I can debug a .DLL module used by my project, that was compiled in Delphi, because the module entry points and addresses do show up when I click on that .DLL in the modules window, unlike when I click on the main .EXE in that same Modules window. When this issue occurs, quitting Delphi and restarting it does not resolve it. If I reboot the entire computer, this issue can resolve itself but may start happening again the same day. Today it occurred, and I rebooted, and it resolved it, but then it happened the 2nd time I ran the program in the IDE, which is very frustrating. I have yet to find a way to get the issue to resolve without rebooting. When this issue occurs with my project, I'm able to load a different 64-bit Delphi project and debug it, so it is not a matter of the XE7 debugger itself failing to load module entry points for the main .exe of all 64-bit apps, just the project I want to work on, and it's very mysterious, because I've gone a week or two at a time without the issue occurring with my project and then it happens and rebooting the machine is the only thing that may resolve it, at least temporarily. By the way, the Modules view does show the Base Address, Module Name and .rsm file for the program's .EXE but, again, when you click on the main exe then none of the entry points and addresses are showing up. I'll also mention that I can debug other projects with the same settings as my project when this issue occurs. When this issue occurs, and the main .EXE module is loaded for my project the Event Log does still indicate that the main .EXE has debug info. Any idea why this is occurring, and will it still occur after upgrading to the latest version of Delphi? I keep getting sales calls about upgrading. This was never an issue when I debugged 32-bit apps. Thanks, J.
  5. Debbie Erickson

    Debug error Meaning?

    Hi. I'm getting a strange (to me) error when debugging a project. The project contains an application and a dll. I have both subprojects open in a project group. I have set some breakpoints in a function within the dll. The functions are initially called from the application. In the dll's function, I have a local variable that's being assigned to. Immediately after the assign statement, I tried to inspect what was in the local variable. The local variable is of a custom-defined class type. When I hit the breakpoint to see what is in that variable called "vo", I get an error message of "error inspecting vo - expression error" Is this related to my debugger settings? In the project, I turned off optimization. Can somebody maybe help me understand and fix this? The first loop checks for a count on a list. The debugger is showing that the count is 1. So the assignment of position 0 should have retrieved the data to the local variable of "vo". Below the code are my project settings for the debugging. function UpdateVendOrdCarrier(Order: TsqlOrderRecord; aVendorCode: string = ''; showWarning: boolean = false): boolean; var i: integer; j: integer; k: integer; CurrCarrierType: char; CurrCarrier: string; CurrShipCode: string; CurrShipMinWk: byte; CurrShipMaxWk: byte; cst: TsqlCustomerRecord; vo: TsqlVendOrdRecord; ShipToState: string; ShipToZip: string; //ManualCarrier: boolean; vsp: TVendorShippingPointRecord; NonStandardWarehouseUsed: boolean; nonDefaultWareHouseCarrId: Integer; carriers: TCarrierList; dcId: string; changed: boolean; lastUsedDc: string; warnings: string; begin changed := FALSE; // for all vendors, recheck the Carriers, this could be because of ShipTo Changes // or we added an Item that changes the Carrier for this Vendor Order result := false; for i := 0 to Order.VendOrdList.count - 1 do begin vo := Order.VendOrdList[i]; if ((aVendorCode = '') or ((aVendorCode <> '') and (vo.VendorCode.data = aVendorCode))) and ((not (vo.RecordState in [rsDelete, rsDeleted]))) // No Changes to invoiced Vendor Orders and ((vo.Status.data = ' ') or (Order.OrderType.data = 'Q')) then begin // Use the Ship To Customer State ShipToState := Order.ShipToCustRec.State.data; ShipToZip := Order.ShipToCustRec.ZipCode.data; // If there is an Installer then use the Installers State for k := 0 to Order.CustomerList.count - 1 do begin if (not (Order.CustomerList[k].RecordState in [rsDelete, rsDeleted])) and (Order.CustomerList[k].TypeCode.data = 'I') then begin cst := TsqlCustomerRecord.CreateAndLoadCustomer(Order.CustomerList[k].CustomerOID.data); ShipToState := cst.State.data; ShipToZip := cst.ZipCode.Data; FreeAndNil(cst); break; end; end; CurrCarrierType := ' '; CurrCarrier := vo.ActlCarrier.data; //ManualCarrier := (vo.Carrier.data <> '') and (vo.ActlCarrier.data <> '') and // (vo.ActlCarrier.data <> vo.Carrier.data); // if uOrderCarrierService.TOrderCarrierService.Instance.ManuallyCarrierChangesOnly(vo, NonStandardWarehouseUsed) then // CurrCarrierType := vo.CarrierType.data; CurrShipCode := vo.ShipCode.data; CurrShipMinWk := vo.ShipMinWk.data; CurrShipMaxWk := vo.ShipMaxWk.data; NonStandardWarehouseUsed := false; vsp := vo.VendorRecord.ShippingPointList.GetShippingPoint(ShipToState); lastUsedDc := ''; if not assigned(vsp) then begin // ShipToState := CurrentLocation.CoAddr.State.data; vsp := vo.VendorRecord.ShippingPointList.GetShippingPoint(CurrentLocation.CoAddr.State.data); end; for j := 0 to vo.VendDtlList.Count - 1 do begin if assigned(vsp) and (vo.VendorCode.data = 'TDQ') and (vsp.DCIdentifier.data <> vo.VendDtlList[j].DCIdentifier.data) then begin if WarehouseManagementSystem.DCCanShip(vsp.DCIdentifier.Data) and WarehouseManagementSystem.DCCanShip(vo.VendDtlList[j].DCIdentifier.data) then begin if (not TCarrierList.IsCollectCarrier(vo.ActlCarrier.Data)) then NonStandardWarehouseUsed := true; // <> 'CLCT'; dcId := vo.VendDtlList[j].DCIdentifier.data; end else if WarehouseManagementSystem.DCCanShip(vo.VendDtlList[j].DCIdentifier.data) then begin if (length(lastUsedDc) > 0) and (lastUsedDc <> vo.VendDtlList[j].DCIdentifier.data) then NonStandardWarehouseUsed := True else if not WarehouseManagementSystem.DCUsesCarrier(vo.VendDtlList[j].DCIdentifier.data, vo.ActlCarrier.data) then NonStandardWarehouseUsed := True; lastUsedDc := vo.VendDtlList[j].DCIdentifier.data; end; end; end; if (assigned(vo.VendOrdLastMileCarrierRecord) and (not string.IsNullOrWhiteSpace(vo.VendOrdLastMileCarrierRecord.ProviderName.Data))) then begin AdjustLeadTimesForLMC(vo); CurrShipMinWk := vo.ShipMinWk.data; CurrShipMaxWk := vo.ShipMaxWk.data; end; if uOrderCarrierService.TOrderCarrierService.Instance.ManuallyCarrierChangesOnly(vo, not NonStandardWarehouseUsed, function(venddtlLine: TsqlVendDtlRecord): boolean var tmsContext: TTmsContext; begin tmsContext := TTmsContext.CreateNew(vo); try SystemSetVendDtlCarrierLine(tmsContext, venddtlLine, result); finally FreeAndNil(tmsContext); end; end ) then begin CurrCarrierType := vo.CarrierType.data; end; for j := 0 to vo.VendDtlList.Count - 1 do begin // After and Item is added, this function gets called and we may have a // combination of N, T or I on the Items. // After F4 Carrier selection, this functioon is also called, // but the Carrier For will set the CarrierType on all of the existing Items // to match the carrier type of the selected carrier. if (not (vo.VendDtlList[j].RecordState in [rsDelete, rsDeleted])) and (vo.VendDtlList[j].Status.data <> 'X') and (vo.VendDtlList[j].VendorCode.data = vo.VendorCode.data) then begin case vo.VendDtlList[j].carrierType.Data of 'N': if CurrCarrierType = ' ' then CurrCarrierType := 'N'; 'T': if CurrCarrierType in [' ', 'N'] then CurrCarrierType := 'T'; 'I': if CurrCarrierType in [' ', 'N', 'T'] then CurrCarrierType := 'I'; end; if vo.VendDtlList[j].ShipMaxWk.data > CurrShipMaxWk then begin CurrShipMinWk := vo.VendDtlList[j].ShipMinWk.data; CurrShipMaxWk := vo.VendDtlList[j].ShipMaxWk.data; end; if pos(vo.VendDtlList[j].ShipCode.Data, 'ISO') > pos(CurrShipCode, 'ISO') then CurrShipCode := vo.VendDtlList[j].ShipCode.Data; end; end; if (not vo.ManLeadTime.data) or (trim(vo.ShipCode.AsString) = '') then begin changed := changed or (vo.ShipCode.AsString <> currShipCode) or (vo.ShipMinWk.Data <> currShipMinWk) or (vo.ShipMaxWk.data <> currShipMaxWk); vo.ShipCode.AsString := CurrShipCode; vo.ShipMinWk.data := CurrShipMinWk; vo.ShipMaxWk.data := CurrShipMaxWk; end; HandleNonDefaultWarehouseMoves(changed, vo, CurrCarrierType, NonStandardWarehouseUsed); HandleDefaultCarrierChanges(changed, Result, Order, vo, ShipToState, ShipToZip, CurrCarrierType, NonStandardWarehouseUsed, j); DcDeliveryProgramService.TDCDeliveryProgramService.Instance.UpdateCarriersForDcDeliveryProgram(vo.OrderRecord, ((CurrCarrier <> vo.ActlCarrier.data) and not (TDCDeliveryProgramService.Instance.CarrierManaullySet(vo)) ) ); ExpectedArrivalDateService.TExpectedArrivalDateService.Instance.UpdateArrivalDateIfNeeded(vo); UpdateTmsCarrierSettings(vo, true); TOrderSystemLibrary.Instance.EnsureCurrentFeightValues(vo); if aVendorCode <> '' then break; end; end; // only display the carrier options changed if something really changed. changed := changed and ( (vo.ShipCode.AsString <> currShipCode) or (vo.ShipMinWk.Data <> currShipMinWk) or (vo.ShipMaxWk.data <> currShipMaxWk) or (vo.Carrier.Data <> CurrCarrier) or (vo.CarrierType.Data <> CurrCarrierType) ) ; if changed and showWarning then begin NBFDialogs.NBFMessageDlg(format('%s: Carrier options carrier has been changed, Please confirm delivery options.', [vo.VendorCode.Data]), mtWarning, [mbok], mrok, 0, false, 'Verify Carrier Options'); end; end;
  6. Ken Aiken

    Changing Windows 64-bit Debugger

    I realized today I don't think I'm using the new LLDB debugger in my 10.4 install. I checked Debugger in the Options windows and the old one is bold when a project is set to 64-bit. I can't figure out how to change which debugger I'm using. I to select the LLDB debugger there and nothing changes. How do I switch debuggers or at least make sure I'm using the LLDB debugger
  7. Cirrus22

    OSX Debugging Issue - How?

    Hi, First time here (just got the Google Groups and it has died). Look, this might be a simple issue and if it is I apologise, but it is driving me spare. Reading the literature I was under the impression you could build for OSX and use the debugger as you would in say a Win32 app,ication, ie. you would have breakpoints and could single step through the code if required. When I build for OSX I have never seen anything like this. The Event Log always says 'No Debug Info'. The best I have been able to do is to use log.d from FMX.Types to show log messages in the PAServer window. I really have tried searching everywhere and anywhere and cannot see anything that would enable what I would call 'normal' Delphi debugging. I think I have all of the necessary debug options set (the debugger certainly works as expected when I build the code for Win32/Win64). Specifically this was a working 32 bit application and DLL that I have converted to a macOS app and DYLIB. I can get the DYLIB to load and functions called if I have a simple test application as the host NOT the converted application. The reason it is now quite desperate is that I'm getting an AV and here's the scenario: Delphi 10.2.3 OSX 10.13.6 PAServer 19.0 Xcode 9.4.1 So my issue with code: Main Program and My Dylib Both call a common unit that generates log file (log4pascal as modified by me) At startup I get Log.d message that now in Initialize Block of log4pascal (it sets up logging for the DYLIB and main application) I then get a Log.d message code is in the Initialize Block of the DYLIB I then get a log.d message that code is leaving the Initialize Block of the DYLIB (all good so far) I SHOULD now get a log.D message that it is entering the Initialize Block of the Unit associated with the main application Instead I get an AV - see attached OSX AV And the PASERVER log shows the same - See log-lines below So the Initialize Block code for the main unit for the application itself is a Log.d line, it NEVER gets executed, ie. the AV occurs before it gets to Initialize? I am having significant difficulty tracking this error. So my initial problem is essentially ...how do i get the debugger to work when running an OSX application so that I can track down that AV (ie. with features like setting breakpoints and single stepping through the code??? Or do I have this all wrong, is there some other way I should be doing it (the Embarcadero documentation suggests I should be able to debug OSX in the same way as I debug Win32 apps). Again, if this is simple stuff I apologies, but it has me stuck.... Kevin
×