This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch/mips] small cleanup (unused variables, comments, etc)


Still in my quest to eliminate the proc_desc from the heuristic cases,
here is a small cleanup patch that helps in that direction. A couple
of changes are worth mentioning (the same change, but both in mips16
and mips32):

+    /* We can't analyze the prologue if we couldn't find the begining
+       of the function.  */
+    if (start_addr == 0)
+      return cache;

This is the only case when heuristic_proc_desc would abort early
and return a NULL proc_desc address. So I added this check in the
caller so that we no longer need to check whether the returned
proc desc was null or not. This allows me to get rid of proc_desc
in mips_insn32_frame_cache() as well as mips_insn16_frame_cache.

The rest is just obvious stuff (unused variables, out of date
comments).

2004-10-10  Joel Brobecker  <brobecker@gnat.com>

        * mips-tdep.c (mips_insn16_frame_cache): Remove unused variables.
        Update comments. Also immediately return empty cache when the start
        address of our function could not be found.
        (mips_insn32_frame_cache): Likewise.

It seems simple enough that I didn't run the testuite, just checked
that it builds. I will run the testsuite tonight, after I have done
all the changes I can squeeze in this evening (I just don't want to
have to run the testuite for each of the numerous little steps I am
making).

Committing now,
-- 
Joel

Attachment: mips-tdep.c.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]