Sign in Join

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

Mailing lists / fpc-pascal / 2009-03

Access violation during compilation and linking

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Roland Turcan

Hello all,

It often happens to me, that during compilation FPC raises an exception and often is enough just to clean up directories where are *.o and *.ppu located. Sometimes it depends also on a problem in my code, but it is very difficult to distinguish where the problem is.

Can I build FPC with debug information to get more details where the exception occured and not to get only addresses from stack, but nothing more.

Thanks.

PS: My question is related to compiler on Mac OS X 10.5

Jonas Maebe
to Roland Turcan

Roland Turcan wrote on do, 12 mrt 2009:

It often happens to me, that during compilation FPC raises an exception and often is enough just to clean up directories where are *.o and *.ppu located. Sometimes it depends also on a problem in my code, but it is very difficult to distinguish where the problem is.

Please submit bug reports (with a sample program that reproduces the problem) when it is due to a problem in your code. The compiler should never crash in that case, and such bugs are usually fairly easy to fix.

It obviously should not crash in other situations either, but it's known that a complete rewrite of the unit handling system is required to fix all crashes related to the presence of old .o/.ppu files.

Can I build FPC with debug information to get more details where the exception occured and not to get only addresses from stack, but nothing more.

You can build it with
make OPT='-O- -gl"

to include debug information and the lineinfo. This will symbolise the stack trace when it crashes (or if that does not work, you can then run it in gdb and use the "bt" command to show a stack trace when it crashes).

Jonas

---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.

Roland Turcan
to Jonas Maebe

Hello Jonas,

At first, thank you for your reply.

<<< 12.3.2009 10:09 - Jonas Maebe "" >>>
JM> Roland Turcan wrote on do, 12 mrt 2009:

> It often happens to me, that during compilation FPC raises an > exception and often is enough just to clean up directories where are > *.o and *.ppu located. Sometimes it depends also on a problem in my > code, but it is very difficult to distinguish where the problem is.

JM> Please submit bug reports (with a sample program that reproduces the JM> problem) when it is due to a problem in your code. The compiler should JM> never crash in that case, and such bugs are usually fairly easy to fix.

It is really not easy, because my project I am just fighting with has about two thousands units/forms.

JM> It obviously should not crash in other situations either, but it's JM> known that a complete rewrite of the unit handling system is required JM> to fix all crashes related to the presence of old .o/.ppu files.

> Can I build FPC with debug information to get more details where the > exception occured and not to get only addresses from stack, but > nothing more.

JM> You can build it with
JM> make OPT='-O- -gl"

JM> to include debug information and the lineinfo. This will symbolise the JM> stack trace when it crashes (or if that does not work, you can then JM> run it in gdb and use the "bt" command to show a stack trace when it JM> crashes).

I have longer time a difficulty to solve this message when I try to build fpc with "sudo make clean all":

Makefile:2279: *** No libgdb.a found, supply NOGDB=1 to disable debugger support.

of course, then I use "sudo make clean all NOGDB=1" and it builds fine, but without debugger support I need.

I am a newbie to MacOSX 10.5 and therefore I would like to ask how to install libgdb.a library which is requested.

Thanks for any reply in advance.

JM> Jonas

JM> ---------------------------------------------------------------- JM> This message was sent using IMP, the Internet Messaging Program.

JM> _______________________________________________ JM> fpc-pascal maillist -
JM> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Jonas Maebe
to Roland Turcan

Roland Turcan wrote on do, 12 mrt 2009:

Show quoted text 26 lines
<<< 12.3.2009 10:09 - Jonas Maebe "" >>> JM> Roland Turcan wrote on do, 12 mrt 2009: >> Can I build FPC with debug information to get more details where the >> exception occured and not to get only addresses from stack, but >> nothing more. JM> You can build it with JM> make OPT='-O- -gl" JM> to include debug information and the lineinfo. This will symbolise the JM> stack trace when it crashes (or if that does not work, you can then JM> run it in gdb and use the "bt" command to show a stack trace when it JM> crashes). I have longer time a difficulty to solve this message when I try to build fpc with "sudo make clean all": Makefile:2279: *** No libgdb.a found, supply NOGDB=1 to disable debugger support. of course, then I use "sudo make clean all NOGDB=1" and it builds fine, but without debugger support I need. I am a newbie to MacOSX 10.5 and therefore I would like to ask how to install libgdb.a library which is requested.

I don't understand this: the message you show only appears when building the text mode IDE, and the text mode IDE is not built for Mac OS X (unless you manually go into the IDE directory and execute make there).

The error message about "no debugger support" means that there will be no internal debugger in the IDE. It does not mean that the units or the compiler do not contain debug information.

You do not need libgdb.a (unless you want to build the text mode IDE with internal debugger support on Mac OS X, but then you are on your own -- this is not tested/supported/planned).

Jonas

---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.

C Western
to Jonas Maebe
Jonas Maebe wrote 42 lines
Roland Turcan wrote on do, 12 mrt 2009: > <<< 12.3.2009 10:09 - Jonas Maebe "" >>> > JM> Roland Turcan wrote on do, 12 mrt 2009: > >>> Can I build FPC with debug information to get more details where the >>> exception occured and not to get only addresses from stack, but >>> nothing more. > > JM> You can build it with > JM> make OPT='-O- -gl" > > JM> to include debug information and the lineinfo. This will > symbolise the > JM> stack trace when it crashes (or if that does not work, you can then > JM> run it in gdb and use the "bt" command to show a stack trace when it > JM> crashes). > > I have longer time a difficulty to solve this message when I try to > build fpc with "sudo make clean all": > > Makefile:2279: *** No libgdb.a found, supply NOGDB=1 to disable > debugger support. > > of course, then I use "sudo make clean all NOGDB=1" and it builds > fine, but without debugger support I need. > > I am a newbie to MacOSX 10.5 and therefore I would like to ask how to > install libgdb.a library which is requested. I don't understand this: the message you show only appears when building the text mode IDE, and the text mode IDE is not built for Mac OS X (unless you manually go into the IDE directory and execute make there). The error message about "no debugger support" means that there will be no internal debugger in the IDE. It does not mean that the units or the compiler do not contain debug information. You do not need libgdb.a (unless you want to build the text mode IDE with internal debugger support on Mac OS X, but then you are on your own -- this is not tested/supported/planned).

Try:
sudo make clean all NOGDB=1 DEBUG=1

The makefile probably needs some adjusment to not try and build the text mode ide on platforms for which it is not supported

Colin