This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: 4.3+trunk, C/C++: fix call to start_source_file
- From: Tom Tromey <tromey at redhat dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 10 Jun 2008 18:09:14 -0600
- Subject: Patch: 4.3+trunk, C/C++: fix call to start_source_file
- Reply-to: tromey at redhat dot com
Andreas Schwab noticed some gdb test suite regressions using gcc 4.3:
http://sourceware.org/ml/gdb/2008-06/msg00075.html
I tracked this down to a bug revealed by the switch to mapped
locations.
The bug is that we pass a source_location to the start_source_file
debug hook -- but this is supposed to take a line number.
This patch fixes the problem. Bootstrapped and regtested on x86-64
(compile farm). I also ran the gdb test suite against a local (x86)
build with this patch, and this fixed the gdb test suite failures.
Ok for 4.3 and trunk?
Tom
gcc/ChangeLog:
2008-06-10 Tom Tromey <tromey@redhat.com>
* c-lex.c (fe_file_change): Pass SOURCE_LINE to start_source_file
debug hook.
Index: gcc/c-lex.c
===================================================================
--- gcc/c-lex.c (revision 136205)
+++ gcc/c-lex.c (working copy)
@@ -205,10 +205,13 @@
we already did in compile_file. */
if (!MAIN_FILE_P (new_map))
{
- int included_at = LAST_SOURCE_LINE_LOCATION (new_map - 1);
+ unsigned int included_at = LAST_SOURCE_LINE_LOCATION (new_map - 1);
+ int line = 0;
+ if (included_at > BUILTINS_LOCATION)
+ line = SOURCE_LINE (new_map - 1, included_at);
input_location = new_map->start_location;
- (*debug_hooks->start_source_file) (included_at, new_map->to_file);
+ (*debug_hooks->start_source_file) (line, new_map->to_file);
#ifndef NO_IMPLICIT_EXTERN_C
if (c_header_level)
++c_header_level;