gas * testsuite/gas/aarch64/ete.d: New test.
* testsuite/gas/aarch64/ete.s: New test.
opcodes * aarch64-opc.c: Add ETE system registers TRCEXTINSELR<0-3> and TRCRSR.
gas * testsuite/gas/aarch64/trbe-invalid.d: New test.
* testsuite/gas/aarch64/trbe-invalid.l: New test.
* testsuite/gas/aarch64/trbe-invalid.s: New test.
* testsuite/gas/aarch64/trbe.d: New test.
* testsuite/gas/aarch64/trbe.s: New test.
opcodes * aarch64-opc.c: Add TRBE system registers TRBIDR_EL1 , TRBBASER_EL1 ,
TRBLIMITR_EL1 , TRBMAR_EL1 , TRBPTR_EL1, TRBSR_EL1 and TRBTRG_EL1.
This simple follow-on patch adds a feature bit (FP16) that was missing
from the initial Neoverse V1 support.
gas/ChangeLog:
* config/tc-arm.c (arm_cpus): Add FP16 to Neoverse V1.
This simple follow-on patch groups the Neoverse cores together and adds
a missing feature bit (F16) to the entry for Neoverse V1.
gas/ChangeLog:
* config/tc-aarch64.c (aarch64_cpus): Group Neoverse cores
together, add missing F16 bit to Neoverse V1.
This rewrites tui_puts. It now writes as many bytes as possible in a
call to waddnstr, letting curses handle multi-byte sequences properly.
Note that tui_puts_internal remains. It is needed to handle computing
the start line of the readline prompt, which is difficult to do
properly in the case where redisplaying can also cause the command
window to scroll. This might be possible to implement by reverting to
single "character" output, by using mbsrtowcs for its side effects to
find character boundaries in the input. I have not attempted this.
gdb/ChangeLog
2020-09-27 Tom Tromey <tom@tromey.com>
PR tui/25342:
* tui/tui-io.c (tui_puts): Rewrite. Move earlier.
This changes tui_copy_source_line to use ISCNTRL. This lets it work
more nicely with UTF-8 input. Note that this still won't work for
stateful multi-byte encodings; for that much more work would be
required. However, I think this patch does not make gdb any worse in
this scenario.
gdb/ChangeLog
2020-09-27 Tom Tromey <tom@tromey.com>
PR tui/25342:
* tui/tui-winsource.c (tui_copy_source_line): Use ISNCTRL.
This changes the TUI source and disassembly windows to use a curses
pad for their text. This is an important step toward properly
handling non-ASCII characters, because it makes it easy to scroll
horizontally without needing gdb to also understand multi-byte
character boundaries -- this can be wholly delegated to curses.
Horizontal scrolling is probably also faster now, because no
re-rendering is required.
gdb/ChangeLog
2020-09-27 Tom Tromey <tom@tromey.com>
* unittests/tui-selftests.c: Update.
* tui/tui-winsource.h (struct tui_source_window_base)
<extra_margin, show_line_number, refresh_pad>: New methods.
<m_max_length, m_pad>: New members.
(tui_copy_source_line): Update.
* tui/tui-winsource.c (tui_copy_source_line): Remove line_no,
first_col, line_width, ndigits parameters. Add length.
(tui_source_window_base::show_source_line): Write to pad. Line
number now 0-based.
(tui_source_window_base::refresh_pad): New method.
(tui_source_window_base::show_source_content): Write to pad. Call
refresh_pad.
(tui_source_window_base::do_scroll_horizontal): Call refresh_pad,
not refill.
(tui_source_window_base::update_exec_info): Call
show_line_number.
* tui/tui-source.h (struct tui_source_window) <extra_margin>: New
method.
<m_digits>: New member.
* tui/tui-source.c (tui_source_window::set_contents): Set m_digits
and m_max_length.
(tui_source_window::show_line_number): New method.
* tui/tui-io.h (tui_puts): Fix comment.
* tui/tui-disasm.c (tui_disasm_window::set_contents): Set
m_max_length.
This removes a call to show_source_line from tui_source_window_base.
This call isn't needed because this function already calls the
'refill' method if the state changed.
gdb/ChangeLog
2020-09-27 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c
(tui_source_window_base::set_is_exec_point_at): Don't call
show_source_line.
This changes tui_py_window to create an inner curses window. This
greatly simplifies tui_py_window::output, beacuse it no longer needs
to be careful to avoid overwriting the window's border. This patch
also makes it a bit easier for a later patch to rewrite
tui_copy_source_line.
gdb/ChangeLog
2020-09-27 Tom Tromey <tom@tromey.com>
* python/py-tui.c (class tui_py_window) <refresh_window>: New
method.
<erase>: Update.
<cursor_x, cursor_y>: Remove.
<m_inner_window>: New member.
(tui_py_window::rerender): Create inner window.
(tui_py_window::output): Write to inner window.
I noticed a duplicated test in gdb.tui. This patch removes it by
wrapping a test in with_test_prefix.
gdb/testsuite/ChangeLog
2020-09-27 Tom Tromey <tom@tromey.com>
* gdb.tui/new-layout.exp: Use with_test_prefix.
Some missing NULL checks meant a stub for a local symbol used a stub
looking like the __tls_get_addr_opt stub.
PR 26656
* elf64-ppc.c (ppc_build_one_stub, ppc_size_one_stub): Check for
NULL stub_entry->h before calling is_tls_get_addr.
Prior to commit 56bcdbea2b, the from_tty keyword argument to the
Python function gdb.execute controlled whether the command took input
from the terminal. When from_tty=True, "starti" and similar commands
prompted the user:
(gdb) python gdb.execute("starti", from_tty=True)
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /bin/true
Program stopped.
When from_tty=False, these commands did not prompt the user, and "yes"
was assumed:
(gdb) python gdb.execute("starti", from_tty=False)
Program stopped.
However, after commit 56bcdbea2b, the from_tty keyword argument no
longer had this effect. For example, as of commit 7ade7fba75:
(gdb) python gdb.execute("starti", from_tty=True)
The program being debugged has been started already.
Start it from the beginning? (y or n) [answered Y; input not from terminal]
Starting program: /bin/true
Program stopped.
Note the "[answered Y; input not from terminal]" in the output even
though from_tty=True was requested.
Looking at commit 56bcdbea2b, it seems that the behaviour of the
from_tty argument was changed accidentally. The commit message said:
Let gdb.execute handle multi-line commands
This changes the Python API so that gdb.execute can now handle
multi-line commands, like "commands" or "define".
and there was no mention of changing the effect of the from_tty
argument. It looks as though the code for setting the instream to
nullptr was accidentally moved from execute_user_command() to
execute_control_commands() along with the other scoped restores.
Accordingly, the simplest way to fix this is to partially reverse
commit 56bcdbea2b by moving the code for setting the instream to
nullptr back to execute_user_command() where it was to begin with.
Additionally, add a test case to reduce the risk of similar breakage
in future.
gdb/ChangeLog:
PR python/26586
* cli/cli-script.c (execute_control_commands): don't set
instream to nullptr here as this breaks the from_tty argument
to gdb.execute in Python.
(execute_user_command): set instream to nullptr here instead.
gdb/testsuite/ChangeLog:
PR python/26586
* gdb.python/python.exp: add test cases for the from_tty
argument to gdb.execute.
Gold version of commit 3cd7c7d7ef.
* powerpc.cc (Target_powerpc): Rename power10_stubs_ to
power10_relocs_.
(Target_powerpc::set_power10_relocs): New accessor.
(Target_powerpc::set_power10_stubs): Delete.
(Target_powerpc::power10_stubs): Adjust.
(Target_powerpc::has_localentry0): New accessor.
(ld_0_11): New constant.
(glink_eh_frame_fde_64v1, glink_eh_frame_fde_64v2): Adjust.
(glink_eh_frame_fde_64v2_localentry0): New.
(Output_data_glink::pltresolve_size): Update.
(Output_data_glink::add_eh_frame): Use localentry0 version eh_frame.
(Output_data_glink::do_write): Move r2 save to start of ELFv2 stub
and only emit for has_localentry0. Don't use r2 in the stub.
(Target_powerpc::Scan::local, global): Adjust for
set_power10_relocs renaming.
(Target_powerpc::scan_relocs): Warn and reset plt_localentry0_.
The save of r2 in __glink_PLTresolve is the culprit. Remove it,
unless we know we need it for --plt-localentry. --plt-localentry
should not be used with power10 pc-relative code that makes tail
calls.
The patch also removes use of r2 as a scratch reg in the ELFv2
__glink_PLTresolve. Using r2 isn't a problem, this is just reducing
the number of scratch regs.
bfd/
* elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Depend on has_plt_localentry0.
(LD_R0_0R11, ADD_R11_R0_R11): Define.
(ppc64_elf_tls_setup): Disable params->plt_localentry0 when power10
code detected.
(ppc64_elf_size_stubs): Update __glink_PLTresolve eh_frame.
(ppc64_elf_build_stubs): Move r2 save to start of __glink_PLTresolve,
and only emit for has_plt_localentry0. Don't use r2 in the stub.
ld/
* testsuite/ld-powerpc/elfv2so.d,
* testsuite/ld-powerpc/notoc2.d,
* testsuite/ld-powerpc/tlsdesc.wf,
* testsuite/ld-powerpc/tlsdesc2.d,
* testsuite/ld-powerpc/tlsdesc2.wf,
* testsuite/ld-powerpc/tlsopt5.d,
* testsuite/ld-powerpc/tlsopt5.wf,
* testsuite/ld-powerpc/tlsopt6.d,
* testsuite/ld-powerpc/tlsopt6.wf: Update __glink_PLTresolve.
The do/while in these macros are not formatted with proper GNU style,
fix that.
gdb/ChangeLog:
* infrun.h (infrun_debug_printf): Fix formatting.
* linux-nat.c (linux_nat_debug_printf): Fix formatting.
Change-Id: I3a723663c76d9091f785941923c2b6cf67459629
compile_module attempts to request a move constructor, but because
munmap_list doesn't have one it gets implicitly deleted. This is an
warning on clang under -Wdefaulted-function-deleted (which is enabled by
default):
In file included from compile/compile-object-load.c:21:
compile/compile-object-load.h:56:3: error: explicitly defaulted move constructor is implicitly deleted [-Werror,-Wdefaulted-function-deleted]
compile_module (compile_module &&other) = default;
^
compile/compile-object-load.h:86:22: note: move constructor of 'compile_module' is implicitly deleted because field 'munmap_list' has a deleted move constructor
struct munmap_list munmap_list;
^
compile/compile-object-load.h:30:28: note: 'munmap_list' has been explicitly marked deleted here
DISABLE_COPY_AND_ASSIGN (munmap_list);
^
gdb/ChangeLog:
* compile/compile-object-load.h: Give munmap_list a move
constructor.
Change-Id: I300c52e27da70087f18c7e359773c2b984073d8b
I've been using the mklog utility from the gcc repo for a while to
generate skeleton of ChangeLog entries. It recently got a rewrite as a
Python script. Unfortunately, to find the repository root, and
eventually to find in which ChangeLog file each entry goes, the new
script assumes it is located in the same git repository that it
generates ChangeLog entries for.
This means that if you make a change in the gcc source tree and run
mklog.py from that same source tree, it works. But if you make changes
in your ~/src/binutils-gdb tree and run ~/src/gcc/contrib/mklog.py, it
won't work.
IIRC, the old script required that you ran it with the project's root
directory as the CWD.
The simplest way to fix this is to import the script in binutils-gdb and
use it from there. It's also nice because we can use it without having
a clone of the gcc repo.
I also thought of adding a "--root" switch to the script to override the
project's base directory. However:
1) It is more work.
2) If the script still lives in the gcc repo, it's less convenient than
having it in binutils-gdb.
This patch imports contrib/mklog.py from the gcc repo, revision
c560591408440f441b8b327f5b41f9328d20b67b.
contrib/ChangeLog:
* mklog.py: New file, imported from gcc.
Note: the ChangeLog entry above was generated using
`git show | ./mklog.py`!
Change-Id: I955592ce6397681986dc82a09593c32d8b8de54f
gdb.base/infcall-nested-structs-c++.exp failed to build using Clang
with many variations on the following error:
gdb compile failed, /gdbtest/src/gdb/testsuite/gdb.base/infcall-nested-structs.c:207:46:
warning: self-comparison always evaluates to true [-Wtautological-compare]
This commit builds this testcase with -Wno-tautological-compare when
using Clang, to avoid this failure.
gdb/testsuite/ChangeLog:
* gdb.base/infcall-nested-structs.exp.tcl: Add
additional_flags=-Wno-tautological-compare for C++
tests when compiling using Clang.
In commit 221db974e6, this patch:
2020-06-24 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (gdb_compile): Pass "-x c++" explicitly when
compiling C++ programs.
attempted to fix problems with testcases that compile .c files
with the C++ compiler. They pass the "c++" option to gdb_compile,
resulting in the following error when using Clang:
gdb compile failed, clang-10: warning: treating 'c' input as 'c++'
when in C++ mode, this behavior is deprecated [-Wdeprecated]
This fix did not work for gdb.base/infcall-nested-structs-c++.exp,
however: the "-x c++" appeared in the compiler's commandline after
the .c file, so the option was not enabled for that file.
The previous files fixed all used build_executable_from_specs, which
compiles and links in separate steps, using gdb_compile: the compile
step passes $type=object to gdb_compile, while the link step passes
$type=executable.
gdb.base/infcall-nested-structs-c++.exp uses gdb_compile directly
instead, and it passes $type=executable to compile and link all in
one step. Pedro found that DejaGnu's default_target_compile adds
the sources at the end when $type=object, but at the beginning when
$type=executable:
# This is obscure: we put SOURCES at the end when building an
# object, because otherwise, in some situations, libtool will
# become confused about the name of the actual source file.
if {$type == "object"} {
set opts "$add_flags $sources"
} else {
set opts "$sources $add_flags"
}
This commit moves the "-x c++" earlier in the compiler's commandline.
Unfortunately this then broke the testcase that required the original
fix, gdb.compile/compile-cplus.exp: the "-x c++" was being parsed for
the linker pass, causing the compiler to attempt to parse the .o files
as C++. This commit makes passing "-x c++" conditional on the source
being a .c file.
gdb/testsuite/ChangeLog:
* lib/gdb.exp (gdb_compile): Pass "-x c++" earlier, and only
for .c files.
* elfcomm.c (byte_put_little_endian, byte_put_big_endian): Support
more field sizes.
* readelf.c (target_specific_reloc_handling <MSP430>): Limit
allowed reloc_size. Don't read_leb128 outside of section.
There are 11 MOD_VEX_0F38* inserted in MOD_0F38* group,
which should be placed in MOD_VEX_0F38* group.
opcode/
PR 26654
*i386-dis.c (enum): Put MOD_VEX_0F38* together.
Emit an error instead of crashing in frag_new, handling this same as the
i386 port.
gas/
PR 26400
* config/tc-riscv.c (append_insn): If in absolute section, emit
error before add_relaxed_insn call.
* testsuite/gas/riscv/absolute-sec.d: New.
* testsuite/gas/riscv/absolute-sec.l: New.
* testsuite/gas/riscv/absolute-sec.s: New.
This adds a get_DW_UT_name function to dwarfnames using dwarf2.def
for use in binutils readelf to show the unit types in a DWARF5 header.
include/ChangeLog:
Sync with GCC
* dwarf2.def: Add DWARF5 Unit type header encoding macros
DW_UT_FIRST, DW_UT and DW_UT_END.
* dwarf2.h (enum dwarf_unit_type): Removed and define using
DW_UT_FIRST, DW_UT and DW_UT_END macros.
(get_DW_UT_name): New function declaration.
libiberty/ChangeLog:
Sync with GCC
* dwarfnames.c (get_DW_UT_name): Define using DW_UT_FIRST, DW_UT
and DW_UT_END.
dwz in DWARF5 mode might produce DW_UT_partial unit types, which are
the same as DW_UT_compile unit types (but start with a DW_TAG_partial_unit)
and it might produce DW_FORM_ref_addr to create a reference between
units. Accept both constructs.
binutils/ChangeLog:
* dwarf.c (read_and_display_attr_value): Handle DW_FORM_ref_addr
for dwarf_version 5 just as version 3 and 4 (only 2 is different).
(process_debug_info): Allow DW_UT_partial.
Remove the typedef (unneeded with C++). Re-format the comments to
follow the more common style.
gdbsupport/ChangeLog:
* event-loop.c (struct file_handler): Remove typedef, re-format.
Change-Id: I3aea21fba1eb2584c507de3412da4e4c98283b2d
PR tui/26638 notes that the C-x o binding can put the focus on the
locator window. However, this is not useful and did not happen
historically. This patch changes the TUI to skip this window when
switching focus.
gdb/ChangeLog
2020-09-24 Tom Tromey <tromey@adacore.com>
PR tui/26638:
* tui/tui-stack.h (struct tui_locator_window) <can_focus>: New
method.
* tui/tui-data.h (struct tui_win_info) <can_focus>: New method.
* tui/tui-data.c (tui_next_win): Exclude non-focusable windows.
(tui_prev_win): Rewrite.
gdb/testsuite/ChangeLog
2020-09-24 Tom Tromey <tromey@adacore.com>
PR tui/26638:
* gdb.tui/list.exp: Check output of "focus next".
When a WOW64 process triggers a breakpoint exception in 64bit code (which
happens when a 64bit gdb calls DebugBreakProcess for a 32bit target),
gdb ignores the breakpoint (because Wow64GetThreadContext can only report
the pc of 32bit code, and there is not int3 at this location).
But if these 64bit breakpoint exceptions are handled as SIGINT, gdb
doesn't check for int3, and always stops the target.
gdb/ChangeLog:
2020-09-23 Hannes Domani <ssbssa@yahoo.de>
* nat/windows-nat.c (handle_exception): Handle 64bit breakpoints
in WOW64 processes as SIGINT.
* nat/windows-nat.h: Make wow64_process a shared variable.
* windows-nat.c: Remove static wow64_process variable.
gdbserver/ChangeLog:
2020-09-23 Hannes Domani <ssbssa@yahoo.de>
* win32-low.cc: Remove local wow64_process variable.
* win32-low.h: Remove local wow64_process variable.
This patch adds support for Arm's Neoverse V1 CPU to AArch32 binutils.
gas/ChangeLog:
2020-09-24 Alex Coplan <alex.coplan@arm.com>
* config/tc-arm.c (arm_cpus): Add Neoverse V1.
* doc/c-arm.texi: Document Neoverse V1 support.
This adds support for Arm's Neoverse V1 CPU to AArch64 binutils.
gas/ChangeLog:
2020-09-24 Alex Coplan <alex.coplan@arm.com>
* config/tc-aarch64.c (aarch64_cpu_option_table): Add Neoverse V1.
* doc/c-aarch64.texi: Document Neoverse V1 support.
This commit:
commit afdcafe891
Date: Thu Sep 17 14:30:28 2020 +0800
CSKY: Add objdump option -M abi-names.
cases the build of GDB (configured with --enabled-targets=all) to fail
with this error:
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../src/opcodes -I. -I../../src/opcodes -I../bfd -I../../src/opcodes/../include -I../../src/opcodes/../bfd -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Werror -O0 -g3 -D_GLIBCXX_DEBUG=1 -MT csky-dis.lo -MD -MP -MF .deps/csky-dis.Tpo -c ../../src/opcodes/csky-dis.c -o csky-dis.o
../../src/opcodes/csky-dis.c: In function 'csky_output_operand':
../../src/opcodes/csky-dis.c:849:7: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
849 | if (IS_CSKY_V1 (mach_flag))
| ^~
../../src/opcodes/csky-dis.c:851:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
851 | strcat (str, buf);
| ^~~~~~
this commit adds { ... } around the if body to resolve this issue.
opcodes/ChangeLog:
* csky-dis.c (csky_output_operand): Enclose body of if in curly
braces.
This adds support for Arm's Neoverse N2 CPU to AArch32 binutils. The
Neoverse N2 CPU builds AArch32 at EL0 and therefore needs support in the
AArch32 assembler.
gas/ChangeLog:
2020-09-24 Alex Coplan <alex.coplan@arm.com>
* config/tc-arm.c (arm_cpus): Add Neoverse N2.
* doc/c-arm.texi: Document -mcpu=neoverse-n2.
This stub doesn't have the r2 store at the beginning.
* powerpc.cc (Target_powerpc::Relocate::relocate): Don't skip
first insn of __tls_get_addr_opt stub.
This adds missing support for a power10 version of the __tls_get_addr
call stub implementing DT_PPC64_OPT PPC64_OPT_TLS. Without this,
power10 code using __tls_get_addr fails miserably at runtime unless
the --no-tls-get-addr-optimize option is given.
PR 26656
* elf64-ppc.c (plt_stub_size): Add "odd" param. Use it with
size_power10_offset rather than calculating from start of stub.
Add size for notoc tls_get_addr_opt stub.
(plt_stub_pad): Add "odd" param, pass to plt_stub_size.
(build_tls_get_addr_head, build_tls_get_addr_tail): New functions.
(build_tls_get_addr_stub): Delete.
(ppc_build_one_stub): Use a temp for htab->params->stub_bfd.
Emit notoc tls_get_addr_opt stub. Move eh_frame code to
suit. Adjust code to use bfd_tls_get_addr_head/tail in place
of build_tls_get_addr_stub.
(ppc_size_one_stub): Size notoc tls_get_addr_opt stub.
Adjust plt_stub_size and plt_stub_pad calls. Correct "odd"
when padding stub. Size eh_frame for notoc stub too.
Correct lr_restore value.
(ppc64_elf_relocate_section): Don't skip over first insn of
notoc tls_get_addr_opt stub.
Some of the powerpc64 code editing functions are better run after
dynamic symbols have stabilised in order to make proper decisions
based on SYMBOL_REFERENCES_LOCAL. The dynamic symbols are processed
early in bfd_elf_size_dynamic_sections, before the backend
always_size_sections function is called.
One function, ppc64_elf_tls_setup must run before
bfd_elf_size_dynamic_sections because it changes dynamic symbols.
ppc64_elf_edit_opd and ppc64_elf_inline_plt can run early or late, I
think. ppc64_elf_tls_optimize and ppc64_elf_edit_toc are better run
later.
So this patch arranges to call some edit functions later via
always_size_sections.
PR 26655
bfd/
* elf64-ppc.c (ppc64_elf_func_desc_adjust): Rename to..
(ppc64_elf_edit): Call params->edit.
(ppc64_elf_tls_setup): Don't call _bfd_elf_tls_setup. Return a
bfd_boolean.
* elf64-ppc.h (struct ppc64_elf_params): Add "edit".
(ppc64_elf_tls_setup): Update declaration.
ld/
* emultempl/ppc64elf.em (params): Add ppc_edit.
(ppc_before_allocation): Split off some edit functions to..
(ppc_edit): ..this, new function.
Add option parser for disassembler, and refine the codes of
parse register operand and disassemble register operand.
While strengthen the operands legality check of some instructions.
Co-Authored-By: Lifang Xia <lifang_xia@c-sky.com>
gas/
* config/tc-csky.c (parse_type_ctrlreg): Use function
csky_get_control_regno to operand.
(csky_get_reg_val): Likewise.
(is_reg_sp_with_bracket): Use function csky_get_reg_val
to parse operand.
(is_reg_sp): Refine.
(is_oimm_within_range): Fix, report error when operand
is not constant.
(parse_type_cpreg): Refine.
(parse_type_cpcreg): Refine.
(get_operand_value): Add handle of OPRND_TYPE_IMM5b_LS.
(md_assemble): Fix no error reporting somtimes when
operands number are not fit.
(csky_addc64): Refine.
(csky_subc64): Refine.
(csky_or64): Refine.
(v1_work_fpu_fo): Refine.
(v1_work_fpu_read): Refine.
(v1_work_fpu_writed): Refine.
(v1_work_fpu_readd): Refine.
(v2_work_addc): New function, strengthen the operands legality
check of addc.
* gas/testsuite/gas/csky/all.d : Use register number format when
disassemble register name by default.
* gas/testsuite/gas/csky/cskyv2_all.d : Likewise.
* gas/testsuite/gas/csky/trust.d: Likewise.
* gas/testsuite/gas/csky/cskyv2_ck860.d : Fix.
* gas/testsuite/gas/csky/trust.s : Fix.
opcodes/
* csky-dis.c (using_abi): New.
(parse_csky_dis_options): New function.
(get_gr_name): New function.
(get_cr_name): New function.
(csky_output_operand): Use get_gr_name and get_cr_name to
disassemble and add handle of OPRND_TYPE_IMM5b_LS.
(print_insn_csky): Parse disassembler options.
* opcodes/csky-opc.h (OPRND_TYPE_IMM5b_LS): New enum.
(GENARAL_REG_BANK): Define.
(REG_SUPPORT_ALL): Define.
(REG_SUPPORT_ALL): New.
(ASH): Define.
(REG_SUPPORT_A): Define.
(REG_SUPPORT_B): Define.
(REG_SUPPORT_C): Define.
(REG_SUPPORT_D): Define.
(REG_SUPPORT_E): Define.
(csky_abiv1_general_regs): New.
(csky_abiv1_control_regs): New.
(csky_abiv2_general_regs): New.
(csky_abiv2_control_regs): New.
(get_register_name): New function.
(get_register_number): New function.
(csky_get_general_reg_name): New function.
(csky_get_general_regno): New function.
(csky_get_control_reg_name): New function.
(csky_get_control_regno): New function.
(csky_v2_opcodes): Prefer two oprerans format for bclri and
bseti, strengthen the operands legality check of addc, zext
and sext.
PR symtab/25470 points out that the Zig programming language allows
integers of various bit sizes (including zero), not just sizes that
are a multiple of 8.
This is supported in DWARF by applying both a byte size and a
DW_AT_bit_size.
This patch adds support for this feature to integer and boolean types.
Other base types are not handled -- for floating-point types, this
didn't seem to make sense, and for character types I didn't see much
need. (These can be added later if desired.)
I've also added support for DW_AT_data_bit_offset at the same time. I
don't know whether the Zig compiler requires this, but it was
described in the same section in the DWARF standard and was easy to
add.
A new test case is supplied, using the DWARF assembler.
gdb/ChangeLog
2020-09-23 Tom Tromey <tom@tromey.com>
PR symtab/25470:
* value.c (unpack_long, pack_long, pack_unsigned_long): Handle bit
offset and bit size.
* printcmd.c (print_scalar_formatted): Handle zero-length
integer.
(print_scalar_formatted): Use bit_size_differs_p.
* gdbtypes.h (enum type_specific_kind) <TYPE_SPECIFIC_INT>: New
constant.
(union type_specific): <int_stuff>: New member.
(struct type) <bit_size_differs_p, bit_size, bit_offset>: New
methods.
* gdbtypes.c (init_integer_type, init_boolean_type): Initialize
TYPE_SPECIFIC_FIELD.
(recursive_dump_type, copy_type_recursive): Update.
* dwarf2/read.c (read_base_type): Handle DW_AT_bit_size and
DW_AT_data_bit_offset.
gdb/testsuite/ChangeLog
2020-09-23 Tom Tromey <tom@tromey.com>
* gdb.dwarf2/intbits.exp: New file.
* gdb.dwarf2/intbits.c: New file.