Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de>
To: dberlin@redhat.com (Daniel Berlin)
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: symtab.h: 2000-10-12 SYMBOL_INIT_DEMANGLED_NAME change, why ?
Date: Sat, 28 Oct 2000 12:55:00 -0000	[thread overview]
Message-ID: <200010281955.VAA14340@reisser.regent.e-technik.tu-muenchen.de> (raw)
In-Reply-To: <m31yx0oj98.fsf@dan2.cygnus.com>

> There is no noticeable speed decrease due to this change.
> I originally thought the  actual likely culprit is somewhere in the stabsreader, the
> SYMBOL_LANGUAGE not getting set in all cases.
> But it turned out the current file's language was language_unknown for
> some reason, at the point it wanted to set the symbol language.
> However, I couldn't follow all the codepaths to track this down, due
> to the gotos.
> I didn't feel like wasting any more time on it, so i just fixed the
> symptom, as you said.

I would be volunteering to `waste' more time on it, if you can provide
an example, as I'd rather like to fix the cause.

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de
From kevinb@cygnus.com Sat Oct 28 14:34:00 2000
From: Kevin Buettner <kevinb@cygnus.com>
To: Elena Zannoni <ezannoni@redhat.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: [PATCH RFA] dwarf2read.c: symbol relocation in new_symbol()
Date: Sat, 28 Oct 2000 14:34:00 -0000
Message-id: <1001028213434.ZM3907@ocotillo.lan>
X-SW-Source: 2000-10/msg00260.html
Content-length: 1725

AIX5/IA-64 relocates read-only and read/write sections by different
amounts.  The patch below fixes dwarf2read.c to account for this
scenario.

I was tempted to try to fix the other occurrences of baseaddr in
this file, but decided to leave that for one our symtabs/dwarf2
experts.

I've tested this patch on linux/x86 w/ -gdwarf-2 and saw no
regressions.  (I've also done some limited testing on AIX5 and it does
indeed fix the problems that I was seeing.)

Okay to commit?

	* dwarf2read.c (new_symbol): Relocate address of symbol by the
	base address of the section it is in rather than always using
	the base address of the .text section.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.16
diff -u -p -r1.16 dwarf2read.c
--- dwarf2read.c	2000/08/04 16:51:47	1.16
+++ dwarf2read.c	2000/10/28 20:59:09
@@ -4185,7 +4185,10 @@ new_symbol (struct die_info *die, struct
 		     the variable is referenced.  */
 		  if (SYMBOL_VALUE_ADDRESS (sym))
 		    {
-		      SYMBOL_VALUE_ADDRESS (sym) += baseaddr;
+		      fixup_symbol_section (sym, objfile);
+		      SYMBOL_VALUE_ADDRESS (sym) +=
+			ANOFFSET (objfile->section_offsets,
+			          SYMBOL_SECTION (sym));
 		      SYMBOL_CLASS (sym) = LOC_STATIC;
 		    }
 		  else
@@ -4215,8 +4218,11 @@ new_symbol (struct die_info *die, struct
 		    }
 		  else
 		    {
+		      fixup_symbol_section (sym, objfile);
 		      SYMBOL_CLASS (sym) = LOC_STATIC;
-		      SYMBOL_VALUE_ADDRESS (sym) = addr + baseaddr;
+		      SYMBOL_VALUE_ADDRESS (sym) =
+		        addr + ANOFFSET (objfile->section_offsets,
+			                 SYMBOL_SECTION (sym));
 		    }
 		}
 	    }


       reply	other threads:[~2000-10-28 12:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m31yx0oj98.fsf@dan2.cygnus.com>
2000-10-28 12:55 ` Peter.Schauer [this message]
2000-10-28 15:31   ` Daniel Berlin
     [not found] <200010281225.OAA13546@reisser.regent.e-technik.tu-muenchen.de>
2000-10-28 10:02 ` Daniel Berlin

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=200010281955.VAA14340@reisser.regent.e-technik.tu-muenchen.de \
    --to=peter.schauer@regent.e-technik.tu-muenchen.de \
    --cc=dberlin@redhat.com \
    --cc=gdb-patches@sourceware.cygnus.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