Sign in Join

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

Mailing lists / fpc-devel / 2005-07

Re: Calling unassigned procedure gives no stack trace with -gl

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Tom Verhoeff
Marco van de Voort wrote 15 lines
> On Thu, Jul 14, 2005 at 10:27:01AM +0200, Peter Vreman wrote: > > > Tom Verhoeff a ?crit : > > > > > > The point is that there is no stack trace with line numbers on the > > > (obviously correct) exception, in spite of the option -gl (even when > > > explicitly using SysUtils). > > > > The problem is that the framepointer register EBP is 0 in the sigcontext. > > We can't solve this. > > So, where should a solution come from? Where in the software/hardware > chain would a change be needed to make it work properly? For *nix: prt/crt0, there is a xorl %ebp,%ebp But there might be code that relies on this (main program's parent's frame being nil)

(Continuing the thread from the fpc-pascal list on fpc-devel.)

But why then is a stack trace generated for the unhandled assert exception and not for the unhandled access violation (under Linux 386)?

Under Mac OS X (Darwin), I do get stack traces in both cases. However, in spite of compiling with -gl, I don't get line numbers in either case. What is the cause for that?

Tom

E-MAIL: T.Verhoeff @ TUE.NL | Fac. of Math. & Computing Science PHONE: +31 40 247 41 25 | Eindhoven University of Technology FAX: +31 40 247 54 04 | PO Box 513, NL-5600 MB Eindhoven http://www.win.tue.nl/~wstomv/ | The Netherlands

Reply by email

Marco van de Voort
to Tom Verhoeff
Show quoted text 11 lines
> > > > So, where should a solution come from? Where in the software/hardware > > chain would a change be needed to make it work properly? > > For *nix: prt/crt0, there is a xorl %ebp,%ebp But there might be code > that relies on this (main program's parent's frame being nil) (Continuing the thread from the fpc-pascal list on fpc-devel.) But why then is a stack trace generated for the unhandled assert exception and not for the unhandled access violation (under Linux 386)?

The first is a called procedure, the other an exception handler I guess (Peter already hinted at that).

Under Mac OS X (Darwin), I do get stack traces in both cases. However, in spite of compiling with -gl, I don't get line numbers in either case. What is the cause for that?

I don't know, but FPC/Darwin's startup mechanisms are afaik a bit different due to the mandatory libc use on Darwin. Linux and FreeBSD are by default still free of libc.

Reply by email

Peter Vreman
to Marco van de Voort
Show quoted text 15 lines
> > > So, where should a solution come from? Where in the > software/hardware > > > chain would a change be needed to make it work properly? > > > > For *nix: prt/crt0, there is a xorl %ebp,%ebp But there might be code > > that relies on this (main program's parent's frame being nil) > > (Continuing the thread from the fpc-pascal list on fpc-devel.) > > But why then is a stack trace generated for the unhandled assert > exception > and not for the unhandled access violation (under Linux 386)? The first is a called procedure, the other an exception handler I guess (Peter already hinted at that).

This is out of reach for fpc. It is the linux kernel that resets ebp register.

Show quoted text 8 lines
> Under Mac OS X (Darwin), I do get stack traces in both cases. However, > in spite of compiling with -gl, I don't get line numbers in either case. > What is the cause for that? I don't know, but FPC/Darwin's startup mechanisms are afaik a bit different due to the mandatory libc use on Darwin. Linux and FreeBSD are by default still free of libc.

The lineinfo unit doesn't support Darwin yet.

Reply by email

Jan Ruzicka
to Jonas Maebe

Hi Jonas

is there any problem with locating the stabs sections in mach-o files? Can apple documentation be used?
http://developer.apple.com/documentation/DeveloperTools/Conceptual/ MachORuntime/index.html

Is there a problem in getting legally actual values needed for the implementation?

Jan

Jonas Maebe wrote 19 lines
On 14 jul 2005, at 22:57, Tom Verhoeff wrote: > Under Mac OS X (Darwin), I do get stack traces in both cases. > However, > in spite of compiling with -gl, I don't get line numbers in either > case. > What is the cause for that? To clarify what Peter said: there is no support in the lineinfo unit yet to locate the stabs sections in mach-o files. Jonas _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Jan Ruzicka
to Jonas Maebe
Jonas Maebe wrote 13 lines
On 20 Jul 2005, at 08:38, Jan Ruzicka wrote: > s there any problem with locating the stabs sections in mach-o files? > Can apple documentation be used? > http://developer.apple.com/documentation/DeveloperTools/Conceptual/ > MachORuntime/index.html > > Is there a problem in getting legally actual values needed for the > implementation? No, it just needs someone to look it up and implement it.

Is attached patch acceptable?
Jan

Reply by email

Jan Ruzicka
to Jonas Maebe

This was just a quick fix as it works only on Power PC 32 . There should be more logic as there can be Power PC 64 (G5) or Intel processors.
Fat binaries, which can contain code versions for multiple processors.

That brings a strange question.
How can program determine where it is running?
Which processor, operating system, version of OS.?

Jan

Jonas Maebe wrote 15 lines
On 21 Jul 2005, at 09:14, Jan Ruzicka wrote: [Mac OS X lineinfo] > Is attached patch acceptable? It's perfect, I've committed it. Thanks a lot! Jonas _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email