Constify 'la_name' in struct language_defn
[deliverable/binutils-gdb.git] / gdb / solib-svr4.c
index ccfd158a9482db77a0e54b8b2451efa29bfdd382..3eea0570afc647a04f1308dea2b253cdf253e43f 100644 (file)
@@ -407,11 +407,7 @@ free_solib_list (struct svr4_info *info)
 static void
 svr4_pspace_data_cleanup (struct program_space *pspace, void *arg)
 {
-  struct svr4_info *info;
-
-  info = program_space_data (pspace, solib_svr4_pspace_data);
-  if (info == NULL)
-    return;
+  struct svr4_info *info = arg;
 
   free_probes_table (info);
   free_solib_list (info);
@@ -1310,6 +1306,7 @@ static int
 svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
                   struct so_list ***link_ptr_ptr, int ignore_first)
 {
+  struct so_list *first = NULL;
   CORE_ADDR next_lm;
 
   for (; lm != 0; prev_lm = lm, lm = next_lm)
@@ -1349,6 +1346,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
        {
          struct svr4_info *info = get_svr4_info ();
 
+         first = new;
          info->main_lm_addr = new->lm_info->lm_addr;
          do_cleanups (old_chain);
          continue;
@@ -1359,8 +1357,14 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
                          SO_NAME_MAX_PATH_SIZE - 1, &errcode);
       if (errcode != 0)
        {
-         warning (_("Can't read pathname for load map: %s."),
-                  safe_strerror (errcode));
+         /* If this entry's l_name address matches that of the
+            inferior executable, then this is not a normal shared
+            object, but (most likely) a vDSO.  In this case, silently
+            skip it; otherwise emit a warning. */
+         if (first == NULL
+             || new->lm_info->l_name != first->lm_info->l_name)
+           warning (_("Can't read pathname for load map: %s."),
+                    safe_strerror (errcode));
          do_cleanups (old_chain);
          continue;
        }
@@ -1978,12 +1982,14 @@ svr4_create_solib_event_breakpoints (struct gdbarch *gdbarch,
        {
          VEC (probe_p) *probes[NUM_PROBES];
          int all_probes_found = 1;
+         int checked_can_use_probe_arguments = 0;
          int i;
 
          memset (probes, 0, sizeof (probes));
          for (i = 0; i < NUM_PROBES; i++)
            {
              const char *name = probe_info[i].name;
+             struct probe *p;
              char buf[32];
 
              /* Fedora 17 and Red Hat Enterprise Linux 6.2-6.4
@@ -2012,6 +2018,18 @@ svr4_create_solib_event_breakpoints (struct gdbarch *gdbarch,
                  all_probes_found = 0;
                  break;
                }
+
+             /* Ensure probe arguments can be evaluated.  */
+             if (!checked_can_use_probe_arguments)
+               {
+                 p = VEC_index (probe_p, probes[i], 0);
+                 if (!can_evaluate_probe_arguments (p))
+                   {
+                     all_probes_found = 0;
+                     break;
+                   }
+                 checked_can_use_probe_arguments = 1;
+               }
            }
 
          if (all_probes_found)
This page took 0.024945 seconds and 4 git commands to generate.