Merge branch 'master' into merge-job
authorJenkins as Icarus Sparry <icarus.sparry@amd.com>
Tue, 10 Dec 2019 04:08:17 +0000 (04:08 +0000)
committerJenkins as Icarus Sparry <icarus.sparry@amd.com>
Tue, 10 Dec 2019 04:08:17 +0000 (04:08 +0000)
52 files changed:
bfd/version.h
binutils/ChangeLog
binutils/objdump.c
gas/ChangeLog
gas/config/tc-i386-intel.c
gas/testsuite/gas/i386/intel-expr.d
gas/testsuite/gas/i386/intel-expr.s
gas/testsuite/gas/i386/intelbad.l
gas/testsuite/gas/i386/intelbad.s
gas/testsuite/gas/i386/intelok.d
gas/testsuite/gas/i386/intelok.e
gas/testsuite/gas/i386/intelok.s
gdb/ChangeLog
gdb/breakpoint.c
gdb/breakpoint.h
gdb/darwin-nat.c
gdb/gdbtypes.c
gdb/guile/scm-breakpoint.c
gdb/python/py-breakpoint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/rvalue-ref-overload.cc
gdb/testsuite/gdb.cp/rvalue-ref-overload.exp
gdb/testsuite/gdb.fortran/derived-type-striding.exp
gdb/testsuite/gdb.fortran/info-modules.exp
gdb/testsuite/gdb.fortran/info-types.exp
gdb/testsuite/gdb.guile/scm-breakpoint.c
gdb/testsuite/gdb.guile/scm-breakpoint.exp
gdb/testsuite/gdb.mi/mi-fortran-modules.exp
gdb/testsuite/gdb.python/py-breakpoint.c
gdb/testsuite/gdb.python/py-breakpoint.exp
gdb/testsuite/lib/sym-info-cmds.exp [new file with mode: 0644]
include/ChangeLog
include/dis-asm.h
opcodes/ChangeLog
opcodes/bpf-dis.c
opcodes/cgen-dis.in
opcodes/disassemble.c
opcodes/epiphany-dis.c
opcodes/fr30-dis.c
opcodes/frv-dis.c
opcodes/ip2k-dis.c
opcodes/iq2000-dis.c
opcodes/lm32-dis.c
opcodes/m32c-dis.c
opcodes/m32r-dis.c
opcodes/mep-dis.c
opcodes/mt-dis.c
opcodes/or1k-dis.c
opcodes/ppc-dis.c
opcodes/s12z-opc.c
opcodes/xc16x-dis.c
opcodes/xstormy16-dis.c

index b0d043da11841c32fdfd7cadce9dcb34fec7b6af..9d2ce737bfef9ad7eebec1daa7ef511f99a94ce9 100644 (file)
@@ -16,7 +16,7 @@
 
    In releases, the date is not included in either version strings or
    sonames.  */
-#define BFD_VERSION_DATE 20191209
+#define BFD_VERSION_DATE 20191210
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
index ef72f21be3694a55b0182330509a495d2e4cfa21..a19480535205738a248a4ebb4b875f9c024f3dc2 100644 (file)
@@ -1,3 +1,15 @@
+2019-12-10  Alan Modra  <amodra@gmail.com>
+
+       PR 24960
+       * objdump.c (disassemble_data): Call disassemble_free_target.
+
+2019-12-10  Alan Modra  <amodra@gmail.com>
+
+       * objdump.c (struct objdump_disasm_info): Delete "sec".
+       (find_symbol_for_address): Use inf->section rather than aux->sec.
+       (objdump_print_addr, disassemble_bytes): Likewise.
+       (disassemble_section): Don't set aux->sec.
+
 2019-12-08  Alan Modra  <amodra@gmail.com>
 
        * testsuite/lib/binutils-common.exp (regexp_diff): Support #?REGEXP.
index 6a1f142a0ebc8f354c2999ba3c5d91aa8148554f..c10136edc3141ab40079dc58445fcb7c21e6bb08 100644 (file)
@@ -147,7 +147,6 @@ static int include_path_count;
 struct objdump_disasm_info
 {
   bfd *              abfd;
-  asection *         sec;
   bfd_boolean        require_sec;
   arelent **         dynrelbuf;
   long               dynrelcount;
@@ -1078,7 +1077,7 @@ find_symbol_for_address (bfd_vma vma,
 
   aux = (struct objdump_disasm_info *) inf->application_data;
   abfd = aux->abfd;
-  sec = aux->sec;
+  sec = inf->section;
   opb = inf->octets_per_byte;
 
   /* Perform a binary search looking for the closest symbol to the
@@ -1342,7 +1341,8 @@ objdump_print_addr (bfd_vma vma,
 
       if (display_file_offsets)
        inf->fprintf_func (inf->stream, _(" (File Offset: 0x%lx)"),
-                          (long int)(aux->sec->filepos + (vma - aux->sec->vma)));
+                          (long int) (inf->section->filepos
+                                      + (vma - inf->section->vma)));
       return;
     }
 
@@ -1362,7 +1362,7 @@ objdump_print_addr (bfd_vma vma,
   if (!skip_find)
     sym = find_symbol_for_address (vma, inf, NULL);
 
-  objdump_print_addr_with_sym (aux->abfd, aux->sec, sym, vma, inf,
+  objdump_print_addr_with_sym (aux->abfd, inf->section, sym, vma, inf,
                               skip_zeroes);
 }
 
@@ -1871,7 +1871,7 @@ disassemble_bytes (struct disassemble_info * inf,
   SFILE sfile;
 
   aux = (struct objdump_disasm_info *) inf->application_data;
-  section = aux->sec;
+  section = inf->section;
 
   sfile.alloc = 120;
   sfile.buffer = (char *) xmalloc (sfile.alloc);
@@ -2384,7 +2384,6 @@ disassemble_section (bfd *abfd, asection *section, void *inf)
       return;
     }
 
-  paux->sec = section;
   pinfo->buffer = data;
   pinfo->buffer_vma = section->vma;
   pinfo->buffer_length = datasize;
@@ -2731,6 +2730,7 @@ disassemble_data (bfd *abfd)
   if (aux.dynrelbuf != NULL)
     free (aux.dynrelbuf);
   free (sorted_syms);
+  disassemble_free_target (&disasm_info);
 }
 \f
 static bfd_boolean
index 0e9a585432de421258881554945ef7c6fbeeb24e..4d2b7384ec80260834e6e484fd1dde20ec84c2d1 100644 (file)
@@ -1,3 +1,46 @@
+2019-12-09  Jan Beulich  <jbeulich@suse.com>
+
+       * config/tc-i386-intel.c (O_oword_ptr): Move.
+       (O_xmmword_ptr): Alias to O_oword_ptr.
+       (O_fword_ptr, O_tbyte_ptr, O_ymmword_ptr, O_zmmword_ptr): Adjust
+       expansion.
+       (i386_intel_simplify, i386_intel_operand): Fold O_oword_ptr and
+       O_xmmword_ptr cases, leaving comments.
+
+2019-12-09  Jan Beulich  <jbeulich@suse.com>
+
+       * config/tc-i386-intel.c (O_mmword_ptr): Define.
+       (i386_types): Add mmword entry.
+       (i386_intel_simplify, i386_intel_operand): Add comment.
+       * testsuite/gas/i386/intel-expr.s: Also test mmword and zmmword.
+       * testsuite/gas/i386/intelok.s: Also test "mmword ptr".
+       * testsuite/gas/i386/intel-expr.d, testsuite/gas/i386/intelok.d,
+       testsuite/gas/i386/intelok.e: Adjust expectations.
+
+2019-12-09  Jan Beulich  <jbeulich@suse.com>
+
+       * config/tc-i386-intel.c (i386_intel_operand): Set "byte"
+       attribute suffix instead of suffix for floating point insns when
+       handling O_near_ptr / O_far_ptr.
+       * testsuite/gas/i386/intelbad.s: Add FPU tests.
+       * testsuite/gas/i386/intelbad.l: Adjust expectations.
+
+2019-12-09  Jan Beulich  <jbeulich@suse.com>
+
+       * config/tc-i386-intel.c (i386_intel_operand): Set "byte"
+       attribute suffix instead of suffix uniformly for insns not
+       possibly accepting "tbyte ptr" explicitly.
+
+2019-12-09  Jan Beulich  <jbeulich@suse.com>
+
+       * config/tc-i386-intel.c (i386_intel_operand): Don't set suffix
+       for floating point insns when handling O_fword_ptr.
+
+2019-12-09  Jan Beulich  <jbeulich@suse.com>
+
+       * config/tc-i386-intel.c (i386_intel_operand): Don't special
+       case LDS et al when handling O_word_ptr.
+
 2019-12-08  Alan Modra  <amodra@gmail.com>
 
        * testsuite/gas/aarch64/bfloat16.d: Match 32-bit and 64-bit output.
index b639ab7dd6b6743b0e6aa7df75030040b11bd0f6..bd88592ace814713111e5244fb056f40cf88138c 100644 (file)
@@ -52,18 +52,20 @@ intel_state;
 #define O_dword_ptr O_md26
 /* qword ptr X_add_symbol */
 #define O_qword_ptr O_md25
-/* oword ptr X_add_symbol */
-#define O_oword_ptr O_md24
+/* mmword ptr X_add_symbol */
+#define O_mmword_ptr O_qword_ptr
 /* fword ptr X_add_symbol */
-#define O_fword_ptr O_md23
+#define O_fword_ptr O_md24
 /* tbyte ptr X_add_symbol */
-#define O_tbyte_ptr O_md22
+#define O_tbyte_ptr O_md23
+/* oword ptr X_add_symbol */
+#define O_oword_ptr O_md22
 /* xmmword ptr X_add_symbol */
-#define O_xmmword_ptr O_md21
+#define O_xmmword_ptr O_oword_ptr
 /* ymmword ptr X_add_symbol */
-#define O_ymmword_ptr O_md20
+#define O_ymmword_ptr O_md21
 /* zmmword ptr X_add_symbol */
-#define O_zmmword_ptr O_md19
+#define O_zmmword_ptr O_md20
 
 static struct
   {
@@ -105,6 +107,7 @@ const i386_types[] =
     I386_TYPE(dword, 4),
     I386_TYPE(fword, 6),
     I386_TYPE(qword, 8),
+    I386_TYPE(mmword, 8),
     I386_TYPE(tbyte, 10),
     I386_TYPE(oword, 16),
     I386_TYPE(xmmword, 16),
@@ -383,10 +386,9 @@ static int i386_intel_simplify (expressionS *e)
     case O_word_ptr:
     case O_dword_ptr:
     case O_fword_ptr:
-    case O_qword_ptr:
+    case O_qword_ptr: /* O_mmword_ptr */
     case O_tbyte_ptr:
-    case O_oword_ptr:
-    case O_xmmword_ptr:
+    case O_oword_ptr: /* O_xmmword_ptr */
     case O_ymmword_ptr:
     case O_zmmword_ptr:
     case O_near_ptr:
@@ -639,12 +641,7 @@ i386_intel_operand (char *operand_string, int got_a_float)
 
        case O_word_ptr:
          i.types[this_operand].bitfield.word = 1;
-         if ((current_templates->start->name[0] == 'l'
-              && current_templates->start->name[2] == 's'
-              && current_templates->start->name[3] == 0)
-             || current_templates->start->base_opcode == 0x62 /* bound */)
-           suffix = BYTE_MNEM_SUFFIX; /* so it will cause an error */
-         else if (got_a_float == 2)    /* "fi..." */
+         if (got_a_float == 2) /* "fi..." */
            suffix = SHORT_MNEM_SUFFIX;
          else
            suffix = WORD_MNEM_SUFFIX;
@@ -681,11 +678,9 @@ i386_intel_operand (char *operand_string, int got_a_float)
                add_prefix (DATA_PREFIX_OPCODE);
              suffix = LONG_DOUBLE_MNEM_SUFFIX;
            }
-         else
-           suffix = BYTE_MNEM_SUFFIX; /* so it will cause an error */
          break;
 
-       case O_qword_ptr:
+       case O_qword_ptr: /* O_mmword_ptr */
          i.types[this_operand].bitfield.qword = 1;
          if (current_templates->start->base_opcode == 0x62 /* bound */
              || got_a_float == 1)      /* "f..." */
@@ -698,21 +693,15 @@ i386_intel_operand (char *operand_string, int got_a_float)
          i.types[this_operand].bitfield.tbyte = 1;
          if (got_a_float == 1)
            suffix = LONG_DOUBLE_MNEM_SUFFIX;
-         else if (current_templates->start->operand_types[0].bitfield.fword
-                  || current_templates->start->operand_types[0].bitfield.tbyte)
-           {
-             /* l[defgs]s, [ls][gi]dt */
-             if (flag_code == CODE_64BIT)
-               suffix = QWORD_MNEM_SUFFIX;
-             else
-               i.types[this_operand].bitfield.byte = 1; /* cause an error */
-           }
+         else if ((current_templates->start->operand_types[0].bitfield.fword
+                   || current_templates->start->operand_types[0].bitfield.tbyte)
+                  && flag_code == CODE_64BIT)
+           suffix = QWORD_MNEM_SUFFIX; /* l[fgs]s, [ls][gi]dt */
          else
-           suffix = BYTE_MNEM_SUFFIX; /* so it will cause an error */
+           i.types[this_operand].bitfield.byte = 1; /* cause an error */
          break;
 
-       case O_oword_ptr:
-       case O_xmmword_ptr:
+       case O_oword_ptr: /* O_xmmword_ptr */
          i.types[this_operand].bitfield.xmmword = 1;
          break;
 
@@ -730,9 +719,12 @@ i386_intel_operand (char *operand_string, int got_a_float)
        case O_near_ptr:
          if (current_templates->start->opcode_modifier.jump != JUMP
              && current_templates->start->opcode_modifier.jump != JUMP_DWORD)
-           suffix = got_a_float /* so it will cause an error */
-                    ? BYTE_MNEM_SUFFIX
-                    : LONG_DOUBLE_MNEM_SUFFIX;
+           {
+             /* cause an error */
+             i.types[this_operand].bitfield.byte = 1;
+             i.types[this_operand].bitfield.tbyte = 1;
+             suffix = i.suffix;
+           }
          break;
 
        default:
index 1b1f937ba2d1d7d866c6cb2ec5029b42ed331db8..5113f15bc886db3dc42c81b902a28b2b6a6592c2 100644 (file)
@@ -9,5 +9,5 @@ Contents of section .data:
  0020 03000000 40020000 00000000 08000000  .*
  0030 05000000 0f000000 ffffffff 00000000  .*
  0040 ffffffff 00000000 ffffffff 00000000  .*
- 0050 01020406 080a1010 20cccccc cccccccc  .*
+ 0050 01020406 08080a10 102040cc cccccccc  .*
  0060 02ff05ff 04ff06ff 08ff06ff cccccccc  .*
index 7149f6951532f6f76ad7e03cccad98e35bb3e32b..8e89d7471b532bd56930e1a49f2662270d20be83 100644 (file)
@@ -24,7 +24,8 @@
 
        .p2align 4, 0xcc
 
-       .byte   byte, word, dword, fword, qword, tbyte, oword, xmmword, ymmword
+       .byte   byte, word, dword, fword, qword, mmword, tbyte
+       .byte   oword, xmmword, ymmword, zmmword
 
        .p2align 4, 0xcc
 
index 4dc091741f6ba06d24d10557263f37da1d00e9bb..20809136fe02c1ff897b3939619862b119e06046 100644 (file)
 .*:176: Warning: .*
 .*:177: Error: .*
 .*:178: Error: .*
+.*:180: Error: .*
+.*:181: Error: .*
+.*:183: Error: .*
+.*:184: Error: .*
index 93e1c44e84b3ab646bb1ce8bd932e219af644bd3..afbb6035dad5c9cebb2584a3a9ee7b428cb1ed86 100644 (file)
@@ -176,3 +176,9 @@ start:
        lfs     eax, dword ptr [eax]
        lgs     eax, qword ptr [eax]
        lss     eax, tbyte ptr [eax]
+
+       fld     near ptr [ebx]
+       fst     far ptr [ebx]
+
+       fild    far ptr [ebx]
+       fist    near ptr [ebx]
index f0780271098c144c5f2830cf0ccd1bb275403278..b1bb6f114b680ede6fc1b78d37d0542396a1d7ca 100644 (file)
@@ -88,6 +88,8 @@ Disassembly of section .text:
 [      ]*[0-9a-f]+:    0f bf 00[       ]+movsx[        ]+eax,WORD PTR \[eax\]
 [      ]*[0-9a-f]+:    0f fc 00[       ]+paddb[        ]+mm0,(QWORD PTR )?\[eax\]
 [      ]*[0-9a-f]+:    0f fc 00[       ]+paddb[        ]+mm0,(QWORD PTR )?\[eax\]
+[      ]*[0-9a-f]+:    0f fc 00[       ]+paddb[        ]+mm0,(QWORD PTR )?\[eax\]
+[      ]*[0-9a-f]+:    66 0f fc 00[    ]+paddb[        ]+xmm0,(XMMWORD PTR )?\[eax\]
 [      ]*[0-9a-f]+:    66 0f fc 00[    ]+paddb[        ]+xmm0,(XMMWORD PTR )?\[eax\]
 [      ]*[0-9a-f]+:    66 0f fc 00[    ]+paddb[        ]+xmm0,(XMMWORD PTR )?\[eax\]
 [      ]*[0-9a-f]+:    0f c4 00 03[    ]+pinsrw[       ]+mm0,(WORD PTR )?\[eax\],0x3
index 585eaf458f05a1c18a4c20eea5e7147e21584a13..fa0818204f0b73da4ef28fce2b68c70ebf286884 100644 (file)
@@ -1,2 +1,2 @@
 .*: Assembler messages:
-.*:153: Warning: redundant segment overrides
+.*:155: Warning: redundant segment overrides
index eae9c2d50923e1067bb1436a917d0556ca9fd7bd..abd98b460c9fe45d36a926882ddcf1ea84ac86f5 100644 (file)
@@ -83,9 +83,11 @@ start:
        movsx   eax, byte ptr [eax]
        movsx   eax, word ptr [eax]
        paddb   mm0, [eax]
+       paddb   mm0, mmword ptr [eax]
        paddb   mm0, qword ptr [eax]
        paddb   xmm0, [eax]
        paddb   xmm0, xmmword ptr [eax]
+       paddb   xmm0, oword ptr [eax]
        pinsrw  mm0, word ptr [eax], 3
        pinsrw  xmm0, word ptr [eax], 7
        push    dword ptr [eax]
index ee45156e391bcc0dd152f009b0ce8f7d20655f21..98a6285dd840301bdcd7e8074a3ca0e16e41c10e 100644 (file)
@@ -1,3 +1,29 @@
+2019-12-10  George Barrett  <bob@bob131.so>
+
+       Fix scripted probe breakpoints.
+       * breakpoint.c (tracepoint_probe_breakpoint_ops): Move
+       declaration forward.
+       (breakpoint_ops_for_event_location_type)
+       (breakpoint_ops_for_event_location): Add function definitions.
+       (break_command_1, trace_command): Use
+       breakpoint_ops_for_event_location.
+       * breakpoint.h (breakpoint_ops_for_event_location): Add function
+       declarations.
+       * guile/scm-breakpoint.c (gdbscm_register_breakpoint_x): Use
+       breakpoint_ops_for_event_location.
+       * python/py-breakpoint.c (bppy_init): Use
+       breakpoint_ops_for_event_location.
+
+2019-12-09  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+       * gdbtypes.c (rank_one_type): Return INCOMPATIBLE_TYPE_BADNESS
+       when ranking an lvalue argument for an rvalue parameter.
+
+2019-12-08  Wataru Ashihara  <wataash@wataash.com>
+
+       * darwin-nat.c (darwin_nat_target::create_inferior): Fix
+       template argument for scoped_restore_tmpl from bool to int.
+
 2019-12-07  Keith Seitz  <keiths@redhat.com>
 
        * build-id.c (build_id_bfd_get): Permit bfd_core, too.
index 98724f8de2871083d13366345e07107ee911fcb8..0d23eb27cc100c7943f1d9219f77b9e34a399130 100644 (file)
@@ -247,6 +247,9 @@ struct breakpoint_ops bkpt_breakpoint_ops;
 /* Breakpoints set on probes.  */
 static struct breakpoint_ops bkpt_probe_breakpoint_ops;
 
+/* Tracepoints set on probes.  */
+static struct breakpoint_ops tracepoint_probe_breakpoint_ops;
+
 /* Dynamic printf class type.  */
 struct breakpoint_ops dprintf_breakpoint_ops;
 
@@ -9169,6 +9172,41 @@ decode_static_tracepoint_spec (const char **arg_p)
   return sals;
 }
 
+/* Returns the breakpoint ops appropriate for use with with LOCATION_TYPE and
+   according to IS_TRACEPOINT.  */
+
+static const struct breakpoint_ops *
+breakpoint_ops_for_event_location_type (enum event_location_type location_type,
+                                       bool is_tracepoint)
+{
+  if (is_tracepoint)
+    {
+      if (location_type == PROBE_LOCATION)
+       return &tracepoint_probe_breakpoint_ops;
+      else
+       return &tracepoint_breakpoint_ops;
+    }
+  else
+    {
+      if (location_type == PROBE_LOCATION)
+       return &bkpt_probe_breakpoint_ops;
+      else
+       return &bkpt_breakpoint_ops;
+    }
+}
+
+/* See breakpoint.h.  */
+
+const struct breakpoint_ops *
+breakpoint_ops_for_event_location (const struct event_location *location,
+                                  bool is_tracepoint)
+{
+  if (location != nullptr)
+    return breakpoint_ops_for_event_location_type
+      (event_location_type (location), is_tracepoint);
+  return is_tracepoint ? &tracepoint_breakpoint_ops : &bkpt_breakpoint_ops;
+}
+
 /* See breakpoint.h.  */
 
 int
@@ -9350,16 +9388,10 @@ break_command_1 (const char *arg, int flag, int from_tty)
   enum bptype type_wanted = (flag & BP_HARDWAREFLAG
                             ? bp_hardware_breakpoint
                             : bp_breakpoint);
-  struct breakpoint_ops *ops;
 
   event_location_up location = string_to_event_location (&arg, current_language);
-
-  /* Matching breakpoints on probes.  */
-  if (location != NULL
-      && event_location_type (location.get ()) == PROBE_LOCATION)
-    ops = &bkpt_probe_breakpoint_ops;
-  else
-    ops = &bkpt_breakpoint_ops;
+  const struct breakpoint_ops *ops = breakpoint_ops_for_event_location
+    (location.get (), false /* is_tracepoint */);
 
   create_breakpoint (get_current_arch (),
                     location.get (),
@@ -12808,8 +12840,7 @@ tracepoint_decode_location (struct breakpoint *b,
 
 struct breakpoint_ops tracepoint_breakpoint_ops;
 
-/* The breakpoint_ops structure to be use on tracepoints placed in a
-   static probe.  */
+/* Virtual table for tracepoints on static probes.  */
 
 static void
 tracepoint_probe_create_sals_from_location
@@ -12830,8 +12861,6 @@ tracepoint_probe_decode_location (struct breakpoint *b,
   return bkpt_probe_decode_location (b, location, search_pspace);
 }
 
-static struct breakpoint_ops tracepoint_probe_breakpoint_ops;
-
 /* Dprintf breakpoint_ops methods.  */
 
 static void
@@ -14473,15 +14502,10 @@ set_tracepoint_count (int num)
 static void
 trace_command (const char *arg, int from_tty)
 {
-  struct breakpoint_ops *ops;
-
   event_location_up location = string_to_event_location (&arg,
                                                         current_language);
-  if (location != NULL
-      && event_location_type (location.get ()) == PROBE_LOCATION)
-    ops = &tracepoint_probe_breakpoint_ops;
-  else
-    ops = &tracepoint_breakpoint_ops;
+  const struct breakpoint_ops *ops = breakpoint_ops_for_event_location
+    (location.get (), true /* is_tracepoint */);
 
   create_breakpoint (get_current_arch (),
                     location.get (),
index a9d689d02a222a0cf442026014e81067cc7240e0..3197854d3cd9359e87f049f3d12977cff169ba59 100644 (file)
@@ -1352,6 +1352,15 @@ extern void init_catchpoint (struct breakpoint *b,
 extern void install_breakpoint (int internal, std::unique_ptr<breakpoint> &&b,
                                int update_gll);
 
+/* Returns the breakpoint ops appropriate for use with with LOCATION and
+   according to IS_TRACEPOINT.  Use this to ensure, for example, that you pass
+   the correct ops to create_breakpoint for probe locations.  If LOCATION is
+   NULL, returns bkpt_breakpoint_ops (or tracepoint_breakpoint_ops, if
+   IS_TRACEPOINT is true).  */
+
+extern const struct breakpoint_ops *breakpoint_ops_for_event_location
+  (const struct event_location *location, bool is_tracepoint);
+
 /* Flags that can be passed down to create_breakpoint, etc., to affect
    breakpoint creation in several ways.  */
 
index 123d2c0b698e06891615767d729b78cfb8d339bf..ecc7fc07f69a8a4ccc80cfa1a7db01c2b2a26e36 100644 (file)
@@ -1985,7 +1985,7 @@ darwin_nat_target::create_inferior (const char *exec_file,
                                    const std::string &allargs,
                                    char **env, int from_tty)
 {
-  gdb::optional<scoped_restore_tmpl<int>> restore_startup_with_shell;
+  gdb::optional<scoped_restore_tmpl<bool>> restore_startup_with_shell;
 
   if (startup_with_shell && may_have_sip ())
     {
index 508628af1f73a99d66b0eec75788c042635432bb..0896f7189fdcdfdd1043ff5e4d6c212a4bd90f89 100644 (file)
@@ -4303,12 +4303,9 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
        }
       else
        {
-         /* Lvalues should prefer lvalue overloads.  */
+         /* It's illegal to pass an lvalue as an rvalue.  */
          if (TYPE_CODE (parm) == TYPE_CODE_RVALUE_REF)
-           {
-             rank.subrank = REFERENCE_CONVERSION_RVALUE;
-             return sum_ranks (rank, REFERENCE_CONVERSION_BADNESS);
-           }
+           return INCOMPATIBLE_TYPE_BADNESS;
        }
     }
 
index a75daa000196dcb48ca01c1b5901fc2ee3f549ae..a6404d544b3adb8c672085ff242f6f31a931d87f 100644 (file)
@@ -437,13 +437,15 @@ gdbscm_register_breakpoint_x (SCM self)
        {
        case bp_breakpoint:
          {
+           const breakpoint_ops *ops =
+             breakpoint_ops_for_event_location (eloc.get (), false);
            create_breakpoint (get_current_arch (),
                               eloc.get (), NULL, -1, NULL,
                               0,
                               0, bp_breakpoint,
                               0,
                               AUTO_BOOLEAN_TRUE,
-                              &bkpt_breakpoint_ops,
+                              ops,
                               0, 1, internal, 0);
            break;
          }
index 4170737416cab30a2e4181104d102fb0c20a9001..32494aec72bbafd6022a40d0fc9575af86757d58 100644 (file)
@@ -828,13 +828,16 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
                location = new_explicit_location (&explicit_loc);
              }
 
+           const struct breakpoint_ops *ops =
+             breakpoint_ops_for_event_location (location.get (), false);
+
            create_breakpoint (python_gdbarch,
                               location.get (), NULL, -1, NULL,
                               0,
                               temporary_bp, bp_breakpoint,
                               0,
                               AUTO_BOOLEAN_TRUE,
-                              &bkpt_breakpoint_ops,
+                              ops,
                               0, 1, internal_bp, 0);
            break;
          }
index 64e7ad75fd339b436515461e26f57e7fc8734b56..c14c341ade86d5fc2a5ccadd1f913dea9fb2b0d8 100644 (file)
@@ -1,3 +1,36 @@
+2019-12-10  George Barrett  <bob@bob131.so>
+
+       Test scripted probe breakpoints.
+       * gdb.guile/scm-breakpoint.c (main): Add probe point.
+       * gdb.python/py-breakpoint.c (main): Likewise.
+       * gdb.guile/scm-breakpoint.exp (test_bkpt_probe): Add probe
+       specifier test.
+       * gdb.python/py-breakpoint.exp (test_bkpt_probe): Likewise.
+
+2019-12-09  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+       * gdb.cp/rvalue-ref-overload.cc (g): New function that takes
+       an rvalue parameter.
+       * gdb.cp/rvalue-ref-overload.exp: Test calling it with an lvalue
+       parameter.
+
+2019-12-09  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * gdb.mi/mi-fortran-modules.exp: Add patterns to skip system
+       modules.
+
+2019-12-09  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * gdb.fortran/derived-type-striding.exp: KFAIL if we are using a
+       broken version of GCC.
+
+2019-12-09  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * gdb.fortran/info-modules.exp: Rewrite to make use of new
+       sym-info-cmds library.
+       * gdb.fortran/info-types.exp: Likewise.
+       * lib/sym-info-cmds.exp: New file.
+
 2019-12-08  Tom de Vries  <tdevries@suse.de>
 
        * gdb.dwarf2/imported-unit.exp: Fix inter-CU references.
index e3111d528bd623873d5094f60565ecd9750e21f5..30634a9c36c44d333a228c0d578503ebb5740266 100644 (file)
@@ -62,6 +62,12 @@ f (int &&x)
   return 3;
 }
 
+static int
+g (int &&x)
+{
+  return x;
+}
+
 int
 main ()
 {
@@ -78,6 +84,12 @@ main ()
   int test_const // = 3
     = foo_rr_instance1.overloadConst (arg);
 
+  /* The statement below is illegal: cannot bind rvalue reference of
+     type 'int&&' to lvalue of type 'int'.
+
+     result = g (i); */
+  result = g (5); // this is OK
+
   marker1 (); // marker1-returns-here
   return result;
 }
index e92e90139a449ff48695469a762e7cd129668b2b..cac3d4ba5887cabba63375390c6867dc44d15e8d 100644 (file)
@@ -66,3 +66,7 @@ gdb_test "print f (ci)" "2" "lvalue reference to const overload"
 
 setup_kfail "c++/15372" "*-*-*"
 gdb_test "print f (3)" "3" "rvalue reference overload"
+
+gdb_test "print g (i)" \
+    "Cannot resolve function g to any overloaded instance" \
+    "passing lvalue arg to rvalue parameter"
index a2590a9ab2f007e3cd30622ac0ba3058ccdf37e3..dc5ef96b3bca0fb10acb24b6748e23f1bbb8547b 100644 (file)
@@ -20,6 +20,10 @@ if {[skip_fortran_tests]} { return -1 }
 
 standard_testfile ".f90"
 
+# Unfortunately recent versions of GCC broke the stride information in
+# the DEBUG so tests in this file will fail.
+set gcc_with_broken_stride [test_compiler_info {gcc-[89]-*}]
+
 if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
         {debug f90}]} {
     return -1
@@ -31,7 +35,9 @@ if {![runto [gdb_get_line_number "post_init"]]} then {
 }
 
 # Test homogeneous derived type.
+if { $gcc_with_broken_stride } { setup_kfail *-*-* gcc/92775 }
 gdb_test "p point_dimension" "= \\\(2, 2, 2, 2, 2, 2, 2, 2, 2\\\)"
 
 # Test mixed type derived type.
+if { $gcc_with_broken_stride } { setup_kfail *-*-* gcc/92775 }
 gdb_test "p point_mixed_dimension" "= \\\(3, 3, 3, 3\\\)"
index c57ac3ff569007a897c38048ee3387096830242f..cf20f0a54b01dd146baeb0ee828e5e43bc9fa3ee 100644 (file)
@@ -17,6 +17,7 @@
 # module variables'.
 
 load_lib "fortran.exp"
+load_lib "sym-info-cmds.exp"
 
 if { [skip_fortran_tests] } { continue }
 
@@ -38,150 +39,130 @@ set real4 [fortran_real4]
 
 # Test 'info modules' command.
 
-gdb_test "info modules" \
-    [multi_line \
-        "All defined modules:" \
-        "" \
-        "File .*${srcfile2}:" \
-        "18:\[\t \]+mod2" \
-        "" \
-        "File .*${srcfile}:" \
-        "16:\[\t \]+mod1" ]
-
-gdb_test "info modules 1" \
-    [multi_line \
-        "All modules matching regular expression \"1\":" \
-        "" \
-        "File .*${srcfile}:" \
-        "16:\[\t \]+mod1" ]
-
-gdb_test "info modules 2" \
-    [multi_line \
-        "All modules matching regular expression \"2\":" \
-        "" \
-        "File .*${srcfile2}:" \
-        "18:\[\t \]+mod2" ]
-
-gdb_test "info modules mod" \
-    [multi_line \
-        "All modules matching regular expression \"mod\":" \
-        "" \
-        "File .*${srcfile2}:" \
-        "18:\[\t \]+mod2" \
-        "" \
-        "File .*${srcfile}:" \
-        "16:\[\t \]+mod1" ]
+GDBInfoSymbols::run_command "info modules"
+GDBInfoSymbols::check_header "All defined modules:"
+GDBInfoSymbols::check_entry "${srcfile2}" "18" "mod2"
+GDBInfoSymbols::check_entry "${srcfile}" "16" "mod1"
+GDBInfoSymbols::check_no_entry "${srcfile}"
+GDBInfoSymbols::check_no_entry "${srcfile2}"
+
+GDBInfoSymbols::run_command "info modules 1"
+GDBInfoSymbols::check_header \
+    "All modules matching regular expression \"1\":"
+GDBInfoSymbols::check_entry "${srcfile}" "16" "mod1"
+GDBInfoSymbols::check_no_entry "${srcfile}"
+GDBInfoSymbols::check_no_entry "${srcfile2}"
+
+GDBInfoSymbols::run_command "info modules 2"
+GDBInfoSymbols::check_header \
+    "All modules matching regular expression \"2\":"
+GDBInfoSymbols::check_entry "${srcfile2}" "18" "mod2"
+GDBInfoSymbols::check_no_entry "${srcfile}"
+GDBInfoSymbols::check_no_entry "${srcfile2}"
+
+GDBInfoSymbols::run_command "info modules mod"
+GDBInfoSymbols::check_header \
+    "All modules matching regular expression \"mod\":"
+GDBInfoSymbols::check_entry "${srcfile2}" "18" "mod2"
+GDBInfoSymbols::check_entry "${srcfile}" "16" "mod1"
+GDBInfoSymbols::check_no_entry "${srcfile}"
+GDBInfoSymbols::check_no_entry "${srcfile2}"
 
 # Test 'info module functions'.
 
-gdb_test "info module functions" \
-    [multi_line \
-        "All functions in all modules:" \
-        "" \
-        "Module \"mod2\":" \
-        "" \
-        "File .*${srcfile2}:" \
-        "22:\[\t \]+void mod2::sub_m2_a\\(${integer4}, ${logical4}\\);" \
-        "30:\[\t \]+${logical4} mod2::sub_m2_b\\(${real4}\\);" \
-        "" \
-        "Module \"mod1\":" \
-        "" \
-        "File .*${srcfile}:" \
-        "35:\[\t \]+void mod1::__copy_mod1_M1t1\\(Type m1t1, Type m1t1\\);" \
-        "25:\[\t \]+void mod1::sub_m1_a\\(${integer4}\\);" \
-        "31:\[\t \]+${integer4} mod1::sub_m1_b\\(void\\);" ]
-
-gdb_test "info module functions -m mod1" \
-    [multi_line \
-        "All functions in all modules matching regular expression \"mod1\":" \
-        "" \
-        "Module \"mod1\":" \
-        "" \
-        "File .*:" \
-        "35:\[\t \]+void mod1::__copy_mod1_M1t1\\(Type m1t1, Type m1t1\\);" \
-        "25:\[\t \]+void mod1::sub_m1_a\\(${integer4}\\);" \
-        "31:\[\t \]+${integer4} mod1::sub_m1_b\\(void\\);" ]
-
-gdb_test "info module functions -t integer" \
-    [multi_line \
-        "All functions with type matching regular expression \"integer\" in all modules:" \
-        "" \
-        "Module \"mod2\":" \
-        "" \
-        "File .*${srcfile2}:" \
-        "22:\[\t \]+void mod2::sub_m2_a\\(${integer4}, ${logical4}\\);" \
-        "" \
-        "Module \"mod1\":" \
-        "" \
-        "File .*${srcfile}:" \
-        "25:\[\t \]+void mod1::sub_m1_a\\(${integer4}\\);" \
-        "31:\[\t \]+${integer4} mod1::sub_m1_b\\(void\\);" ]
+GDBInfoModuleSymbols::run_command "info module functions"
+GDBInfoModuleSymbols::check_header "All functions in all modules:"
+GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "22" \
+    "void mod2::sub_m2_a\\(${integer4}, ${logical4}\\);"
+GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "30" \
+    "${logical4} mod2::sub_m2_b\\(${real4}\\);"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "35" \
+    "void mod1::__copy_mod1_M1t1\\(Type m1t1, Type m1t1\\);"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "25" \
+    "void mod1::sub_m1_a\\(${integer4}\\);"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "31" \
+    "${integer4} mod1::sub_m1_b\\(void\\);"
+GDBInfoModuleSymbols::check_no_entry "${srcfile}" ".*"
+GDBInfoModuleSymbols::check_no_entry "${srcfile2}" ".*"
+
+GDBInfoModuleSymbols::run_command "info module functions -m mod1"
+GDBInfoModuleSymbols::check_header \
+    "All functions in all modules matching regular expression \"mod1\":"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "35" \
+    "void mod1::__copy_mod1_M1t1\\(Type m1t1, Type m1t1\\);"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "25" \
+    "void mod1::sub_m1_a\\(${integer4}\\);"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "31" \
+    "${integer4} mod1::sub_m1_b\\(void\\);"
+GDBInfoModuleSymbols::check_no_entry "${srcfile}" ".*"
+GDBInfoModuleSymbols::check_no_entry "${srcfile2}" ".*"
+
+GDBInfoModuleSymbols::run_command "info module functions -t integer"
+GDBInfoModuleSymbols::check_header \
+    "All functions with type matching regular expression \"integer\" in all modules:"
+GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "22" \
+    "void mod2::sub_m2_a\\(${integer4}, ${logical4}\\);"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "25" \
+    "void mod1::sub_m1_a\\(${integer4}\\);"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "31" \
+    "${integer4} mod1::sub_m1_b\\(void\\);"
+GDBInfoModuleSymbols::check_no_entry "${srcfile}" ".*"
+GDBInfoModuleSymbols::check_no_entry "${srcfile2}" ".*"
 
 # Test 'info module variables'.
 
-gdb_test "info module variables" \
-    [multi_line \
-        "All variables in all modules:" \
-        "" \
-        "Module \"mod2\":" \
-        "" \
-        "File .*${srcfile2}:" \
-        "19:\[\t \]+${integer4} mod2::mod2_var_1;" \
-        "20:\[\t \]+${real4} mod2::mod2_var_2;" \
-        "" \
-        "Module \"mod1\":" \
-        "" \
-        "File .*${srcfile}:" \
-        "35:\[\t \]+Type m1t1 mod1::__def_init_mod1_M1t1;" \
-        "35:\[\t \]+Type __vtype_mod1_M1t1 mod1::__vtab_mod1_M1t1;" \
-        "21:\[\t \]+${real4} mod1::mod1_var_1;" \
-        "22:\[\t \]+${integer4} mod1::mod1_var_2;" ]
-
-gdb_test "info module variables -t real" \
-    [multi_line \
-        "All variables with type matching regular expression \"real\" in all modules:" \
-        "" \
-        "Module \"mod2\":" \
-        "" \
-        "File .*:" \
-        "20:\[\t \]+${real4} mod2::mod2_var_2;" \
-        "" \
-        "Module \"mod1\":" \
-        "" \
-        "File .*:" \
-        "21:\[\t \]+${real4} mod1::mod1_var_1;" ]
-
-gdb_test "info module variables -m mod2" \
-    [multi_line \
-        "All variables in all modules matching regular expression \"mod2\":" \
-        "" \
-        "Module \"mod2\":" \
-        "" \
-        "File .*${srcfile2}:" \
-        "19:\[\t \]+${integer4} mod2::mod2_var_1;" \
-        "20:\[\t \]+${real4} mod2::mod2_var_2;" ]
-
-gdb_test "info module variables -m mod2 -t real" \
-    [multi_line \
-        "All variables with type matching regular expression \"real\"" \
-        "      in all modules matching regular expression \"mod2\":" \
-        "" \
-        "Module \"mod2\":" \
-        "" \
-        "File .*${srcfile2}:" \
-        "20:\[\t \]+${real4} mod2::mod2_var_2;" ]
-
-gdb_test "info module variables _1" \
-    [multi_line \
-        "All variables matching regular expression \"_1\" in all modules:" \
-        "" \
-        "Module \"mod2\":" \
-        "" \
-        "File .*:" \
-        "19:\[\t \]+${integer4} mod2::mod2_var_1;" \
-        "" \
-        "Module \"mod1\":" \
-        "" \
-        "File .*:" \
-        "21:\[\t \]+${real4} mod1::mod1_var_1;" ]
+GDBInfoModuleSymbols::run_command "info module variables"
+GDBInfoModuleSymbols::check_header "All variables in all modules:"
+GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "19" \
+    "${integer4} mod2::mod2_var_1;"
+GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "20" \
+    "${real4} mod2::mod2_var_2;"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "35" \
+    "Type m1t1 mod1::__def_init_mod1_M1t1;"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "35" \
+    "Type __vtype_mod1_M1t1 mod1::__vtab_mod1_M1t1;"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "21" \
+    "${real4} mod1::mod1_var_1;"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "22" \
+    "${integer4} mod1::mod1_var_2;"
+GDBInfoModuleSymbols::check_no_entry "${srcfile}" ".*"
+GDBInfoModuleSymbols::check_no_entry "${srcfile2}" ".*"
+
+GDBInfoModuleSymbols::run_command "info module variables -t real"
+GDBInfoModuleSymbols::check_header \
+    "All variables with type matching regular expression \"real\" in all modules:"
+GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "20" \
+    "${real4} mod2::mod2_var_2;"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "21" \
+    "${real4} mod1::mod1_var_1;"
+GDBInfoModuleSymbols::check_no_entry "${srcfile}" ".*"
+GDBInfoModuleSymbols::check_no_entry "${srcfile2}" ".*"
+
+GDBInfoModuleSymbols::run_command "info module variables -m mod2"
+GDBInfoModuleSymbols::check_header \
+    "All variables in all modules matching regular expression \"mod2\":"
+GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "19" \
+    "${integer4} mod2::mod2_var_1;"
+GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "20" \
+    "${real4} mod2::mod2_var_2;"
+GDBInfoModuleSymbols::check_no_entry "${srcfile}" ".*"
+GDBInfoModuleSymbols::check_no_entry "${srcfile2}" ".*"
+
+GDBInfoModuleSymbols::run_command "info module variables -m mod2 -t real"
+GDBInfoModuleSymbols::check_header \
+    "All variables with type matching regular expression \"real\" in all modules matching regular expression \"mod2\":"
+GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "20" \
+    "${real4} mod2::mod2_var_2;"
+GDBInfoModuleSymbols::check_no_entry "${srcfile}" ".*"
+GDBInfoModuleSymbols::check_no_entry "${srcfile2}" ".*"
+
+GDBInfoModuleSymbols::run_command "info module variables _1"
+GDBInfoModuleSymbols::check_header \
+    "All variables matching regular expression \"_1\" in all modules:"
+GDBInfoModuleSymbols::check_entry "${srcfile2}" "mod2" "19" \
+    "${integer4} mod2::mod2_var_1;"
+GDBInfoModuleSymbols::check_entry "${srcfile}" "mod1" "21" \
+    "${real4} mod1::mod1_var_1;"
+GDBInfoModuleSymbols::check_no_entry "${srcfile}" ".*"
+GDBInfoModuleSymbols::check_no_entry "${srcfile2}" ".*"
 
index 324b4e01296acb5949763122b50cd8850fc163d4..a99ac84f19792ce2c13d210ab26278b09054b6b9 100644 (file)
@@ -16,6 +16,7 @@
 # This file tests 'info types' for some Fortran types.
 
 load_lib "fortran.exp"
+load_lib "sym-info-cmds.exp"
 
 if { [skip_fortran_tests] } { continue }
 
@@ -37,6 +38,18 @@ set logical4 [fortran_logical4]
 set character1 [fortran_character1]
 set real4 [fortran_real4]
 
+GDBInfoSymbols::run_command "info types"
+GDBInfoSymbols::check_header "All defined types:"
+
+GDBInfoSymbols::check_entry "${srcfile}" "" "${character1}"
+GDBInfoSymbols::check_entry "${srcfile}" "" "${integer4}"
+GDBInfoSymbols::check_entry "${srcfile}" "" "${logical4}"
+GDBInfoSymbols::check_entry "${srcfile}" "$decimal" "Type m1t1;"
+GDBInfoSymbols::check_entry "${srcfile}" "" "${real4}"
+GDBInfoSymbols::check_entry "${srcfile}" "37" "Type s1;"
+
+return 0
+
 gdb_test "info types" \
     [multi_line \
         "All defined types:" \
index 1670041677d9ff6e58e08c08617ab339c89fca52..ed7dbdba917ff5e1be7a86d5a2c9887a5766424a 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see  <http://www.gnu.org/licenses/>.  */
 
+#ifdef USE_PROBES
+#include <sys/sdt.h>
+#endif
+
 int result = 0;
 
 int multiply (int i)
@@ -38,6 +42,9 @@ int main (int argc, char *argv[])
     {
       result += multiply (foo);  /* Break at multiply. */
       result += add (bar); /* Break at add. */
+#ifdef USE_PROBES
+      DTRACE_PROBE1 (test, result_updated, result);
+#endif
     }
 
   return 0; /* Break at end. */
index 47bc80c2c8a2c75a0bfde723a2b68ea7e94feedc..183ad1671f5997706421c91eb3a6191d28f77189 100644 (file)
@@ -499,6 +499,28 @@ proc test_bkpt_address {} {
        ".*Breakpoint ($decimal)+ at .*$srcfile, line ($decimal)+\."
 }
 
+proc test_bkpt_probe {} {
+    global decimal hex testfile srcfile
+
+    if { [prepare_for_testing "failed to prepare" ${testfile}-probes \
+           ${srcfile} {additional_flags=-DUSE_PROBES}] } {
+       return -1
+    }
+
+    if ![gdb_guile_runto_main] then {
+       return
+    }
+
+    gdb_scm_test_silent_cmd \
+       "guile (define bp1 (make-breakpoint \"-probe test:result_updated\"))" \
+       "create probe breakpoint"
+
+    gdb_test \
+       "guile (register-breakpoint! bp1)" \
+       "Breakpoint $decimal at $hex" \
+       "register probe breakpoint"
+}
+
 test_bkpt_basic
 test_bkpt_deletion
 test_bkpt_cond_and_cmds
@@ -508,3 +530,4 @@ test_bkpt_internal
 test_bkpt_eval_funcs
 test_bkpt_registration
 test_bkpt_address
+test_bkpt_probe
index df48324784b2f2886697a9f808a2daf968c33cd8..e61f2a3c975f98c7c08cd77c69f38ed090a56da9 100644 (file)
@@ -33,8 +33,15 @@ if {[mi_gdb_start]} {
 
 mi_run_to_main
 
+
+# Patterns to skip optional system modules that appear with later versions of GFortran.
+set system_modules_pattern \
+    "\{filename=\"\[^\"\]+/ieee/\[^/\]+\.F90\",fullname=\"\[^\"\]+\",symbols=\\\[(\[^\]\]+)\\\]\},"
+set system_module_symbols_pattern \
+    "\{module=\"\[^\"\]*ieee\[^\"\]*\",files=\\\[\{filename=\"\[^\"\]+\",fullname=\"\[^\"\]+\",symbols=\\\[\[^\]\]+\\\]\}\\\]\},"
+
 mi_gdb_test "101-symbol-info-modules" \
-    "101\\^done,symbols=\{debug=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"16\",name=\"mod1\"\},\{line=\"27\",name=\"mod2\"\}\\\]\},\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"16\",name=\"mod3\"\},\{line=\"32\",name=\"modmany\"\},\{line=\"41\",name=\"moduse\"\}\\\]\}\\\]\}" \
+    "101\\^done,symbols=\{debug=\\\[($system_modules_pattern)*\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"16\",name=\"mod1\"\},\{line=\"27\",name=\"mod2\"\}\\\]\},\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"16\",name=\"mod3\"\},\{line=\"32\",name=\"modmany\"\},\{line=\"41\",name=\"moduse\"\}\\\]\}\\\]\}" \
     "-symbol-info-modules"
 
 mi_gdb_test "102-symbol-info-modules --name mod\[123\]" \
@@ -48,8 +55,8 @@ mi_gdb_test "103-symbol-info-modules --name moduse" \
 mi_gdb_test "104-symbol-info-module-functions" \
     [join \
      [list \
-      "104\\^done,symbols=\\\[\{module=\"mod1\",files=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"21\",name=\"mod1::check_all\",type=\"void \\(void\\)\",description=\"void mod1::check_all\\(void\\);\"\}\\\]\}\\\]\},\{module=\"mod2\",files=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"30\",name=\"mod2::check_var_i\",type=\"void \\(void\\)\",description=\"void mod2::check_var_i\\(void\\);\"\}\\\]\}\\\]\},\{module=\"mod3\",files=\\\[\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"21\",name=\"mod3::check_all\",type=\"void \\(void\\)\",description=\"void mod3::check_all\\(void\\);\"\},\{line=\"27\",name=\"mod3::check_mod2\",type=\"void \\(void\\)\",description=\"void mod3::check_mod2\\(void\\);\"\}\\\]\}\\\]\}," \
-         "\{module=\"modmany\",files=\\\[\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"35\",name=\"modmany::check_some\",type=\"void \\(void\\)\",description=\"void modmany::check_some\\(void\\);\"\}\\\]\}\\\]\},\{module=\"moduse\",files=\\\[\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"44\",name=\"moduse::check_all\",type=\"void \\(void\\)\",description=\"void moduse::check_all\\(void\\);\"\},\{line=\"49\",name=\"moduse::check_var_x\",type=\"void \\(void\\)\",description=\"void moduse::check_var_x\\(void\\);\"\}\\\]\}\\\]\}\\\]" ] "" ] \
+      "104\\^done,symbols=\\\[(${system_module_symbols_pattern})*\{module=\"mod1\",files=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"21\",name=\"mod1::check_all\",type=\"void \\(void\\)\",description=\"void mod1::check_all\\(void\\);\"\}\\\]\}\\\]\},\{module=\"mod2\",files=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"30\",name=\"mod2::check_var_i\",type=\"void \\(void\\)\",description=\"void mod2::check_var_i\\(void\\);\"\}\\\]\}\\\]\},\{module=\"mod3\",files=\\\[\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"21\",name=\"mod3::check_all\",type=\"void \\(void\\)\",description=\"void mod3::check_all\\(void\\);\"\},\{line=\"27\",name=\"mod3::check_mod2\",type=\"void \\(void\\)\",description=\"void mod3::check_mod2\\(void\\);\"\}\\\]\}\\\]\}," \
+      "\{module=\"modmany\",files=\\\[\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"35\",name=\"modmany::check_some\",type=\"void \\(void\\)\",description=\"void modmany::check_some\\(void\\);\"\}\\\]\}\\\]\},\{module=\"moduse\",files=\\\[\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"44\",name=\"moduse::check_all\",type=\"void \\(void\\)\",description=\"void moduse::check_all\\(void\\);\"\},\{line=\"49\",name=\"moduse::check_var_x\",type=\"void \\(void\\)\",description=\"void moduse::check_var_x\\(void\\);\"\}\\\]\}\\\]\}\\\]" ] "" ] \
     "-symbol-info-module-functions"
 
 mi_gdb_test "105-symbol-info-module-functions --name _all" \
@@ -65,7 +72,7 @@ set int4 [fortran_int4]
 mi_gdb_test "107-symbol-info-module-variables" \
     [join \
      [list \
-      "107\\^done,symbols=\\\[\{module=\"mod1\",files=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"18\",name=\"mod1::var_const\",type=\"$int4\",description=\"$int4 mod1::var_const;\"\},\{line=\"17\",name=\"mod1::var_i\",type=\"$int4\",description=\"$int4 mod1::var_i;\"\}\\\]\}\\\]\},\{module=\"mod2\",files=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"28\",name=\"mod2::var_i\",type=\"$int4\",description=\"$int4 mod2::var_i;\"\}\\\]\}\\\]\}," \
+      "107\\^done,symbols=\\\[(${system_module_symbols_pattern})*\{module=\"mod1\",files=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"18\",name=\"mod1::var_const\",type=\"$int4\",description=\"$int4 mod1::var_const;\"\},\{line=\"17\",name=\"mod1::var_i\",type=\"$int4\",description=\"$int4 mod1::var_i;\"\}\\\]\}\\\]\},\{module=\"mod2\",files=\\\[\{filename=\"\[^\"\]+$srcfile2\",fullname=\"\[^\"\]+$srcfile2\",symbols=\\\[\{line=\"28\",name=\"mod2::var_i\",type=\"$int4\",description=\"$int4 mod2::var_i;\"\}\\\]\}\\\]\}," \
          "\{module=\"mod3\",files=\\\[\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"18\",name=\"mod3::mod1\",type=\"$int4\",description=\"$int4 mod3::mod1;\"\},\{line=\"17\",name=\"mod3::mod2\",type=\"$int4\",description=\"$int4 mod3::mod2;\"\},\{line=\"19\",name=\"mod3::var_i\",type=\"$int4\",description=\"$int4 mod3::var_i;\"\}\\\]\}\\\]\},\{module=\"modmany\",files=\\\[\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"33\",name=\"modmany::var_a\",type=\"$int4\",description=\"$int4 modmany::var_a;\"\}," \
          "\{line=\"33\",name=\"modmany::var_b\",type=\"$int4\",description=\"$int4 modmany::var_b;\"\},\{line=\"33\",name=\"modmany::var_c\",type=\"$int4\",description=\"$int4 modmany::var_c;\"\},\{line=\"33\",name=\"modmany::var_i\",type=\"$int4\",description=\"$int4 modmany::var_i;\"\}\\\]\}\\\]\},\{module=\"moduse\",files=\\\[\{filename=\"\[^\"\]+$srcfile\",fullname=\"\[^\"\]+$srcfile\",symbols=\\\[\{line=\"42\",name=\"moduse::var_x\",type=\"$int4\",description=\"$int4 moduse::var_x;\"\},\{line=\"42\",name=\"moduse::var_y\",type=\"$int4\",description=\"$int4 moduse::var_y;\"\}\\\]\}\\\]\}\\\]" ] "" ] \
     "-symbol-info-module-variables"
index d102a5f306e01ab204ce6455b5e96a4bb3d7986c..12adc99a1b5e04fb443cb7764a280b576601837f 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see  <http://www.gnu.org/licenses/>.  */
 
+#ifdef USE_PROBES
+#include <sys/sdt.h>
+#endif
+
 int result = 0;
 
 namespace foo_ns
@@ -46,6 +50,9 @@ int main (int argc, char *argv[])
     {
       result += multiply (foo);  /* Break at multiply. */
       result += add (bar); /* Break at add. */
+#ifdef USE_PROBES
+      DTRACE_PROBE1 (test, result_updated, result);
+#endif
     }
 
   return 0; /* Break at end. */
index 625977c0ad48810735cf581c2cd0cc8073a26ef7..95f2b2905d3cadef1821ea93f0148a4cc90359b0 100644 (file)
@@ -695,6 +695,25 @@ proc_with_prefix test_bkpt_qualified {} {
        "-q in spec string and qualified false"
 }
 
+proc_with_prefix test_bkpt_probe {} {
+    global decimal hex testfile srcfile
+
+    if { [prepare_for_testing "failed to prepare" ${testfile}-probes \
+           ${srcfile} {debug c++ additional_flags=-DUSE_PROBES}] } {
+       return -1
+    }
+
+    if ![runto_main] then {
+       fail "cannot run to main."
+       return 0
+    }
+
+    gdb_test \
+       "python gdb.Breakpoint(\"-probe test:result_updated\")" \
+       "Breakpoint $decimal at $hex" \
+       "-probe in spec string"
+}
+
 test_bkpt_basic
 test_bkpt_deletion
 test_bkpt_cond_and_cmds
@@ -708,3 +727,4 @@ test_bkpt_pending
 test_bkpt_events
 test_bkpt_explicit_loc
 test_bkpt_qualified
+test_bkpt_probe
diff --git a/gdb/testsuite/lib/sym-info-cmds.exp b/gdb/testsuite/lib/sym-info-cmds.exp
new file mode 100644 (file)
index 0000000..9c2777d
--- /dev/null
@@ -0,0 +1,507 @@
+# Copyright 2019 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Make it easier to run the 'info modules' command (using
+# GDBInfoModules), and the 'info module ...' commands (using
+# GDBInfoModuleContents) and process the output.
+#
+# The difficulty we run into is that different versions of gFortran
+# include different helper modules which show up in the results.  The
+# procedures in this library help process those parts of the output we
+# actually want to check, while ignoring those parts that we don't
+# care about.
+#
+# For each namespace GDBInfoModules and GDBInfoModuleContents, there's
+# a run_command proc, use this to run a command and capture the
+# output.  Then make calls to check_header, check_entry, and
+# check_no_entry to ensure the output was as expected.
+
+namespace eval GDBInfoSymbols {
+
+    # A string that is the header printed by GDB immediately after the
+    # 'info [modules|types|functions|variables]' command has been issued.
+    variable _header
+
+    # A list of entries extracted from the output of the command.
+    # Each entry is a filename, a line number, and the rest of the
+    # text describing the entry.  If an entry has no line number then
+    # it is replaced with the text NONE.
+    variable _entries
+
+    # The string that is the complete last command run.
+    variable _last_command
+
+    # Add a new entry to the _entries list.
+    proc _add_entry { filename lineno text } {
+       variable _entries
+
+       set entry [list $filename $lineno $text]
+       lappend _entries $entry
+    }
+
+    # Run the 'info modules' command, passing ARGS as extra arguments
+    # to the command.  Process the output storing the results within
+    # the variables in this namespace.
+    #
+    # The results of any previous call to run_command are discarded
+    # when this is called.
+    proc run_command { cmd { testname "" } } {
+       global gdb_prompt
+
+       variable _header
+       variable _entries
+       variable _last_command
+
+       if {![regexp -- "^info (modules|types|variables|functions)" $cmd]} {
+           perror "invalid command"
+       }
+
+       set _header ""
+       set _entries [list]
+       set _last_command $cmd
+
+       if { $testname == "" } {
+           set testname $cmd
+       }
+
+       send_gdb "$cmd\n"
+       gdb_expect {
+           -re "^$cmd\r\n" {
+               # Match the original command echoed back to us.
+           }
+           timeout {
+               fail "$testname (timeout)"
+               return 0
+           }
+       }
+
+       gdb_expect {
+           -re "^\r\n" {
+               # Found the blank line after the header, we're done
+               # parsing the header now.
+           }
+           -re "^\[ \t]*(\[^\r\n\]+)\r\n" {
+               set str $expect_out(1,string)
+               if { $_header == "" } {
+                   set _header $str
+               } else {
+                   set _header "$_header $str"
+               }
+               exp_continue
+           }
+           timeout {
+               fail "$testname (timeout)"
+               return 0
+           }
+       }
+
+       set current_file ""
+       gdb_expect {
+           -re "^File (\[^\r\n\]+):\r\n" {
+               set current_file $expect_out(1,string)
+               exp_continue
+           }
+           -re "^(\[0-9\]+):\[ \t\]+(\[^\r\n\]+)\r\n" {
+               set lineno $expect_out(1,string)
+               set text $expect_out(2,string)
+               if { $current_file == "" } {
+                   fail "$testname (missing filename)"
+                   return 0
+               }
+               _add_entry $current_file $lineno $text
+               exp_continue
+           }
+           -re "^\[ \t\]+(\[^\r\n\]+)\r\n" {
+               set lineno "NONE"
+               set text $expect_out(1,string)
+               if { $current_file == "" } {
+                   fail "$testname (missing filename)"
+                   return 0
+               }
+               _add_entry $current_file $lineno $text
+               exp_continue
+           }
+           -re "^\r\n" {
+               exp_continue
+           }
+           -re "^$gdb_prompt $" {
+               # All done.
+           }
+           timeout {
+               fail "$testname (timeout)"
+               return 0
+           }
+       }
+
+       pass $testname
+       return 1
+    }
+
+    # Check that the header held in _header matches PATTERN.  Use
+    # TESTNAME as the name of the test, or create a suitable default
+    # test name based on the last command.
+    proc check_header { pattern { testname "" } } {
+       variable _header
+       variable _last_command
+
+       if { $testname == "" } {
+           set testname "$_last_command: check header"
+       }
+
+       gdb_assert {[regexp -- $pattern $_header]} $testname
+    }
+
+    # Check that we have an entry in _entries matching FILENAME,
+    # LINENO, and TEXT.  If LINENO is the empty string it is replaced
+    # with the string NONE in order to match a similarly missing line
+    # number in the output of the command.
+    #
+    # TESTNAME is the name of the test, or a default will be created
+    # based on the last command run and the arguments passed here.
+    #
+    # If a matching entry is found then it is removed from the
+    # _entries list, this allows us to check for duplicates using the
+    # check_no_entry call.
+    proc check_entry { filename lineno text { testname "" } } {
+       variable _entries
+       variable _last_command
+
+       if { $testname == "" } {
+           set testname \
+               "$_last_command: check for entry '$filename', '$lineno', '$text'"
+       }
+
+       if { $lineno == "" } {
+           set lineno "NONE"
+       }
+
+       set new_entries [list]
+
+       set found_match 0
+       foreach entry $_entries {
+
+           if {!$found_match} {
+               set f [lindex $entry 0]
+               set l [lindex $entry 1]
+               set t [lindex $entry 2]
+               if { [regexp -- $filename $f] \
+                        && [regexp -- $lineno $l] \
+                        && [regexp -- $text $t] } {
+                   set found_match 1
+               } else {
+                   lappend new_entries $entry
+               }
+           } else {
+               lappend new_entries $entry
+           }
+       }
+
+       set _entries $new_entries
+       gdb_assert { $found_match } $testname
+    }
+
+    # Check that there is no entry in the _entries list matching
+    # FILENAME, LINENO, and TEXT.  The LINENO and TEXT are optional,
+    # and will be replaced with '.*' if missing.
+    #
+    # If LINENO is the empty string then it will be replaced with the
+    # string NONE in order to match against missing line numbers in
+    # the output of the command.
+    #
+    # TESTNAME is the name of the test, or a default will be built
+    # from the last command run and the arguments passed here.
+    #
+    # This can be used after a call to check_entry to ensure that
+    # there are no further matches for a particular file in the
+    # output.
+    proc check_no_entry { filename { lineno ".*" } { text ".*" } \
+                             { testname "" } } {
+       variable _entries
+       variable _last_command
+
+       if { $testname == "" } {
+           set testname \
+               "$_last_command: check no matches for '$filename', $lineno', and '$text'"
+       }
+
+       if { $lineno == "" } {
+           set lineno "NONE"
+       }
+
+       foreach entry $_entries {
+           set f [lindex $entry 0]
+           set l [lindex $entry 1]
+           set t [lindex $entry 2]
+           if { [regexp -- $filename $f] \
+                    && [regexp -- $lineno $l] \
+                    && [regexp -- $text $t] } {
+               fail $testname
+           }
+       }
+
+       pass $testname
+    }
+}
+
+
+namespace eval GDBInfoModuleSymbols {
+
+    # A string that is the header printed by GDB immediately after the
+    # 'info modules (variables|functions)' command has been issued.
+    variable _header
+
+    # A list of entries extracted from the output of the command.
+    # Each entry is a filename, a module name, a line number, and the
+    # rest of the text describing the entry.  If an entry has no line
+    # number then it is replaced with the text NONE.
+    variable _entries
+
+    # The string that is the complete last command run.
+    variable _last_command
+
+    # Add a new entry to the _entries list.
+    proc _add_entry { filename module lineno text } {
+       variable _entries
+
+       set entry [list $filename $module $lineno $text]
+       lappend _entries $entry
+    }
+
+    # Run the 'info module ....' command, passing ARGS as extra
+    # arguments to the command.  Process the output storing the
+    # results within the variables in this namespace.
+    #
+    # The results of any previous call to run_command are discarded
+    # when this is called.
+    proc run_command { cmd { testname "" } } {
+       global gdb_prompt
+
+       variable _header
+       variable _entries
+       variable _last_command
+
+       if {![regexp -- "^info module (variables|functions)" $cmd]} {
+           perror "invalid command: '$cmd'"
+       }
+
+       set _header ""
+       set _entries [list]
+       set _last_command $cmd
+
+       if { $testname == "" } {
+           set testname $cmd
+       }
+
+       send_gdb "$cmd\n"
+       gdb_expect {
+           -re "^$cmd\r\n" {
+               # Match the original command echoed back to us.
+           }
+           timeout {
+               fail "$testname (timeout)"
+               return 0
+           }
+       }
+
+       gdb_expect {
+           -re "^\r\n" {
+               # Found the blank line after the header, we're done
+               # parsing the header now.
+           }
+           -re "^\[ \t\]*(\[^\r\n\]+)\r\n" {
+               set str $expect_out(1,string)
+               if { $_header == "" } {
+                   set _header $str
+               } else {
+                   set _header "$_header $str"
+               }
+               exp_continue
+           }
+           timeout {
+               fail "$testname (timeout)"
+               return 0
+           }
+       }
+
+       set current_module ""
+       set current_file ""
+       gdb_expect {
+           -re "^Module \"(\[^\"\]+)\":\r\n" {
+               set current_module $expect_out(1,string)
+               exp_continue
+           }
+           -re "^File (\[^\r\n\]+):\r\n" {
+               if { $current_module == "" } {
+                   fail "$testname (missing module)"
+                   return 0
+               }
+               set current_file $expect_out(1,string)
+               exp_continue
+           }
+           -re "^(\[0-9\]+):\[ \t\]+(\[^\r\n\]+)\r\n" {
+               set lineno $expect_out(1,string)
+               set text $expect_out(2,string)
+               if { $current_module == "" } {
+                   fail "$testname (missing module)"
+                   return 0
+               }
+               if { $current_file == "" } {
+                   fail "$testname (missing filename)"
+                   return 0
+               }
+               _add_entry $current_file $current_module \
+                   $lineno $text
+               exp_continue
+           }
+           -re "^\[ \t\]+(\[^\r\n\]+)\r\n" {
+               set lineno "NONE"
+               set text $expect_out(1,string)
+               if { $current_module == "" } {
+                   fail "$testname (missing module)"
+                   return 0
+               }
+               if { $current_file == "" } {
+                   fail "$testname (missing filename)"
+                   return 0
+               }
+               _add_entry $current_file $current_module \
+                   $lineno $text
+               exp_continue
+           }
+           -re "^\r\n" {
+               exp_continue
+           }
+           -re "^$gdb_prompt $" {
+               # All done.
+           }
+           timeout {
+               fail "$testname (timeout)"
+               return 0
+           }
+       }
+
+       pass $testname
+       return 1
+    }
+
+    # Check that the header held in _header matches PATTERN.  Use
+    # TESTNAME as the name of the test, or create a suitable default
+    # test name based on the last command.
+    proc check_header { pattern { testname "" } } {
+       variable _header
+       variable _last_command
+
+       if { $testname == "" } {
+           set testname "$_last_command: check header"
+       }
+
+       gdb_assert {[regexp -- $pattern $_header]} $testname
+    }
+
+    # Check that we have an entry in _entries matching FILENAME,
+    # MODULE, LINENO, and TEXT.  If LINENO is the empty string it is
+    # replaced with the string NONE in order to match a similarly
+    # missing line number in the output of the command.
+    #
+    # TESTNAME is the name of the test, or a default will be created
+    # based on the last command run and the arguments passed here.
+    #
+    # If a matching entry is found then it is removed from the
+    # _entries list, this allows us to check for duplicates using the
+    # check_no_entry call.
+    proc check_entry { filename module lineno text { testname "" } } {
+       variable _entries
+       variable _last_command
+
+       if { $testname == "" } {
+           set testname \
+               "$_last_command: check for entry '$filename', '$lineno', '$text'"
+       }
+
+       if { $lineno == "" } {
+           set lineno "NONE"
+       }
+
+       set new_entries [list]
+
+       set found_match 0
+       foreach entry $_entries {
+
+           if {!$found_match} {
+               set f [lindex $entry 0]
+               set m [lindex $entry 1]
+               set l [lindex $entry 2]
+               set t [lindex $entry 3]
+               if { [regexp -- $filename $f] \
+                        && [regexp -- $module $m] \
+                        && [regexp -- $lineno $l] \
+                        && [regexp -- $text $t] } {
+                   set found_match 1
+               } else {
+                   lappend new_entries $entry
+               }
+           } else {
+               lappend new_entries $entry
+           }
+       }
+
+       set _entries $new_entries
+       gdb_assert { $found_match } $testname
+    }
+
+    # Check that there is no entry in the _entries list matching
+    # FILENAME, MODULE, LINENO, and TEXT.  The LINENO and TEXT are
+    # optional, and will be replaced with '.*' if missing.
+    #
+    # If LINENO is the empty string then it will be replaced with the
+    # string NONE in order to match against missing line numbers in
+    # the output of the command.
+    #
+    # TESTNAME is the name of the test, or a default will be built
+    # from the last command run and the arguments passed here.
+    #
+    # This can be used after a call to check_entry to ensure that
+    # there are no further matches for a particular file in the
+    # output.
+    proc check_no_entry { filename module { lineno ".*" } \
+                             { text ".*" } { testname "" } } {
+       variable _entries
+       variable _last_command
+
+       if { $testname == "" } {
+           set testname \
+               "$_last_command: check no matches for '$filename', $lineno', and '$text'"
+       }
+
+       if { $lineno == "" } {
+           set lineno "NONE"
+       }
+
+       foreach entry $_entries {
+           set f [lindex $entry 0]
+           set m [lindex $entry 1]
+           set l [lindex $entry 2]
+           set t [lindex $entry 3]
+           if { [regexp -- $filename $f] \
+                    && [regexp -- $module $m] \
+                    && [regexp -- $lineno $l] \
+                    && [regexp -- $text $t] } {
+               fail $testname
+           }
+       }
+
+       pass $testname
+    }
+}
index 42aa17d1dba58b188b8508eb4e33e545e884f205..681cbfa837e017b05135fb9d34f4b528034b13ed 100644 (file)
@@ -1,3 +1,13 @@
+2019-12-10  Alan Modra  <amodra@gmail.com>
+
+       PR 24960
+       * dis-asm.h (disassemble_free_target): Declare.
+
+2019-12-10  Alan Modra  <amodra@gmail.com>
+
+       * dis-asm.h (struct disassemble_info): Delete insn_sets.
+       (INIT_DISASSEMBLE_INFO_NO_ARCH): Don't define.
+
 2019-12-05  Jan Beulich  <jbeulich@suse.com>
 
        * opcode/aarch64.h (AARCH64_FEATURE_CRYPTO): Expand to the
index b4d5025811f6e2daf39d3da5d9e63056fee6ef75..82bf4dc942bc1a034fea13113a5a993db48dbdea 100644 (file)
@@ -78,11 +78,6 @@ typedef struct disassemble_info
   enum bfd_endian endian;
   /* Endianness of code, for mixed-endian situations such as ARM BE8.  */
   enum bfd_endian endian_code;
-  /* An arch/mach-specific bitmask of selected instruction subsets, mainly
-     for processors with run-time-switchable instruction sets.  The default,
-     zero, means that there is no constraint.  CGEN-based opcodes ports
-     may use ISA_foo masks.  */
-  void *insn_sets;
 
   /* Some targets need information about the current section to accurately
      display insns.  If this is NULL, the target disassembler function
@@ -330,7 +325,10 @@ extern disassembler_ftype disassembler (enum bfd_architecture arc,
 
 /* Amend the disassemble_info structure as necessary for the target architecture.
    Should only be called after initialising the info->arch field.  */
-extern void disassemble_init_for_target (struct disassemble_info * dinfo);
+extern void disassemble_init_for_target (struct disassemble_info *);
+
+/* Tidy any memory allocated by targets, such as info->private_data.  */
+extern void disassemble_free_target (struct disassemble_info *);
 
 /* Document any target specific options available from the disassembler.  */
 extern void disassembler_usage (FILE *);
@@ -394,9 +392,6 @@ extern void init_disassemble_info (struct disassemble_info *dinfo, void *stream,
 /* For compatibility with existing code.  */
 #define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
   init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
-#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
-  init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
-
 
 #ifdef __cplusplus
 }
index 2183b2383fa3691c421fcfb5d4702d84f9b5eea3..4d22d51178626706f3d7c01701bc9fb932b15986 100644 (file)
@@ -1,3 +1,37 @@
+2019-12-10  Alan Modra  <amodra@gmail.com>
+
+       PR 24960
+       * disassemble.c (disassemble_free_target): New function.
+
+2019-12-10  Alan Modra  <amodra@gmail.com>
+
+       * cgen-dis.in (print_insn_@arch@): Replace insn_sets with private_data.
+       * disassemble.c (disassemble_init_for_target): Likewise.
+       * bpf-dis.c: Regenerate.
+       * epiphany-dis.c: Regenerate.
+       * fr30-dis.c: Regenerate.
+       * frv-dis.c: Regenerate.
+       * ip2k-dis.c: Regenerate.
+       * iq2000-dis.c: Regenerate.
+       * lm32-dis.c: Regenerate.
+       * m32c-dis.c: Regenerate.
+       * m32r-dis.c: Regenerate.
+       * mep-dis.c: Regenerate.
+       * mt-dis.c: Regenerate.
+       * or1k-dis.c: Regenerate.
+       * xc16x-dis.c: Regenerate.
+       * xstormy16-dis.c: Regenerate.
+
+2019-12-10  Alan Modra  <amodra@gmail.com>
+
+       * ppc-dis.c (private): Delete variable.
+       (get_powerpc_dialect): Don't segfault on NULL info->private_data.
+       (powerpc_init_dialect): Don't use global private.
+
+2019-12-10  Alan Modra  <amodra@gmail.com>
+
+       * s12z-opc.c: Formatting.
+
 2019-12-08  Alan Modra  <amodra@gmail.com>
 
        * s12z-opc.c (exg_sex_discrim): Don't leak memory on invalid
index c48bce85e6434a2e0e8aff7f11a955a820e5e8b2..99a292a3727ad7d657ab4cc636aa39d1ad6b6ed8 100644 (file)
@@ -553,7 +553,7 @@ print_insn_bpf (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index d1e06bf7b86f61adbb437af1b755d28583ec20d0..cf3e872de84e45815af6e43356ed60ade8c4092d 100644 (file)
@@ -388,7 +388,7 @@ print_insn_@arch@ (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index aef2fd8644b34afe737ec0670c307dd85f291fd2..7c919972ee250a553532062de024ffd2556c85e1 100644 (file)
@@ -654,26 +654,26 @@ disassemble_init_for_target (struct disassemble_info * info)
       /* This processor in fact is little endian.  The value set here
         reflects the way opcodes are written in the cgen description.  */
       info->endian = BFD_ENDIAN_BIG;
-      if (! info->insn_sets)
+      if (!info->private_data)
        {
-         info->insn_sets = cgen_bitset_create (ISA_MAX);
+         info->private_data = cgen_bitset_create (ISA_MAX);
          if (info->mach == bfd_mach_m16c)
-           cgen_bitset_set (info->insn_sets, ISA_M16C);
+           cgen_bitset_set (info->private_data, ISA_M16C);
          else
-           cgen_bitset_set (info->insn_sets, ISA_M32C);
+           cgen_bitset_set (info->private_data, ISA_M32C);
        }
       break;
 #endif
 #ifdef ARCH_bpf
     case bfd_arch_bpf:
-      if (!info->insn_sets)
-        {
-          info->insn_sets = cgen_bitset_create (ISA_EBPFMAX);
-          if (info->endian == BFD_ENDIAN_BIG)
-            cgen_bitset_set (info->insn_sets, ISA_EBPFBE);
-          else
-            cgen_bitset_set (info->insn_sets, ISA_EBPFLE);
-        }
+      if (!info->private_data)
+       {
+         info->private_data = cgen_bitset_create (ISA_EBPFMAX);
+         if (info->endian == BFD_ENDIAN_BIG)
+           cgen_bitset_set (info->private_data, ISA_EBPFBE);
+         else
+           cgen_bitset_set (info->private_data, ISA_EBPFLE);
+       }
       break;
 #endif
 #ifdef ARCH_pru
@@ -716,6 +716,65 @@ disassemble_init_for_target (struct disassemble_info * info)
     }
 }
 
+void
+disassemble_free_target (struct disassemble_info *info)
+{
+  if (info == NULL)
+    return;
+
+  switch (info->arch)
+    {
+    default:
+      return;
+
+#ifdef ARCH_bpf
+    case bfd_arch_bpf:
+#endif
+#ifdef ARCH_m32c
+    case bfd_arch_m32c:
+#endif
+#if defined ARCH_bpf || defined ARCH_m32c
+      if (info->private_data)
+       {
+         CGEN_BITSET *mask = info->private_data;
+         free (mask->bits);
+       }
+      break;
+#endif
+
+#ifdef ARCH_arc
+    case bfd_arch_arc:
+      break;
+#endif
+#ifdef ARCH_cris
+    case bfd_arch_cris:
+      break;
+#endif
+#ifdef ARCH_mmix
+    case bfd_arch_mmix:
+      break;
+#endif
+#ifdef ARCH_nfp
+    case bfd_arch_nfp:
+      break;
+#endif
+#ifdef ARCH_powerpc
+    case bfd_arch_powerpc:
+      break;
+#endif
+#ifdef ARCH_riscv
+    case bfd_arch_riscv:
+      break;
+#endif
+#ifdef ARCH_rs6000
+    case bfd_arch_rs6000:
+      break;
+#endif
+    }
+
+  free (info->private_data);
+}
+
 /* Remove whitespace and consecutive commas from OPTIONS.  */
 
 char *
index 376d678afcc5b1ae3b799e60535d2d49d92144b9..3c79031c999ae16eb97f64a7936870be5526d35b 100644 (file)
@@ -629,7 +629,7 @@ print_insn_epiphany (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index b83051b1fb78acef3eaef913fe7dc59bcf79ee69..2d1de96fa00e4f9a786264e6d1b010fdba8490a1 100644 (file)
@@ -650,7 +650,7 @@ print_insn_fr30 (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index 9df0dd59c004f77f9af84ae8851e3832fbdfdc04..bf9d4f789f100fa92860f12500a8a115433b6e62 100644 (file)
@@ -747,7 +747,7 @@ print_insn_frv (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index 3d3e8be412f533d610d22f83d0afc79cf7c98366..bc758a6618d51d9f9d39fc7f1d3d78cbb0ceb98d 100644 (file)
@@ -639,7 +639,7 @@ print_insn_ip2k (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index 422665e869cc96089e065fe59cbd6319623afa26..2762b642688c2258aa9eb431691d5a9ddccd2f5f 100644 (file)
@@ -540,7 +540,7 @@ print_insn_iq2000 (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index b18fb3dbfd425af113c0f40a8d33b5be979ca912..274b63f58eb79634601a6f55dc0cb74bb8e773df 100644 (file)
@@ -498,7 +498,7 @@ print_insn_lm32 (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index 92b87f283bf50b90f3e08a5f2ea671fdb6ae0201..b36868524c1835779b5b8a8fe03e5802f81543c6 100644 (file)
@@ -1242,7 +1242,7 @@ print_insn_m32c (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index 8722d6b5b0f6e4e7f32cf3e01bf50c652fbff244..c778b88326e3834b618b846b73b4eea83af9f459 100644 (file)
@@ -630,7 +630,7 @@ print_insn_m32r (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index 13bcb472763dcab5a46a27add3a2126ac8ce92fb..79bd7761c5bc9a64cfb29f807af78dcbc0f9b679 100644 (file)
@@ -1538,7 +1538,7 @@ print_insn_mep (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index 44e6720fc1694228ae66e535bb04fb48f11a6eaf..00b3d06ed3976144770702038323a7b69c691894 100644 (file)
@@ -641,7 +641,7 @@ print_insn_mt (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index 74bf38f26b70b9237bc28d82760486975ba7236d..dce00b3f2815554cae2dcb01546f98a3a5bcb4d6 100644 (file)
@@ -534,7 +534,7 @@ print_insn_or1k (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index 2f5756b6ccd027342e2d837a87c8fe6dde753670..9add60272a5172fad9f44c28451bce6aa3d349da 100644 (file)
@@ -40,7 +40,7 @@ struct dis_private
 {
   /* Stash the result of parsing disassembler_options here.  */
   ppc_cpu_t dialect;
-} private;
+};
 
 #define POWERPC_DIALECT(INFO) \
   (((struct dis_private *) ((INFO)->private_data))->dialect)
@@ -259,7 +259,8 @@ get_powerpc_dialect (struct disassemble_info *info)
 {
   ppc_cpu_t dialect = 0;
 
-  dialect = POWERPC_DIALECT (info);
+  if (info->private_data)
+    dialect = POWERPC_DIALECT (info);
 
   /* Disassemble according to the section headers flags for VLE-mode.  */
   if (dialect & PPC_OPCODE_VLE
@@ -308,7 +309,7 @@ powerpc_init_dialect (struct disassemble_info *info)
   struct dis_private *priv = calloc (sizeof (*priv), 1);
 
   if (priv == NULL)
-    priv = &private;
+    return;
 
   switch (info->mach)
     {
index 475c9eb5f1e79af0e61f992872cc8e292de1ce67..3e0c0e0582ca8c3ff9539b5cfb1f5d28c348f68e 100644 (file)
@@ -256,7 +256,8 @@ xysp_reg_from_postbyte (uint8_t postbyte)
   return reg;
 }
 
-static struct operand * create_immediate_operand (int value)
+static struct operand *
+create_immediate_operand (int value)
 {
   struct immediate_operand *op = malloc (sizeof (*op));
 
@@ -267,7 +268,8 @@ static struct operand * create_immediate_operand (int value)
   return (struct operand *) op;
 }
 
-static struct operand * create_bitfield_operand (int width, int offset)
+static struct operand *
+create_bitfield_operand (int width, int offset)
 {
   struct bitfield_operand *op = malloc (sizeof (*op));
 
@@ -297,7 +299,8 @@ create_register_operand (int reg)
   return create_register_operand_with_size (reg, -1);
 }
 
-static struct operand * create_register_all_operand (void)
+static struct operand *
+create_register_all_operand (void)
 {
   struct register_operand *op = malloc (sizeof (*op));
 
@@ -307,7 +310,8 @@ static struct operand * create_register_all_operand (void)
   return (struct operand *) op;
 }
 
-static struct operand * create_register_all16_operand (void)
+static struct operand *
+create_register_all16_operand (void)
 {
   struct register_operand *op = malloc (sizeof (*op));
 
@@ -371,7 +375,8 @@ create_memory_auto_operand (enum op_reg_mutation mutation, int reg)
 \f
 
 static void
-z_ext24_decode (struct mem_read_abstraction_base *mra, int *n_operands, struct operand **operand)
+z_ext24_decode (struct mem_read_abstraction_base *mra, int *n_operands,
+               struct operand **operand)
 {
   uint8_t buffer[3];
   int status = mra->read (mra, 0, 3, buffer);
@@ -391,7 +396,8 @@ z_ext24_decode (struct mem_read_abstraction_base *mra, int *n_operands, struct o
 
 
 static uint32_t
-z_decode_signed_value (struct mem_read_abstraction_base *mra, int offset, short size)
+z_decode_signed_value (struct mem_read_abstraction_base *mra, int offset,
+                      short size)
 {
   assert (size >0);
   assert (size <= 4);
@@ -438,7 +444,7 @@ x_imm1 (struct mem_read_abstraction_base *mra,
 /* An eight bit immediate operand.  */
 static void
 imm1_decode (struct mem_read_abstraction_base *mra,
-       int *n_operands, struct operand **operand)
+            int *n_operands, struct operand **operand)
 {
   x_imm1 (mra, 0, n_operands, operand);
 }
@@ -485,30 +491,30 @@ x_opr_decode_with_size (struct mem_read_abstraction_base *mra, int offset,
        else
          n = x;
 
-        operand = create_immediate_operand (n);
+       operand = create_immediate_operand (n);
        break;
       }
     case OPR_REG:
       {
        uint8_t x = (postbyte & 0x07);
-        operand = create_register_operand (x);
+       operand = create_register_operand (x);
        break;
       }
     case OPR_OFXYS:
       {
-        operand = create_memory_operand (false, postbyte & 0x0F, 1,
+       operand = create_memory_operand (false, postbyte & 0x0F, 1,
                                         xysp_reg_from_postbyte (postbyte), -1);
        break;
       }
     case OPR_REG_DIRECT:
       {
-        operand = create_memory_operand (false, 0, 2, postbyte & 0x07,
+       operand = create_memory_operand (false, 0, 2, postbyte & 0x07,
                                         xysp_reg_from_postbyte (postbyte));
        break;
       }
     case OPR_REG_INDIRECT:
       {
-        operand = create_memory_operand (true, 0, 2, postbyte & 0x07,
+       operand = create_memory_operand (true, 0, 2, postbyte & 0x07,
                                         (postbyte & 0x10) ? REG_Y : REG_X);
        break;
       }
@@ -525,7 +531,7 @@ x_opr_decode_with_size (struct mem_read_abstraction_base *mra, int offset,
            idx -= 0x1UL << 8;
          }
 
-        operand = create_memory_operand (true, idx, 1,
+       operand = create_memory_operand (true, idx, 1,
                                         xysp_reg_from_postbyte (postbyte), -1);
        break;
       }
@@ -542,7 +548,7 @@ x_opr_decode_with_size (struct mem_read_abstraction_base *mra, int offset,
            idx -= 0x1UL << 24;
          }
 
-        operand = create_memory_operand (false, idx, 1,
+       operand = create_memory_operand (false, idx, 1,
                                         xysp_reg_from_postbyte (postbyte), -1);
        break;
       }
@@ -559,7 +565,7 @@ x_opr_decode_with_size (struct mem_read_abstraction_base *mra, int offset,
            idx -= 0x1UL << 24;
          }
 
-        operand = create_memory_operand (false, idx, 1, postbyte & 0x07, -1);
+       operand = create_memory_operand (false, idx, 1, postbyte & 0x07, -1);
        break;
       }
 
@@ -592,7 +598,7 @@ x_opr_decode_with_size (struct mem_read_abstraction_base *mra, int offset,
            idx -= 0x1UL << 8;
          }
 
-        operand = create_memory_operand (false, idx, 1,
+       operand = create_memory_operand (false, idx, 1,
                                         xysp_reg_from_postbyte (postbyte), -1);
        break;
       }
@@ -604,7 +610,7 @@ x_opr_decode_with_size (struct mem_read_abstraction_base *mra, int offset,
        uint32_t idx = x[1] | x[0] << 8 ;
        idx |= (postbyte & 0x30) << 12;
 
-        operand = create_memory_operand (false, idx, 1, postbyte & 0x07, -1);
+       operand = create_memory_operand (false, idx, 1, postbyte & 0x07, -1);
        break;
       }
 
@@ -709,7 +715,7 @@ x_opr_decode_with_size (struct mem_read_abstraction_base *mra, int offset,
            ext24 |= buffer[i] << (8 * (size - i - 1));
          }
 
-        operand = create_memory_operand (true, ext24, 0, -1, -1);
+       operand = create_memory_operand (true, ext24, 0, -1, -1);
        break;
       }
 
@@ -1003,7 +1009,9 @@ sub_d6_y_x (struct mem_read_abstraction_base *mra ATTRIBUTE_UNUSED,
   operand[(*n_operands)++] = create_register_operand (REG_X);
 }
 
-static void ld_18bit_decode (struct mem_read_abstraction_base *mra, int *n_operands, struct operand **operand);
+static void
+ld_18bit_decode (struct mem_read_abstraction_base *mra, int *n_operands,
+                struct operand **operand);
 
 static enum optr
 mul_discrim (struct mem_read_abstraction_base *mra, enum optr hint)
@@ -2254,7 +2262,7 @@ loop_primitive_discrim (struct mem_read_abstraction_base *mra,
 
 static void
 loop_primitive_decode (struct mem_read_abstraction_base *mra,
-                 int *n_operands, struct operand **operands)
+                      int *n_operands, struct operand **operands)
 {
   int offs = 1;
   uint8_t lb;
@@ -2294,7 +2302,8 @@ loop_primitive_decode (struct mem_read_abstraction_base *mra,
 
 
 static enum optr
-shift_discrim (struct mem_read_abstraction_base *mra,  enum optr hint ATTRIBUTE_UNUSED)
+shift_discrim (struct mem_read_abstraction_base *mra,
+              enum optr hint ATTRIBUTE_UNUSED)
 {
   size_t i;
   uint8_t sb;
@@ -2323,7 +2332,8 @@ shift_discrim (struct mem_read_abstraction_base *mra,  enum optr hint ATTRIBUTE_
 
 
 static void
-shift_decode (struct mem_read_abstraction_base *mra,  int *n_operands, struct operand **operands)
+shift_decode (struct mem_read_abstraction_base *mra, int *n_operands,
+             struct operand **operands)
 {
   size_t i;
 
@@ -2415,30 +2425,30 @@ shift_decode (struct mem_read_abstraction_base *mra,  int *n_operands, struct op
 
     case SB_REG_REG_N:
       {
-        uint8_t xb;
-        mra->read (mra, 1, 1, &xb);
-
-        /* This case is slightly unusual.
-           If XB matches the binary pattern 0111XXXX, then instead of
-           interpreting this as a general OPR postbyte in the IMMe4 mode,
-           the XB byte is interpreted in s special way.  */
-        if ((xb & 0xF0) == 0x70)
-          {
-            if (byte & 0x10)
-              {
-                int shift = ((sb & 0x08) >> 3) | ((xb & 0x0f) << 1);
-                operands[(*n_operands)++] = create_immediate_operand (shift);
-              }
-            else
-              {
-                /* This should not happen.  */
-                abort ();
-              }
-          }
-        else
-          {
-            operands[(*n_operands)++] = x_opr_decode (mra, 1);
-          }
+       uint8_t xb;
+       mra->read (mra, 1, 1, &xb);
+
+       /* This case is slightly unusual.
+          If XB matches the binary pattern 0111XXXX, then instead of
+          interpreting this as a general OPR postbyte in the IMMe4 mode,
+          the XB byte is interpreted in s special way.  */
+       if ((xb & 0xF0) == 0x70)
+         {
+           if (byte & 0x10)
+             {
+               int shift = ((sb & 0x08) >> 3) | ((xb & 0x0f) << 1);
+               operands[(*n_operands)++] = create_immediate_operand (shift);
+             }
+           else
+             {
+               /* This should not happen.  */
+               abort ();
+             }
+         }
+       else
+         {
+           operands[(*n_operands)++] = x_opr_decode (mra, 1);
+         }
       }
       break;
     case SB_REG_OPR_OPR:
@@ -2470,8 +2480,8 @@ shift_decode (struct mem_read_abstraction_base *mra,  int *n_operands, struct op
     case SB_REG_OPR_EFF:
     case SB_OPR_N:
       {
-        int imm = (sb & 0x08) ? 2 : 1;
-        operands[(*n_operands)++] = create_immediate_operand (imm);
+       int imm = (sb & 0x08) ? 2 : 1;
+       operands[(*n_operands)++] = create_immediate_operand (imm);
       }
       break;
 
@@ -2505,9 +2515,7 @@ psh_pul_decode (struct mem_read_abstraction_base *mra,
   if (byte & 0x40)
     {
       if ((byte & 0x3F) == 0)
-        {
-         operand[(*n_operands)++] = create_register_all16_operand ();
-        }
+       operand[(*n_operands)++] = create_register_all16_operand ();
       else
        for (bit = 5; bit >= 0; --bit)
          {
@@ -2520,9 +2528,7 @@ psh_pul_decode (struct mem_read_abstraction_base *mra,
   else
     {
       if ((byte & 0x3F) == 0)
-        {
-         operand[(*n_operands)++] = create_register_all_operand ();
-        }
+       operand[(*n_operands)++] = create_register_all_operand ();
       else
        for (bit = 5; bit >= 0; --bit)
          {
@@ -2535,7 +2541,8 @@ psh_pul_decode (struct mem_read_abstraction_base *mra,
 }
 
 static enum optr
-bit_field_discrim (struct mem_read_abstraction_base *mra, enum optr hint ATTRIBUTE_UNUSED)
+bit_field_discrim (struct mem_read_abstraction_base *mra,
+                  enum optr hint ATTRIBUTE_UNUSED)
 {
   int status;
   bfd_byte bb;
@@ -2569,10 +2576,10 @@ bit_field_decode (struct mem_read_abstraction_base *mra,
     {
       bbs = bb_modes + i;
       if ((bb & bbs->mask) == bbs->value)
-        {
-          mode = bbs->mode;
-          break;
-        }
+       {
+         mode = bbs->mode;
+         break;
+       }
     }
   int reg1 = byte2 & 0x07;
   /* First operand */
@@ -2600,15 +2607,15 @@ bit_field_decode (struct mem_read_abstraction_base *mra,
     case BB_REG_REG_REG:
     case BB_REG_REG_IMM:
       {
-        int reg_src = (bb >> 2) & 0x07;
-        operands[(*n_operands)++] = create_register_operand (reg_src);
+       int reg_src = (bb >> 2) & 0x07;
+       operands[(*n_operands)++] = create_register_operand (reg_src);
       }
       break;
     case BB_OPR_REG_REG:
     case BB_OPR_REG_IMM:
       {
-        int reg_src = (byte2 & 0x07);
-        operands[(*n_operands)++] = create_register_operand (reg_src);
+       int reg_src = (byte2 & 0x07);
+       operands[(*n_operands)++] = create_register_operand (reg_src);
       }
       break;
     case BB_REG_OPR_REG:
@@ -2628,7 +2635,7 @@ bit_field_decode (struct mem_read_abstraction_base *mra,
     case BB_OPR_REG_REG:
     case BB_REG_OPR_REG:
       {
-        int reg_parm = bb & 0x03;
+       int reg_parm = bb & 0x03;
        operands[(*n_operands)++] = create_register_operand (reg_parm);
       }
       break;
@@ -2636,13 +2643,13 @@ bit_field_decode (struct mem_read_abstraction_base *mra,
     case BB_OPR_REG_IMM:
     case BB_REG_OPR_IMM:
       {
-        bfd_byte i1;
-        mra->read (mra, 1, 1, &i1);
-        int offset = i1 & 0x1f;
-        int width = bb & 0x03;
-        width <<= 3;
-        width |= i1 >> 5;
-        operands[(*n_operands)++] = create_bitfield_operand (width, offset);
+       bfd_byte i1;
+       mra->read (mra, 1, 1, &i1);
+       int offset = i1 & 0x1f;
+       int width = bb & 0x03;
+       width <<= 3;
+       width |= i1 >> 5;
+       operands[(*n_operands)++] = create_bitfield_operand (width, offset);
       }
       break;
     }
index 2c61e81287c5249c00f025f974a477545dbc057b..3081083821d8cf1af0aad94f338f749aa0b602d2 100644 (file)
@@ -771,7 +771,7 @@ print_insn_xc16x (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
index 2382d08297ab28f3477b579a5f500e82707f2ba5..7da09f373e0b25eb14367b43b616cd4793528037 100644 (file)
@@ -519,7 +519,7 @@ print_insn_xstormy16 (bfd_vma pc, disassemble_info *info)
     cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
   }
 #else
-  isa = info->insn_sets;
+  isa = info->private_data;
 #endif
 
   /* If we've switched cpu's, try to find a handle we've used before */
This page took 0.068049 seconds and 4 git commands to generate.