Sign in Join

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

Mailing lists / lazarus / 2010-07

GDB crash when I try to debug

14 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

Pierre Delore

Hi all,

I wrote a application with lazarus the last stable version of Lazarus 0.9.28.2 (under winxp). I released 2 versions of my program without problem.

Last week I tried to modify my application. When I launch the application in debug mode, gdb crashed. I restored the previous version of the application => same problem (2 months ago I had no problem). I tried with an other application => Ok

I re-installed lazarus => same problem

Probably one the program I installed in the last month modify a setting but I don't find what.

An idea?

Regards

Reply by email

Tobias Giesen
to Pierre Delore

Hi,

I've had the same problem on Mac OS X for around 2 years. Incidentally, the project which I cannot debug is larger than the one that I can debug. But that is probably just a coincidence.

gdb crashes trying to load the symbols. I don't know of any solution.

Cheers,
Tobias

Reply by email

Pierre Delore
to Tobias Giesen

Hi,

I also tried to execute my program directly from gdb (gdb app_name + r) => same problem.

During the last 2 months I installed Delphi 6 and Code composer studio (for TI Chronos watch). They probably modified something.

I tried to modify some compiler settings but nothing changed.

Pierre Delore http://datalinkwristapps.free.fr http://dpsite.free.fr ----- "Tobias Giesen" a ?crit : > Hi, > > are there tools to dump the symbolic information, stabs or dwarf, and > maybe even manipulate it so we can try to find which part is causing > gdb to crash? > > Cheers, > Tobias > > > > -- > _______________________________________________ > 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/20100716/8438cda3/attachment.html>

Reply by email

Tobias Giesen
to Pierre Delore: I wrote a application with lazarus the last stable version of Lazarus 0.9.28.2 (under…

Hi,

now I removed a few dozen units from the application and the debugging works. If only I could find out what exactly the debugger does not like in these units.

Unfortunately, $D- in these units does not have the same positive effect as cutting the units completely. So I guess I will have to use conditional compilation to have a debuggable version of my app, which will however lack some important features.

Again this is on Mac OS X 10.5 and gdb says Segmentation Fault loading the project when it contains these units.

Cheers,
Tobias

Reply by email

waldo kitty
to Tobias Giesen
Tobias Giesen wrote 5 lines
Hi, now I removed a few dozen units from the application and the debugging works. If only I could find out what exactly the debugger does not like in these units.

i would be adding them back in, one at the time, and only one each time while removing the previous, to see if it breaks again... it could be that a combination breaks the debugger...

Unfortunately, $D- in these units does not have the same positive effect as cutting the units completely.

that sounds like maybe a bug of some sort... are these only FPC related units or do they also use LCL??

Reply by email

Tobias Giesen
to waldo kitty
i would be adding them back in, one at the time, and only one each time while removing the previous, to see if it breaks again... it could be that a combination breaks the debugger...

Yes I will do something like that, maybe I can even create a minimal project with only one unit that breaks it. I will try!

They are mostly just hashing and encryption algorithms with some assembler but one of them has some GUI stuff as well.

Cheers,
Tobias

Reply by email

waldo kitty
to Tobias Giesen
Tobias Giesen wrote 9 lines
> i would be adding them back in, one at the time, and only one each > time while removing the previous, to see if it breaks again... it > could be that a combination breaks the debugger... Yes I will do something like that, maybe I can even create a minimal project with only one unit that breaks it. I will try! They are mostly just hashing and encryption algorithms with some assembler but one of them has some GUI stuff as well.

mmmm.... i have to wonder, without knowing more, about that assembler code... maybe it is causing problems?

in any case, yes, i'd still do as i suggest above... it would be good if you can determine which unit(s) is/are the problem and then figure out how to fix them ;)

Reply by email

Bogusław Brandys
to waldo kitty

waldo kitty pisze:

Show quoted text 18 lines
On 7/20/2010 02:52, Tobias Giesen wrote: >> i would be adding them back in, one at the time, and only one each >> time while removing the previous, to see if it breaks again... it >> could be that a combination breaks the debugger... > > Yes I will do something like that, maybe I can even create a minimal > project with only one unit that breaks it. I will try! > > They are mostly just hashing and encryption algorithms with some > assembler but one of them has some GUI stuff as well. mmmm.... i have to wonder, without knowing more, about that assembler code... maybe it is causing problems? in any case, yes, i'd still do as i suggest above... it would be good if you can determine which unit(s) is/are the problem and then figure out how to fix them ;)

I think gdb should dump to file the list of loaded units before loading each one ,such feature would have perfect sense to me. Is there something we can do about it ?

Boguslaw

Reply by email

Tobias Giesen
to Bogusław Brandys

Hello,

I found out the most incredible thing. When I add this stripped-down unit to my program, GDB will crash loading it. When I remove the line in the initialization section, it works. When I rename the unit, it works also. So I can easily work around the problem, but maybe a more generic solution should be made in FPC? Should I submit it as an FPC bug?

unit ZFUSysUtils;
interface
uses
  SysUtils,Types;
var
  Win32PlatformIsUnicode: Boolean;
  Win32PlatformIsXP: Boolean;
  Win32PlatformIs2003: Boolean;
  Win32PlatformIsVista: Boolean;
implementation
initialization
  Win32PlatformIsUnicode := true;
end.

Cheers,
Tobias

Reply by email

Martin
to Tobias Giesen: I found out the most incredible thing. When I add this stripped-down unit to my program,…
Tobias Giesen wrote 8 lines
Hello, I found out the most incredible thing. When I add this stripped-down unit to my program, GDB will crash loading it. When I remove the line in the initialization section, it works. When I rename the unit, it works also. So I can easily work around the problem, but maybe a more generic solution should be made in FPC? Should I submit it as an FPC bug?

Which Version of GDB do you have ?

It works fine here:
Windows Vista 32bit
Lazaus trunc
fpc 2.5.1 (trunk a few weeks old)
gdb 7.0 or gdb 6.8.3
stabs or dwarf

If it is related to symbols, try the external linker -Xe, try dwarf instead of stabs (or vice versa).... smart linking or not...

Switch you AntiVirus off for testing => mine is always disliking gdb.

Martin

Reply by email

Pierre Delore
to Martin

Hi,

I compiled and ran my application in a virtual machine without any problem. So the problem come from my system (win XP SP3). Probably a conflict between gdb and a dll. I think it doesn't come directly from gdb because I re-install lazarus (with gdb) 3 days ago.

Somebody know which dll are used by gdb?

Regards,

Pierre Delore http://datalinkwristapps.free.fr http://dpsite.free.fr ----- "Martin" a ?crit : > On 20/07/2010 22:20, Tobias Giesen wrote: > > Hello, > > > > I found out the most incredible thing. When I add this stripped-down > > unit to my program, GDB will crash loading it. When I remove the line > > in the initialization section, it works. When I rename the unit, it > > works also. So I can easily work around the problem, but maybe a more > > generic solution should be made in FPC? Should I submit it as an FPC bug? > > > Which Version of GDB do you have ? > > It works fine here: > Windows Vista 32bit > Lazaus trunc > fpc 2.5.1 (trunk a few weeks old) > gdb 7.0 or gdb 6.8.3 > stabs or dwarf > > If it is related to symbols, try the external linker -Xe, try dwarf > instead of stabs (or vice versa).... smart linking or not... > > Switch you AntiVirus off for testing => mine is always disliking gdb. > > Martin > > -- > _______________________________________________ > 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/20100721/7c69e5e0/attachment.html>

Reply by email