* * *

Author Topic: Debug is not work when include file the unit Dialogs  (Read 332 times)

zuibaf

  • Newbie
  • Posts: 2
Debug is not work when include file the unit Dialogs
« on: November 12, 2017, 01:55:12 am »
When I created Project, of type 'Program' [A free pascal command line program with some useful settings added.]
When to trying debug after include the unit 'Dialogs', the debugger 'gdb' start, I see this on System Monitor,  but,
on the Lazarus it indicates debugging, but debugger not start on the ide.
Well, I put a breakpoint on the first line, and the debugger does not appear indicating with the arrow that it has a breakpoint on that line.
However, when I do not include the unit 'Dialog', the debugger start normally.

SO: Linux Fedora 25
Lazarus: 1.6.4
FPC Version: 3.0.2
SVN Revision: Unversion Directory
x86_64-linux-gtk 2
Versão do gdb:
GNU gdb (GDB) Fedora 7.12.1-48.fc25

This ocurred on this project type:
Program,
Simple Program,
Console Application

This NOT OCURRED on this project type:
Application.

Below, application for try:

program teste_bug_2;
uses
Classes,

// When include the unit below 'Dialogs', debugger not start inside in ide.
Dialogs;

begin
  Writeln('Teste');
end.
         


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4379
    • wiki
Re: Debug is not work when include file the unit Dialogs
« Reply #1 on: November 12, 2017, 08:23:19 am »
"Simple Program" (or anything, except "application") can not use Dialogs.

You would at least have to include the unit "interfaces".
And you would have to set up an instance of TApplication  and start the event loop. And that would mean you have exactly what you get if you select project type "application"

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3190
  • I like bugs.
Re: Debug is not work when include file the unit Dialogs
« Reply #2 on: November 12, 2017, 08:56:29 am »
You would at least have to include the unit "interfaces".
And you would have to set up an instance of TApplication  and start the event loop. And that would mean you have exactly what you get if you select project type "application"
+ a dependency for LCL package which contains the Dialogs unit.

Thaddy

  • Hero Member
  • *****
  • Posts: 4629
Re: Debug is not work when include file the unit Dialogs
« Reply #3 on: November 12, 2017, 12:25:26 pm »
I think OP means the FreeVision version of dialogs. (Command line program). In that case add packages/fv/src
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

zuibaf

  • Newbie
  • Posts: 2
Re: Debug is not work when include file the unit Dialogs
« Reply #4 on: November 12, 2017, 01:23:08 pm »
Ok, I understand, is that it accidentally includes this unit, I was looking for the MessageDlg function, however, it gets in another way.
As I was doing a command line project, I considered using the WriteLn function to report some messages on the screen instead of MessageDlg.
As I had forgotten this Unit in the source code, the project did not start in debugging.
Then after analyzing I realized that this Unit Dialogs was, the problem of the debugger did not start.
I never imagined that including a unit would cause the debugger not to start, would not this be a bug ???

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4379
    • wiki
Re: Debug is not work when include file the unit Dialogs
« Reply #5 on: November 13, 2017, 05:41:21 pm »
Well yes, if it compiles (that is, if you had the unit dependencies), then yes it is a bug, you may report it. (Needs to be reproducible...)

If it doesnt compile then there should be an error about that (it may just say "linking failed")

If it compiles pour app would be crashing (or behave undefined). If it crashes the debugger should show this.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus