From: Fernando Nasser <fnasser@redhat.com>
To: Elena Zannoni <ezannoni@cygnus.com>
Cc: gdb-patches@sources.redhat.com, hilfingr@otisco.mckusick.com
Subject: Re: RFA: [symfile.c} Fix to symbol_file_add()
Date: Mon, 30 Apr 2001 16:36:00 -0000 [thread overview]
Message-ID: <3AEDF6A3.440D0C62@redhat.com> (raw)
In-Reply-To: <15085.43538.55216.581538@kwikemart.cygnus.com>
Thanks for reviewing my patch so promptly Elena. Please see my comments
below.
Elena Zannoni wrote:
>
> Fernando Nasser writes:
> > Paul N. Hilfinger has pointed out to me that a few operations should be
> > done every time a new symbol file is read. This was an oversight in a
> > patch I wrote in January. The small patch attached fixes that.
> >
> > ChangeLog:
> >
> > * symfile.c (symbol_file_command): Move cleanup operations
> > from here...
> > (symbol_file_add): ...to here, so they are run every time a new
> > symbol file is read.
> >
>
> This would change the behavior of all the calls to symbol_file_add().
> Which may not be what you want.
You are right, this bits:
> > + #ifdef HPUXHPPA
> > + RESET_HP_UX_GLOBALS ();
> > + #endif
> > +
> > + set_initial_language ();
should only be done when a new "main" is loaded. I suggested moving it
to symbol_file_add_main(), which is called exactly in those cases.
However, the bit:
> > + /* Getting new symbols may change our opinion about
> > + what is frameless. */
> > + reinit_frame_cache ();
should _always_ be done, whenever we load new symbols.
What happens today, and happened _before_ my patch (it hasn't changed
any call to symbol_file_add() nor symbol_file_add() itself except for
the clear part), is that _some_ of the callers do it and some do not.
I guess this will be very difficult to control unless we move the
reinit_frame_cache () call to inside symbol_file_add().
So, I would, if you agree, post a patch (and ask Paul to help me test
it) that does:
1) Move the HP and set_initial_language() bits to symbol_file_add_main()
2) Move the reinit_frame_cache () bit to symbol_file_add(), as the
current patch does.
3) Remove the duplicate call to reinit_frame_cache () from the targets.
How does it sound?
Regards,
Fernando
> Later on in symfile.c there is another
> call to symbol_file_add which is followed by reinit_frame_cache(). In
> this case the same thing would be done twice, and in other calls it
> would be done, when it was not done before. I am not sure why the
> other calls to symbol_file_add don't reinititalize things, but it
> seems a little too risky to do this, w/o making sure those platforms
> are not affected.
>
> coff-solib.c:91: objfile = symbol_file_add (filename, from_tty,
> cxux-nat.c:370: objfile = symbol_file_add (LIBC_FILE, 0, NULL, 0, OBJF_READNOW);
> cxux-nat.c:390: symbol_file_add (path_name, 1, §ion_addrs, 0, 0);
> irix5-nat.c:850: so->objfile = symbol_file_add (so->so_name, so->from_tty,
> osfsolib.c:585: so->objfile = symbol_file_add (so->so_name, so->from_tty,
> pa64solib.c:273: so->objfile = symbol_file_add (name, from_tty, §ion_addrs, 0, OBJF_SHARED);
> remote-udi.c:1291: symbol_file_add (strtok (args, " \t"), from_tty, NULL, 1, 0);
> remote-vx.c:670: objfile = symbol_file_add (name, from_tty, NULL, 0, 0);
> solib.c:313: so->objfile = symbol_file_add (so->so_name, so->from_tty,
> somsolib.c:290: so->objfile = symbol_file_add (name, from_tty, NULL, 0, OBJF_SHARED);
> symfile.c:905: symbol_file_add (args, from_tty, NULL, 1, 0);
> symfile.c:982: symbol_file_add (name, from_tty, NULL, 1, flags);
> symfile.c:1549: symbol_file_add (filename, from_tty, §ion_addrs, 0, flags);
> win32-nat.c:444: p->ret = symbol_file_add (p->name, p->from_tty, p->addrs, p->mainline, p->flags);
>
> Since the original code substitution was to replace calls to
> symbol_file_command() with symbol_file_add_main(), I would think that
> the lines below should be left in the symbol_file_command function and
> added to symbol_file_add_main() instead, therefore preserving the
> original semantics.
>
> Elena
>
> > --
> > Fernando Nasser
> > Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
> > 2323 Yonge Street, Suite #300
> > Toronto, Ontario M4P 2C9Index: symfile.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/symfile.c,v
> > retrieving revision 1.31
> > diff -c -p -r1.31 symfile.c
> > *** symfile.c 2001/04/05 02:02:13 1.31
> > --- symfile.c 2001/04/29 16:13:12
> > *************** symbol_file_add (char *name, int from_tt
> > *** 893,898 ****
> > --- 893,907 ----
> > if (target_new_objfile_hook)
> > target_new_objfile_hook (objfile);
> >
> > + #ifdef HPUXHPPA
> > + RESET_HP_UX_GLOBALS ();
> > + #endif
> > + /* Getting new symbols may change our opinion about
> > + what is frameless. */
> > + reinit_frame_cache ();
> > +
> > + set_initial_language ();
> > +
> > return (objfile);
> > }
> >
> > *************** symbol_file_command (char *args, int fro
> > *** 980,993 ****
> > {
> > name = *argv;
> > symbol_file_add (name, from_tty, NULL, 1, flags);
> > - #ifdef HPUXHPPA
> > - RESET_HP_UX_GLOBALS ();
> > - #endif
> > - /* Getting new symbols may change our opinion about
> > - what is frameless. */
> > - reinit_frame_cache ();
> > -
> > - set_initial_language ();
> > }
> > argv++;
> > }
> > --- 989,994 ----
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
next prev parent reply other threads:[~2001-04-30 16:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-30 8:25 Fernando Nasser
2001-04-30 11:28 ` Elena Zannoni
2001-04-30 16:36 ` Fernando Nasser [this message]
2001-04-30 20:29 ` Elena Zannoni
2001-05-01 5:51 ` Fernando Nasser
[not found] ` <15087.31793.429533.289522@kwikemart.cygnus.com>
2001-05-02 8:55 ` RFA: [symfile.c} Fix to symbol_file_add() [REPOST] Fernando Nasser
[not found] ` <15088.12423.711167.908434@kwikemart.cygnus.com>
2001-05-02 9:43 ` Fernando Nasser
2001-05-02 10:26 ` Elena Zannoni
2001-05-02 11:06 ` Fernando Nasser
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=3AEDF6A3.440D0C62@redhat.com \
--to=fnasser@redhat.com \
--cc=ezannoni@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
--cc=hilfingr@otisco.mckusick.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