[RFA] New solib function: discard all solib symbols.

Michael Snyder msnyder@cygnus.com
Tue Apr 17 14:00:00 GMT 2001


The purpose of this function is actually for handling shared libs on remote targets, 
but I figured it might be useful as a user command (complementary to the "sharedlib"
command which loads all solib symbols).
2001-04-17  Michael Snyder  <msnyder@redhat.com>

	* solib.c (no_shared_libraries): New function.  Discard all symbols
	from shared libraries.
	(_initialize_solib): Add command "nosharedlibrary" as complement
	to the command "sharedlibrary".  Unloads symbols for all solibs.
	
Index: solib.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/solib.c,v
retrieving revision 1.166
diff -c -3 -p -r1.166 solib.c
*** solib.c	2001/03/26 19:54:37	1.166
--- solib.c	2001/04/17 20:45:01
*************** sharedlibrary_command (char *args, int f
*** 809,814 ****
--- 809,820 ----
    solib_add (args, from_tty, (struct target_ops *) 0);
  }
  
+ void
+ no_shared_libraries (char *ignored, int from_tty)
+ {
+   objfile_purge_solibs ();
+   do_clear_solib (NULL);
+ }
  
  void
  _initialize_solib (void)
*************** _initialize_solib (void)
*** 819,824 ****
--- 825,832 ----
  	   "Load shared object library symbols for files matching REGEXP.");
    add_info ("sharedlibrary", info_sharedlibrary_command,
  	    "Status of loaded shared object libraries.");
+   add_com ("nosharedlibrary", class_files, no_shared_libraries,
+ 	   "Unload all shared object library symbols except .");
  
    add_show_from_set
      (add_set_cmd ("auto-solib-add", class_support, var_zinteger,




More information about the Gdb-patches mailing list