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]

[patch] Set is_stmt flag to 0 in DWARF line number table for discriminators


This is a followup to the patch I checked in recently to add
discriminators to the DWARF line number table:

  http://gcc.gnu.org/ml/gcc-patches/2009-06/msg00443.html

That patch caused a couple of gdb testsuite regressions because of
extra rows in the line number table that would not have been there
otherwise. The effect was that gdb would occasionally set extra
breakpoints or stop at unexpected places when single stepping because
of those extra rows. The solution is to mark the new rows with the
is_stmt flag set to 0, and to teach gdb to ignore any rows where
is_stmt == 0. This patch does the first part; I've submitted a patch
for the second part to the gdb-patches mailing list:

  http://sourceware.org/ml/gdb-patches/2009-06/msg00406.html

While I was at it, I converted the conditional compilation using
#ifdef HAVE_GAS_DISCRIMINATOR into a runtime test on
SUPPORTS_DISCRIMINATOR, to make things look a bit cleaner (as
suggested offline by Ian).

Bootstrapped and tested on x86_64-unknown-linux-gnu. Also tested with
the gdb testsuite, where it (with the gdb patch) fixes all regressions
that were caused by my original discriminator patch.

OK for trunk?

-cary


	* dbxout.c (dbxout_source_line): Add is_stmt parameter.
	Change caller.
	* debug.c (struct gcc_debug_hooks): Change placeholder for
	source_line hook.
	(debug_nothing_int_charstar_int): Replaced by...
	(debug_nothing_int_charstar_int_bool): ...this.
	* debug.h (struct gcc_debug_hooks): Add is_stmt parameter to
	source_line prototype.
	(debug_nothing_int_charstar_int): Replaced by...
	(debug_nothing_int_charstar_int_bool): ...this.
	* defaults.h (SUPPORTS_DISCRIMINATOR): New constant.
	* dwarf2out.c (dwarf2out_source_line): Add is_stmt parameter.
	Output is_stmt operand when necessary.
	* final.c (last_is_stmt): New variable.
	(final_start_function): Initialize last_is_stmt.
	(final_scan_insn): Pass is_stmt to source_line debug hook.
	(notice_source_line): Add is_stmt parameter.
	* sdbout.c (sdbout_source_line): Add is_stmt parameter.
	* vmsdbgout.c (vmsdbgout_source_line): Add is_stmt parameter.
	Change callers.
	* xcoffout.c (xcoffout_source_line): Add is_stmt parameter.
	* xcoffout.h (xcoffout_source_line): Add is_stmt parameter.

Attachment: gcc-isstmt-patch.txt
Description: Text document


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