Age | Commit message (Collapse) | Author | Files | Lines |
|
This commit builds on work started in the following two commits:
commit 24ed6739b699f329c2c45aedee5f8c7d2f54e493
Date: Thu Jan 30 14:35:40 2020 +0000
gdb/remote: Restore support for 'S' stop reply packet
commit cada5fc921e39a1945c422eea055c8b326d8d353
Date: Wed Mar 11 12:30:13 2020 +0000
gdb: Handle W and X remote packets without giving a warning
This is related to how GDB handles remote targets that send back 'S'
packets.
In the first of the above commits we fixed GDB's ability to handle a
single process, single threaded target that sends back 'S' packets.
Although the 'T' packet would always be preferred to 'S' these days,
there's nothing really wrong with 'S' for this situation.
The second commit above fixed an oversight in the first commit, a
single-process, multi-threaded target can send back a process wide
event, for example the process exited event 'W' without including a
process-id, this also is fine as there is no ambiguity in this case.
In PR gdb/26819 we run into yet another problem with the above
commits. In this case we have a single process with two threads, GDB
hits a breakpoint in thread 2 and then performs a stepi:
(gdb) b main
Breakpoint 1 at 0x1212340830: file infinite_loop.S, line 10.
(gdb) c
Continuing.
Thread 2 hit Breakpoint 1, main () at infinite_loop.S:10
10 in infinite_loop.S
(gdb) set debug remote 1
(gdb) stepi
Sending packet: $vCont;s:2#24...Packet received: S05
../binutils-gdb/gdb/infrun.c:5807: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed.
What happens in this case is that on the RISC-V target displaced
stepping is not supported, so when the stepi is issued GDB steps just
thread 2. As only a single thread was set running the target decides
that is can get away with sending back an 'S' packet without a
thread-id. GDB then associates the stop with thread 1 (the first
non-exited thread), but as thread 1 was not previously set executing
the assertion seen above triggers.
As an aside I am surprised that the target sends pack 'S' in this
situation. The target is happy to send back 'T' (including thread-id)
when multiple threads are set running, so (to me) it would seem easier
to just always use the 'T' packet when multiple threads are in use.
However, the target only uses 'T' when multiple threads are actually
executing, otherwise an 'S' packet it used.
Still, when looking at the above situation we can see that GDB should
be able to understand which thread the 'S' reply is referring too.
The problem is that is that in commit 24ed6739b699 (above) when a stop
reply comes in with no thread-id we look for the first non-exited
thread and select that as the thread the stop applies too.
What we should really do is select the first non-exited, resumed thread,
and associate the stop event with this thread. In the above example
both thread 1 and 2 are non-exited, but only thread 2 is resumed, so
this is what we should use.
There's a test for this issue included which works with stock
gdbserver by disabling use of the 'T' packet, and enabling
'scheduler-locking' within GDB so only one thread is set running.
gdb/ChangeLog:
PR gdb/26819
* remote.c
(remote_target::select_thread_for_ambiguous_stop_reply): New
member function.
(remote_target::process_stop_reply): Call
select_thread_for_ambiguous_stop_reply.
gdb/testsuite/ChangeLog:
PR gdb/26819
* gdb.server/stop-reply-no-thread-multi.c: New file.
* gdb.server/stop-reply-no-thread-multi.exp: New file.
Change-Id: I9b49d76c2a99063dcc76203fa0f5270a72825d15
|
|
The previous patch made the commit_resume implementations in the record
targets unnecessary, as the remote target's commit_resume implementation
won't commit-resume threads for which it didn't see a resume. This
patch removes them.
gdb/ChangeLog:
* record-btrace.c (class record_btrace_target): Remove.
(record_btrace_target::commit_resume): Remove.
* record-full.c (class record_full_target): Remove.
(record_full_target::commit_resume): Remove.
Change-Id: I3a68d3d726fb09d8b7165b4edefc330d27803b27
|
|
The next patch moves the target commit_resume method to be a
process_stratum_target-only method. The only non-process targets that
currently implement the commit_resume method are the btrace and full
record targets. The only reason they need to do so is to prevent a
commit resume from reaching the beneath (process) target if they are
currently replaying.
This is important if a record target is used on top of the remote target
(the only process target implementing the commit_resume method).
Currently, the remote target checks the `thread_info::executing` flag of
a thread to know if it should commit resume that thread:
if (!tp->executing || remote_thr->vcont_resumed)
continue;
The `tp->executing` flag is set by infrun when it has asked the target
stack to resume the thread, and therefore if the thread is executing,
from its point of view. It _not_ equivalent to whether the remote
target was asked to resume this thread.
Indeed, if infrun asks the target stack to resume some thread while the
record target is replaying, the record target won't forward the resume
request the remote target beneath, because we don't actually want to
resume the thread on the execution target. But the `tp->executing` flag
is still set, because from the point of view of infrun, the thread
executes. So, if the commit_resume call wasn't intercepted by the
record target as it is today and did reach the remote target, the remote
target would say "Oh, this thread should be executing and I haven't
vCont-resumed it! I must vCont-resume it!". But that would be wrong,
because it was never asked to resume this thread, the resume request did
not reach it. This is why the record targets currently need to
implement commit_resume: to prevent the beneath target from
commit_resuming threads it wasn't asked to resume.
Since commit_resume will become a method on process_stratum_target in
the following patch, record targets won't have a chance to intercept the
calls and that would result in the remote target commit_resuming threads
it shouldn't. To avoid this, this patch makes the remote target track
its own thread resumption state. That means, tracking which threads it
was asked to resume via target_ops::resume. Regardless of the context
of this patch, I think this change makes it easier to understand how
resume / commit_resume works in the remote target. It makes the target
more self-contained, as it only depends on what it gets asked to do via
the target methods, and not on tp->executing, which is a flag maintained
from the point of view of infrun.
I initially made it so this state was only used when the remote target
operates in non-stop mode, since commit_resume is only used when the
target is non-stop. However, it's more consistent and it can be useful
to maintain this state even in all-stop too. In all-stop, receiving a
stop notification for one thread means all threads of the target are
considered stopped.
From the point of view of the remote target, there are three states a
thread can be in:
1. not resumed
2. resumed but pending vCont-resume
3. resumed
State 2 only exists when the target is non-stop.
As of this patch, valid state transitions are:
- 1 -> 2 (through the target resume method if in non-stop)
- 2 -> 3 (through the target commit_resume method if in non-stop)
- 1 -> 3 (through the target resume method if in all-stop)
- 3 -> 1 (through a remote stop notification / reporting an event to the
event loop)
A subsequent patch will make it possible to go from 2 to 1, in case
infrun asks to stop a thread that was resumed but not commit-resumed
yet. I don't think it can happen as of now.
In terms of code, this patch replaces the vcont_resumed field with an
enumeration that explicitly represents the three states described above.
The last_resume_sig and last_resume_step fields are moved to a structure
which is clearly identified as only used when the thread is in the
"resumed but pending vCont-resume" state.
gdb/ChangeLog:
* remote.c (enum class resume_state): New.
(struct resumed_pending_vcont_info): New.
(struct remote_thread_info) <resume_state, set_not_resumed,
set_resumed_pending_vcont, resumed_pending_vcont_info,
set_resumed, m_resume_state, m_resumed_pending_vcont_info>:
New.
<last_resume_step, last_resume_sig, vcont_resumed>: Remove.
(remote_target::remote_add_thread): Adjust.
(remote_target::process_initial_stop_replies): Adjust.
(remote_target::resume): Adjust.
(remote_target::commit_resume): Rely on state in
remote_thread_info and not on tp->executing.
(remote_target::process_stop_reply): Adjust.
Change-Id: I10480919ccb4552faa62575e447a36dbe7c2d523
|
|
|
|
PR 27160
* ldelfgen.c (compare_link_order): Protect access of ELF section
data.
(add_link_order_input_section): Remove redundant NULL check.
Use bfd_get_flavour.
(ldelf_map_segments): Use bfd_get_flavour.
|
|
Add the standard arc_debug_printf, but also arc_linux_debug_printf,
arc_linux_nat_debug_printf and arc_newlib_debug_printf to match the
prefixes currently used in the debug messages.
gdb/ChangeLog:
* arc-tdep.h (arc_debug_printf): New.
* arc-tdep.c: Use arc_debug_printf.
* arc-linux-nat.c (arc_linux_nat_debug_printf): Add and use.
* arc-linux-tdep.c (arc_linux_debug_printf): Add and use.
* arc-newlib-tdep.c (arc_newlib_debug_printf): Add and use.
Change-Id: I5d937566ed7a1925f7982e8809802c8f0560d8c6
|
|
Shahab suggested we get rid of the verbosity level for the ARC debug
logging [1]. This patch does that, before doing any other change.
gdb/ChangeLog:
* arc-tdep.h (arc_debug): Change type to bool.
* arc-tdep.c (arc_debug): Change type to bool.
(arc_analyze_prologue): Adjust.
(_initialize_arc_tdep): Use add_setshow_boolean_cmd.
* arc-linux-nat.c (ps_get_thread_area): Adjust.
[1] https://sourceware.org/pipermail/gdb-patches/2021-January/175075.html
Change-Id: I16688bd42ed8978ae1acf57012c8d41a943044a5
|
|
Bool-ify the return type of maybe_add_script_text and
maybe_add_script_file, the loaded parameter and related things.
gdb/ChangeLog:
* auto-load.c (struct loaded_script) <loaded>: Change to bool.
(maybe_add_script_file): Change return type to bool.
(maybe_add_script_text): Change return type and
loaded parameter to bool.
(source_script_file): Adjust.
(execute_script_contents): Adjust.
Change-Id: I59ab5862796fa7d154721b56e2ff8612ad5d734b
|
|
A previous patch missed those.
gdb/ChangeLog:
* auto-load.c (auto_load_objfile_script_1): Use bool.
(execute_script_contents): Use bool.
Change-Id: I214bf7ed25af36ced375eb3ec5a403ded2fa572e
|
|
Make it and related functions return bool. Move function comments to
header where applicable.
gdb/ChangeLog:
* auto-load.h (auto_load_gdb_scripts_enabled): Return bool, move
comment here.
* auto-load.c (auto_load_gdb_scripts_enabled): Return bool, move
comment to header.
* extension-priv.h (struct extension_language_script_ops)
<auto_load_enabled>: Return bool.
* extension.h (ext_lang_auto_load_enabled): Return bool, move
comment here.
* extension.c (ext_lang_auto_load_enabled): Return bool, move
comment to header.
* guile/guile-header.h (gdbscm_auto_load_enabled): Return bool,
move comment here.
* guile/scm-auto-load.c (gdbscm_auto_load_enabled): Return bool,
move comment to header.
* python/python-header.h (gdbpy_auto_load_enabled): Return bool,
move comment here.
* python/py-auto-load.c (gdbpy_auto_load_enabled): Return bool,
move comment to header.
Change-Id: I657a17d2dab77a36884a137ce9b23a2cc6d53140
|
|
Make it return bool and change the advice_printed to bool as well. Move
doc to header file.
gdb/ChangeLog:
* auto-load.h (file_is_auto_load_safe): Change return type to
bool, move comment here.
* auto-load.c (file_is_auto_load_safe): Change return type and
advice_printed to bool. Move comment to header.
Change-Id: Ia7395e7cea8880377800240833316e4be5251d49
|
|
Here's a sample output, with infrun debug enabled as well to show
nesting:
[infrun] fetch_inferior_event: enter
[infrun] print_target_wait_results: target_wait (-1.0.0 [process -1], status) =
[infrun] print_target_wait_results: 4116727.4116727.0 [process 4116727],
[infrun] print_target_wait_results: status->kind = stopped, signal = GDB_SIGNAL_TRAP
[infrun] handle_inferior_event: status->kind = stopped, signal = GDB_SIGNAL_TRAP
[infrun] start_step_over: enter
[infrun] start_step_over: stealing global queue of threads to step, length = 0
[infrun] operator(): step-over queue now empty
[infrun] start_step_over: exit
[infrun] handle_signal_stop: stop_pc=0x555555555229
[infrun] handle_jit_event: handling bp_jit_event
[jit] jit_read_descriptor: descriptor_addr = 0x5555555580b0
[jit] jit_register_code: symfile_addr = 0x7000000, symfile_size = 15560
[jit] jit_bfd_try_read_symtab: symfile_addr = 0x7000000, symfile_size = 15560
[jit] jit_breakpoint_re_set_internal: breakpoint_addr = 0x555555555229
[infrun] process_event_stop_test: BPSTAT_WHAT_SINGLE
[infrun] process_event_stop_test: no stepping, continue
[infrun] resume_1: step=1, signal=GDB_SIGNAL_0, trap_expected=1, current thread [process 4116727] at 0x555555555229
[infrun] prepare_to_wait: prepare_to_wait
[infrun] fetch_inferior_event: exit
gdb/ChangeLog:
* jit.c (jit_debug_printf): New, use throughout file.
Change-Id: Ic0f5eb3ffc926fb555de4914e7dc1076ada63a97
|
|
commit b209b5a6b8a accesses ELF section data without checking if input is
ELF. It caused:
sh: line 1: 1355479 Segmentation fault (core dumped) /export/build/gnu/tools-build/binutils-gitlab-x32/build-x86_64-linux-gnux32/ld/ld-new -o tmpdir/pe-x86-64-1 -z norelro -L/export/gnu/import/git/gitlab/x86-binutils/ld/testsuite/ld-x86-64 -m elf_x86_64 --entry=begin tmpdir/pe-x86-64-1a.obj tmpdir/pe-x86-64-1b.obj tmpdir/pe-x86-64-1c.obj 2>&1
FAIL: Build pe-x86-64-1
on Linux/x86-64 with PE/x86-64 inputs. Add check for ELF input before
accessing ELF section data.
* ldelfgen.c (add_link_order_input_section): Check for ELF input
before accessing ELF section data.
|
|
Don't generate the _GLOBAL_OFFSET_TABLE_ symbol for PLT relocations
since it isn't needed.
PR gas/27178
* config/tc-i386.c (lex_got::gotrel): Add need_GOT_symbol.
Don't generate GOT_symbol for PLT relocations.
* testsuite/gas/i386/i386.exp: Run PR gas/27178 tests.
* testsuite/gas/i386/no-got.d: New file.
* testsuite/gas/i386/no-got.s: Likewise.
* testsuite/gas/i386/x86-64-no-got.d: Likewise.
* testsuite/gas/i386/x86-64-no-got.s: Likewise.
|
|
bfd/
* Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.
binutils/
* Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.
gas/
* Makefile.in: Regenerate.
* Makefile.in: Regenerate.
gprof/
* Makefile.in: Regenerate.
ld/
* Makefile.in: Regenerate.
libctf/
* Makefile.in: Regenerate.
opcodes/
* Makefile.in: Regenerate.
|
|
This moves the SHF_LINK_ORDER sorting from bfd_elf_final_link to
the linker which means generic ELF targets now support SHF_LINK_ORDER
and we cope with odd cases that require resizing of output sections.
The patch also fixes two bugs in the current implementation,
introduced by commit cd6d537c48fa. The pattern test used by that
commit meant that sections matching something like
"*(.IA_64.unwind* .gnu.linkonce.ia64unw.*)" would not properly sort a
mix of sections matching the two wildcards. That commit also assumed
a stable qsort.
bfd/
PR 27160
* section.c (struct bfd_section): Remove pattern field.
(BFD_FAKE_SECTION): Adjust to suit.
* bfd-in2.h: Regenerate.
* elflink.c (compare_link_order, elf_fixup_link_order): Delete.
(bfd_elf_final_link): Don't call elf_fixup_link_order.
ld/
PR 27160
* ldlang.h (lang_output_section_statement_type): Add data field.
(lang_input_section_type, lang_section_bst_type): Add pattern field.
(statement_list): Declare.
(lang_add_section): Adjust prototype.
* emultempl/aarch64elf.em: Adjust lang_add_section calls.
* emultempl/armelf.em: Likewise.
* emultempl/beos.em: Likewise.
* emultempl/cskyelf.em: Likewise.
* emultempl/hppaelf.em: Likewise.
* emultempl/m68hc1xelf.em: Likewise.
* emultempl/metagelf.em: Likewise.
* emultempl/mipself.em: Likewise.
* emultempl/mmo.em: Likewise.
* emultempl/msp430.em: Likewise.
* emultempl/nios2elf.em: Likewise.
* emultempl/pe.em: Likewise.
* emultempl/pep.em: Likewise.
* emultempl/ppc64elf.em: Likewise.
* emultempl/spuelf.em: Likewise.
* emultempl/vms.em: Likewise.
* ldelf.c: Likewise.
* ldelfgen.c: Include ldctor.h.
(struct os_sections): New.
(add_link_order_input_section, link_order_scan): New functions.
(compare_link_order, fixup_link_order): New functions.
(ldelf_map_segments): Call link_order_scan and fixup_link_order.
* ldlang.c (statement_list): Make global.
(output_section_callback_fast): Save pattern in tree node.
(lang_add_section): Add pattern parameter, save in lang_input_section.
(output_section_callback_tree_to_list): Adjust lang_add_section calls.
(lang_insert_orphan, output_section_callback): Likewise.
(ldlang_place_orphan): Likewise.
(gc_section_callback): Don't set section->pattern
* testsuite/ld-elf/pr26256-2a.d: Don't xfail generic.
* testsuite/ld-elf/pr26256-3b.d: Likewise.
* testsuite/ld-elf/pr26256-2b.d: Likewise. notarget xgate.
|
|
* ldlang.h (callback_t): Remove flag_info function parameter.
* ldlang.c (walk_wild_consider_section): Adjust to suit.
(walk_wild_section_general): Likewise.
(output_section_callback_fast, output_section_callback): Likewise.
(check_section_callback, gc_section_callback): Likewise.
(find_relro_section_callback): Likewise.
|
|
PR 27037
* dlltool.c (i386_trampoline): Adjust %rsp immediately on entry
and before exit.
(i386_x64_trampoline): Add SEH annotations.
(struct mac): Add how_seh field.
(make_delay_head): If how_set field is true add SEh instructions.
|
|
The code supports a <start>[,<end>] syntax, but the logic for handling
the <end> check was broken: it would detect the first byte was ",", but
then include that in the strtoul call meaning the result is always 0.
Further, it (re)assigned to arg0 when it meant arg1 which means this
code always processed a range expression as 0,0. Oops.
|
|
My change 1ac72f0659d64d6a14da862242db0d841d2878d0 ("sim: convert to
bfd_endian") subtly broke the watchpoint module on little endian host
systems. The old code used 0 to mean "whatever the host endian is",
and while that was changed to use BFD_ENDIAN_UNKNOWN, this caller was
missed. Since its API used an int instead of an enum, the coercion
from 0 to the BFD endian enum was silently missed, and 0 happens to
be BFD_ENDIAN_BIG.
Instead of restoring the old logic by passing in BFD_ENDIAN_UNKNOWN,
we know the right host endian at compile time, so use that directly.
|
|
|
|
The indentation of the body of the nested statements got out of sync
leading to the entire function being indented incorrectly and looking
like it's part of the for loop.
|
|
gdb/ChangeLog:
* infrun.c (normal_stop): Fix indentation.
Change-Id: Icbae5272188f6ddb464b585a9194abd611f5ad27
|
|
... since they are defined in symfile.c.
gdb/ChangeLog:
* top.h (readnow_symbol_files, readnever_symbol_files): Move
declarations to ...
* symfile.h: ... here.
* symfile.c: Update doc.
Change-Id: Ie35a80d236bea70947bc496f66f62c8c621670b4
|
|
They are currently in target.h, it would make more sense to have them in
serial.h, since they are defined in serial.c.
gdb/ChangeLog:
* target.h (baud_rate, serial_parity): Move declarations...
* serial.h: ... here.
* main.c: Include serial.h.
* serial.c (baud_rate, serial_parity): Update doc.
Change-Id: Idc983c154c80ccc29b07ce68df3483cefe03fb71
|
|
The sources for the test-cases gdb.arch/i386-mpx*.exp contain have_mpx
functions that test whether the processor supports mpx instructions.
OTOH, the test-cases are compiled using -mmpx -fcheck-pointer-bounds, which
instrument all functions with mpx instructions.
So, the function that is supposed to test whether mpx instruction are
supported contains mpx instructions, which is a bit odd.
We could fix this by:
- factoring out the have_mpx function into a single source file, and
- compiling it without "-mmpx -fcheck-pointer-bounds".
But having the mpx support test as part of the test-cases seems like an
unnecessary complication that makes the test-cases more difficult to analyze,
reason about and modify.
So we go one step further and factor out the mpx support test in into a
gdb_caching_proc.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2021-01-12 Tom de Vries <tdevries@suse.de>
* gdb.arch/i386-mpx-call.c (have_mpx): Remove.
(main): Remove call to have_mpx.
* gdb.arch/i386-mpx-call.exp: Use have_mpx.
* gdb.arch/i386-mpx-map.c (have_mpx): Remove.
(main): Remote call to have_mpx.
* gdb.arch/i386-mpx-map.exp: Use have_mpx.
* gdb.arch/i386-mpx-sigsegv.c (have_mpx): Remove.
(main): Remove call to have_mpx.
* gdb.arch/i386-mpx-sigsegv.exp: Use have_mpx.
* gdb.arch/i386-mpx-simple_segv.c (have_mpx): Remove.
(main): Remove call to have_mpx.
* gdb.arch/i386-mpx-simple_segv.exp: Use have_mpx.
* gdb.arch/i386-mpx.c (have_mpx): Remove.
(main): Remote call to have_mpx.
* gdb.arch/i386-mpx.exp: Use have_mpx.
* lib/gdb.exp (have_mpx): New proc.
|
|
This hook appears to be unused. I guess it was used from insight or
something like that at some point. But I grepped in today's source of
insight [1] and there was no match. So I think it's safe to remove.
gdb/ChangeLog:
* top.c (pre_init_ui_hook): Remove.
[1] https://sourceware.org/git/?p=insight.git
Change-Id: Ia14499a4b6b9d79bb9a526d635fe44a654ef2a27
|
|
This patch adds support for bfloat16 in AArch64 gdb.
Also adds the field "bf" to vector registers h0-h31.
Also adds the vector "bf" to h field in vector registers v0-v31.
The following is how the vector register h and v looks like.
Before this patch:
(gdb) p $h0
$1 = {f = 0, u = 0, s = 0}
(gdb) p/x $h0
$2 = {f = 0x0, u = 0x0, s = 0x0}
(gdb) p $v0.h
$3 = {f = {0, 0, 0, 0, 0, 0, 0, 0}, u = {0, 0, 0, 0, 0, 0, 0, 0}, s = {0, 0, 0, 0, 0, 0, 0, 0}}
(gdb) p/x $v0.h
$4 = {f = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
s = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
After this patch:
(gdb) p $h0
$1 = {bf = 0, f = 0, u = 0, s = 0}
(gdb) p/x $h0
$2 = {bf = 0x0, f = 0x0, u = 0x0, s = 0x0}
(gdb) p $v0.h
$3 = {bf = {0, 0, 0, 0, 0, 0, 0, 0}, f = {0, 0, 0, 0, 0, 0, 0, 0}, u = {0, 0, 0, 0, 0, 0, 0, 0},
s = {0, 0, 0, 0, 0, 0, 0, 0}}
(gdb) p/x $v0.h
$4 = {bf = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, f = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
u = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, s = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
gdb/ChangeLog:
2021-01-12 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
* aarch64-tdep.c (aarch64_vnh_type): Add "bf" field in h registers.
(aarch64_vnv_type): Add "bf" type in h field of v registers.
* features/aarch64-fpu.c (create_feature_aarch64_fpu): Regenerated.
* features/aarch64-fpu.xml: Add bfloat16 type.
gdb/testsuite/ChangeLog:
2021-01-12 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
* gdb.arch/aarch64-fp.exp: Modify to test bfloat16 support.
|
|
Compiling binutils using -flto=jobserver with GCC 11 leads to
libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wwrite-strings -I../../gas/../zlib -g -O2 -fprofile-generate -flto=jobserver -o as-new app.o as.o atof-generic.o compress-debug.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o remap.o sb.o stabs.o subsegs.o symbols.o write.o config/tc-i386.o config/obj-elf.o config/atof-ieee.o ../opcodes/.libs/libopcodes.a ../bfd/.libs/libbfd.a -L/tmp/binutils-gdb/objdir/zlib -lz ../libiberty/libiberty.a -ldl
lto-wrapper: warning: jobserver is not available: '--jobserver-auth=' is not present in 'MAKEFLAGS'
since the '+' is missing on the recipe line in Makefiles generated by
automake. Add the '+' to the recipe line by hand.
bfd/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
binutils/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
config/
PR binutils/26792
* jobserver.m4: New file.
gas/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
gprof/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
ld/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
libctf/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
opcodes/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
|
|
When running test-case gdb.base/disasm-optim.exp with target board unix/-m32,
we get:
...
Running disasm-optim.exp ...
gdb compile failed, disasm-optim.c: Assembler messages:
disasm-optim.c:35: Error: bad register name `%rip)'
disasm-optim.c:46: Error: bad register name `%rax)'
disasm-optim.c:57: Error: bad register name `%rip)'
=== gdb Summary ===
# of untested testcases 1
...
Fix this by requiring is_amd64_regs_target instead of istarget
"x86_64-*-linux*".
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2021-01-12 Tom de Vries <tdevries@suse.de>
* gdb.base/disasm-optim.exp: Require is_amd64_regs_target.
|
|
Subtract the value of the section contents for R_AMD64_DIR64 and
R_AMD64_DIR32 relocations when generating ELF output from PE/x86-64
inputs.
bfd/
PR ld/27171
* reloc.c (bfd_perform_relocation): Adjust R_AMD64_DIR64 and
R_AMD64_DIR32 relocations for PE/x86-64 inputs.
ld/
PR ld/27171
* testsuite/ld-x86-64/pe-x86-64-5.obj.bz2: New file.
* testsuite/ld-x86-64/pe-x86-64-5.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-5.rd: Likewise.
* testsuite/ld-x86-64/pe-x86-64.exp: Run PR ld/27171 test.
|
|
|
|
Consider this GDB session:
(gdb) set language fortran
(gdb) set debug expression 1
(gdb) p .TRUE.
Dump of expression @ 0x4055d90, before conversion to prefix form:
Language fortran, 3 elements, 16 bytes each.
Index Opcode Hex Value String Value
0 OP_BOOL 79 O...............
1 BINOP_ADD 1 ................
2 OP_BOOL 79 O...............
Dump of expression @ 0x4055d90, after conversion to prefix form:
Expression: `TRUE'
Language fortran, 3 elements, 16 bytes each.
0 OP_BOOL Unknown format
1 BINOP_ADD
2 OP_BOOL Unknown format
3 OP_NULL Unknown format
$1 = .TRUE.
The final dump of the OP_BOOL is completely wrong. After this patch
we now get:
(gdb) set language fortran
(gdb) set debug expression 1
(gdb) p .TRUE.
Dump of expression @ 0x2d07470, before conversion to prefix form:
Language fortran, 3 elements, 16 bytes each.
Index Opcode Hex Value String Value
0 OP_BOOL 79 O...............
1 BINOP_ADD 1 ................
2 OP_BOOL 79 O...............
Dump of expression @ 0x2d07470, after conversion to prefix form:
Expression: `TRUE'
Language fortran, 3 elements, 16 bytes each.
0 OP_BOOL TRUE
$1 = .TRUE.
Much better. I added a test for this into the Fortran testsuite.
gdb/ChangeLog:
* expprint.c (dump_subexp_body_standard): Handle OP_BOOL.
gdb/testsuite/ChangeLog:
* gdb.fortran/debug-expr.exp: Add new tests.
|
|
Fortran supports symbol based comparison operators as well as the
classic text based comparison operators, so we have:
Text | Symbol
Operator | Operator
---------|---------
.eq. | ==
.ne. | /=
.le. | <=
.ge. | >=
.gt. | >
.lt. | <
This commit adds the symbol based operators as well as some tests.
gdb/ChangeLog:
* f-exp.y (dot_ops): Rename to...
(fortran_operators): ...this. Add a header comment. Add symbol
based operators.
(yylex): Update to use fortran_operators not dot_ops. Remove
special handling for '**', this is now included in
fortran_operators.
gdb/testsuite/ChangeLog:
* gdb.fortran/dot-ops.exp: Add new tests.
|
|
Use the correct style of declaring variables at top of scope.
This fixes a few compiler warnings in the process.
|
|
This logic was migrated to the common code long ago so ports don't
need to declare them themselves.
|
|
The run.c interface was deleted long ago and everyone moved to nrun.c
(which is also the default), so no one needs to declare this anymore.
|
|
|
|
This was merged into the common code a long time ago, so ports
shouldn't be calling this themselves.
|
|
Check if AR is usable for LTO build with --enable-pgo-build=lto:
checking for -plugin option... ar: no operation specified
Failed: ar --plugin /usr/gcc-11.0.0-x32/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/liblto_plugin.so rc
no
configure: error: AR with --plugin and rc is required for LTO build
instead of build failure later.
PR binutils/26766
* configure.ac:
* configure: Regenerated.
|
|
Check if AR works with --plugin and rc before passing --plugin to AR and
RANLIB.
bfd/
PR ld/27173
binutils/
PR ld/27173
* configure: Regenerated.
gas/
PR ld/27173
* configure: Regenerated.
gprof/
PR ld/27173
* configure: Regenerated.
ld/
PR ld/27173
* configure: Regenerated.
libctf/
PR ld/27173
* configure: Regenerated.
opcodes/
PR ld/27173
* configure: Regenerated.
|
|
AR from older binutils doesn't work with --plugin and rc:
[hjl@gnu-cfl-2 bin]$ touch foo.c
[hjl@gnu-cfl-2 bin]$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
[hjl@gnu-cfl-2 bin]$ ./ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
./ar: no operation specified
[hjl@gnu-cfl-2 bin]$ ./ar --version
GNU ar (Linux/GNU Binutils) 2.29.51.0.1.20180112
Copyright (C) 2018 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
[hjl@gnu-cfl-2 bin]$
Check if AR works with --plugin and rc before passing --plugin to AR and
RANLIB.
PR ld/27173
* configure: Regenerated.
* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Check if AR works with
--plugin and rc before enabling --plugin.
config/
PR ld/27173
* gcc-plugin.m4 (GCC_PLUGIN_OPTION): Check if AR works with
--plugin and rc before enabling --plugin.
libiberty/
PR ld/27173
* configure: Regenerated.
zlib/
PR ld/27173
* configure: Regenerated.
|
|
|
|
These were written with 32-bit host assumptions baked into it.
Simplify the printf formats to use ll length modifier as it's
in C11 rather than trying to manually break it up into two,
and cleanup some of the casts to stop assuming sizeof(long) is
the same as sizeof(int).
We also have to add a few more includes for the various funcs
used in here.
The tests aren't compiled automatically still. We can figure
that out later with more work.
|
|
I haven't tried this on an actual aarch64 machine, but I am able to
exercise it like this:
(gdb) set debug aarch64
(gdb) maintenance selftest aa
Running selftest aarch64-analyze-prologue.
[aarch64] aarch64_analyze_prologue: prologue analysis gave up addr=0x14 opcode=0xf94013e0
Running selftest aarch64-process-record.
Ran 2 unit tests, 0 failed
gdb/ChangeLog:
* arch/aarch64-insn.h (aarch64_debug_printf): New.
* arch/aarch64-insn.c: Use aarch64_debug_printf.
* aarch64-tdep.c: Use aarch64_debug_printf.
Change-Id: Ifdb40e2816ab8e55a9aabb066d1833d9b5a46094
|
|
This is only compile-tested.
gdb/ChangeLog:
* solib-aix.c (solib_aix_debug_printf): New, use throughout
file.
Change-Id: I7ec4baa15ab5b8ad786212b8b9de61c2c447bac1
|
|
gdb/ChangeLog:
* jit.c (jit_debug): Change type to bool.
(_initialize_jit): Adjust.
Change-Id: Ic2b1eec28eafe8ccb2899f38ddc91ba9703cb38e
|
|
On SLE-11 I ran into:
...
(gdb) print $_probe_arg0^M
Cannot access memory at address 0x8000003fe05c^M
(gdb) FAIL: gdb.arch/amd64-stap-special-operands.exp: probe: three_arg: \
print $_probe_arg0
...
The memory cannot be accessed because the address used to evaluate
$_probe_arg0 at the probe point is incorrect.
The address is calculated using this expression:
...
.asciz "-4@-4(%rbp,%ebx,0)"
...
which uses $ebx, but $ebx is uninitialized at the probe point.
The test-case does contain a "movl $0, %ebx" insn to set $ebx to 0, but that
insn is placed after the probe point. We could fix this by moving the insn
to before the probe point. But, $ebx is also a callee-save register, so
normally, if we modify it, we also need to save and restore it, which is
currently not done. This is currently not harmful, because we don't run the
test-case further than the probe point, but it's bound to cause confusion.
So, fix this instead by using $eax instead in the expression, and moving the
insn setting $eax to 0 to before the probe point.
gdb/testsuite/ChangeLog:
2021-01-11 Tom de Vries <tdevries@suse.de>
PR testsuite/26968
* gdb.arch/amd64-stap-three-arg-disp.S: Remove insn modifying $ebx.
Move insn setting $eax to before probe point.
|
|
This patch removes support for the CSRE extension from aarch64
gas/objdump.
CSRE (FEAT_CSRE) is part of the Future Architecture Technologies program
and at this time Arm is withdrawing this particular feature.
The patch removes the system registers and the CSR PDEC instruction.
gas/ChangeLog
* NEWS: Remove CSRE.
* config/tc-aarch64.c (parse_csr_operand): Delete.
(parse_operands): Delete handling of AARCH64_OPND_CSRE_CSR.
(aarch64_features): Remove csre.
* doc/c-aarch64.texi: Remove CSRE.
* testsuite/gas/aarch64/csre.d: Delete.
* testsuite/gas/aarch64/csre-invalid.s: Likewise.
* testsuite/gas/aarch64/csre-invalid.d: Likewise.
* testsuite/gas/aarch64/csre_csr.s: Likewise.
* testsuite/gas/aarch64/csre_csr.d: Likewise.
* testsuite/gas/aarch64/csre_csr-invalid.s: Likewise.
* testsuite/gas/aarch64/csre_csr-invalid.l: Likewise.
* testsuite/gas/aarch64/csre_csr-invalid.d: Likewise.
include/ChangeLog
* opcode/aarch64.h (AARCH64_FEATURE_CSRE): Delete.
(aarch64_opnd): Delete AARCH64_OPND_CSRE_CSR.
opcodes/ChangeLog
* aarch64-asm-2.c: Regenerate.
* aarch64-dis-2.c: Likewise.
* aarch64-opc-2.c: Likewise.
* aarch64-opc.c (aarch64_print_operand): Delete handling of
AARCH64_OPND_CSRE_CSR.
* aarch64-tbl.h (aarch64_feature_csre): Delete.
(CSRE): Likewise.
(_CSRE_INSN): Likewise.
(aarch64_opcode_table): Delete csr.
|
|
PR ld/27167
* ldmain.c (get_emulation): Add mipsmips32r3, mips32r5, mips64r3
and mips64r5 to list of known mips targets.
|