Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@gnat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] inline find_proc_desc into mips_insn32_frame_cache
Date: Wed, 01 Sep 2004 18:47:00 -0000	[thread overview]
Message-ID: <20040901184716.GB978@gnat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 580 bytes --]

Re: http://sources.redhat.com/ml/gdb-patches/2004-09/msg00009.html

Implements the suggested inlining. I also removed some dead code.
This doesn't fix yet the unwinder problem I reported in

        http://sources.redhat.com/ml/gdb-patches/2004-07/msg00319.html

I'll do that separately.

2004-09-01  Joel Brobecker  <brobecker@gnat.com>

	* mips-tdep.c (linked_proc_desc_table): Delete, not used.
        (mips_insn32_frame_cache): Inline call to find_proc_desc.
        (find_proc_desc): Remove dead code.

Tested on mips-irix 6.5, no regression.
OK to apply?

Thanks,
-- 
Joel

[-- Attachment #2: inline.diff --]
[-- Type: text/plain, Size: 2235 bytes --]

Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.310
diff -u -p -r1.310 mips-tdep.c
--- mips-tdep.c	9 Aug 2004 05:45:20 -0000	1.310
+++ mips-tdep.c	1 Sep 2004 18:40:28 -0000
@@ -661,13 +661,6 @@ static unsigned int heuristic_fence_post
 #define PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym == _PROC_MAGIC_)
 #define SET_PROC_DESC_IS_DUMMY(proc) ((proc)->pdr.isym = _PROC_MAGIC_)
 
-struct linked_proc_info
-{
-  struct mips_extra_func_info info;
-  struct linked_proc_info *next;
-}
- *linked_proc_desc_table = NULL;
-
 /* Number of bytes of storage in the actual machine representation for
    register N.  NOTE: This defines the pseudo register type so need to
    rebuild the architecture vector.  */
@@ -2080,8 +2073,18 @@ mips_insn32_frame_cache (struct frame_in
   (*this_cache) = cache;
   cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
 
-  /* Get the mdebug proc descriptor.  */
-  proc_desc = find_proc_desc (frame_pc_unwind (next_frame), next_frame, 1);
+  /* Synthesize a proc descriptor.  */
+  {
+    const CORE_ADDR pc = frame_pc_unwind (next_frame);
+    CORE_ADDR start_addr;
+
+    find_pc_partial_function (pc, NULL, &start_addr, NULL);
+    if (start_addr == 0)
+      start_addr = heuristic_proc_start (pc);
+
+    proc_desc = heuristic_proc_desc (start_addr, pc, next_frame, 1);
+  }
+  
   if (proc_desc == NULL)
     /* I'm not sure how/whether this can happen.  Normally when we
        can't find a proc_desc, we "synthesize" one using
@@ -3186,18 +3189,6 @@ find_proc_desc (CORE_ADDR pc, struct fra
     }
   else
     {
-      /* Is linked_proc_desc_table really necessary?  It only seems to be used
-         by procedure call dummys.  However, the procedures being called ought
-         to have their own proc_descs, and even if they don't,
-         heuristic_proc_desc knows how to create them! */
-
-      struct linked_proc_info *link;
-
-      for (link = linked_proc_desc_table; link; link = link->next)
-	if (PROC_LOW_ADDR (&link->info) <= pc
-	    && PROC_HIGH_ADDR (&link->info) > pc)
-	  return &link->info;
-
       if (startaddr == 0)
 	startaddr = heuristic_proc_start (pc);
 

             reply	other threads:[~2004-09-01 18:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-01 18:47 Joel Brobecker [this message]
2004-09-01 19:20 ` Andrew Cagney
2004-09-01 20:43   ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040901184716.GB978@gnat.com \
    --to=brobecker@gnat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox