* ax-gdb.c (gen_var_ref): Unconditionally call via computed ops,
[deliverable/binutils-gdb.git] / gdb / tracepoint.c
index a33905a479c86229782561b5a9d7007a69319002..66533f72c4326e256d3c1704814f4b6aeabedfef 100644 (file)
@@ -2678,101 +2678,107 @@ scope_info (char *args, int from_tty)
          gdbarch = get_objfile_arch (SYMBOL_SYMTAB (sym)->objfile);
 
          printf_filtered ("Symbol %s is ", symname);
-         switch (SYMBOL_CLASS (sym))
+
+         if (SYMBOL_COMPUTED_OPS (sym) != NULL)
+           SYMBOL_COMPUTED_OPS (sym)->describe_location (sym,
+                                                         BLOCK_START (block),
+                                                         gdb_stdout);
+         else
            {
-           default:
-           case LOC_UNDEF:     /* Messed up symbol?  */
-             printf_filtered ("a bogus symbol, class %d.\n",
-                              SYMBOL_CLASS (sym));
-             count--;          /* Don't count this one.  */
-             continue;
-           case LOC_CONST:
-             printf_filtered ("a constant with value %s (%s)",
-                              plongest (SYMBOL_VALUE (sym)),
-                              hex_string (SYMBOL_VALUE (sym)));
-             break;
-           case LOC_CONST_BYTES:
-             printf_filtered ("constant bytes: ");
-             if (SYMBOL_TYPE (sym))
-               for (j = 0; j < TYPE_LENGTH (SYMBOL_TYPE (sym)); j++)
-                 fprintf_filtered (gdb_stdout, " %02x",
-                                   (unsigned) SYMBOL_VALUE_BYTES (sym)[j]);
-             break;
-           case LOC_STATIC:
-             printf_filtered ("in static storage at address ");
-             printf_filtered ("%s", paddress (gdbarch,
-                                              SYMBOL_VALUE_ADDRESS (sym)));
-             break;
-           case LOC_REGISTER:
-             /* GDBARCH is the architecture associated with the objfile
-                the symbol is defined in; the target architecture may be
-                different, and may provide additional registers.  However,
-                we do not know the target architecture at this point.
-                We assume the objfile architecture will contain all the
-                standard registers that occur in debug info in that
-                objfile.  */
-             regno = SYMBOL_REGISTER_OPS (sym)->register_number (sym,
-                                                                 gdbarch);
-
-             if (SYMBOL_IS_ARGUMENT (sym))
-               printf_filtered ("an argument in register $%s",
-                                gdbarch_register_name (gdbarch, regno));
-             else
-               printf_filtered ("a local variable in register $%s",
-                                gdbarch_register_name (gdbarch, regno));
-             break;
-           case LOC_ARG:
-             printf_filtered ("an argument at stack/frame offset %s",
-                              plongest (SYMBOL_VALUE (sym)));
-             break;
-           case LOC_LOCAL:
-             printf_filtered ("a local variable at frame offset %s",
-                              plongest (SYMBOL_VALUE (sym)));
-             break;
-           case LOC_REF_ARG:
-             printf_filtered ("a reference argument at offset %s",
-                              plongest (SYMBOL_VALUE (sym)));
-             break;
-           case LOC_REGPARM_ADDR:
-             /* Note comment at LOC_REGISTER.  */
-             regno = SYMBOL_REGISTER_OPS (sym)->register_number (sym,
-                                                                 gdbarch);
-             printf_filtered ("the address of an argument, in register $%s",
-                              gdbarch_register_name (gdbarch, regno));
-             break;
-           case LOC_TYPEDEF:
-             printf_filtered ("a typedef.\n");
-             continue;
-           case LOC_LABEL:
-             printf_filtered ("a label at address ");
-             printf_filtered ("%s", paddress (gdbarch,
-                                              SYMBOL_VALUE_ADDRESS (sym)));
-             break;
-           case LOC_BLOCK:
-             printf_filtered ("a function at address ");
-             printf_filtered ("%s",
-               paddress (gdbarch, BLOCK_START (SYMBOL_BLOCK_VALUE (sym))));
-             break;
-           case LOC_UNRESOLVED:
-             msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
-                                           NULL, NULL);
-             if (msym == NULL)
-               printf_filtered ("Unresolved Static");
-             else
+             switch (SYMBOL_CLASS (sym))
                {
-                 printf_filtered ("static storage at address ");
+               default:
+               case LOC_UNDEF: /* Messed up symbol?  */
+                 printf_filtered ("a bogus symbol, class %d.\n",
+                                  SYMBOL_CLASS (sym));
+                 count--;              /* Don't count this one.  */
+                 continue;
+               case LOC_CONST:
+                 printf_filtered ("a constant with value %s (%s)",
+                                  plongest (SYMBOL_VALUE (sym)),
+                                  hex_string (SYMBOL_VALUE (sym)));
+                 break;
+               case LOC_CONST_BYTES:
+                 printf_filtered ("constant bytes: ");
+                 if (SYMBOL_TYPE (sym))
+                   for (j = 0; j < TYPE_LENGTH (SYMBOL_TYPE (sym)); j++)
+                     fprintf_filtered (gdb_stdout, " %02x",
+                                       (unsigned) SYMBOL_VALUE_BYTES (sym)[j]);
+                 break;
+               case LOC_STATIC:
+                 printf_filtered ("in static storage at address ");
+                 printf_filtered ("%s", paddress (gdbarch,
+                                                  SYMBOL_VALUE_ADDRESS (sym)));
+                 break;
+               case LOC_REGISTER:
+                 /* GDBARCH is the architecture associated with the objfile
+                    the symbol is defined in; the target architecture may be
+                    different, and may provide additional registers.  However,
+                    we do not know the target architecture at this point.
+                    We assume the objfile architecture will contain all the
+                    standard registers that occur in debug info in that
+                    objfile.  */
+                 regno = SYMBOL_REGISTER_OPS (sym)->register_number (sym,
+                                                                     gdbarch);
+
+                 if (SYMBOL_IS_ARGUMENT (sym))
+                   printf_filtered ("an argument in register $%s",
+                                    gdbarch_register_name (gdbarch, regno));
+                 else
+                   printf_filtered ("a local variable in register $%s",
+                                    gdbarch_register_name (gdbarch, regno));
+                 break;
+               case LOC_ARG:
+                 printf_filtered ("an argument at stack/frame offset %s",
+                                  plongest (SYMBOL_VALUE (sym)));
+                 break;
+               case LOC_LOCAL:
+                 printf_filtered ("a local variable at frame offset %s",
+                                  plongest (SYMBOL_VALUE (sym)));
+                 break;
+               case LOC_REF_ARG:
+                 printf_filtered ("a reference argument at offset %s",
+                                  plongest (SYMBOL_VALUE (sym)));
+                 break;
+               case LOC_REGPARM_ADDR:
+                 /* Note comment at LOC_REGISTER.  */
+                 regno = SYMBOL_REGISTER_OPS (sym)->register_number (sym,
+                                                                     gdbarch);
+                 printf_filtered ("the address of an argument, in register $%s",
+                                  gdbarch_register_name (gdbarch, regno));
+                 break;
+               case LOC_TYPEDEF:
+                 printf_filtered ("a typedef.\n");
+                 continue;
+               case LOC_LABEL:
+                 printf_filtered ("a label at address ");
+                 printf_filtered ("%s", paddress (gdbarch,
+                                                  SYMBOL_VALUE_ADDRESS (sym)));
+                 break;
+               case LOC_BLOCK:
+                 printf_filtered ("a function at address ");
                  printf_filtered ("%s",
-                   paddress (gdbarch, SYMBOL_VALUE_ADDRESS (msym)));
+                                  paddress (gdbarch, BLOCK_START (SYMBOL_BLOCK_VALUE (sym))));
+                 break;
+               case LOC_UNRESOLVED:
+                 msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (sym),
+                                               NULL, NULL);
+                 if (msym == NULL)
+                   printf_filtered ("Unresolved Static");
+                 else
+                   {
+                     printf_filtered ("static storage at address ");
+                     printf_filtered ("%s",
+                                      paddress (gdbarch,
+                                                SYMBOL_VALUE_ADDRESS (msym)));
+                   }
+                 break;
+               case LOC_OPTIMIZED_OUT:
+                 printf_filtered ("optimized out.\n");
+                 continue;
+               case LOC_COMPUTED:
+                 gdb_assert_not_reached (_("LOC_COMPUTED variable missing a method"));
                }
-             break;
-           case LOC_OPTIMIZED_OUT:
-             printf_filtered ("optimized out.\n");
-             continue;
-           case LOC_COMPUTED:
-             SYMBOL_COMPUTED_OPS (sym)->describe_location (sym,
-                                                           BLOCK_START (block),
-                                                           gdb_stdout);
-             break;
            }
          if (SYMBOL_TYPE (sym))
            printf_filtered (", length %d.\n",
This page took 0.02868 seconds and 4 git commands to generate.