Recent

Author Topic: [SOLVED] Debugger error before program starts  (Read 4349 times)

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
[SOLVED] Debugger error before program starts
« on: January 20, 2016, 02:21:43 pm »
I keep getting a time-out error (See attachment) BEFORE my program starts.
How can i correct this?


P.S. I installed my GDB with MacPorts.
« Last Edit: January 20, 2016, 07:08:15 pm by madref »
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12291
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger error before program starts
« Reply #1 on: January 20, 2016, 03:04:19 pm »

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Debugger error before program starts
« Reply #2 on: January 20, 2016, 03:20:53 pm »
See log-file
« Last Edit: January 20, 2016, 03:33:43 pm by madref »
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12291
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger error before program starts
« Reply #3 on: January 20, 2016, 03:25:09 pm »
sorry somehow this did not get the important output

Did you have the entire
Code: [Select]
--debug-enable=DBG_CMD_ECHO,DBG_STATE,DBG_DATA_MONITORS,DBGMI_QUEUE_DEBUG,DBGMI_TYPE_INFO
Otherwise try the content of the "debug output" window (which should be open, before you hit "run")

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Debugger error before program starts
« Reply #4 on: January 20, 2016, 03:34:15 pm »
Updated the log-file
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12291
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger error before program starts
« Reply #5 on: January 20, 2016, 04:28:22 pm »
Ok, first of all, you have gdb version 6.3.50
Code: Pascal  [Select][+][-]
  1.   << TCmdLineDebugger.ReadLn "~"GNU gdb 6.3.50.20050815-cvs (Thu Aug 27 13:01:51 UTC 2015)\n""
  2.   << TCmdLineDebugger.ReadLn "~"Copyright 2004 Free Software Foundation, Inc.\n""
  3.   << TCmdLineDebugger.ReadLn "~"GDB is free software, covered by the GNU General Public License, and you
  4.  

This is ok, and supported by the IDE. This is the version that apple used to ship with xcode in the past.
I wonder, since you build from macports, if that is the version you wanted. MacPorts should have a later version. (gdb 7.8 or 7.9, maybe even 7.10).
Ensure you have the correct path. IIRC MacPorts installs the gdb binary somewhere deep in /opt/ or /opts/

That said, it should work with 6.3.50.
But with 6.3.50 timeouts are normal. The warning can be disabled in the debugger options (look through the property grid, on the "general" page (menu: tools > options > debugger)
There you can also reduce the timeout to 50 msec. (50 is the smallest allowed value greater than zero / zero will hang the debugger / 50 is safe).

From the rest of the logfile.
It looks like (after lots of timeouts) your app get started correctly.
It also looks like you have no breakpoints set, and there are no exceptions thrown in your app, and your app terminates normally.
Is this correct? (If so disable the warnings, and you may be fine)

If your app is a console app, then there is another issue, as this is not fully supported: http://wiki.lazarus.freepascal.org/Debugger_Console_App#Mac



I also see from the log, that you use "dwarf" (project options / debug)
This is fine. However (IIRC, not sure, but you may want to try) with 6.3.50, using stabs might be better. If so, you need to do that for all packages too. (or use additions and overrides). So changing this might be a bit complicated.

So unless you get problems inspecting variables, then leave it at dwarf.

With newer gdb dwarf is ok, or even the only option.

Be aware, neither dwarf nor stabs will solve properties. Read http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Inspecting_data_types_.28Watch.2FHint.29

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Debugger error before program starts
« Reply #6 on: January 20, 2016, 04:33:58 pm »
Quote
This is ok, and supported by the IDE. This is the version that apple used to ship with xcode in the past.I wonder, since you build from macports, if that is the version you wanted. MacPorts should have a later version. (gdb 7.8 or 7.9, maybe even 7.10).Ensure you have the correct path. IIRC MacPorts installs the gdb binary somewhere deep in /opt/ or /opts/

Installed GDB as followed -=> http://ntraft.com/installing-gdb-on-os-x-mavericks/
Path = /opt/local/bin/gdb-apple

How do i update to a newer version?
« Last Edit: January 20, 2016, 04:46:36 pm by madref »
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Debugger error before program starts
« Reply #7 on: January 20, 2016, 04:40:12 pm »
Quote
From the rest of the logfile.It looks like (after lots of timeouts) your app get started correctly.It also looks like you have no breakpoints set, and there are no exceptions thrown in your app, and your app terminates normally.Is this correct? (If so disable the warnings, and you may be fine)


Yes the app terminates correctly and normal.
It only starts with 5 timeouts overtime and thats really annoying when programming.

P.S. The program is a database
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12291
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger error before program starts
« Reply #8 on: January 20, 2016, 05:54:40 pm »
As I said, you can switch of the warning, then it starts up, and you do not need to click them away.
And if you do set the timeout to 50, just speeds it up a tiny bit.

------------
I dont use Mac myself, there is a page on our wiki about setting up gdb (search for codesigning)

or maybe try "sudo port install gdb" (instead of the apple gdb / also make sure port is up to date).

But if you switch the warnings off, and it works, then you can keep 6.3.50

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Debugger error before program starts
« Reply #9 on: January 20, 2016, 06:01:07 pm »
or maybe try "sudo port install gdb" (instead of the apple gdb / also make sure port is up to date).
Tried it but then i get more errors and that the debugger runs into an unexceptional error and quits.

You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12291
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger error before program starts
« Reply #10 on: January 20, 2016, 06:39:48 pm »
Then keep 6.3.50
and try the options in the image

WarnOnTimeOut must be false. That is the important setting.

On Mac you should have one more option, defining the timeout length, that can be set to 50.

"Reset Debugger after each run" is optional, I recommend to enable it.

"DisableForceBreakPoint" another optional, but you may want to set it to true too. Same for "DisableLoadSymbolsForLibraries"

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Debugger error before program starts
« Reply #11 on: January 20, 2016, 07:07:30 pm »
Thanx for the advice. Now i don't get the time-out messages anymore.
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

 

TinyPortal © 2005-2018