diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-01-31 02:13:56 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-01-31 02:13:56 +0000 |
commit | d1c7e53bc5eccf19275580fbafa3ac5f2ea919eb (patch) | |
tree | 6866d61c078ce0545d2a8c24032c3ae45bab40bc | |
parent | e2c9a72cc09e6028b4517d1a58a018976bdd0403 (diff) | |
download | gdb-d1c7e53bc5eccf19275580fbafa3ac5f2ea919eb.zip gdb-d1c7e53bc5eccf19275580fbafa3ac5f2ea919eb.tar.gz gdb-d1c7e53bc5eccf19275580fbafa3ac5f2ea919eb.tar.bz2 |
* parse.c (target_map_name_to_register): Simplify, search regs and
pseudo-regs using a single loop.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | 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 <ac131313@redhat.com> + + * parse.c (target_map_name_to_register): Simplify, search regs and + pseudo-regs using a single loop. + 2002-01-30 Andrew Cagney <ac131313@redhat.com> * 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)) { |