--- gdb/solib.c@@/main/INSIGHT-6.6-ST-1.0-int/LATEST 2007-08-28 11:30:33.257546000 +0100 +++ gdb/solib.c 2007-08-28 11:26:54.360656000 +0100 @@ -82,6 +82,8 @@ static int solib_cleanup_queued = 0; /* make_run_cleanup called */ +static int solib_enabled = 1; /* Shared libraries enabled ? */ + /* Local function prototypes */ static void do_clear_solib (void *); @@ -869,7 +871,8 @@ solib_create_inferior_hook (void) { struct target_so_ops *ops = solib_ops (current_gdbarch); - ops->solib_create_inferior_hook(); + if (solib_enabled) + ops->solib_create_inferior_hook(); } /* GLOBAL FUNCTION @@ -951,6 +954,39 @@ value); } +/* LOCAL FUNCTION + + disable_shared_libraries -- handle command to disable shared library + support. + + DESCRIPTION + + Implements the command "disable sharedlibrary". */ + +static void +disable_shared_libraries (char *ignored, int from_tty) +{ + solib_enabled = 0; + remove_solib_event_breakpoints (); + no_shared_libraries (NULL, from_tty); +} + +/* LOCAL FUNCTION + + enable_shared_libraries -- handle command to enable shared library + support. + + DESCRIPTION + + Implements the command "enable sharedlibrary". */ + +static void +enable_shared_libraries (char *ignored, int from_tty) +{ + solib_enabled = 1; + solib_create_inferior_hook (); + solib_add (NULL, from_tty, NULL, auto_solib_add); +} extern initialize_file_ftype _initialize_solib; /* -Wmissing-prototypes */ @@ -1001,4 +1037,12 @@ reload_shared_libraries, show_solib_search_path, &setlist, &showlist); + + add_cmd ("sharedlibrary", class_support, disable_shared_libraries, _("\ +Disable shared library support."), + &disablelist); + + add_cmd ("sharedlibrary", class_support, enable_shared_libraries, _("\ +Enable shared library support."), + &enablelist); }