Forum > Debugger

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

<< < (2/3) > >>

Martin_fr:

--- Quote from: Odacir on May 18, 2024, 10:52:27 pm ---The comand   objdump.exe --info=dwarf  yourproject.exe > log.txt
Have some sintax error, the --info don't allow an argument.


--- End quote ---

Ouch, my bad:
 objdump.exe --dwarf=info  yourproject.exe > log.txt


Another idea, in the "custom options" specify -Xe
This changes the linker. Just in case (I don't really think it matters, but ...)

Also what is the path/folder in which you store your project (and or the project name). Do any of those contain "special" chars? (e.g. accented, or other non a-z?)

What is the size of the exe? It should be big (a few MB at least) if it has debug info. You should see a difference in size, if you disable debug info.

Martin_fr:
You can also start lazarus from cmd.com with the following command line.


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---lazarus.exe --debug-log=C:\log.txt  --debug-enable=DBG_STATE,FPDBG_DWARF_ERRORS,FPDBG_DWARF_WARNINGS,FPDBG_DWARF_VERBOSE_LOAD,FPDBG_DWARF_DATA_WARNINGS,DBG_VERBOSE,DBG_WARNINGS,DBG_STATE,DBG_EVENTS,DBG_THREAD_AND_FRAME,DBG_ERRORS,DBG_VERBOSE_BRKPOINT,FPDEBUG_VERBOSE     
Maybe the log will have some info.

Odacir:
Some updates

Returnf of the  objdebug, only this line:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---M:\Photomovie\Horus\Controle de produção\ctrl_producao.exe:     file format pei-x86-64
Have some special caracters on the path but i tryed short and without specials and nothing change.

Buuuuut, some progres: The EXE have about 13MB and i changed the optimization level, on Compiler Options -> Compilation and LInking From zero to 4 and NOTHING CHANGED IN THE SIZE OF THE EXE....

I used the "cleanup and build" to confirm all be rebuild but nothing change in the EXE size....   :o   %)

And now we have a big log and more infos (log from lazarus, i will attach the file!
But i think this is important: DebuggerState: Setting to dsStop, from dsIdle

Thanks a lot for your time in help-me on this!

Martin_fr:
It does indeed look like the compiler does not add debug info.

13MB is too small for that. For comparison, an empty project with just a form has 30MB with debug info. 
The log also states that the exe does not have debug info.


Starting with a possible silly question, but: The exe has been recreated? The modified time has changed (or better, if you delete the exe before compiling, then a new exe will be created)?

Also, there isn't somewhere a 2nd exe? (like in the lib folder?)

You may want to
- delete/rename the lib folder (rename in case you have anything in there you still need / making sure the IDE can not find the folder anymore)
- delete/move-away all *.o *.ppu *.dbg files that you can find in your project folder and sub-folders  (*.dbg shouldn't be there, but if....)
- then compile it again


Please open the "Project options" (from project menu). The dialog has a button "show options" => if you click it a window opens and shows "command line parameters" => can you copy and paste it here?


Also in the project options, go to the page "Custom options" and in the "custom options" text field, enter the following (replacing anything that may be in there, unless you put it in there and you know what it is for).

-O- -g- -gw3

And see if that changes anything.

If not then in that field add
   -va
and build your project again, then after building right click the messages window and select from the submenu "copy" => "Copy all/original messages to clipboard".
This may be a lot of text. Save the text to a file, and attach it here.  (or sent in private)

Odacir:
Bingooooo!!!!

Solved!!!!!

Now debuging:
https://prnt.sc/jsv-udZXYYY6

The solution was "simple" (after know how to solve), add the custom options.


My Project Options:



--- Quote ---C:\lazarus\fpc\3.2.2\bin\x86_64-win64\fpc.exe
-MObjFPC
-Scghi
-gw3
-gl
-WG
-l
-vewnhibq
-Filib\x86_64-win64
-FuC:\Users\odacr\AppData\Local\lazarus\onlinepackagemanager\packages\VirtualTreeViewV5\Source\lib\x86_64-win64-win32
-FuC:\lazarus\components\tachart\lib\x86_64-win64\win32
-FuC:\lazarus\components\memds\lib\x86_64-win64\win32
-FuC:\Users\odacr\AppData\Local\lazarus\onlinepackagemanager\packages\fortes4lazarus 3.24\lib\x86_64-win64
-FuC:\lazarus\components\printers\lib\x86_64-win64\win32
-FuC:\lazarus\components\ideintf\units\x86_64-win64\win32
-FuC:\lazarus\components\lclextensions\lib\x86_64-win64-win32
-FuC:\lazarus\components\lazcontrols\lib\x86_64-win64\win32
-FuC:\Users\odacr\AppData\Local\lazarus\onlinepackagemanager\packages\jujiboutils\lib\x86_64-win64
-FuC:\lazarus\components\cairocanvas\lib\x86_64-win64\win32
-FuC:\Users\odacr\AppData\Local\lazarus\onlinepackagemanager\packages\zeosdbo\packages\lazarus\lib\zcomponent\x86_64-win64
-FuC:\lazarus\lcl\units\x86_64-win64\win32
-FuC:\Users\odacr\AppData\Local\lazarus\onlinepackagemanager\packages\zeosdbo\packages\lazarus\lib\zdbc\x86_64-win64
-FuC:\lazarus\lcl\units\x86_64-win64
-FuC:\Users\odacr\AppData\Local\lazarus\onlinepackagemanager\packages\zeosdbo\packages\lazarus\lib\zplain\x86_64-win64
-FuC:\Users\odacr\AppData\Local\lazarus\onlinepackagemanager\packages\zeosdbo\packages\lazarus\lib\zparsesql\x86_64-win64
-FuC:\lazarus\components\freetype\lib\x86_64-win64
-FuC:\lazarus\components\buildintf\units\x86_64-win64
-FuC:\Users\odacr\AppData\Local\lazarus\onlinepackagemanager\packages\zeosdbo\packages\lazarus\lib\zcore\x86_64-win64
-FuC:\lazarus\components\lazutils\lib\x86_64-win64
-FuC:\lazarus\packager\units\x86_64-win64
-Fu.
-FUlib\x86_64-win64
-FE.
-octrl_producao.exe
-dLCL
-dLCLwin32
-g-

--- End quote ---

I deleted the lib folder (o does a copy of the project to "test") and no changed nothing in exe size.

Well, thanks a lot for all help to understand and solve my problem!

A very good weekend to you!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version