Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-04

How do I debug wince LCL?

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Paul van Helden

Hi all,

I can step into LCL code when debugging a Win32 project, but a WINCE project shows me the exact line number and file name in the stack trace but always come up with Unable to load file
"\lazarus\lcl\include\custombitmap.inc" (for example). I've tried adding search paths in debugger options with no success. Where do I tell Lazarus where to find the wince interface source code? And why doesn't the snapshot work for wince out-of-the-box like win32 does?

Wince LCL needs a lot of work and I'd like to try to contribute.

Thanks,

Paul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120425/29ed86a2/attachment.html>

Reply by email

Martin
to Paul van Helden
Paul van Helden wrote 12 lines
Hi all, I can step into LCL code when debugging a Win32 project, but a WINCE project shows me the exact line number and file name in the stack trace but always come up with Unable to load file "\lazarus\lcl\include\custombitmap.inc" (for example). I've tried adding search paths in debugger options with no success. Where do I tell Lazarus where to find the wince interface source code? And why doesn't the snapshot work for wince out-of-the-box like win32 does? Wince LCL needs a lot of work and I'd like to try to contribute.

Please read http://bugs.freepascal.org/view.php?id=21061

the notes explain how to set the search path as work around

Show quoted text 6 lines
As for the IDE doing a workaround. That is what "additional search path" is for. But it is currently broken. Once fixed (will update if I have more info) it should be D:\ (the "\" is important)

and the fix (the fix for the work around only) was in rev 34716 (0.9.31)

Reply by email

Felipe Monteiro de Carvalho
to Paul van Helden: I can step into LCL code when debugging a Win32 project, but a WINCE project shows me the…

One nice way to debug it is compiling LCL-WinCE for the Win32 operating system. I made it work in desktop Windows to be able to debug problems there. Unfortunatelly most of the remaining bugs do not reproduce in desktop Windows and therefore are related to differences between the WinCE API and Win32 API, so this won't help that much.

Another debug solution is using DebugLn.

Yet another one is using GDB tui interface from the command line. The last time I used that was a long time ago, so I don't remember that much anymore. In the forum there is a stiky post about that in the WinCE section.

Felipe Monteiro de Carvalho

Reply by email

Paul van Helden
to Felipe Monteiro de Carvalho

Thanks Martin & Felipe,

C:\ in the search path solved my LCL problem.

I'm now running into memory trouble and hitting the 32MB process memory limit. Without debug info my .exe is 5MB but it is 25MB with debug info and it seems it is using up the same amounts of process memory. My app works without debug info but crashes when I'm debugging due to the low memory condition. (B.t.w. there is no out-of-memory exception, the allocation routines silently returns nil... is this something that can be fixed in FPC?)

I tried with external debug info file but gdb goes crazy. (Stops at breakpoints but complete wrong ones). Also tried copying the .dbg file onto the wince device but it doesn't make a difference. Can wince be debugged with an external symbols file?

Finally, how can I tell Lazarus to tell gdb to copy the compiled exe somewhere other than \gdb on the device?

Thanks a lot for your help so far,

Paul.

On Thu, Apr 26, 2012 at 2:32 PM, Felipe Monteiro de Carvalho <

Show quoted text 24 lines
wrote: One nice way to debug it is compiling LCL-WinCE for the Win32 operating system. I made it work in desktop Windows to be able to debug problems there. Unfortunatelly most of the remaining bugs do not reproduce in desktop Windows and therefore are related to differences between the WinCE API and Win32 API, so this won't help that much. Another debug solution is using DebugLn. Yet another one is using GDB tui interface from the command line. The last time I used that was a long time ago, so I don't remember that much anymore. In the forum there is a stiky post about that in the WinCE section. -- Felipe Monteiro de Carvalho -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120426/4b817048/attachment.html>

Reply by email

Martin
to Paul van Helden
Paul van Helden wrote 20 lines
Thanks Martin & Felipe, C:\ in the search path solved my LCL problem. I'm now running into memory trouble and hitting the 32MB process memory limit. Without debug info my .exe is 5MB but it is 25MB with debug info and it seems it is using up the same amounts of process memory. My app works without debug info but crashes when I'm debugging due to the low memory condition. (B.t.w. there is no out-of-memory exception, the allocation routines silently returns nil... is this something that can be fixed in FPC?) I tried with external debug info file but gdb goes crazy. (Stops at breakpoints but complete wrong ones). Also tried copying the .dbg file onto the wince device but it doesn't make a difference. Can wince be debugged with an external symbols file? Finally, how can I tell Lazarus to tell gdb to copy the compiled exe somewhere other than \gdb on the device?

Sorry this goes out of my area of knowledge. Couple of random things, that may or may not be helpful.
In environment options debugger, you can give gdb extra start up options. (But I wouldn't know of any that help)

Try dwarf vs stabs?

if you only need parts of the LCL, with debug info, maybe the following helps.
- Compile LCL with debug info.
- Remove *.ppu and *.o files for units that do not need dbg-info
- compile again without dbg info (so the missing files will be created)

Only the IDE is now to clever. It sees the changed options, and cleans the package.
Not sure if/where in the IDE to disable that. Otherwise do not change the settings in the IDE and call the compiler by hand (using --debug-log= you can get the exact fpc comand line issued by the IDE / take off any -g...).

Reply by email

Paul van Helden
to Martin

Hi Martin,

Thanks, I deleted some breakpoints and placed new ones and the debugger now works fine with external .dbg (not on device).

I also found this in the docs for changing the exe location: --eval-command="set
remotedirectory \Storage Card\Program Files\My Program\bin" and set the Debug_Startup_Options to that value but the compiled exe still goes to \gdb. But this not a major problem any more because my exe is so much smaller. Awesome!

Thanks a stack,

Paul.

Martin wrote 49 lines
On 26/04/2012 15:30, Paul van Helden wrote: > Thanks Martin & Felipe, > > C:\ in the search path solved my LCL problem. > > I'm now running into memory trouble and hitting the 32MB process memory > limit. Without debug info my .exe is 5MB but it is 25MB with debug info and > it seems it is using up the same amounts of process memory. My app works > without debug info but crashes when I'm debugging due to the low memory > condition. (B.t.w. there is no out-of-memory exception, the allocation > routines silently returns nil... is this something that can be fixed in > FPC?) > > I tried with external debug info file but gdb goes crazy. (Stops at > breakpoints but complete wrong ones). Also tried copying the .dbg file onto > the wince device but it doesn't make a difference. Can wince be debugged > with an external symbols file? > > Finally, how can I tell Lazarus to tell gdb to copy the compiled exe > somewhere other than \gdb on the device? > > Sorry this goes out of my area of knowledge. Couple of random things, that may or may not be helpful. In environment options debugger, you can give gdb extra start up options. (But I wouldn't know of any that help) Try dwarf vs stabs? if you only need parts of the LCL, with debug info, maybe the following helps. - Compile LCL with debug info. - Remove *.ppu and *.o files for units that do not need dbg-info - compile again without dbg info (so the missing files will be created) Only the IDE is now to clever. It sees the changed options, and cleans the package. Not sure if/where in the IDE to disable that. Otherwise do not change the settings in the IDE and call the compiler by hand (using --debug-log= you can get the exact fpc comand line issued by the IDE / take off any -g...). -- ______________________________**_________________ Lazarus mailing list .**freepascal.org http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarus<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120426/dfc837f3/attachment.html>

Reply by email

Dimitrios Chr. Ioannidis
to Paul van Helden: I can step into LCL code when debugging a Win32 project, but a WINCE project shows me the…

Hi,

Paul van Helden wrote 7 lines
I can step into LCL code when debugging a Win32 project, but a WINCE project shows me the exact line number and file name in the stack trace but always come up with Unable to load file "\lazarus\lcl\include\custombitmap.inc" (for example). I've tried adding search paths in debugger options with no success. Where do I tell Lazarus where to find the wince interface source code? And why doesn't the snapshot work for wince out-of-the-box like win32 does?

for me if i setup the arm-wince-gdb in the IDE, compile with external .dbg and use stabs ( AFAIK WinCE doesn't support dwarfs ) when i work with WinCE.

regards,

Dimitrios Chr. Ioannidis

Reply by email