Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 1/5] Prefer symtab symbol over minsym for function names in non-contiguous blocks
Date: Thu, 04 Jul 2019 05:03:00 -0000	[thread overview]
Message-ID: <20190703220305.0266c944@f29-4.lan> (raw)
In-Reply-To: <20190704045503.1250-2-kevinb@redhat.com>

I find the diff easier to read when the -w switch is used.  So here's
just the patch using -w:

diff --git a/gdb/stack.c b/gdb/stack.c
index b3d113d3b4..e0a7403ec0 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1134,46 +1134,6 @@ find_frame_funname (struct frame_info *frame, enum language *funlang,
 
   func = get_frame_function (frame);
   if (func)
-    {
-      /* In certain pathological cases, the symtabs give the wrong
-         function (when we are in the first function in a file which
-         is compiled without debugging symbols, the previous function
-         is compiled with debugging symbols, and the "foo.o" symbol
-         that is supposed to tell us where the file with debugging
-         symbols ends has been truncated by ar because it is longer
-         than 15 characters).  This also occurs if the user uses asm()
-         to create a function but not stabs for it (in a file compiled
-         with -g).
-
-         So look in the minimal symbol tables as well, and if it comes
-         up with a larger address for the function use that instead.
-         I don't think this can ever cause any problems; there
-         shouldn't be any minimal symbols in the middle of a function;
-         if this is ever changed many parts of GDB will need to be
-         changed (and we'll create a find_pc_minimal_function or some
-         such).  */
-
-      struct bound_minimal_symbol msymbol;
-
-      /* Don't attempt to do this for inlined functions, which do not
-	 have a corresponding minimal symbol.  */
-      if (!block_inlined_p (SYMBOL_BLOCK_VALUE (func)))
-	msymbol
-	  = lookup_minimal_symbol_by_pc (get_frame_address_in_block (frame));
-      else
-	memset (&msymbol, 0, sizeof (msymbol));
-
-      if (msymbol.minsym != NULL
-	  && (BMSYMBOL_VALUE_ADDRESS (msymbol)
-	      > BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (func))))
-	{
-	  /* We also don't know anything about the function besides
-	     its address and name.  */
-	  func = 0;
-	  funname.reset (xstrdup (MSYMBOL_PRINT_NAME (msymbol.minsym)));
-	  *funlang = MSYMBOL_LANGUAGE (msymbol.minsym);
-	}
-      else
     {
       const char *print_name = SYMBOL_PRINT_NAME (func);
 
@@ -1195,7 +1155,6 @@ find_frame_funname (struct frame_info *frame, enum language *funlang,
       if (funname == NULL)
 	funname.reset (xstrdup (print_name));
     }
-    }
   else
     {
       struct bound_minimal_symbol msymbol;


  reply	other threads:[~2019-07-04  5:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04  4:55 [PATCH v2 0/5] Non-contiguous address range bug fixes / improvements Kevin Buettner
2019-07-04  4:55 ` [PATCH v2 3/5] dwarf2-frame.c: Fix FDE processing bug involving non-contiguous ranges Kevin Buettner
2019-07-04  4:55 ` [PATCH v2 1/5] Prefer symtab symbol over minsym for function names in non-contiguous blocks Kevin Buettner
2019-07-04  5:03   ` Kevin Buettner [this message]
2019-07-04  4:55 ` [PATCH v2 2/5] Restrict use of minsym names when printing addresses in disassembled code Kevin Buettner
2019-07-19 17:07   ` Pedro Alves
2019-07-04  5:05 ` [PATCH v2 5/5] Improve test gdb.dwarf2/dw2-ranges-func.exp Kevin Buettner
2019-07-04  5:08   ` Kevin Buettner
2019-07-04  5:05 ` [PATCH v2 4/5] Allow display of negative offsets in print_address_symbolic() Kevin Buettner
2019-07-30 16:47   ` Kevin Buettner
2019-07-27 20:48 ` [PATCH v2 0/5] Non-contiguous address range bug fixes / improvements Kevin Buettner

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=20190703220305.0266c944@f29-4.lan \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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