Commit Graph

104264 Commits

Author SHA1 Message Date
Rogerio Alves
539d71e89a PowerPC remove 512 bytes region limit if 2nd DAWR is avaliable.
Power 10 introduces the 2nd DAWR (second watchpoint) and also removed
a restriction that limit the watch region to 512 bytes.

2020-11-08  Rogerio A. Cardoso  <rcardoso@linux.ibm.com>

/gdb

	* ppc-linux-nat.c: (PPC_DEBUG_FEATURE_DATA_BP_ARCH_31): New define.
	(region_ok_for_hw_watchpoint): Check if 2nd DAWR is avaliable before
	set region.
2020-12-01 16:53:38 -03:00
Rogerio Alves
0ae4576980 Add missing ChangeLog entry. 2020-12-01 16:44:31 -03:00
Simon Marchi
4d56d64a85 gdb/testsuite: fix comment in gdb.threads/non-ldr-exit.exp
Maybe there's something I don't understand in that test, but the comment
seems wrong.  It checks what happens when the non-leader thread does an
exit, not the leader.

gdb/testsuite/ChangeLog:

	* gdb.threads/non-ldr-exit.exp: Fix comment.

Change-Id: I35c96a70c097fa9529737874f54f3f78036008a4
2020-12-01 10:31:19 -05:00
H.J. Lu
3ed3c10425 arc: Enable -Ttext-segment
Define TEXT_START_ADDR and SHLIB_TEXT_START_ADDR with SEGMENT_START to
enable -Ttext-segment.

	PR ld/26970
	* scripttempl/elfarc.sc (TEXT_START_ADDR): New.  Add SEGMENT_START.
	(SHLIB_TEXT_START_ADDR): Likewise.
2020-12-01 04:27:41 -08:00
Andrew Burgess
54e75f291e gdbsupport/tdesc: print enum fields using 'evalue' syntax
Currently when printing an XML description GDB prints enum values like
this:

  <enum id="levels_type" size="4">
    <field name="low" start="0"/>
    <field name="high" start="1"/>
  </enum>

This is incorrect, and is most likely a copy and paste error with the
struct and flags printing code.  The correct syntax is:

  <enum id="levels_type" size="4">
    <evalue name="low" value="0"/>
    <evalue name="high" value="1"/>
  </enum>

A test is included to cover this functionality.

gdb/testsuite/ChangeLog:

	* gdb.xml/maint-xml-dump-03.xml: New file.

gdbsupport/ChangeLog:

	* tdesc.cc (print_xml_feature::visit): Print enum fields using
	'evalue' syntax.
2020-12-01 11:22:24 +00:00
Chungyi Chi
4f36e61b2d gdbsupport/tdesc: print enum size attribute
According to gdb online docs[1], XML target description enum types
have both name and size attributes.  Currently GDB does not print the
size attribute.  This commit fixes this.  This change will be visible
in the output of the command `maint print xml-tdesc`.

There are other bugs with the print of enum types in XML target
descriptions, the next commit will fix these and include a test that
covers this patch.

[1] https://sourceware.org/gdb/current/onlinedocs/gdb/Enum-Target-Types.html#Enum-Target-Types

gdbsupport/ChangeLog:

	* tdesc.cc (print_xml_feature::visit): Print enum size attribute.
2020-12-01 11:22:24 +00:00
Nelson Chu
6729e2c2af RISC-V: Fix the order checking for Z* extension.
We have to check the first char of the Z* extensions, to make sure that
they follow the order of the standard extensions.  But we can not have
the testcases for this patch, since we only support the zicsr and zifencei
so far, both of them are the sub extensions of i.

	bfd/
	* elfxx-riscv.c (riscv_parse_prefixed_ext): Use riscv_compare_subsets
	to check the Z* extensions' order.
2020-12-01 15:24:10 +08:00
Nelson Chu
00d4d1b0a3 RISC-V: Support to add implicit extensions for G.
G is a special case, consider the ISA spec github issue as follows,
https://github.com/riscv/riscv-isa-manual/issues/575

My understand is that - i, m, a, f and d extensions are not g's implicit
extensions, they are g's expansions.  The zifencei is the implicit extension
of g, and so is zicsr, since it is implicited by f (or i2p1).  However,
we add the g with the RISCV_UNKNOWN_VERSION to the subset list, and it
will not output to the arch string, it is only used to check what implicit
extensions are need to be added.

	bfd/
	* elfxx-riscv.c (riscv_parse_add_subset): Allow to add g with
	RISCV_UNKNOWN_VERSION versions.
	(riscv_parse_std_ext): Add g to the subset list, we only use it
	to add the implicit extensions, but won't output it to arch string.
	(riscv_parse_add_implicit_subsets): Add implicit zicsr and zifencei
	for g extension.
	(riscv_arch_str1): Do not output g to the arch string.
	* elfxx-riscv.h (RISCV_UNKNOWN_VERSION): Moved to include/opcode/riscv.h.

	gas/
	* testsuite/gas/riscv/attribute-10.d: Updated.
	* testsuite/gas/riscv/march-imply-g.d: New testcase for g.
	* testsuite/gas/riscv/march-imply-unsupported.d: The zicsr and zifencei
	are not supported in the ISA spec v2.2, so don't add and output them.

	include/
	* opcode/riscv.h (RISCV_UNKNOWN_VERSION): added.
2020-12-01 15:23:02 +08:00
Nelson Chu
dfe9249667 RISC-V: Support to add implicit extensions.
We have to parse and add all arch string extensions at first, and then
start to add their implicit extensions.  That means we can always add
arch string extensions at the end of the subset list, but we need to
search the right place to add their implicit extensions.  For now we
follow the following rules to add the implicit extensions,

* Add zicsr and zifencei only when the i's version less than 2.1.
* Add d, f and zicsr when q is found.
* Add f and zicsr when d is found.
* Add zicsr when f is found.

Besides, we do not add the implicit extensions if they are already added
in the subset list, or we cannot find their default versions according to
the chosen ISA spec.

	bfd/
	* elfnn-riscv.c (riscv_merge_std_ext): Updated since
	riscv_lookup_subset is changed.
	* elfxx-riscv.c (riscv_ext_order): New Array used to compare the
	extensions' order quickly.
	(riscv_init_ext_order): New function.  Init the riscv_ext_order
	according to the riscv_supported_std_ext and parse_config[i].class
	automatically.
	(riscv_compare_subsets): New function.  Similar to the strcmp, but
	compare the subsets with the specific order.
	(riscv_lookup_subset): Return TRUE and set `current` to the subset
	if it is found.  Otherwise, return FALSE and set `current` to the
	place where we should insert the subset.
	(riscv_add_implicit_subset): New function.  Search the list first,
	and then find the right place to add the implicit_subset.
	(riscv_parse_add_subset): Since We have to add all arch string
	extensions first, and then start to add their implicit extensions.
	We can add arch string extensions in order by the original
	riscv_add_subset, and then add the implicit subsets by the
	riscv_add_implicit_subset.  Besides, do not add the implicit
	extensions if we failed to find their default versions.
	(riscv_parse_std_ext): Updated.
	(riscv_parse_add_implicit_subsets): New function.  Add all implicit
	extensions according to the arch string extensions.
	(riscv_parse_subset): Call riscv_init_ext_order and
	riscv_parse_add_implicit_subsets, before and after parsing the
	arch string.  Remove parts of the ISA conflict checking since
	the implicit extensions are added.
	* elfxx-riscv.h (riscv_lookup_subset): Updated.

	gas/
	* config/tc-riscv.c (riscv_subset_supports): Updated.
	* testsuite/gas/riscv/march-imply-i2p0.d: New testcase.  Need to
	add the implicit zicsr and zifencei when i's version less than 2.1.
	* testsuite/gas/riscv/march-imply-i2p1.d: New testcase.
	* testsuite/gas/riscv/march-imply-d.d: Likewise.
	* testsuite/gas/riscv/march-imply-f.d: Likewise.
	* testsuite/gas/riscv/march-imply-q.d: Likewise.
	* testsuite/gas/riscv/march-fail-rv32iq.l: Updated.
	* testsuite/gas/riscv/march-fail-rv32id.d: Removed.
	* testsuite/gas/riscv/march-fail-rv32id.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv64iq.d: Likewise.
	* testsuite/gas/riscv/march-fail-rv64iq.l: Likewise.
2020-12-01 15:18:48 +08:00
Nelson Chu
7ef19aa616 RISC-V: Improve the version parsing for arch string.
Keep the riscv_add_subset to do the same thing, and use a new
function, riscv_parse_add_subset, to cover most of the things
when parsing, including find the default versions for extensions,
and check whether the versions are valid.  The version 0p0 should
be an invalid version, that is the mistake I made before.  This
patch clarify the version rules as follows,

* We accept any version of extensions set by users, except 0p0.
* The non-standard x extensions must be set with versions in arch string.
* If user don't set the versions, or set 0p0 for the extensions, then try
  to find the supported versions according to the chosen ISA spec.
  Otherwise, report errors rather than output 0p0 for them.

Besides, we use as_bad rather than as_fatal to report more errors
for assembler.

	bfd/
	* elfxx-riscv.c (riscv_lookup_subset): Moved to front.
	(riscv_add_subset): Likewise.
	(riscv_release_subset_list): Likewise.
	(riscv_parse_add_subset): New function.  Find and check the
	versions before adding them by riscv_add_subset.
	(riscv_parsing_subset_version): Remove use_default_version
	and change the version type from unsigned to int.  Set the
	versions to RISCV_UNKNOWN_VERSION if we can not find them
	in the arch string.
	(riscv_parse_std_ext): Updated.
	(riscv_parse_prefixed_ext): Updated.  Since we use as_bad
	rather than as_fatal to report more errors, return NULL
	string if the parsed end_of_version is NULL, too.
	(riscv_parse_subset): Use a new boolean, no_conflict, to
	report more errors when we have more than one ISA conflicts.

	* elfxx-riscv.h (RISCV_DONT_CARE_VERSION): Changed to
	RISCV_UNKNOWN_VERSION.
	(riscv_lookup_subset_version): Removed.
	(riscv_parse_subset_t): Updated.

	gas/
	* config/tc-riscv.c (riscv_get_default_ext_version):
	Change the version type from unsigned to int.
	(riscv_set_arch): Use as_bad rather than as_fatal to
	report more errors.

	* testsuite/gas/riscv/attribute-02.d: Updated since x must be
	set with versions.
	* testsuite/gas/riscv/attribute-03.d: Likewise.
	* testsuite/gas/riscv/march-ok-two-nse.d: Likewise.
	* testsuite/gas/riscv/attribute-09.d: zicsr wasn't supported
	in the spec 2.2, so choose the newer spec.
	* testsuite/gas/riscv/march-fail-base-01.l: Updated since as_bad.
	* testsuite/gas/riscv/march-fail-base-02.l: Likewise.
	* testsuite/gas/riscv/march-fail-order-std.l: Likewise.
	* testsuite/gas/riscv/march-fail-order-x.l: Likewise.
	* testsuite/gas/riscv/march-fail-order-z.l: Likewise.
	* testsuite/gas/riscv/march-fail-porder.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32ef.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32id.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32iq.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv64iq.l: Likewise.
	* testsuite/gas/riscv/march-fail-single-char.l: Likewise.
	* testsuite/gas/riscv/march-fail-unknown-std.l: Likewise.
	* testsuite/gas/riscv/march-fail-unknown.l: Likewise.
	* testsuite/gas/riscv/march-fail-uppercase.l: Likewise.
	* testsuite/gas/riscv/march-fail-version.l: Likewise.
	* testsuite/gas/riscv/march-fail-isa-spec.d: Likewise.
	* testsuite/gas/riscv/march-fail-isa-spec.l: Likewise.

	include/
	* opcode/riscv.h (riscv_ext_version):
	Change the version type from unsigned to int.
2020-12-01 15:16:25 +08:00
Nelson Chu
27a46348cb RISC-V: Remove the unimplemented extensions.
Although spec had defined and ratified p, v and n extensions,
but we don't have any related implementaitons so far, so keep
them in the supported extension table looks weird.  Remove them
until we have the related implementations.

	opcodes/
	* riscv-opc.c (riscv_ext_version_table): Remove the p, v, n
	and their versions.
2020-12-01 15:13:06 +08:00
Nelson Chu
5a1b31e1e1 RISC-V: Add zifencei and prefixed h class extensions.
bfd/
	* elfxx-riscv.c (riscv_parse_std_ext): Stop parsing standard
	extensions when parsed h keyword.
	(riscv_get_prefix_class): Support prefixed h class.
	(riscv_std_h_ext_strtab): Likewise.
	(riscv_ext_h_valid_p): Likewise.
	(parse_config): Likewise.
	(riscv_std_z_ext_strtab): Add zifencei.
	* elfxx-riscv.h (riscv_isa_ext_class): Add RV_ISA_CLASS_H.

	gas/
	* testsuite/gas/riscv/march-fail-order-z.d: New testcase, check
	orders of prefixed z extensions.
	* testsuite/gas/riscv/march-fail-order-z.l: Likewise.
	* testsuite/gas/riscv/march-fail-single-char-h.d: New testcase.
	* testsuite/gas/riscv/march-fail-single-char.l: Updated.
	* testsuite/gas/riscv/march-fail-unknown-h.d: New testcase.
	* testsuite/gas/riscv/march-fail-unknown.l: Updated.

	opcodes/
	* riscv-opc.c (riscv_ext_version_table): Add zifencei.
2020-12-01 15:11:30 +08:00
Nelson Chu
e8d4709e6a RISC-V: Don't allow any uppercase letter in the arch string.
Although I cannot find any RISC-V specs said that uppercases are not
allowed in the arhc string, but seems like it is an established fact
both for GNU and LLVM.  Therefore, we shouldn't allow the uppercases
for the non-standard x extensions, too.

	bfd/
	* elfxx-riscv.c (riscv_parse_subset): ISA string cannot contain
	any uppercase letter.

	gas/
	* testsuite/gas/riscv/march-fail-uppercase-base.d: Updated.
	* testsuite/gas/riscv/march-fail-uppercase.l: Updated.
	* testsuite/gas/riscv/march-fail-uppercase-x.d: New testcase.
2020-12-01 15:09:26 +08:00
Nelson Chu
d541518bec RISC-V: Minor cleanup and testcases improvement for arch string parser.
Re-indent the related codes, unify and improve the related error messages
and comments.  Besies, also re-write the testcases to cover more cases.

	bfd/
	* elfxx-riscv.c: Re-indent codes, unify and improve the error
	messages and comments.
	(riscv_parse_prefixed_ext): Stop parsing the prefixed class
	extensions if the class is RV_ISA_CLASS_UNKNOWN, I get internal
	errors before adding this check for march-fail-porder* testcases.
	(riscv_parse_subset): Move the rv32 with q checking in front.
	* elfxx-riscv.h: Likewise.

	gas/
	(These are new testcases that cover more cases)
	* testsuite/gas/riscv/march-fail-base-01.d: The first extension must
	be e, i or g.
	* testsuite/gas/riscv/march-fail-base-01.l: Likewise.
	* testsuite/gas/riscv/march-fail-base-02.d: rv64e is an invalid base ISA.
	* testsuite/gas/riscv/march-fail-base-02.l: Likewise.
	* testsuite/gas/riscv/march-fail-order-std.d: Check orders of standard
	extensions.
	* testsuite/gas/riscv/march-fail-order-std.l: Likewise.
	* testsuite/gas/riscv/march-fail-order-x.d: Check orders of prefixed
	x extensions.
	* testsuite/gas/riscv/march-fail-order-x.l: Likewise.
	* testsuite/gas/riscv/march-fail-porder-x-std.d: Check orders when
	standard and prefixed extensions are set at the same time.
	* testsuite/gas/riscv/march-fail-porder-x-z.d: Likewise.
	* testsuite/gas/riscv/march-fail-porder-z-std.d: Likewise.
	* testsuite/gas/riscv/march-fail-porder.l: Likewise.
	* testsuite/gas/riscv/march-fail-single-char-s.d: Only standard
	extensions can use single char.
	* testsuite/gas/riscv/march-fail-single-char-x.d: Likewise.
	* testsuite/gas/riscv/march-fail-single-char-z.d: Likewise.
	* testsuite/gas/riscv/march-fail-single-char.l: Likewise.
	* testsuite/gas/riscv/march-fail-unknown-s.d: All extensions
	should be known, except the non-standard x extensions.
	* testsuite/gas/riscv/march-fail-unknown-std.d: Likewise.
	* testsuite/gas/riscv/march-fail-unknown-std.l: Likewise.
	* testsuite/gas/riscv/march-fail-unknown-z.d: Likewise.
	* testsuite/gas/riscv/march-fail-unknown.l: Likewise.
	* testsuite/gas/riscv/march-fail-uppercase-base.d: Do not
	allow any uppercase in the arch string.
	* testsuite/gas/riscv/march-fail-uppercase-std.d: Likewise.
	* testsuite/gas/riscv/march-fail-uppercase-z.d: Likewise.
	* testsuite/gas/riscv/march-fail-uppercase.l: Likewise.
	* testsuite/gas/riscv/march-fail-version-x.d: Failed to set versions.
	* testsuite/gas/riscv/march-fail-version-z.d: Likewise.
	* testsuite/gas/riscv/march-fail-version.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32ef.l: Updated.
	* testsuite/gas/riscv/march-fail-rv32id.d: Need f-ext.
	* testsuite/gas/riscv/march-fail-rv32iq.d: Should be rv64.
	* testsuite/gas/riscv/march-fail-rv32iq.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv64iq.d: Need d-ext and f-ext.
	* testsuite/gas/riscv/march-fail-rv64iq.l: Likewise.

	(The following testcases are removed and covered by new testcases)
	* testsuite/gas/riscv/march-fail-rv32i.d: march-fail-uppercase-base.
	* testsuite/gas/riscv/march-fail-rv32i.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32iam.d: march-fail-order-std.
	* testsuite/gas/riscv/march-fail-rv32iam.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32ic.d: march-fail-uppercase-std.
	* testsuite/gas/riscv/march-fail-rv32ic.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32icx2p.d: march-fail-version-x.
	* testsuite/gas/riscv/march-fail-rv32icx2p.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv32imc.d: march-fail-order-std.
	* testsuite/gas/riscv/march-fail-rv32imc.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv64I.d: march-fail-uppercase-std.
	* testsuite/gas/riscv/march-fail-rv64I.l: Likewise.
	* testsuite/gas/riscv/march-fail-rv64e.d: march-fail-base-02.
	* testsuite/gas/riscv/march-fail-rv64e.l: Likewise.
	* testsuite/gas/riscv/march-fail-s-with-version.d: march-fail-unknown-s.
	* testsuite/gas/riscv/march-fail-s-with-version.l: Likewise.
	* testsuite/gas/riscv/march-fail-s.d: march-fail-unknown-s.
	* testsuite/gas/riscv/march-fail-s.l: Likewise.
	* testsuite/gas/riscv/march-fail-sx.d: march-fail-unknown-s.
	* testsuite/gas/riscv/march-fail-sx.l: Likewise.
2020-12-01 15:04:03 +08:00
Alan Modra
56af5a30b8 tic6x elf testsuite fix
* testsuite/ld-elf/elf.exp: Set ASFLAGS for tic6x.
	* testsuite/ld-elf/reloc-discard.d: Remove tic6x xfail.
2020-12-01 11:26:58 +10:30
Alan Modra
5160d0f323 PR26979, Visibility of undefined foo@v1 should constrain foo@@v1
Also, undefined foo should constrain the visibility of foo@@v1 just as
it does for a later plain foo definition.

bfd/
	PR 26979
	* elf-bfd.h (elf_backend_merge_symbol_attribute): Update prototype.
	* elf32-m68hc1x.h (elf32_m68hc11_merge_symbol_attribute): Likewise.
	* elfxx-mips.h (_bfd_mips_elf_merge_symbol_attribute): Likewise.
	* elfxx-x86.h (_bfd_x86_elf_merge_symbol_attribute): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): Replace
	isym parameter with st_other.  Adjust code.
	* elf64-alpha.c (elf64_alpha_merge_symbol_attribute): Likewise.
	* elf64-ppc.c (ppc64_elf_merge_symbol_attribute): Likewise.
	* elfnn-aarch64.c (elfNN_aarch64_merge_symbol_attribute): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): Likewise.
	* elfxx-x86.c (_bfd_x86_elf_merge_symbol_attribute): Likewise.
	* elflink.c (elf_merge_st_other): Likewise.
	(_bfd_elf_merge_symbol, elf_link_add_object_symbols): Adjust to suit.
	(_bfd_elf_copy_link_hash_symbol_type): Likewise.
	(_bfd_elf_add_default_symbol): Merge st_other from undecorated
	symbol and @VER symbol to @@VER symbol.
ld/
	* testsuite/ld-elf/pr26979a.s,
	* testsuite/ld-elf/pr26979b.s,
	* testsuite/ld-elf/pr26979c.s,
	* testsuite/ld-elf/pr26979.ver,
	* testsuite/ld-elf/pr26979a.d,
	* testsuite/ld-elf/pr26979b.d: New tests.
2020-12-01 11:26:35 +10:30
GDB Administrator
3ca6a4e547 Automatic date update in version.in 2020-12-01 00:00:19 +00:00
H.J. Lu
15eb8c2d92 ld: Xfail PR ld/26936 test if not supported
Linkonce sections and comdat groups can be mixed only if comdat groups
have only a single member with matching symbol table entries.  Xfail
ld/26936 test:

1. If comdat groups always have more than one member.
2. If symbol table entries in linkonce and comdat group don't match.
3. If the assembly source file is renamed.

	PR ld/26936
	* testsuite/ld-elf/pr26936.d: Xfail targets which don't support
	mixing linkonce and comdat sections.
2020-11-30 05:21:51 -08:00
Tom de Vries
c18d491fbd Revert accidental empty commits
Revert empty commits:
- "[gdb] Don't return non-existing path in debuginfod_source_query"
  commit 59404f827c
- "[gdb/testsuite] Fix minimal encodings KPASSes"
  commit 61049d1ee5
2020-11-30 13:59:57 +01:00
Tom de Vries
7ce05d212d [gdb/symtab] Fix gdb.base/vla-optimized-out.exp with clang
Consider test-case gdb.base/vla-optimized-out.exp, compiled using clang-10.

GDB fails to get the size of the vla a:
...
(gdb) p sizeof (a)^M
Cannot access memory at address 0x6^M
(gdb) FAIL: gdb.base/vla-optimized-out.exp: o1: printed size of \
  optimized out vla
...

The relevant DWARF looks like this: the variable a:
...
 <2><12b>: Abbrev Number: 5 (DW_TAG_variable)
    <12c>   DW_AT_name        : a
    <132>   DW_AT_type        : <0x189>
...
has type:
...
 <1><189>: Abbrev Number: 10 (DW_TAG_array_type)
    <18a>   DW_AT_type        : <0x198>
 <2><18e>: Abbrev Number: 11 (DW_TAG_subrange_type)
    <18f>   DW_AT_type        : <0x19f>
    <193>   DW_AT_count       : <0x117>
...
with the count attribute equated to the value of this artificial variable:
...
 <2><117>: Abbrev Number: 4 (DW_TAG_variable)
    <118>   DW_AT_location    : 10 byte block: 75 1 10 ff ff ff ff f 1a 9f \
              (DW_OP_breg5 (rdi): 1;
	       DW_OP_constu: 4294967295;
	       DW_OP_and;
	       DW_OP_stack_value)
    <123>   DW_AT_name        : __vla_expr0
    <127>   DW_AT_type        : <0x182>
    <12b>   DW_AT_artificial  : 1
...

The location description of the variable is terminated with DW_OP_stack_value,
which according to the DWARF spec means that "the DWARF expression represents
the actual value of the object, rather than its location".

However, in attr_to_dynamic_prop, we set is_reference to true:
...
               baton->locexpr.is_reference = true;
...
and use it in dwarf2_evaluate_property to dereference the value of the DWARF
expression, which causes the access to memory at address 0x6.

Fix this by ignoring the baton->locexpr.is_reference == true setting if
the expression evaluation has ctx.location == DWARF_VALUE_STACK, such that we
get:
...
(gdb) p sizeof (a)^M
$2 = 6^M
(gdb) PASS: gdb.base/vla-optimized-out.exp: o1: printed size of \
  optimized out vla
...

Tested on x86_64-linux, with gcc.

Tested the following test-cases (the ones mentioned in PR26905) on
x86_64-linux with clang-10:
- gdb.base/vla-optimized-out.exp
- gdb.base/vla-ptr.exp
- gdb.mi/mi-vla-c99

gdb/ChangeLog:

2020-11-30  Tom de Vries  <tdevries@suse.de>

	PR symtab/26905
	* dwarf2/loc.c (dwarf2_locexpr_baton_eval): Add and handle
	is_reference parameter.
	(dwarf2_evaluate_property): Update dwarf2_locexpr_baton_eval call.

gdb/testsuite/ChangeLog:

2020-11-30  Tom de Vries  <tdevries@suse.de>

	PR symtab/26905
	* gdb.dwarf2/count.exp: Remove kfails.
2020-11-30 13:50:26 +01:00
Tom de Vries
61049d1ee5 [gdb/testsuite] Fix minimal encodings KPASSes
With current master I see a couple of KPASSes:
...
KPASS: gdb.ada/enum_idx_packed.exp: scenario=minimal: ptype small \
  (PRMS minimal encodings)
  ...
KPASS: gdb.ada/mod_from_name.exp: scenario=minimal: print xp \
  (PRMS minimal encodings)
KPASS: gdb.ada/pckd_arr_ren.exp: scenario=minimal: print var \
  (PRMS minimal encodings)
...

The corresponding setup_kfail is called for everything before gnat 11.

However, the test-cases also PASS for me with gnat-4.8, gnat-7.5.0 and
gnat-8.4.0.

Fix the KPASSes by limiting the setup_kfail to gnat 9 and 10.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-11-16  Tom de Vries  <tdevries@suse.de>

	* gdb.ada/enum_idx_packed.exp: Limit setup_kfail to gnat 9 and 10.
	* gdb.ada/mod_from_name.exp: Same.
	* gdb.ada/pckd_arr_ren.exp: Same.
2020-11-30 13:44:55 +01:00
Tom de Vries
59404f827c [gdb] Don't return non-existing path in debuginfod_source_query
When setting env var DEBUGINFOD_URLS to " " and running the testsuite, we run
into these regressions:
...
FAIL: gdb.base/list-missing-source.exp: info source
FAIL: gdb.base/source-dir.exp: info source before setting directory search list
...

Setting var DEBUGINFOD_URLS to " " allows the debuginfod query function
debuginfod_source_query to get past its early exit.

The function debuginfod_source_query is documented as: "If the file is
successfully retrieved, its path on the local machine is stored in DESTNAME".

However, in case we get back -ENOENT from libdebuginfod, we still set
DESTNAME:
....
  if (fd.get () < 0 && fd.get () != -ENOENT)
    printf_filtered (_("Download failed: %s.  Continuing without source file %ps.\n"),
                     safe_strerror (-fd.get ()),
                     styled_string (file_name_style.style (),  srcpath));
  else
    *destname = make_unique_xstrdup (srcpath);

  return fd;
...

Fix this by making debuginfod_source_query fit it's documentation and only
setting DESTNAME when successfully retrieving a file.  Likewise in
debuginfod_debuginfo_query.

gdb/ChangeLog:

2020-11-16  Tom de Vries  <tdevries@suse.de>

	* debuginfod-support.c (debuginfod_source_query)
	(debuginfod_debuginfo_query): Only set DESTNAME if successful.
2020-11-30 13:44:55 +01:00
Tom Tromey
88b91969e1 Remove per-language op_name functions
enum exp_opcode is created from all the .def files, but then each
language is required to implement its own op_name function to turn an
enum value to a string.  This seemed over-complicated to me, and this
patch removes the per-language functions in favor of simply using the
.def names for all languages.  Note that op_name is only used for
dumping expressions, which is a maintainer/debug feature.
Furthermore, I don't think there was any case where the .def name and
the string name differed.

gdb/ChangeLog
2020-11-30  Tom Tromey  <tom@tromey.com>

	* rust-lang.c (rust_op_name): Remove.
	(exp_descriptor_rust): Update.
	* parser-defs.h (op_name_standard): Don't declare.
	(struct exp_descriptor) <op_name>: Remove.
	* parse.c (exp_descriptor_standard): Update.
	* opencl-lang.c (exp_descriptor_opencl): Update.
	* m2-lang.c (m2_language::exp_descriptor_modula2): Update.
	* f-lang.c (op_name_f): Remove.
	(f_language::exp_descriptor_tab): Update.
	* expression.h (op_name): Update.
	* expprint.c (op_name): Rewrite.
	(op_name_standard): Remove.
	(dump_raw_expression, dump_subexp): Update.
	* c-lang.c (exp_descriptor_c): Update.
	* ax-gdb.c (gen_expr): Update.
	* ada-lang.c (ada_op_name): Remove.
	(ada_exp_descriptor): Update.
2020-11-30 01:37:10 -07:00
Tom Tromey
1cd49c43f3 Remove some dead code from evaluate_subexp_standard
I noticed that in the OP_ARRAY case in evaluate_subexp_standard,
"index_pc" is read but never set.  This dead code then guards the only
call to init_array_element, so this can be removed as well.

gdb/ChangeLog
2020-11-30  Tom Tromey  <tom@tromey.com>

	* eval.c (init_array_element): Remove.
	(evaluate_subexp_standard) <OP_ARRAY>: Remove "index_pc".
2020-11-30 01:24:57 -07:00
GDB Administrator
b7bbf3c81a Automatic date update in version.in 2020-11-30 00:00:13 +00:00
H.J. Lu
4bccc875d2 gold: Add endbr64 to IBT TLSDESC PLT entry
Gold generates:

 c10:   ff 35 da 23 00 00       push   0x23da(%rip)        # 2ff0 <_GLOBAL_OFFSET_TABLE_+0x8>
 c16:   f2 ff 25 c3 23 00 00    bnd jmp *0x23c3(%rip)        # 2fe0 <_DYNAMIC+0x260>
 c1d:   0f 1f 00                nopl   (%rax)

for IBT TLSDESC PLT entry which misses endbr64.  Add endbr64 to generate:

 c10:   f3 0f 1e fa             endbr64
 c14:   ff 35 d6 23 00 00       push   0x23d6(%rip)        # 2ff0 <_GLOBAL_OFFSET_TABLE_+0x8>
 c1a:   ff 25 c0 23 00 00       jmp    *0x23c0(%rip)        # 2fe0 <_DYNAMIC+0x260>

	PR ld/26972
	* x86_64.cc (Output_data_plt_x86_64_ibt::tlsdesc_plt_entry): Add
	endbr64.
	(Output_data_plt_x86_64_ibt::do_fill_tlsdesc_entry): Adjusted.
2020-11-29 11:41:47 -08:00
Hannes Domani
9f1212394f Fix Value.format_string docu for static members argument
The argument is called static_members, not static_fields.

gdb/doc/ChangeLog:

2020-11-29  Hannes Domani  <ssbssa@yahoo.de>

	PR python/26974
	* python.texi: Fix docu for static members argument.
2020-11-29 19:07:30 +01:00
Hannes Domani
96fb90861a Don't delete the locator win info
The locator win info is special because it is static, all the others are
created dynamically.

gdb/ChangeLog:

2020-11-29  Hannes Domani  <ssbssa@yahoo.de>

	PR tui/26973
	* tui/tui-layout.c (tui_apply_current_layout): Don't delete the
	static locator win info.
2020-11-29 18:47:38 +01:00
Borislav Petkov
632ee6fd82 x86: Do not dump DS/CS segment overrides for branch hints
The previous change

  "x86: Ignore CS/DS/ES/SS segment-override prefixes in 64-bit mode"

to ignore segment override prefixes in 64-bit mode lead to dumping
branch hints as excessive prefixes:

  ffffffff8109d5a0 <vmx_get_rflags>:
  ...
  ffffffff8109d601:       3e 77 0a                ds ja,pt ffffffff8109d60e <vmx_get_rflags+0x6e>
  						^^^^^

In this particular case, those prefixes are not excessive but are used
to provide branch hints - taken/not-taken - to the CPU.

Assign active_seg_prefix in that particular case to consume them.

gas/

2002-11-29  Borislav Petkov  <bp@suse.de>

        * testsuite/gas/i386/branch.d: Add new branch insns test.
        * testsuite/gas/i386/branch.s: Likewise.
        * testsuite/gas/i386/i386.exp: Insert the new branch test.
        * testsuite/gas/i386/x86-64-branch.d: Test for branch hints insns.
        * testsuite/gas/i386/x86-64-branch.s: Likewise.
        * testsuite/gas/i386/ilp32/x86-64-branch.d: Likewise.

opcodes/

2020-11-28 Borislav Petkov  <bp@suse.de>

        * i386-dis.c (print_insn): Set active_seg_prefix for branch hint insns
        to not dump branch hint prefixes 0x2E and 0x3E as unused prefixes.
2020-11-29 09:08:56 -08:00
H.J. Lu
568cbddc71 gold: Convert x86-64 GOTPCRELX only if addend == -4
Convert x86-64 GOTPCRELX relocations only if addend == -4.

	PR gold/26939
	* x86_64.cc (Target_x86_64<size>::Scan::local): Check
	get_r_addend() == -4 for GOTPCRELX conversion.
	(Target_x86_64<size>::Scan::global): Likewise.
	(Target_x86_64<size>::Relocate::relocate): Likewise.
	* testsuite/Makefile.am (check_DATA): Add
	x86_64_mov_to_lea15.stdout and x86_64_mov_to_lea16.stdout.
	(MOSTLYCLEANFILES): Add x86_64_mov_to_lea15 and
	x86_64_mov_to_lea16.
	(x86_64_mov_to_lea9.o): New target.
	(x86_64_mov_to_lea10.o): Likewise.
	(x86_64_mov_to_lea15): Likewise.
	(x86_64_mov_to_lea16): Likewise.
	(x86_64_mov_to_lea15.stdout): Likewise.
	(x86_64_mov_to_lea16.stdout): Likewise.
	* testsuite/Makefile.in: Regenerated.
	* testsuite/x86_64_mov_to_lea.sh: Updated.
	* testsuite/x86_64_mov_to_lea5.s: New file.
2020-11-29 06:00:50 -08:00
H.J. Lu
8ca751ee63 gold: Get linkonce/comdate sections for debugging sections
When relocating debug sections, get the section index for the linkonce
section.  Since symbols referenced in debugging sections can be defined
a single comdat section with a different section name, also check the
single comdat section.

	PR gold/26937
	* object.cc (Sized_relobj_file::map_to_kept_section): Get the
	section index for linkonce section.  Also check the single
	comdat section.
	* testsuite/Makefile.am (check_SCRIPTS): Add pr26936.sh.
	(check_DATA): Add pr26936a.stdout and pr26936b.stdout.
	(MOSTLYCLEANFILES): Add pr26936a and pr26936b.
	(pr26936a.stdout): New target.
	(pr26936a): Likewise.
	(pr26936b.stdout): Likewise.
	(pr26936b): Likewise.
	(pr26936a.o): Likewise.
	(pr26936b.o): Likewise.
	(pr26936c.o): Likewise.
	(pr26936d.o): Likewise.
	* testsuite/Makefile.in: Regenerated.
	* testsuite/pr26936.sh: New file.
	* testsuite/pr26936a.s: Likewise.
	* testsuite/pr26936b.s: Likewise.
	* testsuite/pr26936c.s: Likewise.
	* testsuite/pr26936d.s: Likewise.
2020-11-29 05:55:35 -08:00
GDB Administrator
b214250c1e Automatic date update in version.in 2020-11-29 00:00:12 +00:00
Alex Richardson
b413232211 GDB: Fix detection of ELF support when configuring with -Werror=implicit-function-declaration
I am getting

    I'm sorry, Dave, I can't do that.  Symbol format `elf64-littleriscv' unknown.

errors after updating from GDB 8.3 to 10.  Bisecting showed that since
commit 1ff6de0312 ("bfd, ld: add CTF section linking"), bfd.h depends
on strncmp() being present, so configuring with
-Werror=implicit-function-declaration results in the check for ELF
support in BFD failing:

    .../gdb/gdb/../bfd/elf-bfd.h: In function 'bfd_section_is_ctf':
    .../gdb/gdb/../bfd/elf-bfd.h:3086:10: error: implicit declaration of function 'strncmp' [-Werror=implicit-function-declaration]
       return strncmp (name, ".ctf", 4) == 0 && (name[4] == 0 || name[4] == '.');

gdb/ChangeLog:

	* acincludde.m4 (GDB_AC_CHECK_BFD): Include string.h in the test
	program.

Change-Id: Iec5e21d454c2a544c44d65e23cfde552c424c18e
2020-11-28 11:45:16 -05:00
Alan Modra
8d748d1dc5 PR26907, segment contains empty SHT_NOBITS section
Section ordering is important for _bfd_elf_map_sections_to_segments
and assign_file_positions_for_load_sections, which are only prepared
to handle sections in increasing LMA order.  When zero size sections
are involved it is possible to have multiple sections at the same LMA.
In that case the zero size sections must sort before any non-zero size
sections regardless of their types.

bfd/
	PR 26907
	* elf.c (elf_sort_sections): Don't sort zero size !load sections
	after load sections.
ld/
	* testsuite/ld-elf/pr26907.ld,
	* testsuite/ld-elf/pr26907.s,
	* testsuite/ld-elf/pr26907.d: New test.
2020-11-28 18:31:32 +10:30
GDB Administrator
ed5e05a2cf Automatic date update in version.in 2020-11-28 00:00:17 +00:00
Andrew Burgess
3df8c6afdd gdb: fix potentially uninitialised variable
In commit:

  commit 037d7135de
  Date:   Mon Nov 16 11:36:56 2020 +0000

      gdb: improve command completion for 'print', 'x', and 'display'

A potential use of an uninitialised variable was introduced.  This is
fixed in this commit.

Previously when analysing /FMT strings for tab completion we
considered two possibilities, either the user has typed '/', or the
user has typed '/' followed by an alpha-numeric character, as these
are the only valid FMT string characters.

This meant that if the user type, for example '/@' and then tried to
tab complete gdb would use an uninitialised variable.

Currently only the first character after the '/' is checked to see if
it is alpha-numeric, so if a user typed '/x@@' then gdb would be happy
to treat this as a FMT string.

Given the goal of this change was primarily to allow tab completion of
symbols later in the command when a /FMT was used then I decided to
just make the /FMT skipping less smart.  Now any characters after the
'/' up to the first white space, will be treated as a FMT string.

gdb/ChangeLog:

	* printcmd.c (skip_over_slash_fmt): Reorder code to ensure in_fmt
	is always initialized.
2020-11-27 14:55:55 +00:00
Rogerio Alves
b1eea24024 Add Rogerio Alves to gdb/MAINTAINERS.
gdb/Changelog
2020-11-26  Rogerio Alves <rcardoso@linux.ibm.com>
	* MAINTAINERS (Write After Approval): Add myself.
2020-11-27 11:41:43 -03:00
Nick Clifton
21c33bcbe3 Allow spaces in the name of the external preprocessor used by windres.
PR 26865
	* windres.c (main): If the preprocessor name includes spaces,
	ensure that it is quoted.
2020-11-27 14:19:56 +00:00
Jozef Lawrynowicz
2c6f3e56cb ELF: Support .noinit and .persistent sections
The ".persistent" section is for data that should be initialized during
load, but not during application reset.

The ".noinit" section is for data that should not be initialized during
load or application reset.

Targets utilizing the elf.sc linker script template can define
HAVE_{NOINIT,PERSISTENT}=yes to include the .noinit or .persistent
output sections in the generated linker script.

Targets with existing support for .noinit did not handle unique
.noinit.* and .gnu.linkonce.n.* sections the .noinit output section,
this patch also fixes that.

bfd/ChangeLog:

	* elf.c (special_sections_g): Add .gnu.linkonce.n and .gnu.linkonce.p.
	(special_sections_n): Add .noinit.
	(special_sections_p): Add .persistent.

binutils/ChangeLog:

	* testsuite/lib/binutils-common.exp (supports_noinit_section): New.
	(supports_persistent_section): New.

gas/ChangeLog:

	* testsuite/gas/elf/elf.exp: Run new tests.
	* testsuite/gas/elf/section25.d: New test.
	* testsuite/gas/elf/section25.s: New test.
	* testsuite/gas/elf/section26.d: New test.
	* testsuite/gas/elf/section26.s: New test.

ld/ChangeLog:

	* emulparams/armelf.sh (OTHER_SECTIONS): Remove .noinit section
	definition.
	Define HAVE_{NOINIT,PERSISTENT}=yes.
	* scripttempl/avr.sc (.noinit): Add .noinit.* and .gnu.linkonce.n.*
	input section wildcard patterns.
	* scripttempl/elf.sc: Define .noinit and .persistent sections when
	HAVE_NOINIT or HAVE_PERSISTENT are defined to "yes".
	* scripttempl/elf32msp430.sc (.noinit): Add .noinit.* and
	.gnu.linkonce.n.*. input section wildcard patterns.
	(.persistent): Add .persistent.* and
	.gnu.linkonce.p.*. input section wildcard patterns.
	* scripttempl/elfarcv2.sc (.noinit): Add .noinit.* and
	.gnu.linkonce.n.*. input section wildcard patterns.
	* scripttempl/pru.sc: Likewise.
	* testsuite/ld-elf/noinit-sections-1.d: New test.
	* testsuite/ld-elf/noinit-sections-2.d: New test.
	* testsuite/ld-elf/noinit-sections-2.l: New test.
	* testsuite/ld-elf/noinit-sections.s: New test.
	* testsuite/ld-elf/persistent-sections-1.d: New test.
	* testsuite/ld-elf/persistent-sections-2.d: New test.
	* testsuite/ld-elf/persistent-sections-2.l: New test.
	* testsuite/ld-elf/persistent-sections.s: New test.
2020-11-27 10:45:35 +00:00
GDB Administrator
bab6ead85f Automatic date update in version.in 2020-11-27 00:00:19 +00:00
Nick Clifton
647cebce12 Prevent a memory allocation failure when parsing corrupt DWARF debug sections.
PR 26946
	* dwarf2.c (read_section): Check for debug sections with excessive
	sizes.
2020-11-26 17:08:33 +00:00
Przemyslaw Wirkus
239ca5e497 gdb/aarch64: Add named flags for FPCR and FPSR registers
This patch updates FPCR (Floating-point Control Register) and FPSR
(Floating-point Status Register) named fields in AArch64. For detailed
description of named register FPCR and FPSR bit fields see [1] and [2].

Please not that bit fields FIZ, AH and NEP (bits 0, 1 and 2 respectively) in
FPCR are defined starting from Armv8.7 architecture.

[1]: https://developer.arm.com/docs/ddi0595/i/aarch64-system-registers/fpcr
[2]: https://developer.arm.com/docs/ddi0595/i/aarch64-system-registers/fpsr

Example:
>>> info all-registers fpsr
fpsr           0x10                [ IXC ]
>>> info all-registers fpcr
fpcr           0x0                 [ RMode=0 ]
2020-11-26 12:11:14 +00:00
Alan Modra
9ed0136bff PR26936 testsuite fixes
Many targets fail this test due to -z noseparate-code not being
supported, or _start not being the proper entry symbol, or "as -g"
something other than "generate debug".

	PR 26936
	* testsuite/ld-elf/pr26936.d: Pass --gen-debug to gas rather than -g.
	Only run when -shared -z options are supported.
	* testsuite/ld-elf/pr26936b.s: Define more entry symbols.
2020-11-26 18:40:10 +10:30
H.J. Lu
58349d00f4 elf: Get the real kept section
When mixing linkonce and comdat sections, we need to keep searching to
get the real kept section.

bfd/

	PR ld/26936
	* elflink.c (_bfd_elf_check_kept_section): Get the real kept
	section.

ld/

	PR ld/26936
	* testsuite/ld-elf/pr26936.d: New file.
	* testsuite/ld-elf/pr26936a.s: Likewise.
	* testsuite/ld-elf/pr26936b.s: Likewise.
	* testsuite/ld-elf/pr26936c.s: Likewise.
2020-11-25 16:14:29 -08:00
GDB Administrator
93bbe484a4 Automatic date update in version.in 2020-11-26 00:00:19 +00:00
H.J. Lu
e8cda20905 libctf: Pass format argument to asprintf
libctf/ChangeLog
2020-09-23  H.J. Lu  <hongjiu.lu@intel.com>

	PR libctf/26934
	* ctf-dump.c (ctf_dump_objts): Pass format argument to asprintf.
2020-11-25 19:11:36 +00:00
Nick Alcock
96c61be508 binutils: readelf: support CTF dicts with non-native-endian symtabs
Now we have a way to tell libctf what the endianness of the symtab is,
get readelf to use it.  (objdump doesn't need to do so, nor does ld,
because they both use BFD-aware mechanisms to open CTF dicts, so libctf
can automatically figure the symtab endianness out.)

binutils/ChangeLog
2020-11-23  Nick Alcock  <nick.alcock@oracle.com>

	* readelf.c (dump_section_as_ctf): Call ctf_arc_symsect_endianness.
2020-11-25 19:11:35 +00:00
Nick Alcock
53651de80f libctf, include: support foreign-endianness symtabs with CTF
The CTF symbol lookup machinery added recently has one deficit: it
assumes the symtab is in the machine's native endianness.  This is
always true when the linker is writing out symtabs (because cross
linkers byteswap symbols only after libctf has been called on them), but
may be untrue in the cross case when the linker or another tool
(objdump, etc) is reading them.

Unfortunately the easy way to model this to the caller, as an endianness
field in the ctf_sect_t, is precluded because doing so would change the
size of the ctf_sect_t, which would be an ABI break.  So, instead, allow
the endianness of the symtab to be set after open time, by calling one
of the two new API functions ctf_symsect_endianness (for ctf_dict_t's)
or ctf_arc_symsect_endianness (for entire ctf_archive_t's).  libctf
calls these functions automatically for objects opened via any of the
BFD-aware mechanisms (ctf_bfdopen, ctf_bfdopen_ctfsect, ctf_fdopen,
ctf_open, or ctf_arc_open), but the various mechanisms that just take
raw ctf_sect_t's will assume the symtab is in native endianness and need
a later call to ctf_*symsect_endianness to adjust it if needed.  (This
call is basically free if the endianness is actually native: it only
costs anything if the symtab endianness was previously guessed wrong,
and there is a symtab, and we are using it directly rather than using
symtab indexing.)

Obviously, calling ctf_lookup_by_symbol or ctf_symbol_next before the
symtab endianness is correctly set will probably give wrong answers --
but you can set it at any time as long as it is before then.

include/ChangeLog
2020-11-23  Nick Alcock  <nick.alcock@oracle.com>

	* ctf-api.h: Style nit: remove () on function names in comments.
	(ctf_sect_t): Mention endianness concerns.
	(ctf_symsect_endianness): New declaration.
	(ctf_arc_symsect_endianness): Likewise.

libctf/ChangeLog
2020-11-23  Nick Alcock  <nick.alcock@oracle.com>

	* ctf-impl.h (ctf_dict_t) <ctf_symtab_little_endian>: New.
	(struct ctf_archive_internal) <ctfi_symsect_little_endian>: Likewise.
	* ctf-create.c (ctf_serialize): Adjust for new field.
	* ctf-open.c (init_symtab): Note the semantics of repeated calls.
	(ctf_symsect_endianness): New.
	(ctf_bufopen_internal): Set ctf_symtab_little_endian suitably for
	the native endianness.
	(_Static_assert): Moved...
	(swap_thing): ... with this...
	* swap.h: ... to here.
	* ctf-util.c (ctf_elf32_to_link_sym): Use it, byteswapping the
	Elf32_Sym if the ctf_symtab_little_endian demands it.
	(ctf_elf64_to_link_sym): Likewise swap the Elf64_Sym if needed.
	* ctf-archive.c (ctf_arc_symsect_endianness): New, set the
	endianness of the symtab used by the dicts in an archive.
	(ctf_archive_iter_internal): Initialize to unknown (assumed native,
	do not call ctf_symsect_endianness).
	(ctf_dict_open_by_offset): Call ctf_symsect_endianness if need be.
	(ctf_dict_open_internal): Propagate the endianness down.
	(ctf_dict_open_sections): Likewise.
	* ctf-open-bfd.c (ctf_bfdopen_ctfsect): Get the endianness from the
	struct bfd and pass it down to the archive.
	* libctf.ver: Add ctf_symsect_endianness and
	ctf_arc_symsect_endianness.
2020-11-25 19:11:35 +00:00
Tom Tromey
cbfa382abb Remove two unnecessary variables from evaluate_subexp_standard
I noticed a couple of spots in evaluate_subexp_standard that looked
like:

    value *result;
    result = something;
    return result;

This patch simplifies these spots to a simple "return".

gdb/ChangeLog
2020-11-25  Tom Tromey  <tom@tromey.com>

	* eval.c (evaluate_subexp_standard): Remove unnecessary
	variables.
2020-11-25 10:19:40 -07:00
Tom Tromey
af30c400ea Do not include parser-defs.h from c-lang.h
While working on another series, I noticed that c-lang.h does not need
to include parser-defs.h.  This patch makes this change, and fixes up
the two .c files that needed this include.  Tested by rebuilding.

gdb/ChangeLog
2020-11-25  Tom Tromey  <tom@tromey.com>

	* d-lang.c: Include parser-defs.h.
	* rust-lang.c: Include parser-defs.h.
	* c-lang.h: Do not include parser-defs.h.
2020-11-25 10:10:11 -07:00