Re: [patch] Replace reread_symbols by load+free calls

Tom Tromey
2009-08-17T15:31:04Z

>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:

Pedro> There were also some FIXME comments related to bfd_get_mtime
Pedro> in the patch that looked like misunderstandings, and that threw
Pedro> me off. Maybe I just didn't understand them. :-/

I was wondering about those too.

Pedro> There's also this comment in the current code that makes that
Pedro> suggested change scare me:
Pedro> /* There are various functions like symbol_file_add,
Pedro> symfile_bfd_open, syms_from_objfile, etc., which might
Pedro> appear to do what we want. But they have various other
Pedro> effects which we *don't* want. So we just do stuff
Pedro> ourselves. (...) */
Pedro> ... as we'd be going in the opposite direction (the patch uses
Pedro> symbol_file_add).

That comment looks stale. It mentions mapped files, as well, which IIUC
gdb hasn't had for years.

Pedro> I wonder how much would we simplify reread_symbols by moving the
Pedro> each-objfile rereading code to objfile.c, and refactor it to share code
Pedro> with allocate_objfile, free_objfile, etc., and thus also making it easier
Pedro> to make hooks and observers be consistent.

Yeah, that would work for me.

Tom