* mips.h (M_DEXT, M_DINS): Delete.
opcodes/
* micromips-opc.c (micromips_opcodes): Replace "dext" and "dins"
macro entries with "dextm", "dextu", "dinsm" and "dinsu" aliases.
Use +H rather than +C for the real "dext".
* mips-opc.c (mips_builtin_opcodes): Likewise.
gas/
* config/tc-mips.c (report_bad_range, report_bad_field): Delete.
(macro): Remove M_DEXT and M_DINS handling.
gas/testsuite/
* gas/mips/ext-ill.l, gas/mips/mips64r2-ill.l: Expect DEXT and DINS
error messages to have the same form as the EXT and INS ones.
* gas/mips/micromips-insn32.d, gas/mips/micromips-noinsn32.d,
gas/mips/micromips-trap.d, gas/mips/micromips.d,
gas/mips/micromips@mips64r2.d, gas/mips/mips64r2.d: Expect
"dext" and "dins" instead of "dextm", "dextu", "dinsm" and "dinsu".
* config/tc-mips.c (mips_arg_info): Replace allow_nonconst and
lax_max with lax_match.
(match_int_operand): Update accordingly. Don't report an error
for !lax_match-only cases.
(match_insn): Replace more_alts with lax_match and use it to
initialize the mips_arg_info field. Add a complete_p parameter.
Handle implicit VU0 suffixes here.
(match_invalid_for_isa, match_insns, match_mips16_insns): New
functions.
(mips_ip, mips16_ip): Use them.
* config/tc-mips.c (mips_arg_info): Remove soft_match.
(match_out_of_range, match_not_constant): New functions.
(match_const_int): Remove fallback parameter and check for soft_match.
Use match_not_constant.
(match_mapped_int_operand, match_addiusp_operand)
(match_perf_reg_operand, match_save_restore_list_operand)
(match_mdmx_imm_reg_operand): Update accordingly. Use
match_out_of_range and set_insn_error* instead of as_bad.
(match_int_operand): Likewise. Use match_not_constant in the
!allows_nonconst case.
(match_float_constant): Report invalid float constants.
(match_insn, match_mips16_insn): Remove soft_match code. Rely on
match_float_constant to check for invalid constants. Fail the
match if match_const_int or match_float_constant return false.
(mips_ip): Update accordingly.
(mips16_ip): Likewise. Undo null termination of instruction name
once lookup is complete.
gas/testsuite/
* gas/mips/ext-ill.l, gas/mips/lui-1.l, gas/mips/mips16e-64.l,
gas/mips/mips32r2-ill-fp64.l, gas/mips/mips32r2-ill-nofp.l,
gas/mips/mips32r2-ill.l, gas/mips/mips64r2-ill.l,
gas/mips/octeon-ill.l, gas/mips/r5900-error-vu0.l,
gas/mips/vr5400-ill.l: Adjust expected errors.
* gas/mips/micromips-size-0.l,
gas/mips/micromips-size-0.s: Likewise. Add new tests.
* gas/mips/mips16e-save-err.s, gas/mips/mips16e-save-err.l: New test.
* gas/mips/mips.exp: Run it.
* config/tc-mips.c (mips_insn_error_format): New enum.
(mips_insn_error): New struct.
(insn_error): Change to a mips_insn_error.
(clear_insn_error, set_insn_error_format, set_insn_error)
(set_insn_error_i, set_insn_error_ss, report_insn_error): New
functions.
(mips_parse_argument_token, md_assemble, match_insn)
(match_mips16_insn): Use them instead of manipulating insn_error
directly.
(mips_ip, mips16_ip): Likewise. Simplify control flow.
gas/testsuite/
* gas/mips/micromips-ill.l: Expect "floating-point expression required"
* config/tc-mips.c (normalize_constant_expr): Move further up file.
(normalize_address_expr): Likewise.
(match_insn, match_mips16_insn): New functions, split out from...
(mips_ip, mips16_ip): ...here.
* Makefile.in (SFILES): Remove common/target-common.c and
add target/waitstatus.c.
(HFILES_NO_SRCDIR): Remove common/target-common.h and add
target/resume.h, target/wait.h and target/waitstatus.h.
(COMMON_OBS): Remove target-common.o and add
waitstatus.o.
(target-common.o): Remove.
(waitstatus.o): New target object file.
* common/target-common.c: Move contents to
target/waitstatus.c and remove.
* common/target-common.h: Move contents to other files and
remove.
(enum resume_kind: Move to target/resume.h.
(TARGET_WNOHANG): Move to target/wait.h.
(enum target_waitkind): Move to target/waitstatus.h.
(struct target_waitstatus): Likewise.
* target.h: Do not include target-common.h and
include target/resume.h, target/wait.h and
target/waitstatus.h.
* target/resume.h: New file.
* target/wait.h: New file.
* target/waitstatus.h: New file.
* target/waitstatus.c: New file.
gdb/gdbserver/
* Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
(SFILES): Remove $(srcdir)/common/target-common.c and
add $(srcdir)/target/waitstatus.c.
(OBS): Remove target-common.o and add waitstatus.o.
(server_h): Remove $(srcdir)/../common/target-common.h and
add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
and $(srcdir)/../target/waitstatus.h.
(target-common.o): Remove.
(waitstatus.o): New target object file.
* target.h: Do not include target-common.h and
include target/resume.h, target/wait.h and
target/waitstatus.h.
2013-08-19 Tristan Gingold <gingold@adacore.com>
* nm.c (print_size_symbols): Directly get symbol size.
binutils/testsuite/
2013-08-19 Tristan Gingold <gingold@adacore.com>
* binutils-all/nm.exp: Add a test for nm --size-sort
* binutils-all/nm-elf-1.s: New file.
* binutils-all/nm-1.s: New file.
In http://sourceware.org/ml/gdb-patches/2013-08/msg00174.html , the
issue of child signal handling around ptrace option support discovery
being different between GDB and GDBserver came up.
I recalled adding these block_child_signals calls, and the "We don't
want those ptrace calls to be interrupted" comment, but not exactly
why. So I looked into it. My first guess is that I got confused.
The patch that added this
<http://sourceware.org/ml/gdb-patches/2009-04/msg00125.html> rewrote
the linux native async support completely, and the old async support
code had the SIGCHLD handler itself do waitpid, so in places that we'd
want a blocking waitpid, we'd have to have the signal handler blocked.
That was probably the mindset I had at the time. Anyway, whatever the
case, looks like I was wrong on the need for this blocking.
Given GDBserver doesn't block like this, I investigated why this is
currently needed on GDB but not on GDBserver.
I removed the block_child_signals (and restore) calls, and hacked
linux-nat.c to call linux_test_for_tracefork in a loop, like:
@@ -534,7 +534,10 @@ static int
linux_supports_tracefork (int pid)
{
if (linux_supports_tracefork_flag == -1)
- linux_test_for_tracefork (pid);
+ {
+ while (1)
+ linux_test_for_tracefork (pid);
+ }
return linux_supports_tracefork_flag;
}
Running the resulting GDB, I then saw bad things happening.
Specifically, I'd end up with a bunch of zombies, and eventually, the
machine would refuse to spawn new processes, claming insufficient
resources.
The issue is that linux_test_for_tracefork test forks, and has the
child fork again. If we don't block SIGCHLD on entry to the function,
the children will inherit SIGCHLD's action/disposition (meaning,
SIGCHLD will be unblocked in the child). When the first child forks
again a second child, and that child exits, the first child gets a
SIGCHLD. Now, when we try to wrap up for the whole options test, we
kill the first child, and collect the waitstatus. Here, when SIGCHLD
isn't blocked, GDB will first see the child reporting a stop with
SIGCHLD. gdbserver's ptrace options test does a PTRACE_KILL loop at
the end, which catches the SIGCHLD, and retries the kill. The GDB
version did not do that. So the GDB version would proceed, leaving
the child zombie (until GDB exists), as nothing collected its final
waitstatus.
So this patch makes the GDB version of linux_test_for_tracefork do the
exact same as the GDBserver version, removes all this unnecessary
blocking throughout, and adds a couple comments at places that do need
it -- namely: places where we'll use sleep with sigsuspend; and
linux_async_pipe, as that destroys the pipe the signal handler
touches.
Tested on x86_64 Fedora 17, sync and async.
gdb/
2013-08-19 Pedro Alves <palves@redhat.com>
* linux-nat.c (linux_test_for_tracefork)
(linux_test_for_tracesysgood, linux_child_follow_fork)
(lin_lwp_attach_lwp, linux_nat_resume): Don't block child signals.
(linux_nat_wait_1): Extend comment.
(linux_async_pipe): Add comment.
The nightly snapshots we have been creating in the past did not
include the "-cvs" suffix at the end of the version number. Snapshot
packaging started breaking ever since GDB switched to using BFD's
version number. Things got partially fixed with the previous change
to this file, but the change missed the fact that the "-cvs" suffix
in the tarball name (Eg: gdb-7.6.50-20130816-cvs.tar) is undesirable.
This patch removes it.
ChangeLog:
* src-release (VER): When using $(TOOL)/common/create-version.sh,
strip the "-cvs" suffix from the version number if present.
* ldgram.y: Likewise
* ldlex.l: Likewise
* NEWS: Mention the new feature.
* ld.texinfo: Document the new feature.
* ld-scripts/log2.exp: New: Run the new log2 test.
* ld-scripts/log2.s: Source for the new test.
* ld-scripts/log2.t: Linker script for new test.
This moves a few static variables from thread-info functions into
remote_state. Pedro said on irc that these functions implement the
ancient thread-discovery method and that he wouldn't be surprised if
they had rotted; nevertheless it seems safer to me to make them
explicitly per-remote.
This necessitated moving a couple of macros and a typedef earlier in
the file.
* remote.c (struct remote_state) <echo_nextthread, nextthread,
resultthreadlist>: New fields.
(OPAQUETHREADBYTES, threadref, MAXTHREADLISTRESULTS): Move earlier.
(remote_get_threadlist, remote_threadlist_iterator): Use
new fields. Remove static variables.
This moves the globals remote_stopped_by_watchpoint_p and
remote_watch_data_address into remote_state.
* remote.c (struct remote_state) <remote_stopped_by_watchpoint_p,
remote_watch_data_address>: New fields.
(remote_stopped_by_watchpoint_p, remote_watch_data_address): Remove.
(process_stop_reply, remote_wait_as)
(remote_check_watch_resources, remote_stopped_data_address): Update.
The global sizeof_pkt is only used in remote_trace_find, like so:
reply = remote_get_noisy_reply (&(rs->buf), &sizeof_pkt);
I think in this situation it is more correct to use the recorded size
of the buffer. Otherwise it seems that some skew could result.
* remote.c (sizeof_pkt): Remove.
(remote_trace_find): Use rs->buf_size, not sizeof_pkt.
This moves the use_threadextra_query and use_threadinfo_query globals
into remote_state.
* remote.c (struct remote_state) <use_threadinfo_query,
use_threadextra_query>: New fields.
(remote_threads_info, remote_threads_extra_info)
(remote_open_1): Update.
This moves a few static variables out of remote_read_qxfer and into
remote_state.
* remote.c (struct remote_state) <finished_object,
finished_annex, finished_offset>: New fields.
(remote_read_qxfer): Use remote_state fields; remove static
variables.
This moves the global last_sent_step into remote_state.
* remote.c (struct remote_state) <last_sent_step>:
New field.
(last_sent_step): Remove.
(remote_resume, remote_wait_as): Update.
This moves the global last_sent_signal into remote_state.
* remote.c (struct remote_state) <last_sent_signal>:
New field.
(last_sent_signal): Remove.
(new_remote_state, remote_resume, remote_wait_as): Update.
This moves the global last_program_signals_packet into remote_state.
* remote.c (struct remote_state) <last_program_signals_packet>:
New field.
(last_program_signals_packet): Remove.
(remote_program_signals, remote_open_1): Update.
This moves the global last_pass_packet into remote_state.
* remote.c (struct remote_state) <last_pass_packet>:
New field.
(last_pass_packet): Remove.
(remote_pass_signals, remote_open_1): Update.
This moves the global remote_traceframe_number into remote_state.
* remote.c (struct remote_state) <remote_traceframe_number>:
New field.
(remote_traceframe_number): Remove.
(new_remote_state, remote_open_1, set_remote_traceframe)
(remote_trace_find): Update.
Add new_remote_state and change remote_state to be a pointer. This is
a preparatory patch for a later series. It could perhaps be omitted,
but new_remote_state also does some initialization that was previously
done for the globals.
* remote.c (remote_state): Now a pointer.
(get_remote_state_raw): Update.
(new_remote_state): New function.
(_initialize_remote): Use new_remote_state.
gdb has a copy of some CRC code that also appears in libiberty.
This patch just removes the local copy.
You may notice that "crc32" returns unsigned long but "xcrc32" returns
unsigned int. However, this does not matter, because crc32 actually
does all its operations in unsigned int type, and only the return
result is widened. So, the difference does not matter.
* remote.c (crc32_table, crc32): Remove.
(remote_verify_memory): Use xcrc32.
* elf32-arm.c (elf32_arm_final_link_relocate): Use origin of output
segment containing the relocating symbol instead of assuming 0 for
sb group relocations.
* ld-arm/group-relocs-ldr-bad.s: Redefine bar into foo section
beyond 16 bit offset width.
* ld-arm/group-relocs-ldrs-bad.s: Likewise.
* ld-arm/group-relocs-ldr-bad.d: Adjust expected result.
* ld-arm/group-relocs-ldrs-bad.d: Likewise.
* ld-arm/group-relocs.s: Add comments. Move symbols used for sb
group relocations into .data section. Drop section zero. Use pc/r0
as base register when pc/sb group relocations are used.
* ld-arm/group-relocs.d: Adjust expected result.
* ld-arm/group-relocs-alu-bad-2.d: New test for sb group relocation.
* ld-arm/group-relocs-ldc-bad-2.d: Likewise.
* ld-arm/group-relocs-ldr-bad-2.d: New test for pc group relocation.
* ld-arm/group-relocs-ldrs-bad-2.d: Likewise.
* ld-arm/unresolved-2.d: Add sb relocation failure test.
* ld-arm/group-relocs-alu-bad-2.s: New test source.
* ld-arm/group-relocs-ldr-bad-2.s: Likewise.
* ld-arm/group-relocs-ldrs-bad-2.s: Likewise.
* ld-arm/group-relocs-ldc-bad-2.s: Likewise.
* ld-arm/unresolved-2.s: Likewise.
* ld-arm/arm-elf.exp: For group-relocs, drop section zero start
definition. Run the new tests.
to PTRACE_TYPE_ARG3.
* linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
PTRACE_TYPE_ARG4.
* linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
(PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
in order to match GNU Coding Standards.
2013-08-13 Sergio Durigan Junior <sergiodj@redhat.com>
* value.h (create_internalvar_type_lazy): Adjust prototype
declaration.
This introduces parallel mode for the test suite.
It doesn't fully work yet in the sense that if you do a fully parallel
run, you will encounter some file-name clashes, but this has to start
somewhere, and it seemed best to add some infrastructure now, so that
you can follow along and test subsequent patches if you care to.
This patch has two parts.
First, it checks for the GDB_PARALLEL variable. If this is set (say,
on the runtest command line), then the test suite assumes "parallel
mode". In this mode, files are put into a subdirectory named after
the test. That is, for DIR/TEST.exp, the outputs are put into
./outputs/DIR/TEST/.
This first part has various follow-on changes coming in subsequent
patches. This is why the code in this patch also makes "temp" and
"cache" directories.
Second, this adds an "inotify" mode. If you have the inotifywait
command (part of inotify-tools), you can set the GDB_INOTIFY variable.
This will tell the test suite to watch for changes outside of the
allowed output directories.
This mode is useful for debugging the test suite, as it issues a
report whenever a possibly parallel-unsafe file open is done.
2013-08-13 Tom Tromey <tromey@redhat.com>
Yao Qi <yao@codesourcery.com>
* lib/cache.exp (gdb_do_cache): Handle GDB_PARALLEL.
* lib/gdb.exp: Handle GDB_PARALLEL.
(default_gdb_version): Kill inotify_pid if it exists.
(default_gdb_exit): Emit warning if the inotify log is not
empty.
(standard_output_file): Respect GDB_PARALLEL.
(standard_temp_file): Likewise.
(gdb_init): Start inotifywait if requested.
* gdbint.texinfo (Testsuite): Use @table, not @itemize.
Document GDB_PARALLEL and GDB_INOTIFY.
http://sourceware.org/ml/gdb-patches/2013-08/msg00340.html
gdb/ChangeLog
* common/format.c (parse_format_string): Don't allow '#' flag for
pointer arguments in format string.
gdb/testsuite/ChangeLog
* gdb.base/printcmds.exp (test_printf): Add test for printf of
pointer with various flags.
In the fully parallel mode, each .exp file can be run in parallel (at
least conceptually -- the actual split may not be so severe). This
means that procs that compute a result and cache it are not going to
function very well. The test they run will be invoked over and over.
This patch introduces a generic caching mechanism and changes various
result-caching procs to use it. This is a cleanup to introduce the
basic change; the results aren't written to disk yet.
A caching proc is defined using gdb_caching_proc, which works like
"proc", except that it caches the result of the body.
* lib/cache.exp: New file.
* lib/cell.exp (skip_cell_tests): Use gdb_caching_proc.
* lib/gdb.exp: Load cache.exp.
(support_complex_tests, is_ilp32_target, is_lp64_target)
(is_amd64_regs_target, skip_altivec_tests, skip_vsx_tests)
(gdb_skip_xml_test): Use gdb_caching_proc.
* lib/opencl.exp (skip_opencl_tests): Use gdb_caching_proc.