From d1c7e53bc5eccf19275580fbafa3ac5f2ea919eb Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 31 Jan 2002 02:13:56 +0000 Subject: [PATCH] * parse.c (target_map_name_to_register): Simplify, search regs and pseudo-regs using a single loop. --- gdb/ChangeLog | 5 +++++ gdb/parse.c | 12 ++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 848af85..b2068fa 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-01-29 Andrew Cagney + + * parse.c (target_map_name_to_register): Simplify, search regs and + pseudo-regs using a single loop. + 2002-01-30 Andrew Cagney * PROBLEMS: Note that the i386 fix was missing from 5.1.1. diff --git a/gdb/parse.c b/gdb/parse.c index 75f93fe..b3fbe19 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -117,16 +117,8 @@ target_map_name_to_register (char *str, int len) { int i; - /* Search architectural register name space. */ - for (i = 0; i < NUM_REGS; i++) - if (REGISTER_NAME (i) && len == strlen (REGISTER_NAME (i)) - && STREQN (str, REGISTER_NAME (i), len)) - { - return i; - } - - /* Try pseudo-registers, if any. */ - for (i = NUM_REGS; i < NUM_REGS + NUM_PSEUDO_REGS; i++) + /* Search register name space. */ + for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++) if (REGISTER_NAME (i) && len == strlen (REGISTER_NAME (i)) && STREQN (str, REGISTER_NAME (i), len)) { -- 2.7.4