From patchwork Thu Apr 21 12:59:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 92409 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 98552B7028 for ; Thu, 21 Apr 2011 23:00:20 +1000 (EST) Received: (qmail 32406 invoked by alias); 21 Apr 2011 13:00:18 -0000 Received: (qmail 32390 invoked by uid 22791); 21 Apr 2011 13:00:17 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Apr 2011 13:00:01 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 1039ECB0232 for ; Thu, 21 Apr 2011 15:00:00 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z040T6lnYFq2 for ; Thu, 21 Apr 2011 14:59:57 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 11617CB01D8 for ; Thu, 21 Apr 2011 14:59:57 +0200 (CEST) From: Tristan Gingold Subject: [vms/committed]: avoid wrong output by vmsdbgout.c for long path Date: Thu, 21 Apr 2011 14:59:56 +0200 Message-Id: To: "gcc-patches@gcc.gnu.org Patches" Mime-Version: 1.0 (Apple Message framework v1084) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, vmsdbgout could generate buggy records for long path. This happened while cross-compiling. Committed on trunk. Tristan. 2011-04-21 Tristan Gingold * vmsdbgout.c (write_srccorr): Compute file length from the string. (dst_file_info_struct): Remove flen field. (lookup_filename): Remove code that set flen field. Index: gcc/vmsdbgout.c =================================================================== --- gcc/vmsdbgout.c (revision 172821) +++ gcc/vmsdbgout.c (working copy) @@ -71,7 +71,6 @@ long ebk; short ffb; char rfo; - char flen; } dst_file_info_entry; @@ -932,7 +931,7 @@ int src_command_size; int linesleft = file_info_entry.max_line; int linestart = file_info_entry.listing_line_start; - int flen = file_info_entry.flen; + int flen = strlen (file_info_entry.file_name); int linestodo = 0; DST_SOURCE_CORR src_header; DST_SRC_COMMAND src_command; @@ -977,7 +976,7 @@ src_command.dst_a_src_cmd_fields.dst_a_src_decl_src.dst_b_src_df_rms_rfo = file_info_entry.rfo; src_command.dst_a_src_cmd_fields.dst_a_src_decl_src.dst_b_src_df_filename - = file_info_entry.flen; + = flen; src_header.dst_a_source_corr_header.dst__header_length.dst_w_length = DST_K_SOURCE_CORR_HEADER_SIZE + src_command_size - 1; @@ -1332,7 +1331,6 @@ register char *fn; register unsigned i; const char *fnam; - char flen; long long cdt = 0; long ebk = 0; short ffb = 0; @@ -1341,7 +1339,6 @@ int ver = 0; fnam = full_name (file_name); - flen = strlen (fnam); /* Check to see if the file name that was searched on the previous call matches this file name. If so, return the index. */ @@ -1386,7 +1383,6 @@ file_info_table[file_info_table_in_use].ebk = ebk; file_info_table[file_info_table_in_use].ffb = ffb; file_info_table[file_info_table_in_use].rfo = rfo; - file_info_table[file_info_table_in_use].flen = flen; last_file_lookup_index = file_info_table_in_use++; return last_file_lookup_index;