c-lex.c (fe_file_change): Pass SOURCE_LINE to start_source_file debug hook.
authorTom Tromey <tromey@redhat.com>
Wed, 11 Jun 2008 00:18:49 +0000 (00:18 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Wed, 11 Jun 2008 00:18:49 +0000 (00:18 +0000)
* c-lex.c (fe_file_change): Pass SOURCE_LINE to start_source_file
debug hook.

From-SVN: r136647

gcc/ChangeLog
gcc/c-lex.c

index 63035a09edfa8ff6071b282b960fd2fb7798ecfb..90f0ebde511ee5f2eb25f09877cef8e25e11aff9 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-10  Tom Tromey  <tromey@redhat.com>
+
+       * c-lex.c (fe_file_change): Pass SOURCE_LINE to start_source_file
+       debug hook.
+
 2008-06-10  Joseph Myers  <joseph@codesourcery.com>
 
        * dfp.c (WORDS_BIGENDIAN): Define to 0 if not defined.
index c3e7f6e3a166f73a6de7d6d195fda71f8b6d508e..c2a0fa350b53c070c4b558a9fdda1c861b335dae 100644 (file)
@@ -205,10 +205,13 @@ fe_file_change (const struct line_map *new_map)
         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;