View Issue Details

IDProjectCategoryView StatusLast Update
0025734LazarusDebuggerpublic2017-04-18 06:29
ReporterCyraxAssigned ToMartin Friebe 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionProduct Build 
Target Version1.4Fixed in Version1.3 (SVN) 
Summary0025734: Win32: When debugging a library, IDE steps in wrong lines.
DescriptionSee Additional Information and Summary.
Additional InformationTarget system: win32, Free Pascal trunk 2.7.1-r26805, Lazarus trunk '1.3'-r44094
fpc make options: make all install sourceinstall UPXPROG=echo OPT="-gw2 -godwarfsets -gl -O- -OoNO -Xs- -vb -dTEST_WIN32_SEH" COMPILER_OPTIONS="-gw2 -godwarfsets -gl -O- -OoNO -Xs- -vb -dTEST_WIN32_SEH" INSTALL_PREFIX=i:\free_pascal_and_lazarus\free_pascal_and_lazarus\fpc\trunk\build\trunk_x32 REVSTR=26805 IDE=1
lazarus make options: make all UPXPROG=echo OPT="-gw2 -godwarfsets -gh -gl -O- -OoNO -dHEAPTRC_WINDOW -Xs- -vb -dTEST_WIN32_SEH" USESVN2REVISIONINC=0
TagsNo tags attached.
Fixed in Revision44429
LazTarget1.4
WidgetsetWin32/Win64
Attached Files

Activities

Cyrax

2014-02-18 12:23

reporter  

library-project.zip (1,498 bytes)

Cyrax

2014-02-18 12:25

reporter  

application-project.zip (2,721 bytes)

Cyrax

2014-02-18 12:26

reporter   ~0073128

Compile attached files and use application-project to run library-project.

Cyrax

2014-02-18 12:27

reporter  

Clipboard03.png (21,395 bytes)
Clipboard03.png (21,395 bytes)

Martin Friebe

2014-02-18 15:19

manager   ~0073133

From a first look this may be a know problem. Yet it may be possible to improve it.

You have 2 files of the same name "project1.lpr"

Under certain conditions the IDE and gdb are using the filename (without path) to communicate. So in this case IDE and gdb are in different project1.lpr.

It the image, the bule dots are from the other file. (by judging the line numbers)

In order to have a closer look, can you please provide a logfile:
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session

Cyrax

2014-02-18 16:39

reporter  

debug.zip (13,315 bytes)

Cyrax

2014-02-18 16:40

reporter   ~0073137

Attached logfile debug.zip.

Martin Friebe

2014-02-18 20:57

manager   ~0073147

Thanks,

yes this is caused by the fact that there are duplicate filenames. Actually in this case the combination of spaces in the path and duplicate filenames.

Most of it can *probably* be fixed in the IDE. This will however need extensive testing on my side (as it needs to be tested with different versions of gdb, and each on several platforms.)

For now I would advice to rename your files. e.g projectl.lpr => LibraryFoo.lpr and unit1.pas => UnitLibFoo.pas

Then it should work.

Martin Friebe

2014-03-14 21:51

manager   ~0073706

This has been improved in Lazarus 1.3. Merging to 1.2 is not certain, as the change needs testing on many platform/gdb combinations.

The fix allows the IDE to use the full path, even if there are spaces.

However, there may still be situations where the full path can not be used. Especially if projects includes paths that are outside the projects directory (and part of the project, not the package). This is because those are encoded as "project_path" + "../foo/a". The IDE does not provide the .. part to gdb.
There is o plan to fix this part. It does work, as the IDE will use the file without path. But it does then break on duplicate file names.

Issue History

Date Modified Username Field Change
2014-02-18 12:21 Cyrax New Issue
2014-02-18 12:21 Cyrax Status new => assigned
2014-02-18 12:21 Cyrax Assigned To => Martin Friebe
2014-02-18 12:23 Cyrax File Added: library-project.zip
2014-02-18 12:25 Cyrax File Added: application-project.zip
2014-02-18 12:26 Cyrax Note Added: 0073128
2014-02-18 12:27 Cyrax File Added: Clipboard03.png
2014-02-18 15:19 Martin Friebe Note Added: 0073133
2014-02-18 15:19 Martin Friebe LazTarget => -
2014-02-18 15:19 Martin Friebe Status assigned => feedback
2014-02-18 16:39 Cyrax File Added: debug.zip
2014-02-18 16:40 Cyrax Note Added: 0073137
2014-02-18 16:40 Cyrax Status feedback => assigned
2014-02-18 20:57 Martin Friebe Note Added: 0073147
2014-02-18 20:57 Martin Friebe LazTarget - => 1.4
2014-02-18 20:57 Martin Friebe Target Version => 1.4
2014-03-14 21:51 Martin Friebe Fixed in Revision => 44429
2014-03-14 21:51 Martin Friebe Note Added: 0073706
2014-03-14 21:51 Martin Friebe Status assigned => resolved
2014-03-14 21:51 Martin Friebe Fixed in Version => 1.3 (SVN)
2014-03-14 21:51 Martin Friebe Resolution open => fixed
2017-04-18 06:29 Cyrax Status resolved => closed