This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bfd_preserve may cause memory leaks


bfd_preserve is a mechanism used to save/restore the state
of a bfd while sniffing a file, and I think it's going to
cause memory leaks.  does anyone care?  I don't think it's
an issue for binutils, since most of those programs finish
relatively quickly.  it might be an issue for gdb if someone
uses the same gdb process for multiple debugging sessions,
eg, treating gdb more like an application than a utility.

fixing this is non-trivial.  the problem is the interface
between bfd_check_format_matches() and the _check_format()
method for a bfd_target.  most _check_format() methods kind
of assume that if they succeed, then that's what bfd_target
the bfd will be forever.  bfd_check_format_matches() kinda
assumes that you can arbitrarily change what bfd_target the
bfd is, without any bad effects.

the fix is to consistently choose one view or the other, and
both options look like they'll require non-trivial changes.
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]