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@
+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.
struct objdump_disasm_info
{
bfd * abfd;
- asection * sec;
bfd_boolean require_sec;
arelent ** dynrelbuf;
long dynrelcount;
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
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;
}
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);
}
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);
return;
}
- paux->sec = section;
pinfo->buffer = data;
pinfo->buffer_vma = section->vma;
pinfo->buffer_length = datasize;
if (aux.dynrelbuf != NULL)
free (aux.dynrelbuf);
free (sorted_syms);
+ disassemble_free_target (&disasm_info);
}
\f
static bfd_boolean
+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.
#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
{
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),
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:
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;
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..." */
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;
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:
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 .*
.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
.*:176: Warning: .*
.*:177: Error: .*
.*:178: Error: .*
+.*:180: Error: .*
+.*:181: Error: .*
+.*:183: Error: .*
+.*:184: Error: .*
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]
[ ]*[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
.*: Assembler messages:
-.*:153: Warning: redundant segment overrides
+.*:155: Warning: redundant segment overrides
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]
+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.
/* 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;
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
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 (),
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
return bkpt_probe_decode_location (b, location, search_pspace);
}
-static struct breakpoint_ops tracepoint_probe_breakpoint_ops;
-
/* Dprintf breakpoint_ops methods. */
static void
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 (),
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. */
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 ())
{
}
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;
}
}
{
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;
}
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;
}
+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.
return 3;
}
+static int
+g (int &&x)
+{
+ return x;
+}
+
int
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;
}
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"
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
}
# 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\\\)"
# module variables'.
load_lib "fortran.exp"
+load_lib "sym-info-cmds.exp"
if { [skip_fortran_tests] } { continue }
# 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}" ".*"
# This file tests 'info types' for some Fortran types.
load_lib "fortran.exp"
+load_lib "sym-info-cmds.exp"
if { [skip_fortran_tests] } { continue }
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:" \
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)
{
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. */
".*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
test_bkpt_eval_funcs
test_bkpt_registration
test_bkpt_address
+test_bkpt_probe
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\]" \
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" \
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"
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
{
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. */
"-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
test_bkpt_events
test_bkpt_explicit_loc
test_bkpt_qualified
+test_bkpt_probe
--- /dev/null
+# 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
+ }
+}
+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
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
/* 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 *);
/* 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
}
+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
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 */
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 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
}
}
+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 *
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
{
/* Stash the result of parsing disassembler_options here. */
ppc_cpu_t dialect;
-} private;
+};
#define POWERPC_DIALECT(INFO) \
(((struct dis_private *) ((INFO)->private_data))->dialect)
{
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
struct dis_private *priv = calloc (sizeof (*priv), 1);
if (priv == NULL)
- priv = &private;
+ return;
switch (info->mach)
{
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));
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));
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));
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));
\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);
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);
/* 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);
}
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;
}
idx -= 0x1UL << 8;
}
- operand = create_memory_operand (true, idx, 1,
+ operand = create_memory_operand (true, idx, 1,
xysp_reg_from_postbyte (postbyte), -1);
break;
}
idx -= 0x1UL << 24;
}
- operand = create_memory_operand (false, idx, 1,
+ operand = create_memory_operand (false, idx, 1,
xysp_reg_from_postbyte (postbyte), -1);
break;
}
idx -= 0x1UL << 24;
}
- operand = create_memory_operand (false, idx, 1, postbyte & 0x07, -1);
+ operand = create_memory_operand (false, idx, 1, postbyte & 0x07, -1);
break;
}
idx -= 0x1UL << 8;
}
- operand = create_memory_operand (false, idx, 1,
+ operand = create_memory_operand (false, idx, 1,
xysp_reg_from_postbyte (postbyte), -1);
break;
}
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;
}
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;
}
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)
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;
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;
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;
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:
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;
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)
{
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)
{
}
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;
{
bbs = bb_modes + i;
if ((bb & bbs->mask) == bbs->value)
- {
- mode = bbs->mode;
- break;
- }
+ {
+ mode = bbs->mode;
+ break;
+ }
}
int reg1 = byte2 & 0x07;
/* First operand */
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:
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;
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;
}
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 */
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 */