Sign in Join

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

Mailing lists / fpc-devel / 2010-08

Debugger problem

9 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

Hans-Peter Diettrich

I've installed Lazarus 0.9.28 (with FPC 2.2.4) 64 bit on Win7/64. Here gdb works.

Then I built and installed FPC 2.5 (trunk) for further use. The compiled apps (64 bit) run fine, as long as I disable debugging. With debugging enabled the application hangs on start, i.e. even the console does not appear for a console app (hello world...).

What might be wrong? Do I need a newer gdb.exe for 2.5?

DoDi

Reply by email

Marc Weustink
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote 7 lines
I've installed Lazarus 0.9.28 (with FPC 2.2.4) 64 bit on Win7/64. Here gdb works. Then I built and installed FPC 2.5 (trunk) for further use. The compiled apps (64 bit) run fine, as long as I disable debugging. With debugging enabled the application hangs on start, i.e. even the console does not appear for a console app (hello world...).

What if you run a gdb from the command line ?

Does the debuggeroutput window show something ?

Marc

Reply by email

Jonas Maebe
to Hans-Peter Diettrich: I've installed Lazarus 0.9.28 (with FPC 2.2.4) 64 bit on Win7/64. Here gdb works. Then I…
Hans-Peter Diettrich wrote 5 lines
I've installed Lazarus 0.9.28 (with FPC 2.2.4) 64 bit on Win7/64. Here gdb works. Then I built and installed FPC 2.5 (trunk) for further use. The compiled apps (64 bit) run fine, as long as I disable debugging. With debugging enabled the application hangs on start, i.e. even the console does not appear for a console app (hello world...). What might be wrong?

See comment 0035256 at http://bugs.freepascal.org/view.php?id=15692 for how to fix it. I think the default image base for Win64 should be reduced back to something < 32 bit until this problem is solved, but the Win64 maintainers don't agree (http://bugs.freepascal.org/view.php?id=15692).

Jonas

Reply by email

Hans-Peter Diettrich
to Marc Weustink: What if you run a gdb from the command line ? Does the debuggeroutput window show…
What if you run a gdb from the command line ?

I'm somewhat confused. There seem to exist two gdb.exe on my system, with slightly different version numbers, but I can locate only one. Typically Windows - protect the system from the user :-(

After some tries: found the other (32 bit?) gdb, and renamed it. Also removed the path to FPC 2.4.0 (32 bit).

Does the debuggeroutput window show something ?

Now gdb allows to run the test program, where the other gdb (32 bit) couldn't identify the file format (64 bit).

Nonetheless when I run the same program from the Lazarus IDE, no console window opens :-(

Seems to become a Lazarus problem...

DoDi

Reply by email

Hans-Peter Diettrich
to Jonas Maebe: See comment 0035256 at http://bugs.freepascal.org/view.php?id=15692 for how to fix it. I…
See comment 0035256 at http://bugs.freepascal.org/view.php?id=15692 for how to fix it.

This was not the problem, but reading helped - I had to enable creation of gdb debug info, to make the debugger work with Lazarus. I wonder why gdb doesn't report any errors, when running it with the same exe without debug information created? Or is the debug info essential for Lazarus?

DoDi

Reply by email

Marc Weustink
to Hans-Peter Diettrich: I'm somewhat confused. There seem to exist two gdb.exe on my system, with slightly…
Hans-Peter Diettrich wrote 10 lines
Marc Weustink schrieb: > What if you run a gdb from the command line ? I'm somewhat confused. There seem to exist two gdb.exe on my system, with slightly different version numbers, but I can locate only one. Typically Windows - protect the system from the user :-( After some tries: found the other (32 bit?) gdb, and renamed it. Also removed the path to FPC 2.4.0 (32 bit).

make sure you use only mingw based gdb for lazarus and not a cygwin based (cygwin has a console which doesn't use stdin/out)

Show quoted text 7 lines
> Does the debuggeroutput window show something ? Now gdb allows to run the test program, where the other gdb (32 bit) couldn't identify the file format (64 bit). Nonetheless when I run the same program from the Lazarus IDE, no console window opens :-(

You cannot debug console apps in lazarus.

Marc

Reply by email

Marc Weustink
to Hans-Peter Diettrich: This was not the problem, but reading helped - I had to enable creation of gdb debug…
Hans-Peter Diettrich wrote 9 lines
Jonas Maebe schrieb: > See comment 0035256 at http://bugs.freepascal.org/view.php?id=15692 > for how to fix it. This was not the problem, but reading helped - I had to enable creation of gdb debug info, to make the debugger work with Lazarus. I wonder why gdb doesn't report any errors, when running it with the same exe without debug information created? Or is the debug info essential for Lazarus?

AFAIK it doesn't ruiquire debuginfo to be present, however without info you only can run your app.

Marc

Reply by email

Hans-Peter Diettrich
to Marc Weustink: make sure you use only mingw based gdb for lazarus and not a cygwin based (cygwin has a…
> Nonetheless when I run the same program from the Lazarus IDE, no console > window opens :-( You cannot debug console apps in lazarus.

I can, on Windows. And, as I've just learned in the chat, it's also possible do debug console applications on Linux, at least as long as no console input is required. For that purpose Lazarus has to be started from a console, which then will receive all output, from Lazarus, debugger and debugged application. A bit weird, but at least I now can single step also on Linux :-)

After some more assistance I could make at least 32 bit console apps work with the 32 bit debugger on Win7/64. I wonder what's the problem with the 64 bit gdb. Both say they are mingw apps, and the 64 bit debugger also works with Lazarus 0.9.28 and fpc 2.2.4, but not with 2.4 or 2.5 :-(

DoDi

Reply by email

Marco van de Voort
to Hans-Peter Diettrich: I'm somewhat confused. There seem to exist two gdb.exe on my system, with slightly…

In our previous episode, Hans-Peter Diettrich said:

I'm somewhat confused. There seem to exist two gdb.exe on my system, with slightly different version numbers, but I can locate only one. Typically Windows - protect the system from the user :-(

Get which.cmd from http://www.robvanderwoude.com/which.php

and then use which gdb.exe to see which one it finds.

Reply by email