From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11853 invoked by alias); 22 Jul 2006 16:36:39 -0000 Received: (qmail 11776 invoked by uid 48); 22 Jul 2006 16:36:32 -0000 Date: Sat, 22 Jul 2006 16:36:00 -0000 Message-ID: <20060722163632.11775.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug debug/25468] [4.0/4.1/4.2 Regression] -g makes g++ loop forever In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "steven at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-07/txt/msg01700.txt.bz2 List-Id: ------- Comment #5 from steven at gcc dot gnu dot org 2006-07-22 16:36 ------- We do the loop-and-putc thing in ASM_OUTPUT_LIMITED_STRING and in dw2_asm_output_nstring as well. Probably it's best to add some kind of generic "escaped string" print function, something like the one below that I'll try to actually make work: void asm_output_string_with_escapes (const char *str, size_t len, const char escapes[255], const char *escapes_fmt /* e.g. "\\%03o" */ size_t escapes_fmt_len) { size_t i, j, len, escaped_len; char *escaped_str; escaped_len = len; for (i = 0; i < len; i++) { int c = str[i]; if (c == '\"' || c == '\\') escaped_len++; else if (escapes[c]) escaped_len += escapes_fmt_len; } str = xmalloc (escaped_len + 1); for (i = 0, j = 0; i < len; i++) { int c = str[i]; if (!escapes[c]) { if (c == '\"' || c == '\\') escaped_str[j++] = '\\'; escaped_str[j++] = c; } else { /* ??? Must also handle things like \t and \b here. */ snprintf (&escaped_str[j], escapes_fmt_len, escapes_fmt, c); j += escapes_fmt_len; } } escaped_str[j] = '\0'; fputs (escaped_str, asm_out_file); free (escaped_str); } -- steven at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |steven at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2006-02-08 04:02:15 |2006-07-22 16:36:32 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25468