This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] improve debug loc of implicit reraise in sjlj blocks


In front-end sjlj mode, for handled_sequence_of_statements with actual
handlers, the code for implicit reraise of unhandled exceptions is
currently attached (debug-info-line-wise) to the first line of the
sequence.

So,

    1       procedure P is
    2       begin
    3          null;
    4          raise Constraint_Error;
    5       exception
    6          when Program_Error => null;
    7       end;

built with --RTS=sjlj on e.g. x86-linux yields:

    (gdb) b 3
    Breakpoint 1 at 0x401ee5: file p.adb, line 3. (2 locations)
    (gdb) r                                       ^^^^^^^^^^^^^
    Starting program: /home/hainque/HC12-024/p

    Breakpoint 1, p () at p.adb:3
    3          null;

    (gdb) c
    Continuing.

    Breakpoint 1, p () at p.adb:3
    3          null;

Pretty annoying.

The attached patch fixes this by attaching the implicit reraise
to the end-of-sequence sloc when we have it instead.

Bootstrapped and regtested on x86_64-linux-gnu.

Olivier

2009-07-06  Olivier Hainque  <hainque@adacore.com>

	* trans.c (Handled_Sequence_Of_Statements_to_gnu, setjmp_longjmp):
	Attach the exception propagation reraise fallback to the sequence
	end label location when we have it.

Attachment: loc.dif
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]