This walks the list of struct kinfo_file objects returned by a call to
kinfo_getfile outputting a description of each open file descriptor.
gdb/ChangeLog:
* fbsd-nat.c (fbsd_nat_target::info_proc): List open file
descriptors for IP_FILES and IP_ALL.
Walk the list of struct kinfo_file objects in the
NT_FREEBSD_PROCSTAT_FILES core dump note outputting a description of
each open file descriptor. For sockets, the local and remote socket
addresses are displayed in place of the file name field. For UNIX
local domain sockets, only a single address is displayed since most
UNIX sockets only have one valid address and printing both pathnames
could be quite long. The output format was somewhat inspired by the
output of the "procstat -f" command on FreeBSD, but with a few less
details and some fields were condensed.
gdb/ChangeLog:
* fbsd-tdep.c (KF_FLAGS, KF_OFFSET, KF_VNODE_TYPE, KF_SOCK_DOMAIN)
(KF_SOCK_TYPE, KF_SOCK_PROTOCOL, KF_SA_LOCAL, KF_SA_PEER)
(KINFO_FILE_TYPE_SOCKET, KINFO_FILE_TYPE_PIPE)
(KINFO_FILE_TYPE_FIFO, KINFO_FILE_TYPE_KQUEUE)
(KINFO_FILE_TYPE_CRYPTO, KINFO_FILE_TYPE_MQUEUE)
(KINFO_FILE_TYPE_SHM, KINFO_FILE_TYPE_SEM, KINFO_FILE_TYPE_PTS)
(KINFO_FILE_TYPE_PROCDESC, KINFO_FILE_FD_TYPE_ROOT)
(KINFO_FILE_FD_TYPE_JAIL, KINFO_FILE_FD_TYPE_TRACE)
(KINFO_FILE_FD_TYPE_CTTY, KINFO_FILE_FLAG_READ)
(KINFO_FILE_FLAG_WRITE, KINFO_FILE_FLAG_APPEND)
(KINFO_FILE_FLAG_ASYNC, KINFO_FILE_FLAG_FSYNC)
(KINFO_FILE_FLAG_NONBLOCK, KINFO_FILE_FLAG_DIRECT)
(KINFO_FILE_FLAG_HASLOCK, KINFO_FILE_FLAG_EXEC)
(KINFO_FILE_VTYPE_VREG, KINFO_FILE_VTYPE_VDIR)
(KINFO_FILE_VTYPE_VCHR, KINFO_FILE_VTYPE_VLNK)
(KINFO_FILE_VTYPE_VSOCK, KINFO_FILE_VTYPE_VFIFO, FBSD_AF_UNIX)
(FBSD_AF_INET, FBSD_AF_INET6, FBSD_SOCK_STREAM, FBSD_SOCK_DGRAM)
(FBSD_SOCK_SEQPACKET, FBSD_IPPROTO_ICMP, FBSD_IPPROTO_TCP)
(FBSD_IPPROTO_UDP, FBSD_IPPROTO_SCTP): New defines.
(struct fbsd_sockaddr_in, struct fbsd_sockaddr_in6)
(struct fbsd_sockaddr_un): New types.
(fbsd_file_fd, fbsd_file_type, fbsd_file_flags, fbsd_ipproto)
(fbsd_print_sockaddr_in, fbsd_print_sockaddr_in6)
(fbsd_info_proc_files_header, fbsd_info_proc_files_entry)
(fbsd_core_info_proc_files): New functions.
(fbsd_core_info_proc): List open file descriptors for IP_FILES and
IP_ALL.
* fbsd-tdep.h (fbsd_info_proc_files_header)
(fbsd_info_proc_files_entry): New.
This command displays a list of open file descriptors.
gdb/ChangeLog:
* defs.h (enum info_proc_what) [IP_FILES]: New value.
* infcmd.c (info_proc_cmd_files): New function.
(_initialize_infcmd): Register 'info proc files' command.
Sort the list of files generated by find to make the order of the
entries deterministic. When sorting, use explicit "C" collation. Use
an explicit tab character instead of '\t' as some sed implementations
treat '\t' as an escaped 't' instead of a tab.
gdb/ChangeLog:
* gnulib/aclocal-m4-deps.mk: New file.
* gnulib/update-gnulib.sh: Generate "aclocal-m4-deps.mk"
deterministically.
fbsd_core_vnode_path needs to use the offset of the kf_path member of
struct kinfo_file as the minimum size of a struct kinfo_file object.
However, it was using KVE_PATH instead due to a copy and paste bug.
While here, fix another copy and paste bug in the error message for a
truncated kinfo_file object.
gdb/ChangeLog:
* fbsd-tdep.c (fbsd_core_vnode_path): Use KF_PATH instead of
KVE_PATH.
Another case of incomplete regexp. The problem is very similar to the
one happening with gdb.arch/amd64-invalid-stack-middle.exp.
The output when GDB is compiled with "--enable-targets" is:
(gdb) interpreter-exec mi "-stack-list-frames"
^done,stack=[frame={level="0",addr="0x00000000004005e7",func="func2",arch="i386:x86-64"}]
While the output when "--enable-targets" is not specified is:
(gdb) interpreter-exec mi "-stack-list-frames"
^done,stack=[frame={level="0",addr="0x00000000004005e7",func="func2"}]
The fix is, again, to extend the current regexp and expect for the
optional "arch=" part. With this patch, the test now passes on both
scenarios.
OK?
gdb/testsuite/ChangeLog:
2018-09-18 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.arch/amd64-invalid-stack-top.exp: Expect optional
"arch=" keyword when executing "-stack-list-frames".
While regression-testing GDB on Fedora Rawhide, I saw the following
output when running gdb.arch/amd64-invalid-stack-middle.exp's
"-stack-list-frames" test:
(gdb) interpreter-exec mi "-stack-list-frames"
^done,stack=[frame={level="0",addr="0x000000000040115a",func="breakpt",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/fedora/gdb/master/gdb-8.2.50.20180917/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="27",arch="i386:x86-64"},frame={level="1",addr="0x000000000040116a",func="func5",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/fedora/gdb/master/gdb-8.2.50.20180917/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="32",arch="i386:x86-64"},frame={level="2",addr="0x000000000040117a",func="func4",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/fedora/gdb/master/gdb-8.2.50.20180917/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="38",arch="i386:x86-64"},frame={level="3",addr="0x000000000040118a",func="func3",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/fedora/gdb/master/gdb-8.2.50.20180917/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="44",arch="i386:x86-64"}]
This test is currently failing on Rawhide. However, this output is
almost the same as I get on my local Fedora 28 machine (where the test
is passing):
(gdb) interpreter-exec mi "-stack-list-frames"
^done,stack=[frame={level="0",addr="0x00000000004005da",func="breakpt",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/work/src/git/binutils-gdb/binutils-gdb/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="27"},frame={level="1",addr="0x00000000004005ea",func="func5",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/work/src/git/binutils-gdb/binutils-gdb/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="32"},frame={level="2",addr="0x00000000004005fa",func="func4",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/work/src/git/binutils-gdb/binutils-gdb/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="38"},frame={level="3",addr="0x000000000040060a",func="func3",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/work/src/git/binutils-gdb/binutils-gdb/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="44"}]
With the exception that there's an "arch=" keyword on Fedora Rawhide's
version. This is because, on Rawhide, I've compiled GDB with
"--enable-targets=xyz,kqp,etc.", while locally I haven't.
This is easy to fix: we just have to extend the regexp and expect for
the optional "arch=" keyword there. It's what this patch does. With
it applied, the test now passes everywhere.
OK?
gdb/testsuite/ChangeLog:
2018-09-18 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.arch/amd64-invalid-stack-middle.exp: Expect optional
"arch=" keyword when executing "-stack-list-frames".
Currently, gdb.ada/complete.exp's "complete break ada" test fails
because the regexp used to match the command's output doesn't expect
"@", but we have an output like:
...
complete break ada
break ada.assertions.assert
break ada.calendar.arithmetic.difference
break ada.calendar.arithmetic_operations.add
break ada.calendar.arithmetic_operations.add.cold
break ada.calendar.arithmetic_operations.add@plt
break ada.calendar.arithmetic_operations.difference
break ada.calendar.arithmetic_operations.difference@plt
...
This patch adds "@" to the regexp, unbreaking the test.
OK?
gdb/testsuite/ChangeLog:
2018-09-18 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.ada/complete.exp: Expect for "@" when doing "complete
break ada".
This removes the remaining cleanups from compile-object-load.c.
gdb/ChangeLog
2018-09-18 Tom Tromey <tom@tromey.com>
* compile/compile-object-load.c (struct
link_hash_table_cleanup_data): Add constructor and destructor.
Use DISABLE_COPY_AND_ASSIGN.
(~link_hash_table_cleanup_data): Rename from
link_hash_table_free. Now a destructor.
(copy_sections): Use gdb::unique_xmalloc_ptr. Remove cleanups.
This removes munmap_listp_free_cleanup, replacing it with a
std::unique_ptr at one spot and an explicit delete in another. It
seemed simplest to completely change this data structure.
gdb/ChangeLog
2018-09-18 Tom Tromey <tom@tromey.com>
* compile/compile-object-run.c (do_module_cleanup): Use delete.
* compile/compile-object-load.c (struct munmap_list): Move to
header file.
(munmap_list::add): Rename from munmap_list_add; rewrite.
(munmap_list::~munmap_list): Rename from munmap_list_free.
(munmap_listp_free_cleanup): Remove.
(compile_object_load): Update.
* compile/compile-object-load.h (struct munmap_list): Move from
compile-object-load.c. Rewrite.
Using "call" on a function that passes arguments via float registers can cause
gdb to overflow buffers.
Ensure enough memory is reserved to hold a full FP register.
This fixes gdb.base/callfuncs.exp for Aarch64 SVE.
2018-09-18 Alan Hayward <alan.hayward@arm.com>
* aarch64-tdep.c (pass_in_v): Use register size.
(aarch64_extract_return_value): Likewise.
(aarch64_store_return_value): Likewise.
This fixes a small bug with the warning filtering code, which when a line has
generated a warning and a template decode error (due to the way templates are
resolved) which would not have been emitted and warnings are being suppressed
with -W it would erroneously emit the error.
I have no testcase for this because the only places we generate warnings during
encoding/decoding now is using msr/mrs and system registers. They don't have a
template that would trigger this.
However an upcoming patch series will have tests in it which would expose this bug.
gas/ChangeLog:
* config/tc-aarch64.c (output_operand_error_report): Apply filtering to
current instead of head message.
gdb doesn't currently build on 64-bit Solaris 10:
/vol/src/gnu/gdb/hg/master/local/gdb/utils.c: In function ‘void dump_core()’:
/vol/src/gnu/gdb/hg/master/local/gdb/utils.c:223:55: error: narrowing conversion
of ‘-3’ from ‘long int’ to ‘rlim_t’ {aka ‘long unsigned int’} inside {
} [-Wnarrowing]
struct rlimit rlim = { RLIM_INFINITY, RLIM_INFINITY };
^
/vol/src/gnu/gdb/hg/master/local/gdb/utils.c:223:55: error: narrowing conversion
of ‘-3’ from ‘long int’ to ‘rlim_t’ {aka ‘long unsigned int’} inside {
} [-Wnarrowing]
This was introduced by
2018-08-27 Tom Tromey <tom@tromey.com>
PR build/23087:
* configure: Rebuild.
* warning.m4 (AM_GDB_WARNINGS): Remove -Wno-narrowing.
and can be fixed by the following patch.
Solaris 11 isn't affected because there <sys/resource.h> has
#define RLIM_INFINITY ((rlim_t)-3l)
instead of
#define RLIM_INFINITY (-3l)
on Solaris 10.
Tested on amd64-pc-solaris2.10 and amd64-pc-solaris2.11.
* utils.c (dump_core) [HAVE_SETRLIMIT]: Cast RLIM_INFINITY to
rlim_t.
Without the patch:
(gdb) apropos able frame-filter
disable frame-filter -- GDB command to disable the specified frame-filter
enable frame-filter -- GDB command to disable the specified frame-filter
With the patch:
(gdb) apropos able frame-filter
disable frame-filter -- GDB command to disable the specified frame-filter
enable frame-filter -- GDB command to enable the specified frame-filter
Pushed as obvious
The Python CFLAGS include -DNDEBUG. This was apparently done
intentionally -- setting the flags is done manually because, according
to a comment, python-config passes too many things to the compiler
(which is true).
Per PR python/20445, this patch changes configure so that -DNDEBUG is
only used by release builds. This probably doesn't have very much
effect in practice, but I did see that some Python headers use assert,
so perhaps it will give some safety.
Tested by rebuilding and re-running gdb.python/*.exp on x86-64 Fedora 28.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
PR python/20445:
* configure: Rebuild.
* configure.ac: Conditionally use -DNDEBUG for Python.
There was a report on irc that the gdb check for mpfr failed when only
static libraries are available. The issue is that mpfr depends on
gmp, but this is not handled explicitly by gdb.
Ideally upstream would switch to pkg-config. Or even more ideally, we
would incorporate pkg-config into the compiler and not mess with any
of this.
Meanwhile, this changes gdb's configure to add gmp to the link line
when checking for mpfr.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* configure.ac: Use gmp as a library dependency when checking for
mpfr.
Commit 00431a78b2 ("Use thread_info and inferior pointers more
throughout") removed the declaration of find_inferior_object, but
missed removing the definition.
gdb/ChangeLog:
2018-09-17 Pedro Alves <palves@redhat.com>
* python/py-inferior.c (find_inferior_object): Delete.
2018-09-17 Kito Cheng <kito@andestech.com>
gas/
* testsuite/gas/riscv/bge.d: New.
* testsuite/gas/riscv/bge.s: Likewise.
opcodes/
* riscv-opc.c (riscv_opcodes): Adjust the order of ble and
bleu.
Patch
d82b3862f1 ("compile: Remove non-const reference parameters")
introduced a regression in compile/compile-cplus-types.c. The new_scope
variable in compile_cplus_instance::enter_scope is used after it was
std::moved. This patch fixes it by referring to the back of the vector
where it was moved instead.
gdb/ChangeLog:
* compile/compile-cplus-types.c
(compile_cplus_instance::enter_scope): Don't use new_scope after
std::move.
Add -mvexwig=[0|1] option to x86 assembler to control how the assembler
should encode the VEX.W bit in WIG VEX instructions.
* gas/NEWS: Mention -mvexwig=[0|1] option.
* config/tc-i386.c (vexwig): New.
(build_vex_prefix): Set the VEX.W bit for -mvexwig=1 for WIG
VEX instructions.
(OPTION_MVEXWIG): New.
(md_longopts): Add -mvexwig=.
(md_parse_option): Handle OPTION_MVEXWIG.
(md_show_usage): Show -mvexwig=[0|1].
* doc/c-i386.texi: Document -mvexwig=[0|1].
* testsuite/gas/i386/avx-wig.d: New file.
* testsuite/gas/i386/avx-wig.s: Likewise.
* testsuite/gas/i386/avx2-wig.d: Likewise.
* testsuite/gas/i386/avx2-wig.s: Likewise.
* testsuite/gas/i386/x86-64-avx-wig.d: Likewise.
* testsuite/gas/i386/x86-64-avx-wig.s: Likewise.
* testsuite/gas/i386/x86-64-avx2-wig.d: Likewise.
* testsuite/gas/i386/x86-64-avx2-wig.s: Likewise.
* testsuite/gas/i386/i386.exp: Run avx-wig, avx2-wig,
x86-64-avx-wig and x86-64-avx2-wig.
add_specific_symbols allocates a buffer to hold symbols. It should be
freed only if it is no longer in use.
PR binutils/23633
* objcopy.c (strip_specific_buffer): New.
(strip_unneeded_buffer): Likewise.
(keep_specific_buffer): Likewise.
(localize_specific_buffer): Likewise.
(globalize_specific_buffer): Likewise.
(keepglobal_specific_buffer): Likewise.
(weaken_specific_buffer): Likewise.
(add_specific_symbols): Add an argument to return pointer to
allocated buffer.
(copy_main): Update add_specific_symbols to update pointers to
allocated buffer. Free pointers to allocated buffer before
return.
On macOS the usual cache directory is ~/Library/Caches. This patch
changes get_standard_cache_dir to use that instead of XDG.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* common/pathstuff.c (get_standard_cache_dir): Use
~/Library/Caches on macOS.
* common/pathstuff.h (get_standard_cache_dir): Update comment.
gdb/doc/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* gdb.texinfo (Index Files): Update for cache directory change on
macOS.
* objcopy.c (handle_remove_section_option): Don't require a dot
after .rela and .rel to handle a possible relocation section.
* testsuite/binutils-all/remove-relocs-07.s,
* testsuite/binutils-all/remove-relocs-07.d,
* testsuite/binutils-all/remove-relocs-08.d: New tests.
* testsuite/binutils-all/remove-relocs-01.d,
* testsuite/binutils-all/remove-relocs-04.d,
* testsuite/binutils-all/remove-relocs-05.d,
* testsuite/binutils-all/remove-relocs-06.d: Exclude mips64-openbsd.
Since commit
56bcdbea2b ("Let gdb.execute handle multi-line commands")
trying to use a command like gdb.execute("show commands") in Python
fails. GDB ends up trying to run the "commands" command.
The reason is that GDB gets confused with the special "commands"
command. In process_next_line, the lookup_cmd_1 function returns the
cmd_list_element representing the "commands" sub-command of "show".
Lower, we check the cmd_list_element to see if it matches various
control commands by name, including the "commands" command. This is
where we wrongfully conclude that the executed command must be
"commands", when in reality it was "show commands".
The fix proposed in this patch removes the comparisons by name, instead
comparing the cmd_list_element object by pointer with the objects
created at initialization time.
Tested on the buildbot, though on a single builder (Fedora-x86_64-m64).
gdb/ChangeLog:
PR python/23669
* breakpoint.c (commands_cmd_element): New.
(_initialize_breakpoint): Assign commands_cmd_element.
* breakpoint.h (commands_cmd_element): New.
* cli/cli-script.c (while_cmd_element, if_command,
define_cmd_element): New.
(command_name_equals): Remove.
(process_next_line): Compare commands by pointer, not by name.
(_initialize_cli_script): Assign the various cmd_list_element
variables.
* compile/compile.c (compile_cmd_element): New.
(_initialize_compile): Assign compile_cmd_element.
* compile/compile.h (compile_cmd_element): New.
* guile/guile.c (guile_cmd_element): New.
(install_gdb_commands): Assign guile_cmd_element.
* guile/guile.h (guile_cmd_element): New.
* python/python.c (python_cmd_element): New.
(_initialize_python): Assign python_cmd_element.
* python/python.h (python_cmd_element): New.
* tracepoint.c (while_stepping_cmd_element): New.
(_initialize_tracepoint): Assign while_stepping_cmd_element.
* tracepoint.h (while_stepping_cmd_element): New.
gdb/testsuite/ChangeLog:
PR python/23669
* gdb.python/python.exp: Test gdb.execute("show commands").
binutils* testsuite/binutils-all/compress.exp: Rename second "objcopy
zlib-gnu compress debug sections 3" test to "objcopy zlib-gabi
compress debug sections 3" and use gabi object files instead
of gnu object files.
* testsuite/binutils-all/objcopy.exp: Add suffix to the names
of the "ELF group" tests.
* testsuite/binutils-all/readelf.exp (proc readelf_find_size):
Add an iteration parameter and include it in the name of the
test. Update callers to include an iteration count.
gas * testuite/gas/elf/group0a.d: Add extra details to the test
name.
* testuite/gas/elf/group0b.d: Likewise.
* testuite/gas/elf/group1a.d: Likewise.
* testuite/gas/elf/group1b.d: Likewise.
* testuite/gas/elf/group0b.d: Likewise.
* testuite/gas/elf/section9.d: Likewise.
* testuite/gas/i386/ilp32/lns/lns-common-1.d: Likewise.
* testuite/gas/i386/ilp32/lns/lns-duplicate-1.d: Likewise.
ld * testuite/ld/ld-elf/audit.exp: Differentiate the names of the
two "Run with shared with --audit" tests.
* testuite/ld/ld-elf/compress.exp: Differentiate the zlib
compressed debug output test names.
* testuite/ld/ld-i386/tlspie1.d: Add extra details to the test
name.
* testuite/ld/ld-i386/tlspie2.d: Likewise.
* testuite/ld/ld-size/size.exp: Add missing escapes to the end
of lines in the size-3e test.
* testuite/ld/ld-unique/unique.exp: Differentiate the names of
the two "Checking unique PIC object" tests.
* testuite/ld/ld-x86-64/tlspie1.d: Add extra details to the test
name.
When dereferencing a GOT slot with lgrl or lg we rewrite this using
larl to get rid of the extra memory access. However, we cannot do
this for:
- symbols marked for absolute addressing
- symbols at odd addresses (larl can handle only even addresses)
Fixed with the attached patch.
bfd/ChangeLog:
2018-09-17 Andreas Krebbel <krebbel@linux.ibm.com>
* elf64-s390.c (elf_s390_relocate_section): Prevent rewriting of
GOT accesses with larl for ABS or misaligned symbols.
ld/ChangeLog:
2018-09-17 Andreas Krebbel <krebbel@linux.ibm.com>
* testsuite/ld-s390/gotreloc-1.s: Add tests for ABS and misaligned
symbol. Move variables into data section. Make bar 8 bytes wide.
* testsuite/ld-s390/gotreloc-1.ver: Make misaligned_sym resolve locally.
* testsuite/ld-s390/gotreloc_31-1.dd: Adjust patterns.
* testsuite/ld-s390/gotreloc_64-norelro-1.dd: Likewise.
* testsuite/ld-s390/gotreloc_64-relro-1.dd: Likewise.
Simon pointed out that save_infcall_suspend_state and
save_infcall_control_state could return unique pointers. This patch
implements this idea.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* infrun.c (save_infcall_suspend_state): Return
infcall_suspend_state_up.
(save_infcall_control_state): Return infcall_control_state_up.
* inferior.h (save_infcall_suspend_state)
(save_infcall_control_state): Declare later. Return unique
pointers.
This removes release_stop_context_cleanup, replacing it with a
stop_context destructor. It also mildly c++-ifies this struct.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* infrun.c (struct stop_context): Declare constructor,
destructor, "changed" method.
(stop_context::stop_context): Rename from save_stop_context.
(stop_context::~stop_context): Rename from
release_stop_context_cleanup.
(normal_stop): Update.
(stop_context::changed): Rename from stop_context_changed. Return
bool.
This removes a couple of cleanups from infrun by introducing a couple
of unique_ptr specializations.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* inferior.h (struct infcall_suspend_state_deleter): New.
(infcall_suspend_state_up): New typedef.
(struct infcall_control_state_deleter): New.
(infcall_control_state_up): New typedef.
(make_cleanup_restore_infcall_suspend_state)
(make_cleanup_restore_infcall_control_state): Don't declare.
* infcall.c (call_function_by_hand_dummy): Update.
* infrun.c (do_restore_infcall_suspend_state_cleanup)
(make_cleanup_restore_infcall_suspend_state): Remove.
(do_restore_infcall_control_state_cleanup)
(make_cleanup_restore_infcall_control_state): Remove.
This removes a cleanup from infrun.c by taking advantage of the
previous patch to introduce a use of unique_xmalloc_ptr.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* infrun.c (struct infcall_suspend_state) <registers>: Now a
unique_ptr.
<siginfo_data>: Now a unique_xmalloc_ptr.
(save_infcall_suspend_state, restore_infcall_suspend_state)
(discard_infcall_suspend_state)
(get_infcall_suspend_state_regcache): Update.
This changes infrun.c to use new and delete for infcall_suspend_state.
This enables the coming cleanups.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* gdbthread.h (struct thread_suspend_state): Add initializers.
(class thread_info) <suspend>: Remove initializer.
* infrun.c (struct infcall_suspend_state): Add initializers.
(save_infcall_suspend_state): Use new.
(discard_infcall_suspend_state): Use delete.
Some Python APIs steal references from their caller, and the refcount
checker supports this via an attribute.
However, in gdb with C++ we have a better idiom available: we can use
std::move on a gdbpy_ref<> instead. This makes the semantics obvious
at the point of call, and is safer at runtime as well, because the
callee's gdbpy_ref<> will be emptied.
This patch changes the reference-stealing code in gdb to use rvalue
references instead.
Tested on x86-64 Fedora 28.
gdb/ChangeLog
2018-09-16 Tom Tromey <tom@tromey.com>
* python/python-internal.h (CPYCHECKER_STEALS_REFERENCE_TO_ARG):
Remove.
* python/py-varobj.c (py_varobj_iter_ctor): Change pyiter to
rvalue reference. Remove CPYCHECKER_STEALS_REFERENCE_TO_ARG.
(py_varobj_iter_new): Likewise.
(py_varobj_get_iterator): Use gdbpy_ref.
An review by Simon of an earlier showed a few spots related to
thread_to_thread_object that could be simplified. This also detected
a latent bug, where thread_to_thread_object was inconsistent about
setting the Python exception before a NULL return.
Tested on x86-64 Fedora 28.
gdb/ChangeLog
2018-09-16 Tom Tromey <tom@tromey.com>
* python/py-threadevent.c (py_get_event_thread): Simplify.
* python/py-inferior.c (infpy_thread_from_thread_handle):
Return immediately after calling thread_to_thread_object. Use
Py_RETURN_NONE.
(thread_to_thread_object): Set the exception on a NULL return.
Tom mentioned this a while ago, as a way to give you a cheap sense of
progression in your build, as all object files will be built
alphabetically (including the directory part). I tried it and I think
it's nice.
gdb/ChangeLog:
* Makefile.in (LIBGDB_OBS): Sort COMMON_OBS.
gdb/gdbserver/ChangeLog:
* Makefile.in (gdbserver$(EXEEXT)): Sort OBS.
(gdbreplay$(EXEEXT)): Sort GDBREPLAY_OBS.
($(IPA_LIB)): Sort IPA_OBJS.
ADD_DEPS is defined nowhere, so I presume it's not useful. If I'm wrong
and this is actually used, there should be a comment explaining where it
comes from.
gdb/gdbserver/ChangeLog:
* Makefile.in: Remove references to $(ADD_DEPS).
ld/testsuite/ld-s12z/
* reloc-ext18-1.d: New file.
* reloc-ext18-1.d: New file.
* reloc-ext18-2.d: New file.
* reloc-ext18.d: New file.
* reloc-ext18.s: New file.
* reloc-ext24.d: New file.
* reloc-ext24.s: New file.
* reloc-ext32.d: New file.
* reloc-ext32.s: New file.
* reloc-opr.d: New file.
* reloc-opr.d: New file.
* reloc-opr.s: New file.
* reloc-pc-rel-7-15.d: New file.
* reloc-pc-rel-7-15.s: New file.