View Issue Details

IDProjectCategoryView StatusLast Update
0017619LazarusDebuggerpublic2014-02-05 23:49
ReporterGraeme GeldenhuysAssigned ToMartin Friebe 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platformx86_64OSUbuntu LinuxOS Version10.04
Product Version0.9.29 (SVN)Product Build 
Target VersionFixed in Version1.0.0 
Summary0017619: Debugger handles strings as 0-based, while they are 1-based. Leading to wrong char being displayed
DescriptionIf we can't trust the debugger output, what can we trust?

See the attached images. They show tooltip debug information while I debugged the following simple application.

--------------------------------
program project1;

{$mode objfpc}{$H+}

uses
  Classes;


var
  s: string;
  c: char;
begin
  s := 'hello';
  c := s[1];

  writeln(c);
  writeln(s[1]);
end.
--------------------------------
TagsNo tags attached.
Fixed in Revision33517
LazTarget0.99.0
Widgetset
Attached Files

Relationships

related to 0020286 acknowledged GDB raises SIGSEGV error in String local variable changing 
related to 0020710 closedMartin Friebe Variable inspection uses wrong index for reading characters from string, showing S[I+1] instead of S[I] 

Activities

2010-10-13 09:14

 

Desk 1_004.png (4,370 bytes)
Desk 1_004.png (4,370 bytes)

2010-10-13 09:15

 

Desk 1_005.png (4,026 bytes)
Desk 1_005.png (4,026 bytes)

2010-10-13 13:20

 

2010-10-13 16:07

 

Desk 1_007.png (14,740 bytes)
Desk 1_007.png (14,740 bytes)

Graeme Geldenhuys

2010-10-13 16:08

reporter   ~0041774

The last attached image (*007.png) even shows the "Watch list" window displaying NO data for the char variable. So now it's not just wrong data, but also missing/inconsistent data. :-/

Martin Friebe

2010-11-01 02:22

manager   ~0042522

Last edited: 2010-11-02 00:46

The "watches window display no data" issue should be fixed in 28017. Same for Locals in 28018, stacks in 28030


The string[index] (offset 0 based) issue, should be either reported with fpc, gdb or both.

Martin Friebe

2010-12-17 05:19

manager   ~0044284

Updated title to reflect issue. (was "Tooltip debugger reports wrong data"

Issue is not related to Tooltip, occurs with watches win too.

The other issues reported (later) in this report are fixed in the meantime.

Martin Friebe

2011-11-14 03:23

manager   ~0054064

At the moment it is not possible to always differ between a pchar (0 based) and a string (1 based)

Therefore the debugger now displays both results, similar to this:
a[1] PCHAR: 'x' STRING: 'y'

This does:
- include the correct data
- makes the user aware of the issue

The user inspecting the data, should be able to choose the correct result.

Issue History

Date Modified Username Field Change
2010-10-13 09:14 Graeme Geldenhuys New Issue
2010-10-13 09:14 Graeme Geldenhuys File Added: Desk 1_004.png
2010-10-13 09:15 Graeme Geldenhuys File Added: Desk 1_005.png
2010-10-13 13:20 Graeme Geldenhuys File Added: Kylix_tooltip_debugging.png
2010-10-13 16:07 Graeme Geldenhuys File Added: Desk 1_007.png
2010-10-13 16:08 Graeme Geldenhuys Note Added: 0041774
2010-10-28 16:11 Vincent Snijders LazTarget => -
2010-10-28 16:11 Vincent Snijders Assigned To => Marc Weustink
2010-10-28 16:11 Vincent Snijders Status new => assigned
2010-10-28 16:14 Vincent Snijders Category IDE => Debugger
2010-11-01 02:22 Martin Friebe Note Added: 0042522
2010-11-01 04:50 Martin Friebe Note Edited: 0042522
2010-11-01 04:51 Martin Friebe Note Edited: 0042522
2010-11-02 00:46 Martin Friebe Note Edited: 0042522
2010-12-17 05:19 Martin Friebe Note Added: 0044284
2010-12-17 05:19 Martin Friebe Summary Tooltip debugger reports wrong data => Debugger handles strings as 0-based, while they are 1-based. Leading to wrong char being displayed
2011-09-18 18:49 Martin Friebe Relationship added related to 0020286
2011-11-14 03:23 Martin Friebe Fixed in Revision => 33517
2011-11-14 03:23 Martin Friebe LazTarget - => 0.99.0
2011-11-14 03:23 Martin Friebe Status assigned => resolved
2011-11-14 03:23 Martin Friebe Fixed in Version => 0.9.31 (SVN)
2011-11-14 03:23 Martin Friebe Resolution open => fixed
2011-11-14 03:23 Martin Friebe Note Added: 0054064
2011-11-14 03:23 Martin Friebe Target Version => 0.99.0
2011-11-19 22:23 Juha Manninen Relationship added related to 0020710
2014-02-05 23:49 Flávio Etrusco (notifications not working) Status resolved => closed
2014-02-05 23:49 Flávio Etrusco (notifications not working) Assigned To Marc Weustink => Martin Friebe
2014-02-05 23:49 Flávio Etrusco (notifications not working) Fixed in Version 0.9.31 (SVN) => 1.0.0
2014-02-05 23:49 Flávio Etrusco (notifications not working) Target Version 0.99.0 =>