1. is_remote is not the right check.
2. Both Simon & Pedro ran it continuously for some time against
native-gdbserver and didn't see a failure.
3. The test has been running against native-extended-gdbserver anyway.
gdb/testsuite/ChangeLog:
2017-10-12 Simon Marchi <simon.marchi@polymtl.ca>
Pedro Alves <palves@redhat.com>
* gdb.base/dprintf-non-stop.exp: Remove is_remote target check.
Check for gdbserver instead of dejagnu remote. Unlike what the
comment says, the test actually fails with target remote + gdbserver
(it does pass with extended-remote). The result is:
FAIL -> KFAIL with --target_board=native-gdbserver
KPASS -> PASS with --target_board=native-extended-gdbserver
gdb/testsuite/ChangeLog:
2017-10-12 Pedro Alves <palves@redhat.com>
Simon Marchi <simon.marchi@polymtl.ca>
* gdb.base/argv0-symlink.exp: kfail on remote gdbserver,
instead of on dejagnu remote boards.
We support follow-fork in the remote protocol nowadays.
Also, the right way to enable non-stop mode is to do it before
connecting, and for use_gdb_stub boards, that means we have to do it
at gdb_load time. The "modern" pattern for that is to pass non-stop
in GDBFLAGS.
This makes the test pass with --target_board=native-gdbserver.
gdb/testsuite/ChangeLog:
2017-10-12 Pedro Alves <palves@redhat.com>
Simon Marchi <simon.marchi@polymtl.ca>
* gdb.base/inferior-died.exp: Remove is_remote and isnative
checks. Use build_executable + clean_restart instead of
prepare_for_testing. Pass "set non-stop on" via GDBFLAGS instead
of enabling non-stop after starting gdb.
This commit makes the gdb.threads/non-ldr-exc-*.exp tests run (and
pass) with --target_board=native-gdbserver.
(These tests were already running with
--target_board=native-extended-gdbserver, because that board is not
is_remote.)
The "No exec event support in the remote protocol." comment is stale.
It's actually supported.
gdb/ChangeLog:
2017-10-12 Pedro Alves <palves@redhat.com>
* gdb.threads/non-ldr-exc-1.exp: No longer skip if is_remote target.
* gdb.threads/non-ldr-exc-2.exp: Ditto.
* gdb.threads/non-ldr-exc-3.exp: Ditto.
* gdb.threads/non-ldr-exc-4.exp: Ditto.
* reloc.c (enum bfd_reloc_status): Start values at 2.
* bfd-in2.h: Regenerate.
* elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
that a TRUE return indicates success. Compare the result of
calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
(build_one_stub): Change sense of tests against aarch64_relocate
return value.
(elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
than FALSE, when an error is detected.
(elfNN_aarch64_final_link_relocate): Likewise.
* testsuite/ld-aarch64/pcrel_pic_defined.d: Expect errors not
warnings. Expect errors about unsupported relocations.
* testsuite/ld-aarch64/pcrel_pic_undefined.d: Likewise.
When there is no dynamic interpreter in PIE, make the undefined weak
symbol dynamic so that PC relative branch to the undefined weak symbol
will land to address 0.
* elf32-i386.c (elf_backend_hide_symbol): New.
* elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
* elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
* elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
I believe we should be warning if ld is given both --no-dynamic-linker
and -z dynamic-undefined-weak. The two options are contradictory, the
first says an executable has no dynamic interpreter to resolve dynamic
symbols, while the second is asking for dynamic symbols to be emitted.
(And even if a static PIE's relocation code, which is needed to
process R_*_RELATIVE relocs, could process symbols, there are no
DT_NEEDED dynamic objects to define such symbols.)
I also think that dynamic_undefined_weak is the right flag to control
whether undefined weaks are made dynamic, whether in static PIEs or
anywhere else. So force it to 0 for static PIEs, fixing PR 22269 for
powerpc and any other target where the backend usually defaults to
undefined weaks being made dynamic.
This patch introduces regressions. I'd normally not do that, but
these are all in very recently added test cases, or expose bugs in the
x86 backend. The test cases were added after I'd made it known that
this patch or one like it was imminent.
PR 22269
* emultempl/elf32.em (after_parse): Warn on --no-dynamic-linker
-z dynamic-undefined-weak combination. Set dynamic_undefined_weak
to zero when nointerp.
This function shouldn't be called directly, except from backend code.
bfd/
* elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
(bfd_elf_define_start_stop): Likewise.
ld/
* emultempl/elf32.em (before_allocation): Call
elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
Formatting.
* elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
when executable rather than non-PIC.
* elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
* elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
This removes the last cleanups from the TUI, by using std::string
rather than manual memory management.
Regression tested against gdb.tui/*.exp on Fedora 26 x86-64.
gdb/ChangeLog
2017-10-09 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_set_win_height, parse_scrolling_args): Use
std::string.
* tui/tui-layout.c (enum tui_status): Use std::string.
prepare_re_set_context returns a null cleanup and doesn't seem
generally useful. This patch removes it plus a few more cleanups; and
changes breakpoint_re_set to use scoped_restore rather than its own
manual mechanism.
2017-10-11 Tom Tromey <tom@tromey.com>
* breakpoint.c (prepare_re_set_context): Remove.
(breakpoint_re_set_one): Update. Don't use cleanups.
(breakpoint_re_set): Use scoped_restore, std::string, and
scoped_restore_current_language.
This removes some cleanups from breakpoint.c, replacing them with C++
data structures.
2017-10-11 Tom Tromey <tom@tromey.com>
* breakpoint.c (commands_command_1): Use std::string.
(cleanup_executing_breakpoints): Remove.
(bpstat_do_actions_1): Use scoped_restore.
(bpstat_check_watchpoint): Use std::string.
(decode_static_tracepoint_spec): Likewise.
(break_range_command): Likewise.
(watch_command_1): Likewise.
(compare_breakpoints): Change argument types.
(clear_command): Use std::vector.
(cleanup_executing_breakpoints): Remove.
(update_global_location_list): Use unique_xmalloc_ptr.
(strace_command): Remove unused declaration.
Since undefined weak symbols in static PIE are always resolved to 0 at
run-time, linker should resolve them as 0 at link-time, regardless of
whether "-z dynamic-undefined-weak" is used. "-z dynamic-undefined-weak"
only makes undefined weak symbols dynamic, but doesn't change undefined
weak symbol resolution in static PIE at link-time. These tests currently
pass on x86, but fails on many other targets.
The framework to resolve weak symbols in static PE at link-time is
posted at
https://sourceware.org/ml/binutils/2017-10/msg00087.html
which requires users/hjl/check_relocs branch to call check_relocs after
opening all inputs. I will submit backend patches for failling targets
after merging users/hjl/check_relocs branch next.
* PR ld/22269
* testsuite/ld-elf/pr22269.s: New file.
* testsuite/ld-elf/pr22269a.d: Likewise.
* testsuite/ld-elf/pr22269b.d: Likewise.
Support for collecting and supplying general purpose and floating
point registers is provided along with signal frame unwinding. While
FreeBSD/arm kernels do populate NT_FPREGSET notes, they are always
zero-filled, so this implementation ignores them. Recent FreeBSD/arm
kernels generate NT_ARM_VFP notes which are used to supply
floating-point registers. As with Linux, the AT_HWCAP feature flags
are used to determine the correct target description.
gdb/ChangeLog:
* Makefile.in (ALL_TARGET_OBS): Add arm-fbsd-tdep.o.
(ALLDEPFILES): Add arm-fbsd-tdep.c.
* NEWS: Mention new FreeBSD/arm target.
* configure.tgt: Add arm*-*-freebsd*.
* arm-fbsd-tdep.c: New file.
* arm-fbsd-tdep.h: New file.
PR 21977
* listing.c (listing_newline): Use the name of the current
physical input file, rather than the current logical input file,
unless including high level source in the listing.
* input-scrub.c (as_where_physical): New function. Returns the
name of the current physical input file.
* as.h: Add prototype for as_where_physical.
Revert parts of commit b3ac9c7756 ("Put more info in NT_PRPSINFO Linux
notes"), <https://sourceware.org/ml/binutils/2013-02/msg00024.html>, and
remove support for a Linux core PRPSINFO note writer override, now that
all variants are handled automatically within BFD itself.
gdb/
* linux-tdep.c (linux_make_corefile_notes): Remove call to
`gdbarch_elfcore_write_linux_prpsinfo'.
* gdbarch.sh (elfcore_write_linux_prpsinfo): Remove architecture
method.
(elf_internal_linux_prpsinfo): Remove declaration.
* gdbarch.h: Regenerate.
* gdbarch.c: Regenerate.
Fix commit 70a38d42c5 ("New entry points for writing Linux NT_PRPSINFO
notes."), <https://sourceware.org/ml/binutils/2013-02/msg00023.html>,
and handle both variants of the 64-bit Linux core PRPSINFO note across
all targets.
The 64-bit Linux core PRPSINFO note matches the 64-bit kernel structure,
defined as follows:
(gdb) ptype struct elf_prpsinfo
type = struct elf_prpsinfo {
char pr_state;
char pr_sname;
char pr_zomb;
char pr_nice;
unsigned long pr_flag;
__kernel_uid_t pr_uid;
__kernel_gid_t pr_gid;
pid_t pr_pid;
pid_t pr_ppid;
pid_t pr_pgrp;
pid_t pr_sid;
char pr_fname[16];
char pr_psargs[80];
}
(gdb)
where the individual data types of most members are the same across all
64-bit Linux ports, with the exception of `__kernel_uid_t' and
`__kernel_gid_t'. These are defined in <asm-generic/posix_types.h> as
32-bit `unsigned int' by default, however overridden as 16-bit `unsigned
short' in port-specific <asm/posix_types.h> for the SuperH target.
The default is already handled, as from the commit referred. Add the
other variant then and provide a backend flag to switch between the two
cases possible, with the 32-bit one being the default and the 16-bit one
explicitly selected. Set the flag in the SuperH target backend. This
arrangement is analogous to how the 32-bit Linux core PRPSINFO note is
handled.
bfd/
* elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
member.
* elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
(elf_external_linux_prpsinfo64_ugid32): ... this.
(swap_linux_prpsinfo32_out): Rename to...
(swap_linux_prpsinfo32_ugid32_out): ... this.
(elf_external_linux_prpsinfo64_ugid16): New structure.
(swap_linux_prpsinfo64_ugid16_out): New function.
* elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
(elf_backend_linux_prpsinfo64_ugid16): Define.
(elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
* elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
of the 64-bit Linux core PRPSINFO note.
* elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
Fix commit 70a38d42c5 ("New entry points for writing Linux NT_PRPSINFO
notes."), <https://sourceware.org/ml/binutils/2013-02/msg00023.html>,
and commit b3ac9c7756 ("Put more info in NT_PRPSINFO Linux notes"),
<https://sourceware.org/ml/binutils/2013-02/msg00024.html>, and handle
both variants of the 32-bit Linux core PRPSINFO note across all targets.
The 32-bit Linux core PRPSINFO note matches the 32-bit kernel structure,
defined as follows:
(gdb) ptype struct elf_prpsinfo
type = struct elf_prpsinfo {
char pr_state;
char pr_sname;
char pr_zomb;
char pr_nice;
unsigned long pr_flag;
__kernel_uid_t pr_uid;
__kernel_gid_t pr_gid;
pid_t pr_pid;
pid_t pr_ppid;
pid_t pr_pgrp;
pid_t pr_sid;
char pr_fname[16];
char pr_psargs[80];
}
(gdb)
where the individual data types of most members are the same across all
32-bit Linux ports, with the exception of `__kernel_uid_t' and
`__kernel_gid_t'. These are defined in <asm-generic/posix_types.h> as
32-bit `unsigned int' by default, however overridden as 16-bit `unsigned
short' in port-specific <asm/posix_types.h> for a few targets, mostly
earlier ports of Linux, specifically: ARM, CRIS, FR-V, M32R, m68k,
MN10300/AM33, s390, SuperH, SPARC and i386.
The default is the same as the PowerPC variant already handled, as from
the commits referred. Make the special PowerPC case generic then,
removing the GDB part, and provide a backend flag to switch between the
two cases possible, with the 32-bit one being the default and the 16-bit
one explicitly selected. Set the flag in the target backends affected.
bfd/
* elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
member.
(elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
* elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
(elf_external_ppc_linux_prpsinfo32)
(swap_ppc_linux_prpsinfo32_out): Move to...
* elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
(swap_linux_prpsinfo32_ugid32_out): ... these.
(elf_external_linux_prpsinfo32): Rename to...
(elf_external_linux_prpsinfo32_ugid16): ... this.
(swap_linux_prpsinfo32_out): Rename to...
(swap_linux_prpsinfo32_ugid16_out): ... this.
* elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
(elf_backend_linux_prpsinfo32_ugid16): Define.
(elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
* elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
of the 32-bit Linux core PRPSINFO note.
* elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
* elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
* elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
* elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
* elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
* elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
* elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
* elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
* elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
* elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
gdb/
* ppc-linux-tdep.c (ppc_linux_init_abi): Remove call to
`set_gdbarch_elfcore_write_linux_prpsinfo'.
Simple replacement of VEC with std::vector.
gdb/ChangeLog:
* symfile.c (registered_sym_fns): Make struct, not typedef.
(DEF_VEC_O (registered_sym_fns)): Remove.
(symtab_fns): Change type to std::vector.
(add_symtab_fns): Adjust.
(find_sym_fns): Adjust.
There was a problem with generation of the disassembler options for ARC in GDB,
because a BFD architecture name was used as a CPU name, but they have different
meaning even if some architectures have same name as respective CPUs. Target
description specifies a BFD architecture, which is different from ARC CPU, as
accepted by the disassembler (and most other ARC tools), because CPU values are
much more fine grained - there can be multiple CPU values per single BFD
architecture. As a result this code should translate architecture to some CPU
value. Since there is no info on exact CPU configuration, it is best to use
the most feature-rich CPU, so that the disassembler will recognize all
instructions available to the specified architecture.
gdb/ChangeLog
yyyy-mm-dd Anton Kolesov <Anton.Kolesov@synopsys.com>
* arc-tdep.c (arc_gdbarch_init): Pass proper cpu value to disassembler.
* arc-tdep.h (arc_arch_is_em): New function.
(arc_arch_is_hs): Likewise.
gdb/testsuite/ChangeLog
yyyy-mm-dd Anton Kolesov <Anton.Kolesov@synopsys.com>
* gdb.arch/arc-tdesc-cpu.exp: New file.
* gdb.arch/arc-tdesc-cpu.xml: Likewise.
Building bfd/ for DJGPP, I see:
../../src/bfd/bfd.c:642:1: error: conflicting types for '_doprnt'
_doprnt (FILE *stream, const char *format, va_list ap)
^~~~~~~
In file included from ../../src/bfd/sysdep.h:37:0,
from ../../src/bfd/bfd.c:367:
/usr/lib64/gcc/i586-pc-msdosdjgpp/6.1.0/include-fixed/stdio.h:171:5: note: previous declaration of '_doprnt' was here
int _doprnt(const char *_fmt, va_list _args, FILE *_f);
^~~~~~~
Possible fixes the build on other systems too -- _doprnt was/is an
exported symbol on old Unix/BSD systems too.
bfd/ChangeLog:
2017-10-11 Pedro Alves <palves@redhat.com>
* bfd.c (_doprnt): Rename to ...
(_bfd_doprnt): ... this.
(error_handler_internal): Adjust.
GCC commit a94975e57 ("C++ warning on vexing parse") introduces new
warnings "unnecessary parentheses in the declaration of ...". These
cause the build of binutils and gdb to fail. This patch removes those
parentheses for a successful build.
gdb/ChangeLog:
2017-10-11 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
* macrotab.h (macro_lookup_inclusion): Remove unnecessary
parentheses in the declaration.
(macro_lookup_inclusion): Likewise.
(macro_lookup_definition): Likewise.
* p-lang.h (pascal_builtin_types): Likewise.
* tui/tui-data.c (tui_win_list): Likewise.
* tui/tui-data.h (tui_win_list): Likewise.
* utils.h (make_cleanup_free_section_addr_info): Likewise.
(This patch is from Mark Rages <markrages@gmail.com>.)
The Nordic nRF52 memory map, reported from black magic probe:
Num Enb Low Addr High Addr Attrs
0 y 0x00000000 0x00080000 flash blocksize 0x1000 nocache
1 y 0x10001000 0x10001210 flash blocksize 0x210 nocache
2 y 0x20000000 0x20010000 rw nocache
The region at 0x10001000 is "UICR" and it is a section of flash that is
erased all at once.
Notice the odd size: 0x210 is the size of the region defined in the
datasheet.
But because the block size was listed as 0x210, gdb was insisting on
issuing two erase commands divisible by 0x210, starting below 0x10001000.
This patch fixes it by doing the alignment computation from the start of
the region, not from address 0.
gdb/ChangeLog:
* target-memory.c (block_boundaries): Fix for block address not
aligned on block size.
Since x86 check_relocs is called after opening all inputs and garbage
collection, they never see the removed sections. There is no need
for incrementing GOT refcount. But since PLT refcount is also used in
/* Don't create the PLT entry if there are only function pointer
relocations which can be resolved at run-time. */
else if (htab->elf.dynamic_sections_created
&& (h->plt.refcount > eh->func_pointer_refcount
|| eh->plt_got.refcount > 0))
{
we must increment it.
* elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
instead of incrementing it.
* elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
The get_integer_valueof outputs the value it has read as part of the
test name. This causes test names to vary from run to run, and adds
some noise when diffing test results. e.g.:
-PASS: gdb.threads/process-dies-while-detaching.exp: multi-process: continue: killed outside: get integer valueof "mypid" (28770)
+PASS: gdb.threads/process-dies-while-detaching.exp: multi-process: continue: killed outside: get integer valueof "mypid" (32238)
This patch removes that, since it's probably not very useful.
gdb/testsuite/ChangeLog:
* lib/gdb.exp (get_integer_valueof): Don't output read value in test name.
Bump the dwarf-mode version number, so it can be installed by package.el
users who installed an earlier verision.
2017-10-10 Tom Tromey <tom@tromey.com>
* dwarf-mode.el: Bump to version 1.4.
I was recently examining a very large .debug file. I tried to use
dwarf-mode, but it blocked Emacs for a very long time while reading
output.
This patch changes dwarf-mode to run the objdump process asynchronously.
This way, I can still do other things in Emacs while waiting for the
dumping to finish.
2017-10-10 Tom Tromey <tom@tromey.com>
* dwarf-mode.el (dwarf--process, dwarf--deletion-region): New
defvar.
(dwarf--check-running, dwarf--sentinel, dwarf--invoke)
(dwarf--filter): New functions.
(dwarf-do-insert-substructure, dwarf-do-refresh): Call
dwarf--check-running, dwarf--invoke.
(dwarf-browse): Initialize new variables.
Emacs has had lexical binding for a while, and it's a good practice to
use it; so enable it in dwarf-mode.el.
2017-10-10 Tom Tromey <tom@tromey.com>
* dwarf-mode.el: Set lexical-binding.
It's bad Emacs style to define keys from a top-level form. Instead, one
should define a mode map separately and binding keys in the definition.
This lets users completely override the map by defining it before
loading the mode.
2017-10-10 Tom Tromey <tom@tromey.com>
* dwarf-mode.el (dwarf-mode-map): New defvar.
This patch gets rid of catch_exceptions / catch_exceptions_with_msg.
The latter is done mostly by getting rid of the three remaining
vestigial libgdb wrapper functions, which are really pointless
nowadays. This results in a good number of simplifications.
(I checked that Insight doesn't use those functions.)
The gdb.mi/mi-pthreads.exp change is necessary because this actually
fixes a bug, IMO -- the patch stops MI's -thread-select causing output
on the CLI stream.
I.e., before:
-thread-select 123456789
&"Thread ID 123456789 not known.\n"
^error,msg="Thread ID 123456789 not known."
(gdb)
After:
-thread-select 123456789
^error,msg="Thread ID 123456789 not known."
(gdb)
gdb/ChangeLog
2017-10-10 Pedro Alves <palves@redhat.com>
Tom Tromey <tom@tromey.com>
* breakpoint.c (struct captured_breakpoint_query_args)
(do_captured_breakpoint_query, gdb_breakpoint_query): Delete.
(print_breakpoint): New.
* breakpoint.h (print_breakpoint): Declare.
* common/common-exceptions.h (enum return_reason): Remove
references to catch_exceptions.
* exceptions.c (catch_exceptions, catch_exceptions_with_msg):
Delete.
* exceptions.h (catch_exceptions_ftype, catch_exceptions)
(catch_exception_ftype, catch_exceptions_with_msg): Delete.
* gdb.h: Delete.
* gdbthread.h (thread_select): Declare.
* mi/mi-cmd-break.c: Don't include gdb.h.
(breakpoint_notify): Use print_breakpoint.
* mi/mi-cmd-catch.c: Don't include gdb.h.
* mi/mi-interp.c: Don't include gdb.h.
(mi_print_breakpoint_for_event): New.
(mi_breakpoint_created, mi_breakpoint_modified): Use
mi_print_breakpoint_for_event.
* mi/mi-main.c: Don't include gdb.h.
(mi_cmd_thread_select): Parse the global thread ID here. Use
thread_select instead of gdb_thread_select.
(mi_cmd_thread_list_ids): Output "thread-ids" tuple here instead
of using gdb_list_thread_ids.
* remote-fileio.c (do_remote_fileio_request): Change type. Reply
FILEIO_ENOSYS here.
(remote_fileio_request): Use TRY/CATCH instead of
catch_exceptions.
* symfile-mem.c (struct symbol_file_add_from_memory_args)
(symbol_file_add_from_memory_wrapper): Delete.
(add_vsyscall_page): Use TRY/CATCH instead of catch_exceptions.
* thread.c: Don't include gdb.h.
(do_captured_list_thread_ids, gdb_list_thread_ids): Delete.
(thread_alive): Use thread_select.
(do_captured_thread_select): Delete, parts salvaged as ...
(thread_select): ... this new function.
(gdb_thread_select): Delete.
gdb/testsuite/ChangeLog
2017-10-10 Pedro Alves <palves@redhat.com>
* gdb.mi/mi-pthreads.exp (check_mi_thread_command_set): Don't
expect CLI output.
If you want to use catch_errors with a function with parameters, then
currently you have to manually write a "capture" struct wrapping the
arguments and marshall/unmarshall that.
https://sourceware.org/ml/gdb-patches/2017-09/msg00834.html proposed
adjusting catch_errors to use gdb::function_view, which would allow
passing lambdas with automatic captures. However, it seems like using
TRY/CATCH directly instead ends up producing clearer and easier to
debug code. This is what this commit does.
Note that removing catch_errors exposes further cleanup opportunities
around no longer having to follow catch_errors callback type, and also
removes a few cleanups.
I didn't do anything to save/restore current_uiout because I think
that should be the responsibility of the code that changes
current_uiout in the first place.
(Another approach could be to make catch_errors a variadic template
like:
template<typename Function, typename... Args>
int catch_errors (const char *errstring, return_mask mask,
Function &&func, Args... args);
and then with:
extern void function_with_args (int, int);
extern void function_with_no_args ();
calls to the above functions would be wrapped like this:
catch_errors ("some error happened", RETURN_MASK_ERROR,
function_with_args, arg1, arg2);
catch_errors ("some error happened", RETURN_MASK_ERROR,
function_with_no_args);
but I'm thinking that that doesn't improve much if at all either.)
gdb/ChangeLog
2017-10-10 Pedro Alves <palves@redhat.com>
Tom Tromey <tom@tromey.com>
* breakpoint.c (breakpoint_cond_eval): Change return type to bool
and reverse logic.
(WP_DELETED, WP_VALUE_CHANGED, WP_VALUE_NOT_CHANGED, WP_IGNORE):
No longer macros. Instead ...
(enum wp_check_result): They're now values of this new
enumeration.
(watchpoint_check): Change return type to wp_check_result and
parameter type to bpstat.
(bpstat_check_watchpoint): Use TRY/CATCH instead of catch_errors.
(bpstat_check_breakpoint_conditions): Use TRY/CATCH instead of
catch_errors. Reverse logic of watchpoint_check call.
(breakpoint_re_set_one): Now returns void and takes a breakpoint
pointer as parameter.
(breakpoint_re_set): Use TRY/CATCH instead of catch_errors.
* common/common-exceptions.c (throw_exception_sjlj): Update
comments to avoid mentioning catch_errors.
* exceptions.c (catch_errors): Delete.
* exceptions.h: Update comments to avoid mentioning catch_errors.
(catch_errors_ftype, catch_errors): Delete.
* infrun.c (normal_stop): Use TRY/CATCH instead of catch_errors.
(hook_stop_stub): Delete.
(restore_selected_frame): Change return type to void, and
parameter type to const frame_id &.
(restore_infcall_control_state): Use TRY/CATCH instead of
catch_errors.
* main.c (captured_command_loop): Return void and remove
parameter. Remove references to catch_errors.
(captured_main): Use TRY/CATCH instead of catch_errors.
* objc-lang.c (objc_submethod_helper_data)
(find_objc_msgcall_submethod_helper): Delete.
(find_objc_msgcall_submethod): Use TRY/CATCH instead of
catch_errors.
* record-full.c (record_full_message): Return void.
(record_full_message_args, record_full_message_wrapper): Delete.
(record_full_message_wrapper_safe): Return bool and use TRY/CATCH
instead of catch_errors.
* solib-aix.c (solib_aix_open_symbol_file_object): Change
parameter type to int.
* solib-darwin.c (open_symbol_file_object): Ditto.
* solib-dsbt.c (open_symbol_file_object): Ditto.
* solib-frv.c (open_symbol_file_object): Ditto.
* solib-svr4.c (open_symbol_file_object): Ditto.
* solib-target.c (solib_target_open_symbol_file_object): Ditto.
* solib.c (update_solib_list): Use TRY/CATCH instead of
catch_errors.
* solist.h (struct target_so_ops) <open_symbol_file_object>:
Change type.
* symmisc.c (struct print_symbol_args): Remove.
(dump_symtab_1): Use TRY/CATCH instead of catch_errors.
(print_symbol): Change type.
* windows-nat.c (handle_load_dll, handle_unload_dll): Return void
and remove parameters.
(catch_errors): New.
(get_windows_debug_event): Adjust.
gdb/testsuite/ChangeLog:
2017-10-10 Pedro Alves <palves@redhat.com>
* lib/selftest-support.exp (selftest_setup): Update for
captured_command_loop's prototype change.
Similar as aarch64 backend, arm backend only overrides the decision on undefined
weak symbols. arm backend part already emits necessary relative relocation for
this case.
bfd/
PR ld/21402
* elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
symbols into dynamic.
ld/
PR ld/21402
* testsuite/ld-arm/tls-app.d: Update address.
* testsuite/ld-arm/tls-app.r: Remove relocations.
* testsuite/ld-arm/unresolved-1-dyn.d: Update.
Cache the max alignment of output sections instead of scanning all
output sections for each input section, which can take a very long
time if there are millions of input/output sections.
PR ld/22274
* elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
(riscv_elf_link_hash_table_create): Initialize max_alignment to
(bfd_vma) -1.
(_bfd_riscv_relax_section): Cache the max alignment of output
sections if possible.
check_relocs was setting up some data used by the --gc-sections
gc_mark_hook. If we change ld to run check_relocs after gc_sections
that data needs to be set up elsewhere. Done by this patch in the
backend check_directives function (ppc64_elf_before_check_relocs).
* elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
.opd whenever .opd is present and non-zero size. Move code
setting abiversion to/from output file earlier. Only set
u.opd.func_sec when --gc-sections. Read relocs and set up
u.opd.func_sec values here..
(ppc64_elf_check_relocs): ..rather than here. Simplify opd
section tests.
(ppc64_elf_edit_opd): Don't set sec_type for .opd here.
There were two copies of earmelf_fuchsia.c dependencies.
* Makefile.am (earmelfb_fuchsia.c): Rename rule from earmelf_fuchsia.c.
* Makefile.in: Regenerate.
One spot in gdb uses a cleanup to free a splay tree. This patch
introduces a unique_ptr specialization for this case.
ChangeLog
2017-10-09 Tom Tromey <tom@tromey.com>
* mi/mi-main.c (free_splay_tree): Remove.
(list_available_thread_groups): Use splay_tree_up.
* common/gdb_splay_tree.h: New file.
The do_nothing function in mi-main.c is used as a splay tree
key-deleting function; but NULL serves the same purpose and is used
elsewhere in gdb. This patch removes the unneeded function.
ChangeLog
2017-10-09 Tom Tromey <tom@tromey.com>
* mi/mi-main.c (do_nothing): Remove.
(list_available_thread_groups): Update.