public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/17857] New: clear_symtab_users callers: what is the contract?
@ 2015-01-18  7:15 xdje42 at gmail dot com
  2015-01-18 20:26 ` [Bug python/17857] " xdje42 at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: xdje42 at gmail dot com @ 2015-01-18  7:15 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17857

            Bug ID: 17857
           Summary: clear_symtab_users callers: what is the contract?
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: xdje42 at gmail dot com

I noticed this in compile-object-run.c:

  ALL_OBJFILES (objfile)
    if ((objfile->flags & OBJF_USERLOADED) == 0
        && (strcmp (objfile_name (objfile), data->objfile_name_string) == 0))
      {
        free_objfile (objfile);

        /* It may be a bit too pervasive in this dummy_frame dtor callback.  */
        clear_symtab_users (0);

        break;
      }

That got me looking elsewhere.

The documentation for the python clear_objfiles event says this:

@item events.clear_objfiles
Emits @code{gdb.ClearObjFilesEvent} which indicates that the list of object
files for a program space has been reset.

The term "reset" here essentially means that the list of objfiles has been
emptied.  This event gets triggered by clear_symtab_users because of this call:

  observer_notify_new_objfile (NULL);

btw, There's no event for an individual objfile going away (e.g., dlclose) but
there should be.

I can imagine some python code hooking into the clear_objfile, new_objfile
events and expecting that monitoring these events will given them an accurate
view of the world. But that won't be the case if random code in gdb expects to
be able to call clear_symtab_users for cases such as the above.

We need reconcile how clear_symtab_users is currently used by all its callers
with the fact that the clear_objfiles event is being erroneously triggered by
many of those callers.
That may involve a new event or a second clear_symtab_users-like function or
both.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug python/17857] clear_symtab_users callers: what is the contract?
  2015-01-18  7:15 [Bug python/17857] New: clear_symtab_users callers: what is the contract? xdje42 at gmail dot com
@ 2015-01-18 20:26 ` xdje42 at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: xdje42 at gmail dot com @ 2015-01-18 20:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17857

--- Comment #1 from Doug Evans <xdje42 at gmail dot com> ---
I think(!) the thing to do, or at least one of the things to do, is reword what
the clear_objfiles event means.  It doesn't mean that the objfile list is now
empty.  It means that symbol table data has been reset in an indeterminate way.
It would be nice to say more, but I'm not sure how.

Thus the event is misnamed, but oh well.

We can certainly add more events if/when they prove useful enough.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-18 20:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-18  7:15 [Bug python/17857] New: clear_symtab_users callers: what is the contract? xdje42 at gmail dot com
2015-01-18 20:26 ` [Bug python/17857] " xdje42 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).