Simon Marchi [Mon, 5 Oct 2020 16:37:23 +0000 (12:37 -0400)]
gdb: sync tui header files in HFILES_NO_SRCDIR
I noticed that tui/tui-windata.h didn't exist anymore, and that
tui/tui-out.h wasn't listed. Fix that.
gdb/ChangeLog:
* Makefile.in (HFILES_NO_SRCDIR): Remove tui/tui-windata.h, add
tui/tui-out.h.
Change-Id: Ic75cc68432b90ba5be857a2852ad52dea326fe36
Simon Marchi [Mon, 5 Oct 2020 16:21:14 +0000 (12:21 -0400)]
gdb: TYPE_VECTOR -> type::is_vector in amd64-windows-tdep.c
I get this build failure:
CXX amd64-windows-tdep.o
cc1plus: warning: command-line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++
/home/smarchi/src/binutils-gdb/gdb/amd64-windows-tdep.c: In function 'return_value_convention amd64_windows_return_value(gdbarch*, value*, type*, regcache*, gdb_byte*, const gdb_byte*)':
/home/smarchi/src/binutils-gdb/gdb/amd64-windows-tdep.c:374:6: error: 'TYPE_VECTOR' was not declared in this scope
374 | if (TYPE_VECTOR (type) && len == 16)
| ^~~~~~~~~~~
TYPE_VECTOR was removed in favor of the type::is_vector method.
gdb/ChangeLog:
* amd64-windows-tdep.c (amd64_windows_return_value): Use
type::is_vector instead of TYPE_VECTOR.
Change-Id: I0ce26c3f7a33625761a8dba351c3158464f21b01
Nick Clifton [Mon, 5 Oct 2020 15:09:00 +0000 (16:09 +0100)]
Fix compile time error building windmc, detected by gcc 11.
PR 26698
* windmc.c (mc_unify_path): Fix typo checking character at end of
pathname.
Przemyslaw Wirkus [Mon, 5 Oct 2020 14:43:41 +0000 (15:43 +0100)]
[PATCH][GAS][AArch64] Update Cortex-X1 feature flags
This is feature flags update for Cortex-X1 CPU.
For more information about this processor, see [0].
[0] : https://www.arm.com/products/cortex-x
gas/ChangeLog:
2020-10-05 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
* config/tc-aarch64.c: Update Cortex-X1 feature flags.
Przemyslaw Wirkus [Mon, 5 Oct 2020 14:43:32 +0000 (15:43 +0100)]
[PATCH][GAS][arm] Update Cortex-X1 feature flags
This is feature flags update for Cortex-X1 CPU.
For more information about this processor, see [0].
[0] : https://www.arm.com/products/cortex-x
gas/ChangeLog:
2020-10-05 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
* config/tc-arm.c: Update Cortex-X1 feature flags.
Nick Clifton [Mon, 5 Oct 2020 13:56:42 +0000 (14:56 +0100)]
Add NetBSD AArch64 Little Endian and Big Endian BFD support.
bfd * config.bfd (aarch64-*-netbsd*, aarch64_be-*-netbsd*): Add target.
Kamil Rytarowski [Mon, 5 Oct 2020 13:54:00 +0000 (14:54 +0100)]
Add NetBSD AArch64 GAS support.
gas * configure.tgt (aarch64*-*-netbsd*): Add target.
Samanta Navarro [Mon, 5 Oct 2020 13:20:15 +0000 (14:20 +0100)]
Fix spelling mistakes
Simon Marchi [Mon, 5 Oct 2020 13:02:42 +0000 (09:02 -0400)]
gdb: avoid unnecessary string copy in auto_load_objfile_script_1
Assigning the result of STRIP_DRIVE_SPEC to an std::string creates an
unnecessary copy of the string. STRIP_DRIVE_SPEC is defined as:
#define STRIP_DRIVE_SPEC(f) ((f) + 2)
So if it is passed a "const char *", it returns a "const char *". We
could use a "const char *" intermediary variable instead of an
std::string, or (as implemented in this patch) just use it directly in
the concatenation right after.
gdb/ChangeLog:
* auto-load.c (auto_load_objfile_script_1): Don't use
debugfile_holder as temporary variable when stripping drive
letter.
Change-Id: If2ccc7a156b22100754d9cdf6778ac7eeb93da4c
T.K. Chia [Mon, 5 Oct 2020 12:46:23 +0000 (05:46 -0700)]
i386: Allow non-absolute segment values for lcall/ljmp
Allow an unresolved or non-absolute symbol as the segment operand of an
immediate far jump (`ljmp SEG, OFF') or far call (`lcall SEG, OFF').
gas/
2020-10-05 T.K. Chia <u1049321969@caramail.com>
PR gas/26694
* NEWS: Updated for i386 lcall and ljmp change.
* config/tc-i386.c (output_interseg_jump): Allow non-absolute
segment operand for immediate lcall and ljmp.
* testsuite/gas/i386/jump.d,
* testsuite/gas/i386/jump.s,
* testsuite/gas/i386/jump16.d,
* testsuite/gas/i386/jump16.e,
* testsuite/gas/i386/jump16.s: Add tests for non-absolute
segment operand for immediate ljmp.
ld/
2020-10-05 T.K. Chia <u1049321969@caramail.com>
PR gas/26694
* testsuite/ld-i386/ljmp.s,
* testsuite/ld-i386/ljmp1.d,
* testsuite/ld-i386/ljmp1.s,
* testsuite/ld-i386/ljmp2.d,
* testsuite/ld-i386/ljmp2.s,
* testsuite/ld-x86-64/ljmp1.d,
* testsuite/ld-x86-64/ljmp2.d: New testcases.
* testsuite/ld-i386/i386.exp,
* testsuite/ld-x86-64/x86-64.exp: Run them.
Nick Clifton [Mon, 5 Oct 2020 12:53:59 +0000 (13:53 +0100)]
Update the BFD linker so that it deprecates grouped short options.
* lexsup.c (parse_args): Generate an error or warning message when
multiple short options are used together.
Hannes Domani [Tue, 5 May 2020 12:31:26 +0000 (14:31 +0200)]
Fix function argument and return value locations
Fixes these testsuite fails on Windows:
FAIL: gdb.base/callfuncs.exp: p t_float_complex_values(fc1, fc2)
FAIL: gdb.base/callfuncs.exp: p t_float_complex_many_args(fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4)
FAIL: gdb.base/callfuncs.exp: noproto: p t_float_complex_values(fc1, fc2)
FAIL: gdb.base/callfuncs.exp: noproto: p t_float_complex_many_args(fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4)
FAIL: gdb.base/call-sc.exp: p/c fun(); call call-sc-tld
FAIL: gdb.base/call-sc.exp: advance to fun for return; return call-sc-tld
FAIL: gdb.base/call-sc.exp: zed L for return; return call-sc-tld
FAIL: gdb.base/call-sc.exp: return foo; return call-sc-tld
FAIL: gdb.base/call-sc.exp: return foo; synchronize pc to main() for 'call-sc-tld'
FAIL: gdb.base/call-sc.exp: return foo; synchronize pc to main() for 'call-sc-tld'
FAIL: gdb.base/call-sc.exp: advance to fun for finish; return call-sc-tld
FAIL: gdb.base/call-sc.exp: zed L for finish; return call-sc-tld
FAIL: gdb.base/call-sc.exp: finish foo; return call-sc-tld (the program is no longer running)
FAIL: gdb.base/call-sc.exp: value foo finished; return call-sc-tld
For function arguments (callfuncs.exp), only TYPE_CODE_COMPLEX was
missing in the types passed via integer registers.
For return values, there were a lot more issues:
- TYPE_CODE_DECFLOAT is NOT returned via XMM0.
- long double is NOT returned via XMM0.
- but __int128 IS returned via XMM0.
- the comments for TYPE_CODE_FLT state that __m128, __m128i and __m128d are
returned by XMM0, and this is correct, but it doesn't actually check for
them, because they are TYPE_CODE_ARRAY with TYPE_VECTOR
So I had to add TYPE_CODE_DECFLOAT to the arguments passed via XMM register,
but I had to remove it from the values returned via XMM0 register.
gdb/ChangeLog:
2020-10-05 Hannes Domani <ssbssa@yahoo.de>
* amd64-windows-tdep.c (amd64_windows_passed_by_integer_register):
Add TYPE_CODE_COMPLEX.
(amd64_windows_return_value): Fix types returned via XMM0.
gdb/testsuite/ChangeLog:
2020-10-05 Hannes Domani <ssbssa@yahoo.de>
* gdb.base/call-sc.c: Fix return struct on stack test case.
* gdb.base/call-sc.exp: Likewise.
H.J. Lu [Mon, 5 Oct 2020 12:27:58 +0000 (05:27 -0700)]
x86-64: Always display suffix for %LQ in 64bit
In 64bit, assembler generates a warning for "sysret":
$ echo sysret | as --64 -o x.o -
{standard input}: Assembler messages:
{standard input}:1: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
Always display suffix for %LQ in 64bit to display "sysretl".
gas/
PR binutils/26704
* testsuite/gas/i386/noreg64-data16.d: Expect sysretl instead of
sysret.
* testsuite/gas/i386/noreg64.d: Likewise.
* testsuite/gas/i386/x86-64-intel64.d: Likewise.
* testsuite/gas/i386/x86-64-opcode.d: Likewise.
opcodes/
PR binutils/26704
* i386-dis.c (putop): Always display suffix for %LQ in 64bit.
H.J. Lu [Mon, 5 Oct 2020 12:23:29 +0000 (05:23 -0700)]
x86: Clear modrm if not needed
The MODRM byte can be checked to display the instruction name only if the
MODRM byte needed. Clear modrm if the MODRM byte isn't needed so that
modrm field checks in putop like, modrm.mod == N with N != 0, can be done
without checking need_modrm.
gas/
PR binutils/26705
* testsuite/gas/i386/x86-64-suffix.s: Add "mov %rsp,%rbp" before
sysretq.
* testsuite/gas/i386/x86-64-suffix-intel.d: Updated.
* testsuite/gas/i386/x86-64-suffix.d: Likewise.
opcodes/
PR binutils/26705
* i386-dis.c (print_insn): Clear modrm if not needed.
(putop): Check need_modrm for modrm.mod != 3. Don't check
need_modrm for modrm.mod == 3.
Alan Hayward [Fri, 25 Sep 2020 11:13:25 +0000 (12:13 +0100)]
Add Luis Machado to AArch64/ARM GDB maintainers
gdb/ChangeLog:
* MAINTAINERS (Responsible Maintainers): Add Luis Machado to
AArch64/ARM maintainers.
Nick Clifton [Mon, 5 Oct 2020 09:40:07 +0000 (10:40 +0100)]
GAS: Update the .section directive so that a numeric section index can be provided when the "o" flag is used.
PR 26253
gas * config/obj-elf.c (obj_elf_section): Accept a numeric value for
the "o" section flag. Interpret it as a section index. Allow an
index of zero.
* doc/as.texi: Document the new behaviour.
* NEWS: Mention the new feature. Tidy entries.
* testsuite/gas/elf/sh-link-zero.s: New test.
* testsuite/gas/elf/sh-link-zero.d: New test driver.
* testsuite/gas/elf/elf.exp: Run the new test.
* testsuite/gas/elf/section21.l: Updated expected assembler
output.
bfd * elf.c (_bfd_elf_setup_sections): Do not complain about an
sh_link value of zero when the SLF_LINK_ORDER flag is set.
(assign_section_numbers): Likewise.
GDB Administrator [Mon, 5 Oct 2020 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
Simon Marchi [Sun, 4 Oct 2020 16:41:56 +0000 (12:41 -0400)]
gdb: add doc for "set/show debug event-loop"
I forgot that "set/show debug" commands are listed in the doc and in
NEWS, so here they are.
gdb/doc/ChangeLog:
* gdb.texinfo (Debugging Output): Add set/show debug event-loop.
gdb/ChangeLog:
* NEWS: Mention set/show debug event-loop.
Change-Id: If30b80177049006578280a06912ee2b97bd03a75
Simon Marchi [Sun, 4 Oct 2020 16:36:02 +0000 (12:36 -0400)]
gdb/doc: space out list entries, fix one type
I want to add an item to this list, but it's so packed I have trouble
finding where one item ends and the next starts. Add a few empty lines
to make it a bit more readable.
Doing this, I also noticed that an "aix-thread" should in fact be
"aix-solib".
gdb/doc/ChangeLog:
* gdb.texinfo (Debugging Output): Add empty lines, fix typo.
Change-Id: I7ef211f9e3988cfbc6ec94124d23a5f2412f3c82
GDB Administrator [Sun, 4 Oct 2020 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
H.J. Lu [Sat, 3 Oct 2020 11:23:55 +0000 (04:23 -0700)]
x86: Update register operand check for AddrPrefixOpReg
When the address size prefix applies to both the memory and the register
operand, we need to extract the address size prefix from the register
operand if the memory operand has no real registers, like symbol, DISP
or symbol(%rip).
NB: GCC always generates symbol(%rip) for RIP-relative addressing for
both x32 and x86-64.
Move the .code16 tests in movdir.s to movdir-16bit to show the correct
output from objdump.
PR gas/26685
* config/tc-i386.c (process_suffix): Also check the register
operand for the address size prefix if the memory operand has
no real registers.
* testsuite/gas/i386/enqcmd-16bit.d: New file.
* testsuite/gas/i386/enqcmd-16bit.s: Likewise.
* testsuite/gas/i386/movdir-16bit.d: Likewise.
* testsuite/gas/i386/movdir-16bit.s: Likewise.
* testsuite/gas/i386/enqcmd.s: Add tests with symbol and DISP.
* testsuite/gas/i386/x86-64-enqcmd.s: Likewise.
* testsuite/gas/i386/x86-64-movdir.s: Likewise.
* testsuite/gas/i386/movdir.s: Add tests with symbol and DISP.
Remove the .code16 test.
* testsuite/gas/i386/i386.exp: Run movdir-16bit and enqcmd-16bit.
* testsuite/gas/i386/x86-64-enqcmd-intel.d: Updated.
* testsuite/gas/i386/x86-64-enqcmd.d: Likewise.
* testsuite/gas/i386/x86-64-movdir-intel.d: Likewise.
* testsuite/gas/i386/x86-64-movdir.d: Likewise.
* testsuite/gas/i386/enqcmd-intel.d: Likewise.
* testsuite/gas/i386/enqcmd.d: Likewise.
* testsuite/gas/i386/movdir-intel.d: Likewise.
* testsuite/gas/i386/movdir.d: Likewise.
* testsuite/gas/i386/x86-64-enqcmd-intel.d: Likewise.
* testsuite/gas/i386/x86-64-enqcmd.d: Likewise.
* testsuite/gas/i386/x86-64-movdir-intel.d: Likewise.
* testsuite/gas/i386/x86-64-movdir.d: Likewise.
GDB Administrator [Sat, 3 Oct 2020 00:00:06 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom Tromey [Fri, 2 Oct 2020 16:23:25 +0000 (10:23 -0600)]
Unconditionally use REG_EXTENDED
skip.c checks whether REG_EXTENDED is defined -- but this should
always be available, and is used unconditionally in other parts of
gdb. This patch removes this check, then further simplifies this
code, removing a declaration and a repeated assertion.
2020-10-02 Tom Tromey <tromey@adacore.com>
* skip.c (skiplist_entry::skiplist_entry): Unconditionally use
REG_EXTENDED.
Przemyslaw Wirkus [Fri, 2 Oct 2020 19:44:13 +0000 (20:44 +0100)]
arm: add support for Cortex-A78 and Cortex-A78AE
bfd/ChangeLog:
2020-09-30 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
* cpu-arm.c: Add cortex-a78 and cortex-a78ae.
gas/ChangeLog:
2020-09-30 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
* config/tc-arm.c: Add cortex-a78 and cortex-a78ae cores.
* doc/c-arm.texi: Update docs.
* NEWS: Update news.
* testsuite/gas/arm/cpu-cortex-a78.d: New test.
* testsuite/gas/arm/cpu-cortex-a78ae.d: New test.
Simon Marchi [Fri, 2 Oct 2020 19:22:21 +0000 (15:22 -0400)]
gdb: fix some inferior_created observer signatures
I just noticed that in
a7aba2668a7b ("gdb: remove arguments from
inferior_created observable"), I forgot to update
aix_thread_inferior_created and procfs_inferior_created, which are in
files I can't compile.
Remove the parameters from aix_thread_inferior_created. And simply
remove procfs_inferior_created, since it's empty anyway.
gdb/ChangeLog:
* aix-thread.c (aix_thread_inferior_created): Remove parameters.
* procfs.c (procfs_inferior_created): Remove.
(_initialize_procfs): Don't register procfs_inferior_created.
Change-Id: Ifc7def7c096332033b5d466d32cb873d1df18c2c
Simon Marchi [Fri, 2 Oct 2020 18:44:40 +0000 (14:44 -0400)]
gdb: add debug prints in event loop
Add debug printouts about event loop-related events:
- When a file descriptor handler gets invoked
- When an async event/signal handler gets invoked
gdb/ChangeLog:
* async-event.c (invoke_async_signal_handlers): Add debug
print.
(check_async_event_handlers): Likewise.
* event-top.c (show_debug_event_loop): New function.
(_initialize_event_top): Register "set debug event-loop"
setting.
gdbserver/ChangeLog:
* server.cc (handle_monitor_command): Handle "set
debug-event-loop".
(captured_main): Handle "--debug-event-loop".
(monitor_show_help): Mention new setting.
(gdbserver_usage): Mention new flag.
gdbsupport/ChangeLog:
* event-loop.h (debug_event_loop): New variable declaration.
(event_loop_debug_printf_1): New function declaration.
(event_loop_debug_printf): New macro.
* event-loop.cc (debug_event_loop): New variable.
(handle_file_event): Add debug print.
(event_loop_debug_printf_1): New function.
Change-Id: If78ed3a69179881368e7895b42940ce13b6a1a05
Simon Marchi [Fri, 2 Oct 2020 18:44:39 +0000 (14:44 -0400)]
gdb: move debug_prefixed_vprintf here
The following patch needs to output debug prints from gdbsupport code.
Move debug_prefixed_vprintf so that it is possible to use it from
gdbsupport.
gdb/ChangeLog:
* debug.c (debug_prefixed_vprintf): Move to gdbsupport.
* debug.h: Remove.
* infrun.c: Include gdbsupport/common-debug.h.
* linux-nat.c: Likewise.
gdbsupport/ChangeLog:
* common-debug.cc (debug_prefixed_vprintf): Move here.
* common-debug.h (debug_prefixed_vprintf): Move here.
Change-Id: I5170065fc10a7a49c0f1bba67c691decb2cf3bcb
Simon Marchi [Fri, 2 Oct 2020 18:44:38 +0000 (14:44 -0400)]
gdb: give names to async event/signal handlers
Assign names to async event/signal handlers. They will be used in debug
messages when file handlers are invoked.
Unlike in the previous patch, the names are not copied in the structure,
since we don't need to (all names are string literals for the moment).
gdb/ChangeLog:
* async-event.h (create_async_signal_handler): Add name
parameter.
(create_async_event_handler): Likewise.
* async-event.c (struct async_signal_handler) <name>: New field.
(struct async_event_handler) <name>: New field.
(create_async_signal_handler): Assign name.
(create_async_event_handler): Assign name.
* event-top.c (async_init_signals): Pass name when creating
handler.
* infrun.c (_initialize_infrun): Likewise.
* record-btrace.c (record_btrace_push_target): Likewise.
* record-full.c (record_full_open): Likewise.
* remote-notif.c (remote_notif_state_allocate): Likewise.
* remote.c (remote_target::open_1): Likewise.
* tui/tui-win.c (tui_initialize_win): Likewise.
Change-Id: Icd9d9f775542ae5fc2cd148c12f481e7885936d5
Simon Marchi [Fri, 2 Oct 2020 18:45:52 +0000 (14:45 -0400)]
gdb: give names to event loop file handlers
Assign names to event loop file handlers. They will be used in debug
messages when file handlers are invoked.
In GDB, each UI used to get its own unique number, until commit
cbe256847e19 ("Remove ui::num"). Re-introduce this field, and use it to
make a unique name for the handler.
I'm not too sure what goes on in ser-base.c, all I know is that it's
what is used when debugging remotely. I've just named the main handler
"serial". It would be good to have unique names there too. For instance
when debugging with two different remote connections, we'd ideally want
the handlers to have unique names. I didn't do it in this patch though.
gdb/ChangeLog:
* async-event.c (initialize_async_signal_handlers): Pass name to
add_file_handler
* event-top.c (ui_register_input_event_handler): Likewise.
* linux-nat.c (linux_nat_target::async): Likewise.
* run-on-main-thread.c (_initialize_run_on_main_thread):
Likewise
* ser-base.c (reschedule): Likewise.
(ser_base_async): Likewise.
* tui/tui-io.c: Likewise.
* top.h (struct ui) <num>: New field.
* top.c (highest_ui_num): New variable.
(ui::ui): Initialize num.
gdbserver/ChangeLog:
* linux-low.cc (linux_process_target::async): Pass name to
add_file_handler.
* remote-utils.cc (handle_accept_event): Likewise.
(remote_open): Likewise.
gdbsupport/ChangeLog:
* event-loop.h (add_file_handler): Add "name" parameter.
* event-loop.cc (struct file_handler) <name>: New field.
(create_file_handler): Add "name" parameter, assign it to file
handler.
(add_file_handler): Add "name" parameter.
Change-Id: I9f1545f73888ebb6778eb653a618ca44d105f92c
Simon Marchi [Fri, 2 Oct 2020 14:46:38 +0000 (10:46 -0400)]
gdb: remove arguments from inferior_created observable
I noticed that non of the listeners of the inferior_created observable
used either of the arguments. Remove them. This in turn allows
removing the target parameter of post_create_inferior.
Tested only by rebuilding.
gdb/ChangeLog:
* observable.h <inferior_created>: Remove parameters. Update all
listeners.
* inferior.h (post_create_inferior): Remove target parameter.
Update all callers.
Change-Id: I8944cefdc4447ed5347dc927b75abf1e7a0e27e6
Gary Benson [Fri, 2 Oct 2020 11:16:55 +0000 (12:16 +0100)]
Fix spelling mistake in gdb/testsuite/README.
This commit corrects the spelling mistake detailed below.
gdb/testsuite/ChangeLog:
* README: Fix "paralell".
Nick Clifton [Fri, 2 Oct 2020 10:14:57 +0000 (11:14 +0100)]
Fix the mve-vcvtne-it assembler test for the arm-*-pe targets.
* testsuite/gas/arm/mve-vcvtne-it.d: Allow for padding inserted by
PE based targets.
H.J. Lu [Fri, 2 Oct 2020 10:08:19 +0000 (11:08 +0100)]
Allow note sections to be discarded when they are linked to another discarded secction.
PR 26681
bfd * elflink.c (bfd_elf_gc_sections): Do not arbitrarily keep note
sections which are linked to another section.
ld * testsuite/ld-elf/pr26681.s: New test.
* testsuite/ld-elf/pr26681.d: New test driver.
* testsuite/ld-elf/pr26681.l: New test output.
nitachra [Sun, 20 Sep 2020 17:52:59 +0000 (23:22 +0530)]
DWARFv5: Handle DW_MACRO_define_strx and DW_MACRO_undef_strx macro entries.
GDB complaints "During symbol reading: unrecognized DW_MACFINO
opcode 0xb" with the testcase given below. Clang is emitting
DW_MACRO_define_strx and DW_MACRO_undef_strx entries in .debug_macro
section which are not supported in GDB. This patch handles them.
DW_MACRO_define_strx and DW_MACRO_undef_strx are added in DWARFv5.
They have two operands. The first operand encodes the line number of
the #define or #undef macro directive. The second operand identifies
a string; it is represented using an unsigned LEB128 encoded value,
which is interpreted as a zero-based index into an array of offsets
in the .debug_str_offsets section. This is as per the section 6.3.2.1
of Dwarf Debugging Information Format Version 5.
Test case used:
#define MAX_SIZE 10
int main(void)
{
int size = 0;
size = size + MAX_SIZE;
printf("\n The value of size is [%d]\n",size);
return 0;
}
clang -gdwarf-5 -fdebug-macro macro.c -o macro.out
Before the patch:
gdb/new_gdb/binutils-gdb/build/bin/gdb -q macro.out -ex "set complaints 1" -ex "start"
Reading symbols from macro.out...
During symbol reading: unrecognized DW_MACFINO opcode 0xb
Temporary breakpoint 1 at 0x4004df: file macro.c, line 7.
Starting program: /home/nitika/workspace/macro.out
Temporary breakpoint 1, main () at macro.c:7
7 int size = 0;
(gdb)
Tested by running the testsuite before and after the patch with
-gdwarf-5 and there is no increase in the number of test cases
that fails. Used clang 11.0.0.
gdb/ChangeLog:
* dwarf2/macro.c (dwarf_decode_macro_bytes): Handle DW_MACRO_define_strx
and DW_MACRO_undef_strx.
(dwarf_decode_macros): Likewise
* dwarf2/read.c (dwarf_decode_macros): Pass str_offsets_base in the parameters
which is the value of DW_AT_str_offsets_base.
* dwarf2/macro.h (dwarf_decode_macros): Modify the definition to include
str_offsets_base.
GDB Administrator [Fri, 2 Oct 2020 00:00:10 +0000 (00:00 +0000)]
Automatic date update in version.in
Kamil Rytarowski [Thu, 1 Oct 2020 23:00:22 +0000 (01:00 +0200)]
Fix the i386 build
Remove old, no longer needed and no longer valid extern.
../../gdb/i386-nbsd-tdep.c:58:12: error: 'i386nbsd_sc_reg_offset' was declared 'extern' and later 'static' [-fpermissive]
58 | static int i386nbsd_sc_reg_offset[] =
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from ../../gdb/i386-nbsd-tdep.c:31:
../../gdb/i386-tdep.h:480:12: note: previous declaration of 'i386nbsd_sc_reg_offset'
480 | extern int i386nbsd_sc_reg_offset[];
| ^~~~~~~~~~~~~~~~~~~~~~
gdb/ChangeLog:
* i386-tdep.h (i386nbsd_sc_reg_offset): Remove.
Kamil Rytarowski [Wed, 23 Sep 2020 03:54:19 +0000 (05:54 +0200)]
Remove the old sanity check of sigcontext offsets for NetBSD/i386
NetBSD switched to ucontext, back in 2003 and the sigcontext code
is no longer available for users, except for legacy compat layers.
This code was not available anyway as the pre-processor check
was probably never operational and buildable on NetBSD. The code
inside it does not compile.
Meanwhile, move the offset variable into the ifdef goards and avoid
the error about unused variable.
../../gdb/i386-bsd-nat.c: In function 'void _initialize_i386bsd_nat()':
../../gdb/i386-bsd-nat.c:347:7: error: unused variable 'offset' [-Werror=unused-variable]
347 | int offset;
| ^~~~~~
cc1plus: all warnings being treated as errors
gdb/ChangeLog:
* i386-bsd-nat.c (_initialize_i386bsd_nat): Update.
* i386-nbsd-tdep.c (i386nbsd_sc_reg_offset): Now static.
Kamil Rytarowski [Wed, 23 Sep 2020 03:31:31 +0000 (05:31 +0200)]
Add NetBSD/i386 gdbserver support
The support is on part with NetBSD/amd64, thus GPR works,
single step and software breakpoint are operational, and the
SVR4 r_debug integration is functional.
gdbserver/ChangeLog:
* netbsd-i386-low.cc: Add.
* Makefile.in (SFILES): Register "netbsd-i386-low.c".
* configure.srv: Add i[34567]86-*-netbsd*.
Kamil Rytarowski [Wed, 23 Sep 2020 02:26:37 +0000 (04:26 +0200)]
Refactor the NetBSD amd64 gdbserver support
Replace the pre-C++ construct of netbsd_target_ops, netbsd_regset_info
and netbsd_tdesc with C++ inheritance approach found in the Linux
gdbserver code. Add netbsd_amd64_target, that inherits from the
netbsd_process_target class and add proper singleton object for
the_netbsd_target, initialized from netbsd_amd64_target.
Call low_arch_setup () on post process creation, which sets machine
specific properties of the traced process.
Remove global singleton the_netbsd_target object from the generic
gdbserver code.
This refactoring introduces no functional change from the end-user
point of view.
gdbserver/ChangeLog:
* netbsd-amd64-low.cc (netbsd_x86_64_arch_setup): Remove.
(netbsd_target_regsets): Now const.
(the_low_target): Remove.
(class netbsd_amd64_target, the_netbsd_amd64_target)
(the_netbsd_target): Add.
* netbsd-low.cc (netbsd_process_target::post_create_inferior): Call
low_arch_setup ().
(netbsd_process_target::fetch_registers)
(netbsd_process_target::store_registers, initialize_low): Update.
(the_netbsd_target): Remove.
* netbsd-low.h (netbsd_target_regsets, netbsd_target_ops)
(the_low_target, netbsd_tdesc): Remove.
(netbsd_process_target::get_regs_info)
(netbsd_process_target::low_arch_setup): Add.
Kamil Rytarowski [Wed, 23 Sep 2020 02:20:05 +0000 (04:20 +0200)]
Preinitialize the sockaddr_un variable to zero
Don't pass random sun_len for the BSD's,
zero the whole structure as recommended for portability.
Reported by Coverity.
gdbsupport/ChangeLog:
* agent.cc (gdb_connect_sync_socket): Preinitialize addr with zeros.
Kamil Rytarowski [Wed, 23 Sep 2020 01:56:46 +0000 (03:56 +0200)]
Include the x86-bsd-nat.h header and fix the NetBSD/i386 build
In file included from ../../gdb/i386-nbsd-nat.c:26:
../../gdb/i386-bsd-nat.h:34:53: error: expected template-name before '<' token
34 | class i386_bsd_nat_target : public x86bsd_nat_target<BaseTarget>
| ^
../../gdb/i386-bsd-nat.h:34:53: error: expected '{' before '<' token
../../gdb/i386-nbsd-nat.c:74:45: error: aggregate 'i386_bsd_nat_target<nbsd_nat_target> the_i386_nbsd_nat_target' has incomplete type and cannot be defined
74 | static i386_bsd_nat_target<nbsd_nat_target> the_i386_nbsd_nat_target;
| ^~~~~~~~~~~~~~~~~~~~~~~~
gdb/ChangeLog:
* i386-bsd-nat.c: Include "x86-bsd-nat.h".
Nick Clifton [Thu, 1 Oct 2020 15:34:05 +0000 (16:34 +0100)]
Add new directive to GAS: .attach_to_group.
* config/obj-elf (elf_pseudo_table): Add attach_to_group.
(obj_elf_attach_to_group): New function.
* doc/as.texi: Document the new directive.
* NEWS: Mention the new feature.
* testsuite/gas/elf/attach-1.s: New test.
* testsuite/gas/elf/attach-1.d: New test driver.
* testsuite/gas/elf/attach-2.s: New test.
* testsuite/gas/elf/attach-2.d: New test driver.
* testsuite/gas/elf/attach-err.s: New test.
* testsuite/gas/elf/attach-err.d: New test driver.
* testsuite/gas/elf/attach-err.err: New test error output.
* testsuite/gas/elf/elf.exp: Run the new tests.
GDB Administrator [Thu, 1 Oct 2020 00:00:06 +0000 (00:00 +0000)]
Automatic date update in version.in
H.J. Lu [Wed, 30 Sep 2020 23:33:35 +0000 (16:33 -0700)]
x86: Check register operand for AddrPrefixOpReg
If the address prefix changes the register operand, we need to check the
register operand when the memory operand is RIP-relative.
PR gas/26685
* config/tc-i386.c (process_suffix): Check the register operand
for the address size prefix if the memory operand is symbol(%rip).
* testsuite/gas/i386/x86-64-enqcmd.s: Add tests with RIP-relative
addressing.
* testsuite/gas/i386/x86-64-movdir.s: Likewise.
* testsuite/gas/i386/x86-64-enqcmd-intel.d: Updated.
* testsuite/gas/i386/x86-64-enqcmd.d: Likewise.
* testsuite/gas/i386/x86-64-movdir-intel.d: Likewise.
* testsuite/gas/i386/x86-64-movdir.d: Likewise.
Tom de Vries [Wed, 30 Sep 2020 19:49:01 +0000 (21:49 +0200)]
[gdb] Fix regression in dwarf2_name
Since commit
2c830f5475 "Change some uses of DW_STRING to string method" we
have these regressions:
...
FAIL: gdb.base/info-types-c++.exp: info types
FAIL: gdb.cp/anon-struct.exp: print type of t::t
FAIL: gdb.cp/anon-struct.exp: print type of X::t2
FAIL: gdb.cp/anon-struct.exp: print type of X::t2::t2
FAIL: gdb.cp/anon-struct.exp: print type of t3::~t3
...
Fix these in dwarf2_name by updating attr_name each time attr is updated.
Tested on x86_64-linux.
gdb/ChangeLog:
2020-09-30 Tom de Vries <tdevries@suse.de>
PR symtab/26683
* dwarf2/read.c (dwarf2_name): Update attr_name after attr is updated.
Tom Tromey [Wed, 30 Sep 2020 15:46:36 +0000 (09:46 -0600)]
Fix regression in variant part handling
My series to change DWARF attribute handling to be type-safe
introduced a regression in gdb.ada/variant.exp. handle_variant was
using as_unsigned on an attribute with DW_FORM_sdata. This patch
changes it to use constant_value instead.
2020-09-30 Tom Tromey <tromey@adacore.com>
* dwarf2/read.c (handle_variant): Use constant_value.
Przemyslaw Wirkus [Wed, 30 Sep 2020 13:52:31 +0000 (14:52 +0100)]
[GAS][AArch64] Add support for Cortex-A78 and Cortex-A78AE
* config/tc-aarch64.c: Add Cortex-A78 and Cortex-A78AE cores.
* doc/c-aarch64.texi: Update docs.
* NEWS: Update news.
H.J. Lu [Wed, 30 Sep 2020 12:23:20 +0000 (05:23 -0700)]
ld: Override the IR definition for non-ELF targets
For non-ELF targets, override the IR definition before all LTO symbols
have been read.
PR ld/26675
* plugin.c (plugin_notice): Override the IR definition before
all LTO symbols have been read for non-ELF targets.
Alex Coplan [Wed, 30 Sep 2020 11:15:18 +0000 (12:15 +0100)]
NEWS: Mention recent Arm CPU support
Mentions Armv8-R AArch64, Cortex-R82, Neoverse V1, and Neoverse N2.
gas/ChangeLog:
2020-09-30 Alex Coplan <alex.coplan@arm.com>
* NEWS: Mention recent Arm processor support.
Alex Coplan [Wed, 30 Sep 2020 11:11:56 +0000 (12:11 +0100)]
aarch64: Add support for Neoverse N2 CPU
This patch adds support for Arm's Neoverse N2 CPU to AArch64 binutils.
gas/ChangeLog:
* config/tc-aarch64.c (aarch64_cpus): Add neoverse-n2.
* doc/c-aarch64.texi: Document support for Neoverse N2.
Gary Benson [Wed, 30 Sep 2020 09:51:58 +0000 (10:51 +0100)]
Fix gdb.dwarf2/dw2-double-set-die-type.exp with Clang
gdb.dwarf2/dw2-double-set-die-type.exp failed to build with Clang,
because of the following issues:
- One .uleb128 directive was specified with an uppercase U,
causing Clang to fail with the message:
error: unknown directive
This commit converts that directive to all-lowercase.
- The label ".Labbrev1_begin" was referenced but not defined,
causing Clang to fail with the message:
<unknown>:0: error: Undefined temporary symbol
This commit adds the label in the appropriate place.
- The label ".Ldebug_line0" was referenced but not defined,
causing Clang to fail with the message:
<unknown>:0: error: Undefined temporary symbol
This commit removes the reference.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/dw2-double-set-die-type.S (.Ldie_3e0):
Convert directive to lowercase.
(.Labbrev1_begin): Add missing label.
(abbrev code 0x1): Remove DW_AT_stmt_list.
(.Ldie_b): Likewise.
Jeremy Drake [Wed, 30 Sep 2020 09:50:46 +0000 (10:50 +0100)]
After preventing creating an import library for an exe when there are no exports, to avoid a crash, it turned out that some projects expected to be able to create an import library for a dll with no exports, so more closely match the condition to the condition around initializing the dll name.
PR 26588
* emultempl/pe.em (_finish): Generate an import library for DLLs,
even if they have no exports.
* emultempl/pep.em (_finish): Likewise.
Alan Modra [Wed, 30 Sep 2020 05:01:15 +0000 (14:31 +0930)]
gcc-4.4.7 warning fixes
* config/obj-elf.c (obj_elf_change_section): Rename variable to
avoid shadowing warning.
* symbols.c (symbol_entry_find): Init all symbol_flags fields.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Remove DW_UNSND
This removes DW_UNSND, replacing uses with either as_unsigned or
constant_value, depending primarily on whether or not the form is
already known to be appropriate.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (lookup_dwo_id, get_type_unit_group)
(read_file_scope, dwarf2_get_pc_bounds)
(dwarf2_record_block_ranges, dwarf2_add_field, get_alignment)
(read_structure_type, handle_struct_member_die)
(read_enumeration_type, read_array_type, read_set_type)
(read_tag_pointer_type, read_tag_reference_type)
(read_subroutine_type, read_base_type, read_subrange_type)
(read_full_die_1, partial_die_info::read)
(partial_die_info::read, by, new_symbol)
(dwarf2_const_value_data, dwarf2_const_value_attr)
(dump_die_shallow, dwarf2_fetch_constant_bytes)
(prepare_one_comp_unit): Update.
* dwarf2/attribute.h (DW_UNSND): Remove.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Add attribute::as_boolean method
This adds a new attribute::as_boolean method, and updates the reader
to use it. The main benefit of this change is that now the code will
respect the attribute's form.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (read_func_scope, prototyped_function_p)
(read_subroutine_type, partial_die_info::read)
(dwarf2_flag_true_p, new_symbol, dump_die_shallow)
(dwarf2_add_member_fn): Update.
* dwarf2/attribute.h (struct attribute) <as_boolean>: Declare.
* dwarf2/attribute.c (attribute::as_boolean): New method.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Add attribute::as_virtuality method
This adds a new attribute::as_virtuality method and changes the DWARF
reader to use it. This also ensures that the attibute's form will now
be respected.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (dwarf2_add_field, dwarf2_add_member_fn): Update.
* dwarf2/attribute.h (struct attribute) <as_virtuality>: New
method.
* dwarf2/attribute.c (attribute::as_virtuality): New method.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Change die_info methods to check the attribute's form
This changes two die_info methods to check the form of the attribute
before using it.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/die.h (struct die_info) <addr_base, ranges_base>: Check
the attribute's form.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Change is_valid_DW_AT_defaulted to a method on attribute
This changes is_valid_DW_AT_defaulted to be a method on struct attribute.
Now it correctly respects the form of the attribute.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (is_valid_DW_AT_defaulted): Move to attribute.c.
(dwarf2_add_member_fn): Update.
* dwarf2/attribute.h (struct attribute) <defaulted>: Declare.
* dwarf2/attribute.c (attribute::defaulted): New method, from
is_valid_DW_AT_defaulted.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Add attribute::as_unsigned method
This introduces a new attribute::as_unsigned method and changes a few
spots to use it.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (dw2_get_file_names_reader)
(dwarf2_build_include_psymtabs, handle_DW_AT_stmt_list)
(dwarf2_cu::setup_type_unit_groups, fill_in_loclist_baton)
(dwarf2_symbol_mark_computed): Use as_unsigned.
* dwarf2/attribute.h (struct attribute) <as_unsigned>: New
method.
<form_is_section_offset>: Update comment.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Change how accessibility is handled in dwarf2/read.c
dwarf2/read.c uses dwarf2_default_access_attribute to check for the
default access attribute. This patch simplifies the code by moving
more of the access processing into this function, changing its name to
reflect the difference. This also ensures that the attribute's form
is respected, by changing to code to use the constant_value method.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (dwarf2_access_attribute): Rename from
dwarf2_default_access_attribute. Look up attribute.
(dwarf2_add_field, dwarf2_add_type_defn, dwarf2_add_member_fn):
Update.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Change how reprocessing is done
Currently gdb keeps a vector of attributes that require reprocessing.
However, now that there is a reprocessing flag in the attribute, we
can remove the vector and instead simply loop over attributes a second
time. Normally there are not many attributes, so this should be
reasonably cheap.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (skip_one_die): Update.
(read_full_die_1): Change how reprocessing is done.
(partial_die_info::read): Update.
(read_attribute_value): Remove need_reprocess parameter.
(read_attribute): Likewise.
* dwarf2/attribute.h (struct attribute) <requires_reprocessing_p>:
New method.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Remove DW_ADDR
This removes DW_ADDR in favor of accessor methods.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (read_attribute_reprocess, read_attribute_value)
(dwarf2_const_value_attr, dump_die_shallow)
(dwarf2_fetch_constant_bytes): Update.
* dwarf2/attribute.h (struct attribute) <form_is_ref>: Update
comment.
<set_address>: New method.
(DW_ADDR): Remove.
* dwarf2/attribute.c (attribute::form_is_ref): Update comment.
(attribute::as_string, attribute::as_address): Add assert.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Add reprocessing flag to struct attribute
Some forms require "reprocessing" -- a second pass to update their
value appropriately. In this case, we'll set the unsigned value on
the attribute, and then later set it to the correct value.
To handle this, we introduce a reprocessing flag to attribute. Then,
we manage this flag to ensure that setting and unsetting is done
properly.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (read_cutu_die_from_dwo): Use OBSTACK_ZALLOC.
(read_attribute_reprocess, read_attribute_value): Update.
(read_attribute): Clear requires_reprocessing.
* dwarf2/attribute.h (struct attribute) <as_unsigned_reprocess,
form_requires_reprocessing>: New methods.
<string_init>: Clear requires_reprocessing.
<set_unsigned_reprocess>: New method.
<name>: Shrink by one bit.
<requires_reprocessing>: New member.
* dwarf2/attribute.c (attribute::form_requires_reprocessing): New
method.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Use setter for attribute's unsigned value
This adds form_is_unsigned and an unsigned setter method to struct
attribute, and updates the remaining code. Now DW_UNSND is no longer
used as an lvalue.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (read_attribute_value): Update.
* dwarf2/attribute.h (struct attribute) <form_is_unsigned,
set_unsigned>: New methods.
* dwarf2/attribute.c (attribute::form_is_unsigned): New method.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Remove DW_SND
This removes DW_SND in favor of accessors on struct attribute.
These accessors check that the form is appropriate.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (get_alignment, read_array_order)
(read_attribute_value, dwarf2_const_value_attr)
(dump_die_shallow, dwarf2_fetch_constant_bytes): Update.
* dwarf2/attribute.h (struct attribute) <as_signed, set_signed>:
New methods.
(DW_SND): Remove.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Remove DW_SIGNATURE
This removes DW_SIGNATURE in favor of methods on struct attribute. As
usual, the methods check the form, which DW_SIGNATURE did not do.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (read_attribute_value, lookup_die_type)
(dump_die_shallow, follow_die_sig, get_DW_AT_signature_type):
Update.
* dwarf2/attribute.h (struct attribute) <as_signature,
set_signature>: New methods.
(DW_SIGNATURE): Remove.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Remove DW_BLOCK
This removes the DW_BLOCK accessor in favor of methods on struct
attribute. The methods, unlike the access, check the form.
Note that DW_FORM_data16 had to be handled by form_is_block, because
in practice that is how we store values of this form.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (read_call_site_scope)
(handle_data_member_location, dwarf2_add_member_fn)
(mark_common_block_symbol_computed, attr_to_dynamic_prop)
(partial_die_info::read, read_attribute_value)
(var_decode_location, dwarf2_const_value_attr, dump_die_shallow)
(dwarf2_fetch_die_loc_sect_off, dwarf2_fetch_constant_bytes)
(dwarf2_symbol_mark_computed): Update.
* dwarf2/attribute.h (struct attribute) <as_block, set_block>: New
methods.
(DW_BLOCK): Remove.
* dwarf2/attribute.c (attribute::form_is_block): Add
DW_FORM_data16.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Remove DW_STRING and DW_STRING_IS_CANONICAL
This removes DW_STRING and DW_STRING_IS_CANONICAL, replacing them with
accessor methods on struct attribute. The new code ensures that a
string value will only ever be used when the form allows it.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (read_cutu_die_from_dwo)
(read_attribute_reprocess, read_attribute_value, read_attribute)
(dwarf2_const_value_attr, dwarf2_name, dump_die_shallow)
(dwarf2_fetch_constant_bytes): Update.
* dwarf2/attribute.h (struct attribute) <form_is_string>: Declare.
<set_string_noncanonical, set_string_canonical>: New methods.
<string_is_canonical>: Update comment.
<canonical_string_p>: Add assert.
(DW_STRING, DW_STRING_IS_CANONICAL): Remove.
* dwarf2/attribute.c (attribute::form_is_string): New method.
(attribute::string): Use it.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Remove some uses of DW_STRING_IS_CANONICAL
This removes the rvalue uses of DW_STRING_IS_CANONICAL, replacing them
with an accessor method.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (anonymous_struct_prefix, dwarf2_name)
(dump_die_shallow): Use canonical_string_p.
* dwarf2/attribute.h (struct attribute) <canonical_string_p>: New
method.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Change some uses of DW_STRING to string method
This changes some of the simpler spots to use attribute::string rather
than DW_STRING.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (partial_die_info::read)
(dwarf2_const_value_attr, anonymous_struct_prefix, )
(dwarf2_name, dwarf2_fetch_constant_bytes): Use
attribute::as_string.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Avoid using DW_* macros in dwarf2/attribute.c
There's no need to use the DW_* accessor macros in dwarf2/attribute.c,
and this is a necessary step toward our goal of removing them
entirely.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/attribute.c (attribute::address): Don't use DW_UNSND or
DW_ADDR.
(attribute::string): Don't use DW_STRING.
(attribute::get_ref_die_offset): Don't use DW_UNSND.
(attribute::constant_value): Don't use DW_UNSND or DW_SND.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Rename struct attribute accessors
This removes the "value_" prefix from the struct value accessors.
This seemed unnecessarily wordy to me.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (dwarf2_find_base_address, read_call_site_scope)
(dwarf2_get_pc_bounds, dwarf2_record_block_ranges)
(partial_die_info::read, dwarf2_string_attr, new_symbol): Update.
* dwarf2/attribute.h (struct attribute): Rename methods.
* dwarf2/attribute.c (attribute::as_address): Rename from
value_as_address.
(attribute::as_string): Rename from value_as_string.
Tom Tromey [Wed, 30 Sep 2020 00:49:08 +0000 (18:49 -0600)]
Add attribute::value_as_string method
The full DIE reader checks that an attribute has a "string" form in
some spots, but the partial DIE reader does not. This patch brings
the two readers in sync for one specific case, namely when examining
the linkage name. This avoids regressions in an existing DWARF test
case.
A full fix for this problem would be preferable. An accessor like
DW_STRING should always check the form. However, I haven't attempted
that in this series.
Also the fact that the partial and full readers can disagree like this
is a design flaw.
gdb/ChangeLog
2020-09-29 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (partial_die_info::read) <case
DW_AT_linkage_name>: Use value_as_string.
(dwarf2_string_attr): Use value_as_string.
* dwarf2/attribute.h (struct attribute) <value_as_string>: Declare
method.
* dwarf2/attribute.c (attribute::value_as_string): New method.
GDB Administrator [Wed, 30 Sep 2020 00:00:06 +0000 (00:00 +0000)]
Automatic date update in version.in
Pedro Alves [Tue, 29 Sep 2020 19:08:51 +0000 (20:08 +0100)]
Tweak gdbsupport/valid-expr.h for GCC 6, fix build
With GCC 6.4 and 6.5 (at least), unit tests that use
gdbsupport/valid-expr.h's CHECK_VALID fail to compile, with:
In file included from src/gdb/unittests/offset-type-selftests.c:24:0:
src/gdb/unittests/offset-type-selftests.c: In substitution of 'template<class Expected, template<class ...> class Op, class ... Args> using is_detected_exact = std::is_same<Expected, typename gdb::detection_detail::detector<gdb::nonesuch, void, Op, Args ...>::type> [with Expected = selftests::offset_type::off_A&; Op = selftests::offset_type::check_valid_expr75::archetype; Args = {selftests::offset_type::off_A, selftests::offset_type::off_B}]':
src/gdb/unittests/offset-type-selftests.c:75:1: required from here
src/gdb/../gdbsupport/valid-expr.h:65:20: error: type/value mismatch at argument 2 in template parameter list for 'template<class Expected, template<class ...> class Op, class ... Args> using is_detected_exact = std::is_same<Expected, typename gdb::detection_detail::detector<gdb::nonesuch, void, Op, Args ...>::type>'
archetype, TYPES>::value == VALID, \
^
The important part is the "error: type/value mismatch" error. Seems
like that GCC doesn't understand that archetype is an alias template,
and is being strict in requiring a template class.
The fix here is then to make archetype a template class, to pacify
GCC. The resulting code looks like this:
template <TYPENAMES, typename = decltype (EXPR)>
struct archetype
{
};
static_assert (gdb::is_detected_exact<archetype<TYPES, EXPR_TYPE>,
archetype, TYPES>::value == VALID, "");
is_detected_exact<Expected, Op, Args> checks whether Op<Args> is type
Expected:
- For Expected, we pass the explicit EXPR_TYPE, overriding the
default parameter type of archetype.
- For Args we don't pass the last template parameter, so archtype
defaults to the EXPR's decltype.
So in essence, we're really checking whether EXPR_TYPE is the same as
decltype(EXPR).
We need to do the decltype in a template context in order to trigger
SFINAE instead of failing to compile.
The hunk in unittests/enum-flags-selftests.c becomes necessary,
because unlike with the current alias template version, this new
version makes GCC trigger -Wenum-compare warnings as well:
src/gdb/unittests/enum-flags-selftests.c:328:33: error: comparison between 'enum selftests::enum_flags_tests::RE' and 'enum selftests::enum_flags_tests::RE2' [-Werror=enum-compare]
CHECK_VALID (true, bool, RE () != RE2 ())
^
src/gdb/../gdbsupport/valid-expr.h:61:45: note: in definition of macro 'CHECK_VALID_EXPR_INT'
template <TYPENAMES, typename = decltype (EXPR)> \
^
Build-tested with:
- GCC {4.8.5, 6.4, 6.5, 7.3.1, 9.3.0, 11.0.0-
20200910}
- Clang 10.0.0
gdbsupport/ChangeLog:
* valid-expr.h (CHECK_VALID_EXPR_INT): Make archetype a template
class instead of an alias template and adjust static_assert.
gdb/ChangeLog:
* unittests/enum-flags-selftests.c: Check whether __GNUC__ is
defined before using '#pragma GCC diagnostic' instead of checking
__clang__.
Przemyslaw Wirkus [Tue, 29 Sep 2020 15:43:57 +0000 (16:43 +0100)]
Add a note about recent changes to the AArch64 assembler: TRBE, ETE and ETMv4 system registers and Cortex-X1 enablement.
gas * NEWS: TRBE, ETE, ETMv4 and Cortex-X1 news updates.
Mark Wielaard [Mon, 28 Sep 2020 22:02:06 +0000 (00:02 +0200)]
binutils: dwarf.c handle DWARF5 DW_LLE_start_end and DW_LLE_start_length.
display_loclists_list only handled DW_LLE_offset_pair as bounded
location description. Also handle DW_LLE_start_end and DW_LLE_start_lenght.
These don't use the base_address.
binutils/ChangeLog:
* dwarf.c (display_loclists_list): Handle DW_LLE_start_end and
DW_LLE_start_length. Only add base_address for DW_LLE_offset_pair.
Tom Tromey [Tue, 29 Sep 2020 01:38:25 +0000 (19:38 -0600)]
Turn target_have_steppable_watchpoint into function
This changes the object-like macro target_have_steppable_watchpoint
into an inline function.
gdb/ChangeLog
2020-09-28 Tom Tromey <tom@tromey.com>
* infrun.c (displaced_step_fixup, thread_still_needs_step_over)
(handle_signal_stop): Update.
* procfs.c (procfs_target::insert_watchpoint): Update.
* target.h (target_have_steppable_watchpoint): Now a function.
Tom Tromey [Tue, 29 Sep 2020 01:38:25 +0000 (19:38 -0600)]
Turn target_can_lock_scheduler into a function
This changes the object-like macro target_can_lock_scheduler into an
inline function.
gdb/ChangeLog
2020-09-28 Tom Tromey <tom@tromey.com>
* infrun.c (set_schedlock_func): Update.
* target.h (target_can_lock_scheduler): Now a function.
Tom Tromey [Tue, 29 Sep 2020 01:38:25 +0000 (19:38 -0600)]
Remove target_has_execution macro
This removes the object-like macro target_has_execution, replacing it
with a function call. target_has_execution_current is also now
handled by this function.
gdb/ChangeLog
2020-09-28 Tom Tromey <tom@tromey.com>
* inferior.h (class inferior) <has_execution>: Update.
* windows-tdep.c (windows_solib_create_inferior_hook): Update.
* valops.c (find_function_in_inferior)
(value_allocate_space_in_inferior): Update.
* top.c (kill_or_detach): Update.
* target.c (target_preopen, set_target_permissions): Update.
(target_has_execution_current): Remove.
* sparc64-tdep.c (adi_examine_command, adi_assign_command):
Update.
* solib.c (update_solib_list, reload_shared_libraries): Update.
* solib-svr4.c (svr4_solib_create_inferior_hook): Update.
* solib-dsbt.c (enable_break): Update.
* score-tdep.c (score7_fetch_inst): Update.
* rs6000-nat.c (rs6000_nat_target::xfer_shared_libraries):
Update.
* remote.c (remote_target::start_remote)
(remote_target::remote_check_symbols, remote_target::open_1)
(remote_target::remote_detach_1, remote_target::verify_memory)
(remote_target::xfer_partial, remote_target::read_description)
(remote_target::get_min_fast_tracepoint_insn_len): Update.
* record-full.c (record_full_open_1): Update.
* record-btrace.c (record_btrace_target_open): Update.
* objc-lang.c (lookup_objc_class, lookup_child_selector)
(value_nsstring): Update.
* linux-thread-db.c (add_thread_db_info)
(thread_db_find_new_threads_silently, check_thread_db_callback)
(try_thread_db_load_1, record_thread): Update.
* linux-tdep.c (linux_info_proc, linux_vsyscall_range_raw):
Update.
* linux-fork.c (checkpoint_command): Update.
* infrun.c (set_non_stop, set_observer_mode)
(check_multi_target_resumption, for_each_just_stopped_thread)
(maybe_remove_breakpoints, normal_stop)
(class infcall_suspend_state): Update.
* infcmd.c (ERROR_NO_INFERIOR, kill_if_already_running)
(info_program_command, attach_command): Update.
* infcall.c (call_function_by_hand_dummy): Update.
* inf-loop.c (inferior_event_handler): Update.
* gcore.c (gcore_command, derive_heap_segment): Update.
* exec.c (exec_file_command): Update.
* eval.c (evaluate_subexp): Update.
* compile/compile.c (compile_to_object): Update.
* cli/cli-dump.c (restore_command): Update.
* breakpoint.c (update_watchpoint)
(update_inserted_breakpoint_locations)
(insert_breakpoint_locations, get_bpstat_thread): Update.
* target.h (target_has_execution): Remove macro.
(target_has_execution_current): Don't declare.
(target_has_execution): Rename from target_has_execution_1. Add
argument default.
Tom Tromey [Tue, 29 Sep 2020 01:38:25 +0000 (19:38 -0600)]
Turn target_can_execute_reverse into function
This changes target_can_execute_reverse from an object-like macro to
an inline function.
gdb/ChangeLog
2020-09-28 Tom Tromey <tom@tromey.com>
* mi/mi-main.c (exec_reverse_continue)
(mi_cmd_list_target_features): Update.
* infrun.c (set_exec_direction_func): Update.
* target.c (default_execution_direction): Update.
* reverse.c (exec_reverse_once): Update.
* target.h (target_can_execute_reverse): Now a function.
Tom Tromey [Tue, 29 Sep 2020 01:38:25 +0000 (19:38 -0600)]
Remove target_has_registers macro
This removes the target_has_registers object-like macro, replacing it
with the underlying function.
gdb/ChangeLog
2020-09-28 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_get_register)
(tui_data_window::show_registers): Update.
* thread.c (scoped_restore_current_thread::restore)
(scoped_restore_current_thread::scoped_restore_current_thread):
Update.
* regcache-dump.c (regcache_print): Update.
* python/py-finishbreakpoint.c (bpfinishpy_detect_out_scope_cb):
Update.
* mi/mi-main.c (mi_cmd_data_write_register_values): Update.
* mep-tdep.c (current_me_module, current_options): Update.
* linux-thread-db.c (thread_db_load): Update.
* infcmd.c (registers_info, info_vector_command)
(info_float_command): Update.
* ia64-tdep.c (ia64_frame_prev_register)
(ia64_sigtramp_frame_prev_register): Update.
* ia64-libunwind-tdep.c (libunwind_frame_prev_register): Update.
* gcore.c (derive_stack_segment): Update.
* frame.c (get_current_frame, has_stack_frames): Update.
* findvar.c (language_defn::read_var_value): Update.
* arm-tdep.c (arm_pc_is_thumb): Update.
* target.c (target_has_registers): Rename from
target_has_registers_1.
* target.h (target_has_registers): Remove macro.
(target_has_registers): Rename from target_has_registers_1.
Tom Tromey [Tue, 29 Sep 2020 01:38:25 +0000 (19:38 -0600)]
Remove target_has_stack macro
This removes the target_has_stack object-like macro, replacing it with
the underlying function.
gdb/ChangeLog
2020-09-28 Tom Tromey <tom@tromey.com>
* windows-tdep.c (tlb_make_value): Update.
* tui/tui-regs.c (tui_data_window::show_registers): Update.
* thread.c (scoped_restore_current_thread::restore)
(scoped_restore_current_thread::scoped_restore_current_thread)
(thread_command): Update.
* stack.c (backtrace_command_1, frame_apply_level_command)
(frame_apply_all_command, frame_apply_command): Update.
* infrun.c (siginfo_make_value, restore_infcall_control_state):
Update.
* gcore.c (derive_stack_segment): Update.
* frame.c (get_current_frame, has_stack_frames): Update.
* auxv.c (info_auxv_command): Update.
* ada-tasks.c (ada_build_task_list): Update.
* target.c (target_has_stack): Rename from target_has_stack_1.
* target.h (target_has_stack): Remove macro.
(target_has_stack): Rename from target_has_stack_1.
Tom Tromey [Tue, 29 Sep 2020 01:38:25 +0000 (19:38 -0600)]
Remove target_has_memory macro
This removes the target_has_memory object-like macro, replacing it
with the underlying function.
gdb/ChangeLog
2020-09-28 Tom Tromey <tom@tromey.com>
* target.c (target_has_memory): Rename from target_has_memory_1.
* tui/tui-regs.c (tui_data_window::show_registers): Update.
* thread.c (scoped_restore_current_thread::restore)
(scoped_restore_current_thread::scoped_restore_current_thread):
Update.
* frame.c (get_current_frame, has_stack_frames): Update.
* target.h (target_has_memory): Remove macro.
(target_has_memory): Rename from target_has_memory_1.
Tom Tromey [Tue, 29 Sep 2020 01:38:25 +0000 (19:38 -0600)]
Remove target_has_all_memory
target_has_all_memory isn't used anywhere, so this patch removes it.
gdb/ChangeLog
2020-09-28 Tom Tromey <tom@tromey.com>
* target.c (target_has_all_memory_1): Remove.
* target.h (target_has_all_memory): Remove define.
(target_has_all_memory_1): Don't declare.
GDB Administrator [Tue, 29 Sep 2020 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
Simon Marchi [Mon, 28 Sep 2020 18:21:24 +0000 (14:21 -0400)]
gdb: fix formatting of serial::async_state's enumerators
The comments related to these enumerators are placed under the
corresponding enumerator. This is quite unusual and confusing. Change
it to have the comments above, as usual.
gdb/ChangeLog:
* ser-base.c: Adjust comments formatting.
Change-Id: If2ea143a7d5217efa5ac088102ddb1933fbcb16a
Przemyslaw Wirkus [Mon, 28 Sep 2020 14:52:24 +0000 (15:52 +0100)]
This patch adds support for Cortex-X1 for ARM.
bfd * cpu-arm.c: (processors) Add Cortex-X1.
gas * config/tc-arm.c: (arm_cpus): Add Cortex-X1.
* doc/c-arm.texi: Document -mcpu=cortex-x1.
* testsuite/gas/arm/cpu-cortex-x1.d: New test.
Przemyslaw Wirkus [Mon, 28 Sep 2020 14:49:11 +0000 (15:49 +0100)]
This patch introduces ETMv4 (Embedded Trace Macrocell) system registers for the AArch64 architecture.
gas * testsuite/gas/aarch64/etm-ro-invalid.d: New test.
* testsuite/gas/aarch64/etm-ro-invalid.l: New test.
* testsuite/gas/aarch64/etm-ro-invalid.s: New test.
* testsuite/gas/aarch64/etm-ro.s: New test.
* testsuite/gas/aarch64/etm-wo-invalid.d: New test.
* testsuite/gas/aarch64/etm-wo-invalid.l: New test.
* testsuite/gas/aarch64/etm-wo-invalid.s: New test.
* testsuite/gas/aarch64/etm-wo.s: New test.
* testsuite/gas/aarch64/etm.s: New test.
* testsuite/gas/aarch64/sysreg.d: system register s2_1_c0_c3_0 disassembled
now to trcstatr.
opcodes * aarch64-opc.c: Added ETMv4 system registers TRCACATRn, TRCACVRn,
TRCAUTHSTATUS, TRCAUXCTLR, TRCBBCTLR, TRCCCCTLR, TRCCIDCCTLR0, TRCCIDCCTLR1,
TRCCIDCVRn, TRCCIDR0, TRCCIDR1, TRCCIDR2, TRCCIDR3, TRCCLAIMCLR, TRCCLAIMSET,
TRCCNTCTLRn, TRCCNTRLDVRn, TRCCNTVRn, TRCCONFIGR, TRCDEVAFF0, TRCDEVAFF1,
TRCDEVARCH, TRCDEVID, TRCDEVTYPE, TRCDVCMRn, TRCDVCVRn, TRCEVENTCTL0R,
TRCEVENTCTL1R, TRCEXTINSELR, TRCIDR0, TRCIDR1, TRCIDR2, TRCIDR3, TRCIDR4,
TRCIDR5, TRCIDR6, TRCIDR7, TRCIDR8, TRCIDR9, TRCIDR10, TRCIDR11, TRCIDR12,
TRCIDR13, TRCIMSPEC0, TRCIMSPECn, TRCITCTRL, TRCLAR WOTRCLSR, TRCOSLAR
WOTRCOSLSR, TRCPDCR, TRCPDSR, TRCPIDR0, TRCPIDR1, TRCPIDR2, TRCPIDR3,
TRCPIDR4, TRCPIDR[5,6,7], TRCPRGCTLR, TRCP,CSELR, TRCQCTLR, TRCRSCTLRn,
TRCSEQEVRn, TRCSEQRSTEVR, TRCSEQSTR, TRCSSCCRn, TRCSSCSRn, TRCSSPCICRn,
TRCSTALLCTLR, TRCSTATR, TRCSYNCPR, TRCTRACEIDR, TRCTSCTLR, TRCVDARCCTLR,
TRCVDCTLR, TRCVDSACCTLR, TRCVICTLR, TRCVIIECTLR, TRCVIPCSSCTLR, TRCVISSCTLR,
TRCVMIDCCTLR0, TRCVMIDCCTLR1 and TRCVMIDCVRn.
Przemyslaw Wirkus [Mon, 28 Sep 2020 14:43:51 +0000 (15:43 +0100)]
This patch adds support for Cortex-X1
gas * config/tc-aarch64.c: (aarch64_cpus): Add Cortex-X1.
* doc/c-aarch64.texi: Document -mcpu=cortex-x1.
Przemyslaw Wirkus [Mon, 28 Sep 2020 14:41:23 +0000 (15:41 +0100)]
This patch introduces ETE (Embedded Trace Extension) system registers for the AArch64 architecture.
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.
Przemyslaw Wirkus [Mon, 28 Sep 2020 14:37:50 +0000 (15:37 +0100)]
This patch introduces TRBE (Trace Buffer Extension) system registers for the AArch64 architecture.
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.
Alex Coplan [Mon, 28 Sep 2020 12:57:09 +0000 (13:57 +0100)]
arm: Add missing Neoverse V1 feature
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.
Alex Coplan [Mon, 28 Sep 2020 12:55:08 +0000 (13:55 +0100)]
aarch64: Neoverse V1 tweaks
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.
Alan Modra [Mon, 28 Sep 2020 10:00:26 +0000 (19:30 +0930)]
PR26656 testcases
* testsuite/ld-powerpc/tlsget.d,
* testsuite/ld-powerpc/tlsget.s,
* testsuite/ld-powerpc/tlsget.wf,
* testsuite/ld-powerpc/tlsget2.d.
* testsuite/ld-powerpc/tlsget2.wf: New testcases.
* testsuite/ld-powerpc/powerpc.exp: Run them.
Tom Tromey [Mon, 28 Sep 2020 02:30:30 +0000 (20:30 -0600)]
Rewrite tui_puts
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.
Tom Tromey [Mon, 28 Sep 2020 02:30:30 +0000 (20:30 -0600)]
Use ISCNTRL in tui_copy_source_line
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.
Tom Tromey [Mon, 28 Sep 2020 02:30:30 +0000 (20:30 -0600)]
Use a curses pad for source and disassembly windows
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.
Tom Tromey [Mon, 28 Sep 2020 02:30:30 +0000 (20:30 -0600)]
Remove a call to show_source_line from TUI
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.
Tom Tromey [Mon, 28 Sep 2020 02:30:30 +0000 (20:30 -0600)]
Use an inner window in tui_py_window
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.