From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20397 invoked by alias); 23 Feb 2009 16:40:02 -0000 Received: (qmail 20247 invoked by uid 48); 23 Feb 2009 16:40:00 -0000 Date: Mon, 23 Feb 2009 16:40:00 -0000 From: "richard dot stuckey at arc dot com" To: gdb-prs@sourceware.org Message-ID: <20090223163959.9884.richard.stuckey@arc.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug gdb/9884] New: Inefficient code in function default_print_registers_info X-Bugzilla-Reason: CC 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 X-SW-Source: 2009-q1/txt/msg00290.txt.bz2 In the function default_print_registers_info in the file infcmd.c, there is the code /* If the register name is empty, it is undefined for this processor, so don't display anything. */ if (gdbarch_register_name (gdbarch, i) == NULL || *(gdbarch_register_name (gdbarch, i)) == '\0') continue; fputs_filtered (gdbarch_register_name (gdbarch, i), file); print_spaces_filtered (15 - strlen (gdbarch_register_name (gdbarch, i)), file); i.e. the function gdbarch_register_name may be called up to four times for each register; it would be better to replace this code with { const char* name = gdbarch_register_name (gdbarch, i); /* If the register name is empty, it is undefined for this processor, so don't display anything. */ if (name == NULL || *name == '\0') continue; fputs_filtered (name, file); print_spaces_filtered (15 - strlen (name), file); } -- Summary: Inefficient code in function default_print_registers_info Product: gdb Version: 6.8 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: gdb AssignedTo: unassigned at sourceware dot org ReportedBy: richard dot stuckey at arc dot com CC: gdb-prs at sourceware dot org http://sourceware.org/bugzilla/show_bug.cgi?id=9884 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.