Sign in Join

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

Mailing lists / fpc-pascal / 2007-03

GDB issues with the latest unstable FPC...

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

m utku

Hi all,

I am using an unstable fpc version(2.1.1 -- snapshot from last week). While debugging my specific project, GDB(6.4 - Debian Sarge) seems to be wrong about the function locations so I cannot use breakpoints. I'd guess that this is a fpc bug about generated debug symbols. Is this is a known-unhandled issue or am I possibly doing something wrong?

Thanks,
Utku.

Reply by email

Jonas Maebe
to m utku
m utku wrote
I am using an unstable fpc version(2.1.1 -- snapshot from last week). While debugging my specific project, GDB(6.4 - Debian Sarge) seems to be wrong about the function locations so I cannot use breakpoints.

Do line numbers work?

I'd guess that this is a fpc bug about generated debug symbols. Is this is a known-unhandled issue or am I possibly doing something wrong?

No, it's not known.

Jonas

Reply by email

m utku

Jonas Maebe wrote
in

Show quoted text 9 lines
On 02 Mar 2007, at 08:56, m utku wrote: > I am using an unstable fpc version(2.1.1 -- snapshot from last > week). While debugging my specific project, GDB(6.4 - Debian Sarge) > seems to be wrong about the function locations so I cannot use > breakpoints. Do line numbers work?

Yes, indeed I can use dump_stack without problems but still no luck with breakpoints. I can always reproduce this case:

(1) declare a test function like:
procedure foobar;
begin
// some code to avoid smart link elimination, just in case.
end;

(2) when I set a breakpoint in gdb, the filename and line of this breakpoint points to a wrong unit and lineno.

(3) interestingly, the map file generated by the linker doesn't even contain the foobar entry. (no optimization commands passed to compiler so it shouldn't be eliminated.)

ps. currently I was cross-linking from Windows, I will try a native build next...

Regards,
Utku.

Reply by email

Jonas Maebe
to m utku
m utku wrote 10 lines
> Do line numbers work? Yes, indeed I can use dump_stack without problems but still no luck with breakpoints. I can always reproduce this case: (1) declare a test function like: procedure foobar; begin // some code to avoid smart link elimination, just in case. end;

Smartlinking happens depending on whether or not the procedure is reachable from the entry point of the program, not depending on whether or not it contains code.

(2) when I set a breakpoint in gdb, the filename and line of this breakpoint points to a wrong unit and lineno.

How do you try to set the breakpoint? You can either use: a) b FOOBAR
b) b sourcefile.pas:linenr

I guess you are using a) (of course that should work as well)

(3) interestingly, the map file generated by the linker doesn't even contain the foobar entry. (no optimization commands passed to compiler so it shouldn't be eliminated.)

Your default configuration file may contain -CX -XX. Alternatively, you may be looking for the wrong symbol name. It will be called something like P$PROGRAM_FOOBAR

Jonas

Reply by email

m utku

Jonas Maebe wrote
in

Show quoted text 5 lines
How do you try to set the breakpoint? You can either use: a) b FOOBAR b) b sourcefile.pas:linenr I guess you are using a) (of course that should work as well)

Another interesting thing is that I can set this with "b foobar" not "b FOOBAR". AFAICR documents were telling the reverse.

And also even if I set the breakpoint succesully with "b foobar", it will never trigger.

Your default configuration file may contain -CX -XX. Alternatively, you may be looking for the wrong symbol name. It will be called something like P$PROGRAM_FOOBAR

Nope, no smartlinking and no "foobar" text in the map file FYI.

Regards, M. Utku Karatas

Reply by email