This is the mail archive of the gdb-patches@sourceware.org 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]

Re: [RFC-v2] Dispose properly of registered gdbarch'es at exit.


Tom> I see a bogus-by-this-rule final cleanup in gdb_insn_length.

Pierre>   It took me some time to understand your point:
Pierre>   we also need to reset that static variable to NULL inside...
Pierre>  Included in new version of the patch.	
 
Actually what I meant in this case is that the cleanup isn't useful to
gdb-as-executable.  There's no point destroying that ui-out object for
ordinary gdb.

If you really want to initialize gdb-as-a-library, then shut it down,
and then re-initialize it, then I think you will find there are other
function-local statics that must be handled.

Pierre> I wasn't sure about unused args, do we still need anything
Pierre> special for those, otherwise I agree it would e easier to just
Pierre> use a dummy NULL arg.

You don't have to do anything special.
We haven't tried enabling -Wunused-parameter in gdb.
I usually just give them an obvious name like "ignore".

Pierre>  static void
Pierre>  do_ui_file_delete (void *arg)
Pierre>  {
Pierre> -  ui_file_delete (arg);
Pierre> +  struct ui_file **ui = (struct ui_file **) arg;
Pierre> +  ui_file_delete (*ui);

Blank line between declarations and code.

Pierre> +  make_final_cleanup (gdbarch_free_registered, NULL);

I'd still rather have a new mechanism, not run by ordinary gdb.

Tom


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