Forum > Debugger

[SOLVED] Breakpoints don't work on a old Lazarus project

(1/3) > >>

Hello, i have an old lazarus project, and at this moment i'm running Lazarus 3.0.

If i create a new project, add some breakpoint, works fine. But on this old project i can't put working the breakpoints, its like don't have any breakpoint.

My debugging configs:

Any idea, what i need check/set to solve this?


Are the breakpoints shown in the source editor?

Once you run, what color do they turn, and do they show some icon (check-mark,  question-mark, two-vertical-bars, ...)?

Also check for breakpoints in the "breakpoint window" => menu: View > Debug Windows > Breakpoints.
- Do they have "break" in the action column?
- No condition set?

Have you tried to remove them, and set them again?

Do you have optimization disabled?

From the image: This is on Windows?

Do you compile for 32 bit or 64 bit?
Is your IDE 32 or 64 bit?

In menu: Tools > Options
Page: Debugger > Debugger Backend

What debugger is selected? FpDebug or Gdb

If there is some red text "The project uses a different debugger" then check in project options too.

Hi Martin, Thanks a lot for your repply and sorry for delay to return here about my problem.

On i compile OTHER projects (and the debug works) i see the points on the lines of code, sample:

On i run the project that have the problem (don't debug), i don't see the "points" on every line of code, on run. Sample:

Nothing change on run:

The breakpoint is set  to break without condition:

Yes i removed and put again in different units, debug don't enabled but i don't know why.... :(

I tryed without optimizations and on level 1, don't work:

Yes i'm running Lazarus on windows, this project i compile to OSX and windows, at this moment on 64 bits, on windows and 64bits on MAC but on years ago, i compile only to 32bits on Mac.

I think can be something related to the project options, because in OSX i can't debug too (exclusively this project) on Mac OS, if i enable some debuger, on Debugger Backend, the app don't run. Elabing the GDB the error on run is:

On windows i don't receive any message, only don't debug using GDB or FpDebug.

About the red text, on compile i don't have any red message.

The gdb error is probably something else (afaik todo with gdb not codesigned on Mac, but I am not a Mac expert). If you have an up to date Mac, it is recommended to use "lldb + fpdebug" on Mac. (lldb comes with MacOs, and fpdebug is part of the IDE).

On Windows, the image with the breakpoint: red breakpoint with two yellow "bars" (like the pause symbol on a CD player). And also the absence of any blue dots. That means there was no debug info found for that code (probably the whole unit).

I have to double check, but I think if the unit had been found by the debugger, then the breakpoint would have gone orange with a cross "x" on it, to say that line had no debug info.

So the question now is why is there no debug info...

Is that unit part of a package? Or is it in your project?

=> If it is in a package, then open that package, and go to the options of that package, and enable "dwarf debug info" for that package.

=> If it is in your project, is it in the same folder than all the other sources in your project?

--- Quote ---and at this moment i'm running Lazarus 3.0.
--- End quote ---
To be sure: From the official installer, with the version of FPC that came with it? Or build yourself with a different Fpc?

Does the code use generics?
Does the code use "type TFoo = object ..." ("object" instead of class or record)?

If none of the above helps

See the image on this page
- Are the highlighted options set (or "not set") in your project?
- On the pages "Custom options" (field "custom options") and "Additions and overrides" are there any settings?

And, if a package is involved, same questions for that package.
Also, if the settings are correct for such a package, from the package window, in the drop-down menu at the very right of the toolbar, chose "recompile clean".

And if still none of that helps: In the bin folder in the fpc directory is a objdump.exe

  objdump.exe --info=dwarf  yourproject.exe > log.txt

- Does it print any warnings ?
- if you search in the "log.txt" for the unit name of the unit that does not work, is that unit name found?

And if even then still none of that helps:
Is the project available public, or can it be shared privately?

None of the project units works the debug. Its for entire project and the Unit of the print, yes its a project unit, not a package and on the same folder of all other project files.

I installed Lazarus and FPC with the official installer FPC version 3.2.2

The code dont use generics.

Here a print of my debug setup:

The comand   objdump.exe --info=dwarf  yourproject.exe > log.txt
Have some sintax error, the --info don't allow an argument.
I run it without argument "dwarf" but i think don't produce what we need of informations. I will attach the file.

If its important, i can share privately the project, no problem. Thanks a lot for your help on try solve this.


[0] Message Index

[#] Next page

Go to full version