Replace "exec" with "executable" in messages.
[deliverable/binutils-gdb.git] / gdb / tracepoint.c
index 42898c482ea5d846dab7f45799d8be17f38c1c72..2a9e7dbf384101675432c8b74558677277020d19 100644 (file)
@@ -497,7 +497,7 @@ tracepoints_info (tpnum_exp, from_tty)
                         t->enabled == enabled ? "y" : "n");
        if (addressprint)
          printf_filtered ("%s ", 
-                          local_hex_string_custom ((unsigned long) t->address, 
+                          local_hex_string_custom ((unsigned long) t->address,
                                                    "08l"));
        printf_filtered ("%-5d %-5d ", t->pass_count, t->step_count);
 
@@ -1206,6 +1206,11 @@ collect_symbol (collect, sym)
     if (info_verbose)
       printf_filtered ("LOC_REG[parm] %s: ", SYMBOL_NAME (sym));
     add_register (collect, reg);
+    /* check for doubles stored in two registers */
+    /* FIXME: how about larger types stored in 3 or more regs? */
+    if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FLT &&
+       len > REGISTER_RAW_SIZE (reg))
+      add_register (collect, reg + 1);
     break;
   case LOC_REF_ARG:
     printf_filtered ("Sorry, don't know how to do LOC_REF_ARG yet.\n");
@@ -1616,9 +1621,50 @@ add_aexpr(collect, aexpr)
   collect->next_aexpr_elt++;
 }
 
-
 static char target_buf[2048];
 
+/* Set "transparent" memory ranges
+
+   Allow trace mechanism to treat text-like sections
+   (and perhaps all read-only sections) transparently, 
+   i.e. don't reject memory requests from these address ranges
+   just because they haven't been collected.  */
+
+static void
+remote_set_transparent_ranges (void)
+{
+  extern bfd *exec_bfd;
+  asection *s;
+  bfd_size_type size;
+  bfd_vma lma;
+  int anysecs = 0;
+
+  if (!exec_bfd)
+    return;            /* no information to give. */
+
+  strcpy (target_buf, "QTro");
+  for (s = exec_bfd->sections; s; s = s->next)
+    {
+      char tmp[40];
+
+      if ((s->flags & SEC_LOAD)     == 0 ||
+       /* (s->flags & SEC_CODE)     == 0 || */
+         (s->flags & SEC_READONLY) == 0)
+       continue;
+
+      anysecs = 1;
+      lma  = s->lma;
+      size = bfd_get_section_size_before_reloc (s);
+      sprintf (tmp, ":%x,%x", lma, lma + size);
+      strcat (target_buf, tmp);
+    }
+  if (anysecs)
+    {
+      putpkt (target_buf);
+      getpkt (target_buf, 0);
+    }
+}
+
 /* tstart command:
  
    Tell target to clear any previous trace experiment.
@@ -1707,6 +1753,9 @@ trace_start_command (args, from_tty)
              do_cleanups (old_chain);
            }
        }
+      /* Tell target to treat text-like sections as transparent */
+      remote_set_transparent_ranges ();
+      /* Now insert traps and begin collecting data */
       putpkt ("QTStart");
       remote_get_noisy_reply (target_buf);
       if (strcmp (target_buf, "OK"))
@@ -1782,7 +1831,7 @@ finish_tfind_command (msg, from_tty)
   while (reply && *reply)
     switch (*reply) {
     case 'F':
-      if ((target_frameno = strtol (++reply, &reply, 16)) == -1)
+      if ((target_frameno = (int) strtol (++reply, &reply, 16)) == -1)
        { 
          /* A request for a non-existant trace frame has failed.
             Our response will be different, depending on FROM_TTY:
@@ -1819,7 +1868,7 @@ finish_tfind_command (msg, from_tty)
        }
       break;
     case 'T':
-      if ((target_tracept = strtol (++reply, &reply, 16)) == -1)
+      if ((target_tracept = (int) strtol (++reply, &reply, 16)) == -1)
        error ("Target failed to find requested trace frame.");
       break;
     case 'O':  /* "OK"? */
@@ -1891,7 +1940,6 @@ trace_find_command (args, from_tty)
 { /* STUB_COMM PART_IMPLEMENTED */
   /* this should only be called with a numeric argument */
   int frameno = -1;
-  int target_frameno = -1, target_tracept = -1, target_stepfrm = 0;
   char *tmp;
 
   if (target_is_remote ())
@@ -1959,7 +2007,6 @@ trace_find_pc_command (args, from_tty)
      int from_tty;
 { /* STUB_COMM PART_IMPLEMENTED */
   CORE_ADDR pc;
-  int target_frameno;
   char *tmp;
 
   if (target_is_remote ())
@@ -1982,7 +2029,7 @@ trace_find_tracepoint_command (args, from_tty)
      char *args;
      int from_tty;
 { /* STUB_COMM PART_IMPLEMENTED */
-  int target_frameno, tdp;
+  int tdp;
   char buf[40], *tmp;
 
   if (target_is_remote ())
@@ -2018,7 +2065,6 @@ trace_find_line_command (args, from_tty)
   static CORE_ADDR start_pc, end_pc;
   struct symtabs_and_lines sals;
   struct symtab_and_line sal;
-  int target_frameno;
   char *tmp;
   struct cleanup *old_chain;
 
@@ -2105,7 +2151,6 @@ trace_find_range_command (args, from_tty)
      int from_tty;
 { /* STUB_COMM PART_IMPLEMENTED */
   static CORE_ADDR start, stop;
-  int target_frameno;
   char *tmp;
 
   if (target_is_remote ())
@@ -2144,7 +2189,6 @@ trace_find_outside_command (args, from_tty)
      int from_tty;
 { /* STUB_COMM PART_IMPLEMENTED */
   CORE_ADDR start, stop;
-  int target_frameno;
   char *tmp;
 
   if (target_is_remote ())
This page took 0.025583 seconds and 4 git commands to generate.