From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24643 invoked by alias); 1 Dec 2014 21:12:24 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 24615 invoked by uid 48); 1 Dec 2014 21:12:24 -0000 From: "larue at cadence dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/9885] field for register names too narrow Date: Mon, 01 Dec 2014 21:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 6.8 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: larue at cadence dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 6.8 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00329.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=9885 --- Comment #2 from larue at cadence dot com --- Oops, accidentally saved before pasting in the patch (shown below): char * n_spaces (int n) { char *t; static char *spaces = 0; static int max_spaces = -1; /* Prevent heap corruption if n is negative (which occurs if default_print_one_register_info is called with a register whose name is > 15 characters long */ if (n < 0) n = 0; if (n > max_spaces) { if (spaces) xfree (spaces); spaces = (char *) xmalloc (n + 1); for (t = spaces + n; t != spaces;) *--t = ' '; spaces[n] = '\0'; max_spaces = n; } return spaces + max_spaces - n; } -- You are receiving this mail because: You are on the CC list for the bug.