Compare commits

...

302 Commits

Author SHA1 Message Date
GDB Administrator
d19bc28bf8 Automatic date update in version.in 2021-07-03 00:00:38 +00:00
GDB Administrator
8817c1fa88 Automatic date update in version.in 2021-07-02 00:00:30 +00:00
GDB Administrator
5882e4da4d Automatic date update in version.in 2021-07-01 00:00:26 +00:00
GDB Administrator
8b1ca68bf0 Automatic date update in version.in 2021-06-30 00:00:27 +00:00
GDB Administrator
40f2c527ae Automatic date update in version.in 2021-06-29 00:00:33 +00:00
GDB Administrator
59fec5cf1f Automatic date update in version.in 2021-06-28 00:00:23 +00:00
GDB Administrator
08ca803369 Automatic date update in version.in 2021-06-27 00:00:25 +00:00
GDB Administrator
9d828925d7 Automatic date update in version.in 2021-06-26 00:00:21 +00:00
GDB Administrator
136d43af9b Automatic date update in version.in 2021-06-25 00:00:27 +00:00
GDB Administrator
9329adf6bf Automatic date update in version.in 2021-06-24 00:00:34 +00:00
GDB Administrator
e24e564529 Automatic date update in version.in 2021-06-23 00:00:27 +00:00
GDB Administrator
3319f38bea Automatic date update in version.in 2021-06-22 00:00:31 +00:00
GDB Administrator
abbf091897 Automatic date update in version.in 2021-06-21 00:00:20 +00:00
GDB Administrator
0989143e01 Automatic date update in version.in 2021-06-20 00:00:24 +00:00
GDB Administrator
a619076ace Automatic date update in version.in 2021-06-19 00:00:17 +00:00
GDB Administrator
df0fd533c7 Automatic date update in version.in 2021-06-18 00:00:28 +00:00
GDB Administrator
62423df4ff Automatic date update in version.in 2021-06-17 00:00:32 +00:00
GDB Administrator
3211a3dbaa Automatic date update in version.in 2021-06-16 00:00:28 +00:00
GDB Administrator
e62a9a1bd1 Automatic date update in version.in 2021-06-15 00:00:26 +00:00
GDB Administrator
81920af3ce Automatic date update in version.in 2021-06-14 00:00:23 +00:00
GDB Administrator
b4606dcdb2 Automatic date update in version.in 2021-06-13 00:00:27 +00:00
GDB Administrator
7f92cc5b02 Automatic date update in version.in 2021-06-12 00:00:20 +00:00
GDB Administrator
642b47369b Automatic date update in version.in 2021-06-11 00:00:41 +00:00
GDB Administrator
286b5c11d8 Automatic date update in version.in 2021-06-10 00:00:24 +00:00
GDB Administrator
990cfb441c Automatic date update in version.in 2021-06-09 00:00:29 +00:00
GDB Administrator
7843e33c7c Automatic date update in version.in 2021-06-08 00:01:15 +00:00
GDB Administrator
fdb55eb661 Automatic date update in version.in 2021-06-07 00:00:58 +00:00
GDB Administrator
79c71e81a7 Automatic date update in version.in 2021-06-06 00:00:57 +00:00
GDB Administrator
ad3ba3baa5 Automatic date update in version.in 2021-06-05 00:01:08 +00:00
GDB Administrator
fe9d4309a6 Automatic date update in version.in 2021-06-04 00:01:18 +00:00
GDB Administrator
cc7dab42bc Automatic date update in version.in 2021-06-03 00:00:59 +00:00
GDB Administrator
21533ee1f5 Automatic date update in version.in 2021-06-02 00:01:05 +00:00
GDB Administrator
462d5a10f1 Automatic date update in version.in 2021-06-01 00:01:09 +00:00
GDB Administrator
1b49f5c9cb Automatic date update in version.in 2021-05-31 00:01:08 +00:00
GDB Administrator
0640d06856 Automatic date update in version.in 2021-05-30 00:00:58 +00:00
GDB Administrator
db2324b5c4 Automatic date update in version.in 2021-05-29 00:00:55 +00:00
GDB Administrator
dc63e7fbc8 Automatic date update in version.in 2021-05-28 00:00:58 +00:00
GDB Administrator
3b3151a9a6 Automatic date update in version.in 2021-05-27 00:00:44 +00:00
GDB Administrator
bb991d45ca Automatic date update in version.in 2021-05-26 00:01:04 +00:00
GDB Administrator
dd14274596 Automatic date update in version.in 2021-05-25 00:00:54 +00:00
GDB Administrator
c042eb2f81 Automatic date update in version.in 2021-05-24 00:00:57 +00:00
GDB Administrator
a9a39471e2 Automatic date update in version.in 2021-05-23 00:01:04 +00:00
GDB Administrator
79d965c819 Automatic date update in version.in 2021-05-22 00:00:54 +00:00
GDB Administrator
20489475ae Automatic date update in version.in 2021-05-21 00:01:14 +00:00
GDB Administrator
e58525abe2 Automatic date update in version.in 2021-05-20 00:00:59 +00:00
GDB Administrator
7bb3004842 Automatic date update in version.in 2021-05-19 00:00:53 +00:00
GDB Administrator
6222fefc39 Automatic date update in version.in 2021-05-18 00:00:55 +00:00
GDB Administrator
5b0cc3b248 Automatic date update in version.in 2021-05-17 00:00:48 +00:00
GDB Administrator
200d1ece14 Automatic date update in version.in 2021-05-16 00:00:50 +00:00
GDB Administrator
da15159c0e Automatic date update in version.in 2021-05-15 00:00:48 +00:00
GDB Administrator
5adac898a8 Automatic date update in version.in 2021-05-14 00:00:48 +00:00
GDB Administrator
bbb49d6135 Automatic date update in version.in 2021-05-13 00:00:47 +00:00
GDB Administrator
cdec299fe4 Automatic date update in version.in 2021-05-12 00:00:57 +00:00
GDB Administrator
fb49a49f22 Automatic date update in version.in 2021-05-11 00:00:56 +00:00
GDB Administrator
c0a3e4bddc Automatic date update in version.in 2021-05-10 00:00:56 +00:00
GDB Administrator
8e49fcd7cb Automatic date update in version.in 2021-05-09 00:00:50 +00:00
GDB Administrator
e866bee434 Automatic date update in version.in 2021-05-08 00:00:52 +00:00
GDB Administrator
dd10a790a0 Automatic date update in version.in 2021-05-07 00:00:55 +00:00
GDB Administrator
56567f6dae Automatic date update in version.in 2021-05-06 00:00:54 +00:00
GDB Administrator
1d251b9288 Automatic date update in version.in 2021-05-05 00:00:51 +00:00
GDB Administrator
42ceb2410f Automatic date update in version.in 2021-05-04 00:00:58 +00:00
GDB Administrator
184d3e6723 Automatic date update in version.in 2021-05-03 00:00:50 +00:00
GDB Administrator
eb2f9e07d8 Automatic date update in version.in 2021-05-02 00:00:43 +00:00
GDB Administrator
71769e95c7 Automatic date update in version.in 2021-05-01 00:00:45 +00:00
GDB Administrator
808d04495e Automatic date update in version.in 2021-04-30 00:00:42 +00:00
GDB Administrator
d897b81f2b Automatic date update in version.in 2021-04-29 00:00:44 +00:00
GDB Administrator
c39cb9d25f Automatic date update in version.in 2021-04-28 00:00:54 +00:00
GDB Administrator
bcb524549d Automatic date update in version.in 2021-04-27 00:00:29 +00:00
Tom Tromey
e7d77ce0c4 Fix crash when expanding partial symtabs with DW_TAG_imported_unit
PR gdb/27743 points out a gdb crash when expanding partial symtabs,
where one of the compilation units uses DW_TAG_imported_unit.

The bug is that partial_map_expand_apply expects only to be called for
the outermost psymtab.  However, filename searching doesn't (and
probably shouldn't) guarantee this.  The fix is to walk upward to find
the outermost CU.

A new test case is included.  It is mostly copied from other test
cases, which really sped up the effort.

This bug does not occur on trunk.  There,
psym_map_symtabs_matching_filename is gone, replaced by
psymbol_functions::expand_symtabs_matching.  When this find a match,
it calls psymtab_to_symtab, which does this same upward walk.

Tested on x86-64 Fedora 32.

I propose checking in this patch on the gdb-10 branch, and just the
new test case on trunk.

gdb/ChangeLog
2021-04-23  Tom Tromey  <tromey@adacore.com>

	PR gdb/27743:
	* psymtab.c (partial_map_expand_apply): Expand outermost psymtab.

gdb/testsuite/ChangeLog
2021-04-23  Tom Tromey  <tromey@adacore.com>

	PR gdb/27743:
	* gdb.dwarf2/imported-unit-bp.exp: New file.
	* gdb.dwarf2/imported-unit-bp-main.c: New file.
	* gdb.dwarf2/imported-unit-bp-alt.c: New file.
2021-04-26 09:39:00 -06:00
GDB Administrator
c29a019680 Automatic date update in version.in 2021-04-26 00:00:30 +00:00
Joel Brobecker
2cd3a59c91 Bump GDB version number to 10.2.90.DATE-git.
gdb/ChangeLog:

	* version.in: Set GDB version number to 10.2.90.DATE-git.

gdb/testsuite/ChangeLog:

	* gdb.base/default.exp: Change $_gdb_minor to 3.
2021-04-25 08:23:56 +04:00
Joel Brobecker
1ae3e3c464 Document the GDB 10.2 release in gdb/ChangeLog
gdb/ChangeLog:

	GDB 10.2 released.
2021-04-25 08:18:45 +04:00
Joel Brobecker
ce35d7163e Set GDB version number to 10.2.
gdb/ChangeLog:

	* version.in: Set GDB version number to 10.2.
2021-04-25 08:06:27 +04:00
GDB Administrator
8dfccda274 Automatic date update in version.in 2021-04-25 00:00:28 +00:00
GDB Administrator
f55843920a Automatic date update in version.in 2021-04-24 00:00:28 +00:00
GDB Administrator
8402ba96dd Automatic date update in version.in 2021-04-23 00:00:27 +00:00
Simon Marchi
28ba2379de gdb/testsuite: add Python support check in gdb.python/flexible-array-member.exp
We don't want to execute this test if Python support is not compiled in
GDB, add the necessary check.

gdb/testsuite/ChangeLog:

	* gdb.python/flexible-array-member.exp: Add check for Python
	support.

Change-Id: I853b937d2a193a0bb216566bef1a35354264b1c5
2021-04-22 15:46:17 -04:00
Simon Marchi
a260236550 gdb: fix getting range of flexible array member in Python
As reported in bug 27757, we get an internal error when doing:

    $ cat test.c
    struct foo {
        int len;
        int items[];
    };

    struct foo *p;

    int main() {
        return 0;
    }
    $ gcc test.c -g -O0 -o test
    $ ./gdb -q -nx --data-directory=data-directory ./test -ex 'python gdb.parse_and_eval("p").type.target()["items"].type.range()'
    Reading symbols from ./test...
    /home/simark/src/binutils-gdb/gdb/gdbtypes.h:435: internal-error: LONGEST dynamic_prop::const_val() const: Assertion `m_kind == PROP_CONST' failed.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

This is because the Python code (typy_range) blindly reads the high
bound of the type of `items` as a constant value.  Since it is a
flexible array member, it has no high bound, the property is undefined.
Since commit 8c2e4e0689 ("gdb: add accessors to struct dynamic_prop"),
the getters check that you are not getting a property value of the wrong
kind, so this causes a failed assertion.

Fix it by checking if the property is indeed a constant value before
accessing it as such.  Otherwise, use 0.  This restores the previous GDB
behavior: because the structure was zero-initialized, this is what was
returned before.  But now this behavior is explicit and not accidental.

Add a test, gdb.python/flexible-array-member.exp, that is derived from
gdb.base/flexible-array-member.exp.  It tests the same things, but
through the Python API.  It also specifically tests getting the range
from the various kinds of flexible array member types (AFAIK it wasn't
possible to do the equivalent through the CLI).

gdb/ChangeLog:

	PR gdb/27757
	* python/py-type.c (typy_range): Check that bounds are constant
	before accessing them as such.
	* guile/scm-type.c (gdbscm_type_range): Likewise.

gdb/testsuite/ChangeLog:

	PR gdb/27757
	* gdb.python/flexible-array-member.c: New test.
	* gdb.python/flexible-array-member.exp: New test.
	* gdb.guile/scm-type.exp (test_range): Add test for flexible
	array member.
	* gdb.guile/scm-type.c (struct flex_member): New.
	(main): Use it.

Change-Id: Ibef92ee5fd871ecb7c791db2a788f203dff2b841
2021-04-22 15:05:18 -04:00
GDB Administrator
36dd66f195 Automatic date update in version.in 2021-04-22 00:00:37 +00:00
GDB Administrator
20899db053 Automatic date update in version.in 2021-04-21 00:00:31 +00:00
GDB Administrator
2b52bbdfa4 Automatic date update in version.in 2021-04-20 00:00:38 +00:00
GDB Administrator
26dfea7696 Automatic date update in version.in 2021-04-19 00:00:26 +00:00
GDB Administrator
91fdd5b9ce Automatic date update in version.in 2021-04-18 00:00:43 +00:00
GDB Administrator
70b55e8f46 Automatic date update in version.in 2021-04-17 00:00:28 +00:00
GDB Administrator
0b1e6d082d Automatic date update in version.in 2021-04-16 00:00:36 +00:00
GDB Administrator
9f70e0a347 Automatic date update in version.in 2021-04-15 00:00:32 +00:00
GDB Administrator
7a1d243e6d Automatic date update in version.in 2021-04-14 00:00:31 +00:00
GDB Administrator
025466feac Automatic date update in version.in 2021-04-13 00:00:40 +00:00
GDB Administrator
f2a2b0148b Automatic date update in version.in 2021-04-12 00:00:26 +00:00
GDB Administrator
37e43ac47b Automatic date update in version.in 2021-04-11 00:00:26 +00:00
GDB Administrator
d86882b2ab Automatic date update in version.in 2021-04-10 00:00:26 +00:00
GDB Administrator
7ab567f249 Automatic date update in version.in 2021-04-09 00:00:36 +00:00
GDB Administrator
0c5bba95b5 Automatic date update in version.in 2021-04-08 00:00:30 +00:00
GDB Administrator
ae13cfbbf5 Automatic date update in version.in 2021-04-07 00:00:38 +00:00
GDB Administrator
d7efdd505a Automatic date update in version.in 2021-04-06 00:00:27 +00:00
GDB Administrator
816bb2b5d0 Automatic date update in version.in 2021-04-05 00:00:31 +00:00
GDB Administrator
416378899e Automatic date update in version.in 2021-04-04 00:00:25 +00:00
GDB Administrator
1832ebfe68 Automatic date update in version.in 2021-04-03 00:00:25 +00:00
GDB Administrator
bd46cc054b Automatic date update in version.in 2021-04-02 00:00:32 +00:00
GDB Administrator
3f97a091c4 Automatic date update in version.in 2021-04-01 00:00:23 +00:00
GDB Administrator
fb587aeda1 Automatic date update in version.in 2021-03-31 00:00:26 +00:00
Simon Marchi
314d069cd6 gdb/dwarf: disable per-BFD resource sharing for -readnow objfiles
As described in PR 27541, we hit an internal error when loading a binary
the standard way and then loading it with the -readnow option:

    $ ./gdb -nx -q --data-directory=data-directory ~/a.out -ex "set confirm off" -ex "file -readnow ~/a.out"
    Reading symbols from /home/simark/a.out...
    Reading symbols from ~/a.out...
    /home/simark/src/binutils-gdb/gdb/dwarf2/read.c:8098: internal-error: void create_all_comp_units(dwarf2_per_objfile*): Assertion `per_objfile->per_bfd->all_comp_units.empty ()' failed.

This is a recurring problem that exposes a design issue in the DWARF
per-BFD sharing feature.  Things work well when loading a binary with
the same method (with/without index, with/without readnow) twice in a
row.  But they don't work so well when loading a binary with different
methods.  See this previous fix, for example:

    efb763a5ea ("gdb: check for partial symtab presence in dwarf2_initialize_objfile")

That one handled the case where the first load is normal (uses partial
symbols) and the second load uses an index.

The problem is that when loading an objfile with a method A, we create a
dwarf2_per_bfd and some dwarf2_per_cu_data and initialize them with the
data belonging to that method.  When loading another obfile sharing the
same BFD but with a different method B, it's not clear how to re-use the
dwarf2_per_bfd/dwarf2_per_cu_data previously created, because they
contain the data specific to method A.

I think the most sensible fix would be to not share a dwarf2_per_bfd
between two objfiles loaded with different methods.  That means that two
objfiles sharing the same BFD and loaded the same way would share a
dwarf2_per_bfd.  Two objfiles sharing the same BFD but loaded with
different methods would use two different dwarf2_per_bfd structures.

However, this isn't a trivial change.  So to fix the known issue quickly
(including in the gdb 10 branch), this patch just disables all
dwarf2_per_bfd sharing for objfiles using READNOW.

Generalize the gdb.base/index-cache-load-twice.exp test to test all
the possible combinations of loading a file with partial symtabs, index
and readnow.  Move it to gdb.dwarf2, since it really exercises features
of the DWARF reader.

gdb/ChangeLog:

	PR gdb/27541
	* dwarf2/read.c (dwarf2_has_info): Don't share dwarf2_per_bfd
	with objfiles using READNOW.

gdb/testsuite/ChangeLog:

	PR gdb/27541
	* gdb.base/index-cache-load-twice.exp: Remove.
	* gdb.base/index-cache-load-twice.c: Remove.
	* gdb.dwarf2/per-bfd-sharing.exp: New.
	* gdb.dwarf2/per-bfd-sharing.c: New.

Change-Id: I9ffcf1e136f3e75242f70e4e58e4ba1fd3083389
2021-03-30 13:37:56 -04:00
GDB Administrator
2b639bbbaa Automatic date update in version.in 2021-03-30 00:00:27 +00:00
GDB Administrator
6ca7d43588 Automatic date update in version.in 2021-03-29 00:00:23 +00:00
GDB Administrator
8726b997ba Automatic date update in version.in 2021-03-28 00:00:27 +00:00
GDB Administrator
8e219339f7 Automatic date update in version.in 2021-03-27 00:00:24 +00:00
GDB Administrator
9f8ac95928 Automatic date update in version.in 2021-03-26 00:00:26 +00:00
GDB Administrator
6a20cdb0af Automatic date update in version.in 2021-03-25 00:00:21 +00:00
GDB Administrator
5e0f8a51e9 Automatic date update in version.in 2021-03-24 00:00:28 +00:00
GDB Administrator
51077ff2f5 Automatic date update in version.in 2021-03-23 00:00:25 +00:00
GDB Administrator
3501b624ae Automatic date update in version.in 2021-03-22 00:00:31 +00:00
GDB Administrator
e22c0c5153 Automatic date update in version.in 2021-03-21 00:00:25 +00:00
GDB Administrator
4d6b822f36 Automatic date update in version.in 2021-03-20 00:00:16 +00:00
GDB Administrator
805ef76461 Automatic date update in version.in 2021-03-19 00:00:18 +00:00
GDB Administrator
762684cacc Automatic date update in version.in 2021-03-18 00:00:32 +00:00
GDB Administrator
7db48cc66a Automatic date update in version.in 2021-03-17 00:00:18 +00:00
GDB Administrator
fc9b4c828d Automatic date update in version.in 2021-03-16 00:00:27 +00:00
GDB Administrator
60fedf2ec5 Automatic date update in version.in 2021-03-15 00:00:32 +00:00
GDB Administrator
11a4913c8a Automatic date update in version.in 2021-03-14 00:00:23 +00:00
GDB Administrator
b061d44241 Automatic date update in version.in 2021-03-13 00:00:26 +00:00
Christian Biesinger
1ee63759b0 Use RAII to set the per-thread SIGSEGV handler
This avoids using a thread-local extern variable, which causes link errors
on some platforms, notably Cygwin.  But I think this is a better pattern
even outside of working around linker bugs because it encapsulates direct
access to the variable inside the class, instead of having a global extern
variable.

The cygwin link error is:
cp-support.o: in function `gdb_demangle(char const*, int)':
/home/Christian/binutils-gdb/obj/gdb/../../gdb/cp-support.c:1619:(.text+0x6472): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for thread_local_segv_handler'
/home/Christian/binutils-gdb/obj/gdb/../../gdb/cp-support.c:1619:(.text+0x648b): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `TLS init function for thread_local_segv_handler'
collect2: error: ld returned 1 exit status

2021-03-12  Christian Biesinger  <cbiesinger@google.com>

	PR threads/27239
	* cp-support.c: Use scoped_segv_handler_restore.
	* event-top.c (thread_local_segv_handler): Made static.
	(scoped_segv_handler_restore::scoped_segv_handler_restore):
	New function.
	(scoped_segv_handler_restore::~scoped_segv_handler_restore): New
	function.
	* event-top.h (class scoped_segv_handler_restore): New class.
	(thread_local_segv_handler): Removed.
2021-03-12 11:27:04 -06:00
GDB Administrator
354d37286a Automatic date update in version.in 2021-03-12 00:00:32 +00:00
GDB Administrator
bb1f773386 Automatic date update in version.in 2021-03-11 00:00:33 +00:00
GDB Administrator
203e692fc1 Automatic date update in version.in 2021-03-10 00:00:43 +00:00
GDB Administrator
6427605cd4 Automatic date update in version.in 2021-03-09 00:00:40 +00:00
GDB Administrator
f260932cf5 Automatic date update in version.in 2021-03-08 00:00:39 +00:00
Tom de Vries
cdb986e09e [gdb/symtab] Fix element type modification in read_array_type
When running test-case gdb.fortran/function-calls.exp with target board
unix/gdb:debug_flags=-gdwarf-5, I run into:
...
(gdb) PASS: gdb.fortran/function-calls.exp: \
  p derived_types_and_module_calls::pass_cart(c)
p derived_types_and_module_calls::pass_cart_nd(c_nd)^M
^M
Program received signal SIGSEGV, Segmentation fault.^M
0x0000000000400f73 in derived_types_and_module_calls::pass_cart_nd \
  (c=<error reading variable: Cannot access memory at address 0xc>) at \
  function-calls.f90:130^M
130             pass_cart_nd = ubound(c%d,1,4)^M
The program being debugged was signaled while in a function called from GDB.^M
GDB has restored the context to what it was before the call.^M
To change this behavior use "set unwindonsignal off".^M
Evaluation of the expression containing the function^M
(derived_types_and_module_calls::pass_cart_nd) will be abandoned.^M
(gdb) FAIL: gdb.fortran/function-calls.exp: p
...

The problem originates in read_array_type, when reading a DW_TAG_array_type
with a dwarf-5 DW_TAG_generic_subrange child.  This is not supported, and the
fallout of this is that rather than constructing a new array type, the code
proceeds to modify the element type.

Fix this conservatively by issuing a complaint and bailing out in
read_array_type when not being able to construct an array type, such that we
have:
...
(gdb) maint expand-symtabs function-calls.f90^M
During symbol reading: unable to find array range \
  - DIE at 0xe1e [in module function-calls]^M
During symbol reading: unable to find array range \
  - DIE at 0xe1e [in module function-calls]^M
(gdb) KFAIL: gdb.fortran/function-calls.exp: no complaints in srcfile \
  (PRMS: symtab/27388)
...

Tested on x86_64-linux.

gdb/ChangeLog:

2021-03-07  Tom de Vries  <tdevries@suse.de>

	PR symtab/27341
	* dwarf2/read.c (read_array_type): Return NULL when not being able to
	construct an array type.  Add assert to ensure that element_type is
	not being modified.

gdb/testsuite/ChangeLog:

2021-03-07  Tom de Vries  <tdevries@suse.de>

	PR symtab/27341
	* lib/gdb.exp (with_complaints): New proc, factored out of ...
	(gdb_load_no_complaints): ... here.
	* gdb.fortran/function-calls.exp: Add test-case.
2021-03-07 17:58:28 +01:00
Kevin Buettner
86bcfb117c Fix date in ChangeLog 2021-03-06 18:32:04 -07:00
GDB Administrator
a7656c7e60 Automatic date update in version.in 2021-03-07 00:00:44 +00:00
Kevin Buettner
4cacb69393 Fix aarch64-linux-hw-point.c build problem
Due to a recent glibc header file change, the file
nat/aarch64-linux-hw-point.c no longer builds on Fedora rawhide.

An enum for PTRACE_SYSEMU is now provided by <sys/ptrace.h>.  In the
past, PTRACE_SYSEMU was defined only in <asm/ptrace.h>.  This is
what it looks like...

In <asm/ptrace.h>:

 #define PTRACE_SYSEMU		  31

In <sys/ptrace.h>:

enum __ptrace_request
{
  ...
  PTRACE_SYSEMU = 31,
 #define PT_SYSEMU PTRACE_SYSEMU

  ...
}

When <asm/ptrace.h> and <sys/ptrace.h> are both included in a source
file, we run into the following build problem when the former is
included before the latter:

In file included from nat/aarch64-linux-hw-point.c:26:
/usr/include/sys/ptrace.h:86:3: error: expected identifier before numeric constant
   86 |   PTRACE_SYSEMU = 31,
      |   ^~~~~~~~~~~~~

(There are more errors after this one too.)

The file builds without error when <asm/ptrace.h> is included after
<sys/ptrace.h>.  I found that this is already done in
nat/aarch64-sve-linux-ptrace.h (which is included by
nat/aarch64-linux-ptrace.c).

I've tested this change on Fedora rawhide and Fedora 33, both
running on an aarch64 machine.

gdb/ChangeLog:

	PR build/27536
	* nat/aarch64-linux-hw-point.c: Include <asm/ptrace.h> after
	<sys/ptrace.h>.
2021-03-06 10:09:28 -07:00
Kevin Buettner
aebc4aa2ec amd64-linux-siginfo.c: Adjust include order to avoid gnulib error
On Fedora rawhide, after updating to glibc-2.33, I'm seeing the
following build failure:

  CXX    nat/amd64-linux-siginfo.o
In file included from /usr/include/bits/sigstksz.h:24,
                 from /usr/include/signal.h:315,
                 from ../gnulib/import/signal.h:52,
                 from /ironwood1/sourceware-git/rawhide-gnulib/bld/../../worktree-gnulib/gdbserver/../gdb/nat/amd64-linux-siginfo.c:20:
../gnulib/import/unistd.h:663:3: error: #error "Please include config.h first."
  663 |  #error "Please include config.h first."
      |   ^~~~~

glibc-2.33 has changed signal.h to now include <bits/sigstksz.h> which,
in turn, includes <unistd.h>. For a gdb build, this causes the gnulib
version of unistd.h to be pulled in first.  The build failure shown
above happens because gnulib's config.h has not been included before
the include of <signal.h>.

The fix is simple - we just rearrange the order of the header file
includes to make sure that gdbsupport/commondefs.h is included before
attempting to include signal.h.  Note that gdbsupport/commondefs.h
includes <gnulib/config.h>.

Build and regression tested on Fedora 33.  On Fedora rawhide, GDB
builds again.

gdb/ChangeLog:

	PR build/27535
	* nat/amd64-linux-siginfo.c: Include "gdbsupport/common-defs.h"
	(which in turn includes <gnulib/config.h>) before include
	of <signal.h>.
2021-03-06 09:58:32 -07:00
Tom de Vries
df3ec334b8 [gdb/symtab] Handle DW_TAG_type_unit in process_psymtab_comp_unit
When running test-case gdb.cp/cpexprs-debug-types.exp with target board
unix/gdb:debug_flags=-gdwarf-5, I run into:
...
(gdb) file cpexprs-debug-types^M
Reading symbols from cpexprs-debug-types...^M
ERROR: Couldn't load cpexprs-debug-types into GDB (eof).
ERROR: Couldn't send delete breakpoints to GDB.
ERROR: GDB process no longer exists
GDB process exited with wait status 23054 exp9 0 0 CHILDKILLED SIGABRT SIGABRT
...

We're running into this abort in process_psymtab_comp_unit:
...
  switch (reader.comp_unit_die->tag)
    {
    case DW_TAG_compile_unit:
      this_cu->unit_type = DW_UT_compile;
      break;
    case DW_TAG_partial_unit:
      this_cu->unit_type = DW_UT_partial;
      break;
    default:
      abort ();
    }
...
because reader.comp_unit_die->tag == DW_TAG_type_unit.

Fix this by adding a DW_TAG_type_unit case.

Tested on x86_64-linux.

gdb/ChangeLog:

2021-02-05  Tom de Vries  <tdevries@suse.de>

	PR symtab/27333
	* dwarf2/read.c (process_psymtab_comp_unit): Handle DW_TAG_type_unit.

(cherry picked from commit e77b0004dd)
2021-03-06 10:34:13 +04:00
GDB Administrator
52a4867a01 Automatic date update in version.in 2021-03-06 00:00:27 +00:00
GDB Administrator
b507c0e4a1 Automatic date update in version.in 2021-03-05 00:00:36 +00:00
Simon Marchi
ffc17e2c02 gdb: set current thread in sparc_{fetch,collect}_inferior_registers (PR gdb/27147)
PR 27147 shows that on sparc64, GDB is unable to properly unwind:

Expected result (from GDB 9.2):

    #0  0x0000000000108de4 in puts ()
    #1  0x0000000000100950 in hello () at gdb-test.c:4
    #2  0x0000000000100968 in main () at gdb-test.c:8

Actual result (from GDB latest git):

    #0  0x0000000000108de4 in puts ()
    #1  0x0000000000100950 in hello () at gdb-test.c:4
    Backtrace stopped: previous frame inner to this frame (corrupt stack?)

The first failing commit is 5b6d1e4fa4 ("Multi-target support").  The cause
of the change in behavior is due to (thanks for Andrew Burgess for finding
this):

 - inferior_ptid is no longer set on entry of target_ops::wait, whereas
   it was set to something valid previously
 - deep down in linux_nat_target::wait (see stack trace below), we fetch
   the registers of the event thread
 - on sparc64, fetching registers involves reading memory (in
   sparc_supply_rwindow, see stack trace below)
 - reading memory (target_ops::xfer_partial) relies on inferior_ptid
   being set to the thread from which we want to read memory

This is where things go wrong:

    #0  linux_nat_target::xfer_partial (this=0x10000fa2c40 <the_sparc64_linux_nat_target>, object=TARGET_OBJECT_MEMORY, annex=0x0, readbuf=0x7feffe3b000 "", writebuf=0x0, offset=8791798050744, len=8, xfered_len=0x7feffe3ae88) at /home/simark/src/binutils-gdb/gdb/linux-nat.c:3697
    #1  0x00000100007f5b10 in raw_memory_xfer_partial (ops=0x10000fa2c40 <the_sparc64_linux_nat_target>, readbuf=0x7feffe3b000 "", writebuf=0x0, memaddr=8791798050744, len=8, xfered_len=0x7feffe3ae88) at /home/simark/src/binutils-gdb/gdb/target.c:912
    #2  0x00000100007f60e8 in memory_xfer_partial_1 (ops=0x10000fa2c40 <the_sparc64_linux_nat_target>, object=TARGET_OBJECT_MEMORY, readbuf=0x7feffe3b000 "", writebuf=0x0, memaddr=8791798050744, len=8, xfered_len=0x7feffe3ae88) at /home/simark/src/binutils-gdb/gdb/target.c:1043
    #3  0x00000100007f61b4 in memory_xfer_partial (ops=0x10000fa2c40 <the_sparc64_linux_nat_target>, object=TARGET_OBJECT_MEMORY, readbuf=0x7feffe3b000 "", writebuf=0x0, memaddr=8791798050744, len=8, xfered_len=0x7feffe3ae88) at /home/simark/src/binutils-gdb/gdb/target.c:1072
    #4  0x00000100007f6538 in target_xfer_partial (ops=0x10000fa2c40 <the_sparc64_linux_nat_target>, object=TARGET_OBJECT_MEMORY, annex=0x0, readbuf=0x7feffe3b000 "", writebuf=0x0, offset=8791798050744, len=8, xfered_len=0x7feffe3ae88) at /home/simark/src/binutils-gdb/gdb/target.c:1129
    #5  0x00000100007f7094 in target_read_partial (ops=0x10000fa2c40 <the_sparc64_linux_nat_target>, object=TARGET_OBJECT_MEMORY, annex=0x0, buf=0x7feffe3b000 "", offset=8791798050744, len=8, xfered_len=0x7feffe3ae88) at /home/simark/src/binutils-gdb/gdb/target.c:1375
    #6  0x00000100007f721c in target_read (ops=0x10000fa2c40 <the_sparc64_linux_nat_target>, object=TARGET_OBJECT_MEMORY, annex=0x0, buf=0x7feffe3b000 "", offset=8791798050744, len=8) at /home/simark/src/binutils-gdb/gdb/target.c:1415
    #7  0x00000100007f69d4 in target_read_memory (memaddr=8791798050744, myaddr=0x7feffe3b000 "", len=8) at /home/simark/src/binutils-gdb/gdb/target.c:1218
    #8  0x0000010000758520 in sparc_supply_rwindow (regcache=0x10000fea4f0, sp=8791798050736, regnum=-1) at /home/simark/src/binutils-gdb/gdb/sparc-tdep.c:1960
    #9  0x000001000076208c in sparc64_supply_gregset (gregmap=0x10000be3190 <sparc64_linux_ptrace_gregmap>, regcache=0x10000fea4f0, regnum=-1, gregs=0x7feffe3b230) at /home/simark/src/binutils-gdb/gdb/sparc64-tdep.c:1974
    #10 0x0000010000751b64 in sparc_fetch_inferior_registers (regcache=0x10000fea4f0, regnum=80) at /home/simark/src/binutils-gdb/gdb/sparc-nat.c:170
    #11 0x0000010000759d68 in sparc64_linux_nat_target::fetch_registers (this=0x10000fa2c40 <the_sparc64_linux_nat_target>, regcache=0x10000fea4f0, regnum=80) at /home/simark/src/binutils-gdb/gdb/sparc64-linux-nat.c:38
    #12 0x00000100008146ec in target_fetch_registers (regcache=0x10000fea4f0, regno=80) at /home/simark/src/binutils-gdb/gdb/target.c:3287
    #13 0x00000100006a8c5c in regcache::raw_update (this=0x10000fea4f0, regnum=80) at /home/simark/src/binutils-gdb/gdb/regcache.c:584
    #14 0x00000100006a8d94 in readable_regcache::raw_read (this=0x10000fea4f0, regnum=80, buf=0x7feffe3b7c0 "") at /home/simark/src/binutils-gdb/gdb/regcache.c:598
    #15 0x00000100006a93b8 in readable_regcache::cooked_read (this=0x10000fea4f0, regnum=80, buf=0x7feffe3b7c0 "") at /home/simark/src/binutils-gdb/gdb/regcache.c:690
    #16 0x00000100006b288c in readable_regcache::cooked_read<unsigned long, void> (this=0x10000fea4f0, regnum=80, val=0x7feffe3b948) at /home/simark/src/binutils-gdb/gdb/regcache.c:777
    #17 0x00000100006a9b44 in regcache_cooked_read_unsigned (regcache=0x10000fea4f0, regnum=80, val=0x7feffe3b948) at /home/simark/src/binutils-gdb/gdb/regcache.c:791
    #18 0x00000100006abf3c in regcache_read_pc (regcache=0x10000fea4f0) at /home/simark/src/binutils-gdb/gdb/regcache.c:1295
    #19 0x0000010000507920 in save_stop_reason (lp=0x10000fc5b10) at /home/simark/src/binutils-gdb/gdb/linux-nat.c:2612
    #20 0x00000100005095a4 in linux_nat_filter_event (lwpid=520983, status=1407) at /home/simark/src/binutils-gdb/gdb/linux-nat.c:3050
    #21 0x0000010000509f9c in linux_nat_wait_1 (ptid=..., ourstatus=0x7feffe3c8f0, target_options=...) at /home/simark/src/binutils-gdb/gdb/linux-nat.c:3194
    #22 0x000001000050b1d0 in linux_nat_target::wait (this=0x10000fa2c40 <the_sparc64_linux_nat_target>, ptid=..., ourstatus=0x7feffe3c8f0, target_options=...) at /home/simark/src/binutils-gdb/gdb/linux-nat.c:3432
    #23 0x00000100007f8ac0 in target_wait (ptid=..., status=0x7feffe3c8f0, options=...) at /home/simark/src/binutils-gdb/gdb/target.c:2000
    #24 0x00000100004ac17c in do_target_wait_1 (inf=0x1000116d280, ptid=..., status=0x7feffe3c8f0, options=...) at /home/simark/src/binutils-gdb/gdb/infrun.c:3464
    #25 0x00000100004ac3b8 in operator() (__closure=0x7feffe3c678, inf=0x1000116d280) at /home/simark/src/binutils-gdb/gdb/infrun.c:3527
    #26 0x00000100004ac7cc in do_target_wait (wait_ptid=..., ecs=0x7feffe3c8c8, options=...) at /home/simark/src/binutils-gdb/gdb/infrun.c:3540
    #27 0x00000100004ad8c4 in fetch_inferior_event () at /home/simark/src/binutils-gdb/gdb/infrun.c:3880
    #28 0x0000010000485568 in inferior_event_handler (event_type=INF_REG_EVENT) at /home/simark/src/binutils-gdb/gdb/inf-loop.c:42
    #29 0x000001000050d394 in handle_target_event (error=0, client_data=0x0) at /home/simark/src/binutils-gdb/gdb/linux-nat.c:4060
    #30 0x0000010000ab5c8c in handle_file_event (file_ptr=0x10001207270, ready_mask=1) at /home/simark/src/binutils-gdb/gdbsupport/event-loop.cc:575
    #31 0x0000010000ab6334 in gdb_wait_for_event (block=0) at /home/simark/src/binutils-gdb/gdbsupport/event-loop.cc:701
    #32 0x0000010000ab487c in gdb_do_one_event () at /home/simark/src/binutils-gdb/gdbsupport/event-loop.cc:212
    #33 0x0000010000542668 in start_event_loop () at /home/simark/src/binutils-gdb/gdb/main.c:348
    #34 0x000001000054287c in captured_command_loop () at /home/simark/src/binutils-gdb/gdb/main.c:408
    #35 0x0000010000544e84 in captured_main (data=0x7feffe3d188) at /home/simark/src/binutils-gdb/gdb/main.c:1242
    #36 0x0000010000544f2c in gdb_main (args=0x7feffe3d188) at /home/simark/src/binutils-gdb/gdb/main.c:1257
    #37 0x00000100000c1f14 in main (argc=4, argv=0x7feffe3d548) at /home/simark/src/binutils-gdb/gdb/gdb.c:32

There is a target_read_memory call in sparc_supply_rwindow, whose return
value is not checked.  That call fails, because inferior_ptid does not
contain a valid ptid, and uninitialized buffer contents is used.
Ultimately it results in a corrupt stop_pc.

target_ops::fetch_registers can be (and should remain, in my opinion)
independent of inferior_ptid, because the ptid of the thread from which
to fetch registers can be obtained from the regcache.  In other words,
implementations of target_ops::fetch_registers should not rely on
inferior_ptid having a sensible value on entry.

The sparc64_linux_nat_target::fetch_registers case is special, because it calls
a target method that is dependent on the inferior_ptid value
(target_read_inferior, and ultimately target_ops::xfer_partial).  So I would
say it's the responsibility of sparc64_linux_nat_target::fetch_registers to set
up inferior_ptid correctly prior to calling target_read_inferior.

This patch makes sparc64_linux_nat_target::fetch_registers (and
store_registers, since it works the same) temporarily set inferior_ptid.  If we
ever make target_ops::xfer_partial independent of inferior_ptid, setting
inferior_ptid won't be necessary, we'll simply pass down the ptid as a
parameter in some way.

I chose to set/restore inferior_ptid in sparc_fetch_inferior_registers, because
I am not convinced that doing so in an inner location (in sparc_supply_rwindow
for instance) would always be correct.  We have access to the ptid in
sparc_supply_rwindow (from the regcache), so we _could_ set inferior_ptid
there.  However, I don't want to just set inferior_ptid, as that would make it
not desync'ed with `current_thread ()` and `current_inferior ()`.  It's
preferable to use switch_to_thread instead, as that switches all the global
"current" stuff in a coherent way.  But doing so requires a `thread_info *`,
and getting a `thread_info *` from a ptid requires a `process_stratum_target
*`.  We could use `current_inferior()->process_target()` in
sparc_supply_rwindow for this (using target_read_memory uses the current
inferior's target stack anyway).  However, sparc_supply_rwindow is also used in
the context of BSD uthreads, where a thread stratum target defines threads.  I
presume the ptid in the regcache would be the ptid of the uthread, defined by
the thread stratum target (bsd_uthread_target).  Using
`current_inferior()->process_target()` would look up a ptid defined by the
thread stratum target using the process stratum target.  I don't think it would
give good results.  So I prefer playing it safe and looking up the thread
earlier, in sparc_fetch_inferior_registers.

I added some assertions (in sparc_supply_rwindow and others) to verify
that the regcache's ptid matches inferior_ptid.  That verifies that the
caller has properly set the correct global context.  This would have
caught (though a failed assertion) the current problem.

gdb/ChangeLog:

	PR gdb/27147
	* sparc-nat.h (sparc_fetch_inferior_registers): Add
	process_stratum_target parameter,
	sparc_store_inferior_registers): update callers.
	* sparc-nat.c (sparc_fetch_inferior_registers,
	sparc_store_inferior_registers): Add process_stratum_target
	parameter.  Switch current thread before calling
	sparc_supply_gregset / sparc_collect_rwindow.
	(sparc_store_inferior_registers): Likewise.
	* sparc-obsd-tdep.c (sparc32obsd_supply_uthread): Add assertion.
	(sparc32obsd_collect_uthread): Likewise.
	* sparc-tdep.c (sparc_supply_rwindow, sparc_collect_rwindow):
	Add assertion.
	* sparc64-obsd-tdep.c (sparc64obsd_collect_uthread,
	sparc64obsd_supply_uthread): Add assertion.

Change-Id: I16c658cd70896cea604516714f7e2428fbaf4301
2021-03-04 11:07:40 -05:00
GDB Administrator
3526b862cb Automatic date update in version.in 2021-03-04 00:00:31 +00:00
GDB Administrator
17c518fa1b Automatic date update in version.in 2021-03-03 00:00:35 +00:00
GDB Administrator
94f0ef5d31 Automatic date update in version.in 2021-03-02 00:00:41 +00:00
GDB Administrator
ba5745709d Automatic date update in version.in 2021-03-01 00:00:50 +00:00
GDB Administrator
3fd24a87a1 Automatic date update in version.in 2021-02-28 00:00:25 +00:00
GDB Administrator
d00f8af8c3 Automatic date update in version.in 2021-02-27 00:00:32 +00:00
GDB Administrator
04e2525cd0 Automatic date update in version.in 2021-02-26 00:00:31 +00:00
Simon Marchi
962ba37a92 gdb: relax assertion in target_mourn_inferior
As reported in PR 26861, when killing an inferior on macOS, we hit the
assert:

    ../../gdb-10.1/gdb/target.c:2149: internal-error: void target_mourn_inferior(ptid_t): Assertion `ptid == inferior_ptid' failed.

This is because darwin_nat_target::kill passes a pid-only ptid to
target_mourn_inferior, with the pid of the current inferior:

    target_mourn_inferior (ptid_t (inf->pid));

... which doesn't satisfy the assert in target_mourn_inferior:

    gdb_assert (ptid == inferior_ptid);

The reason for this assertion is that target_mourn_inferior is a
prototype shared between GDB and GDBserver, so that shared code in
gdb/nat (used in both GDB and GDBserver) can call target_mourn_inferior.
In GDB's implementation, it is likely that some targets still rely on
inferior_ptid being set to "the current thread we are working on".  So
until targets are completely decoupled from inferior_ptid (at least
their mourn_inferior implementations), we need to ensure the passed in
ptid matches inferior_ptid, to ensure the calling code called
target_mourn_inferior with the right global context.

However, I think the assert is a bit too restrictive.  The
mourn_inferior operation works on an inferior, not a specific thread.
And by the time we call mourn_inferior, the threads of the inferior
don't exist anymore, the process is gone, so it doesn't really make
sense to require inferior_ptid to point a specific thread.

I looked at all the target_ops::mourn_inferior implementations, those
that read inferior_ptid only care about the pid field, which supports
the idea that only the inferior matters.  Other implementations look at
the current inferior (call `current_inferior ()`).

I think it would make sense to change target_mourn_inferior to accept
only a pid rather than a ptid.  It would then assert that the pid is the
same as the current inferior's pid.  However, this would be a quite
involved change, so I'll keep it for later.

To fix the macOS issue immediately, I propose to relax the assert to
only compare the pids, as is done in this patch.

Another solution would obviously be to make darwin_nat_target::kill pass
inferior_ptid to target_mourn_inferior.  However, the solution I propose
is more in line with where I think we want to go (passing a pid to
target_mourn_inferior).

gdb/ChangeLog:

	PR gdb/26861
	* target.c (target_mourn_inferior): Only compare pids in
	target_mourn_inferior.

Change-Id: If2439ccc5aa67272ea16148a43c5362ef23fb2b8
2021-02-25 15:53:18 -05:00
GDB Administrator
de4e5d0886 Automatic date update in version.in 2021-02-25 00:00:34 +00:00
GDB Administrator
e94ea07548 Automatic date update in version.in 2021-02-24 00:00:31 +00:00
Simon Marchi
ad4eb5acba gdb/dwarf: create and destroy dwarf2_per_bfd's CUs-to-expand queue
As described in the log of patch "gdb/dwarf: add assertion in
maybe_queue_comp_unit", it would happen that a call to
maybe_queue_comp_unit would enqueue a CU in the to-expand queue while
nothing up the stack was processing the queue.  This is not desirable,
as items are then left lingering in the queue when we exit the
dwarf2/read code.  This is an inconsistent state.

The normal case of using the queue is when we go through
dw2_do_instantiate_symtab and process_queue.  As depended-on CUs are
found, they get added to the queue.  process_queue expands CUs until the
queue is empty.

To catch these cases where things are enqueued while nothing up the
stack is processing the queue, change dwarf2_per_bfd::queue to be an
optional.  The optional is instantiated in dwarf2_queue_guard, just
before where we call process_queue.  In the dwarf2_queue_guard
destructor, the optional gets reset.  Therefore, the queue object is
instantiated only when something up the stack is handling it.  If
another entry point tries to enqueue a CU for expansion, an assertion
will fail and we know we have something to fix.

dwarf2_queue_guard sounds like the good place for this, as it's
currently responsible for making sure the queue gets cleared if we exit
due to an error.

This also allows asserting that when age_comp_units or remove_all_cus
run, the queue is not instantiated, and gives us one more level of
assurance that we won't free the DIEs of a CU that is in the
CUs-to-expand queue.

gdb/ChangeLog:

	PR gdb/26828
	* dwarf2/read.c (dwarf2_queue_guard) <dwarf2_queue_guard>:
	Instantiate queue.
	(~dwarf2_queue_guard): Clear queue.
	(queue_comp_unit): Assert that queue is
	instantiated.
	(process_queue): Adjust.
	* dwarf2/read.h (struct dwarf2_per_bfd) <queue>: Make optional.

Change-Id: I8fe3d77845bb4ad3d309eac906acebe79d9f0a9d
2021-02-23 13:48:19 -05:00
Simon Marchi
1c8a25b683 gdb/dwarf: don't enqueue CU in maybe_queue_comp_unit if already expanded
The previous commit log described how items could be left lingering in
the dwarf2_per_bfd::queue and how that could cause trouble.

This patch fixes the issue by changing maybe_queue_comp_unit so that it
doesn't put a CU in the to-expand queue if that CU is already expanded.
This will make it so that when dwarf2_fetch_die_type_sect_off calls
follow_die_offset and maybe_queue_comp_unit, it won't enqueue the target
CU, because it will see the CU is already expanded.

This assumes that if a CU is dwarf2_fetch_die_type_sect_off's target CU,
it will have previously been expanded.  I think it is the case, but I
can't be 100% sure.  If that's not true, the assertions added in the
following patch will catch it, and it means we'll have to re-think a bit
more how things work (it wouldn't be well handled at all today anyway).

This fixes something else in maybe_queue_comp_unit that looks wrong.
Imagine the DIEs of a CU are loaded in memory, but that CU is not
expanded.  In that case, maybe_queue_comp_unit will use this early
return:

  /* If the compilation unit is already loaded, just mark it as
     used.  */
  dwarf2_cu *cu = per_objfile->get_cu (per_cu);
  if (cu != nullptr)
    {
      cu->last_used = 0;
      return 0;
    }

... so the CU won't be queued for expansion.  Whether the DIEs of a CU
are loaded in memory and whether that CU is expanded are two orthogonal
things, but that function appears to mix them.  So, move the queuing
above that check / early return, so that if the CU's DIEs are loaded in
memory but the CU is not expanded yet, it gets enqueued.

I tried to improve maybe_queue_comp_unit's documentation to clarify what
the return value means.  By clarifying this, I noticed that two callers
(follow_die_offset and follow_die_sig_1) access the CU's DIEs after
calling maybe_queue_comp_unit, only relying on maybe_queue_comp_unit's
return value to tell whether DIEs need to be loaded first or not.  As
explained in the new comment, this is problematic:
maybe_queue_comp_unit's return value doesn't tell whether DIEs are
currently loaded, it means whether maybe_queue_comp_unit requires the
caller to load them.  If the CU is already expanded but the DIEs to have
been freed, maybe_queue_comp_unit returns 0, meaning "I don't need you
to load the DIEs".  So if these two functions (follow_die_offset and
follow_die_sig_1) need to access the DIEs in any case, for their own
usage, they should make sure to load them if they are not loaded
already.  I therefore added an extra check to the condition they use,
making it so they will always load the DIEs if they aren't already.

From what I found, other callers don't care for the CU's DIEs, they call
maybe_queue_comp_unit to ensure the CU gets expanded eventually, but
don't care for it after that.

gdb/ChangeLog:

	PR gdb/26828
	* dwarf2/read.c (maybe_queue_comp_unit): Check if CU is expanded
	to decide whether or not to enqueue it for expansion.
	(follow_die_offset, follow_die_sig_1): Ensure we load the DIEs
	after calling maybe_queue_comp_unit.

Change-Id: Id98c6b60669f4b4b21b9be16d0518fc62bdf686a
2021-02-23 13:45:51 -05:00
GDB Administrator
aa6592f515 Automatic date update in version.in 2021-02-23 00:00:26 +00:00
Simon Marchi
2907db7e77 gdb: push target earlier in procfs_target::attach (PR 27435)
Since this is a GDB 9 -> 10 regression, I would like to push it to
gdb-10-branch.

This is a follow-up to:

  https://sourceware.org/pipermail/gdb-patches/2021-February/176202.html

This patch fixes a segfault seen when attaching to a process on Solaris.
The steps leading to the segfault are:

 - procfs_target::attach calls do_attach, at this point the inferior's
   process slot in the target stack is empty.
 - do_attach adds a thread with `add_thread (&the_procfs_target, ptid)`
 - in add_thread_silent, the passed target (&the_procfs_target) is
   passed to find_inferior_ptid
 - find_inferior_ptid returns nullptr, as there is no inferior with this
   ptid that has &the_procfs_target as its process target
 - the nullptr `inf` is passed to find_thread_ptid, which dereferences
   it, causing a segfault
 - back in procfs_target::attach, after do_attach, we push the
   the_procfs_target on the inferior's target stack, although we never
   reach this because the segfault happens before.

To fix this, I think we need to do the same as is done in
inf_ptrace_target::attach: push the target early and unpush it in case
the attach fails (and keep it if the attach succeeds).

Implement it by moving target_unpush_up to target.h, so it can be
re-used here.  Make procfs_target::attach use it.  Note that just like
is mentioned in inf_ptrace_target::attach, we should push the target
before calling target_pid_to_str, so that calling target_pid_to_str ends
up in procfs_target::pid_to_str.

Tested by trying to attach on a process on gcc211 on the gcc compile
farm.

gdb/ChangeLog:

	PR gdb/27435
	* inf-ptrace.c (struct target_unpusher): Move to target.h.
	(target_unpush_up): Likewise.
	* procfs.c (procfs_target::attach): Push target early.  Use
	target_unpush_up to unpush target in case of error.
	* target.h (struct target_unpusher): Move here.
	(target_unpush_up): Likewise.

Change-Id: I88aff8b20204e1ca1d792e27ac6bc34fc1aa0d52
2021-02-22 11:43:40 -05:00
GDB Administrator
44da9f63e1 Automatic date update in version.in 2021-02-22 00:00:29 +00:00
GDB Administrator
4271e70d39 Automatic date update in version.in 2021-02-21 00:00:26 +00:00
GDB Administrator
3b192a4ff1 Automatic date update in version.in 2021-02-20 00:00:33 +00:00
GDB Administrator
d45dd78e4c Automatic date update in version.in 2021-02-19 00:00:32 +00:00
GDB Administrator
2c47dea327 Automatic date update in version.in 2021-02-18 00:00:54 +00:00
GDB Administrator
cf877e6b71 Automatic date update in version.in 2021-02-17 00:00:32 +00:00
GDB Administrator
5102c507de Automatic date update in version.in 2021-02-16 00:00:31 +00:00
GDB Administrator
0783554565 Automatic date update in version.in 2021-02-15 00:00:23 +00:00
GDB Administrator
fec94df9b5 Automatic date update in version.in 2021-02-14 00:00:23 +00:00
GDB Administrator
924c60ee7c Automatic date update in version.in 2021-02-13 00:00:23 +00:00
GDB Administrator
aa20553024 Automatic date update in version.in 2021-02-12 00:00:33 +00:00
GDB Administrator
548cc50426 Automatic date update in version.in 2021-02-11 00:00:26 +00:00
GDB Administrator
4afc066f0a Automatic date update in version.in 2021-02-10 00:00:39 +00:00
Shahab Vahedi
15e1376fea arc: Fix gcc-4.8 compilation failure for arc.c
Building an arc target:

$ configulre --target=arc-elf32                \
             --enable-targets=arc-linux-uclibc \
	     ...

On a system with gcc-4.8 (CentOS 7.x), fails with:
--------8<---------
../../gdb/arch/arc.c:117:43:   required from here
/usr/include/c++/4.8.2/bits/hashtable_policy.h:195:39: error: no matching
function for call to 'std::pair<const arc_arch_features, const
std::unique_ptr<target_desc, target_desc_deleter> >::pair(const
arc_arch_features&, target_desc*&)'
  : _M_v(std::forward<_Args>(__args)...) { }
                                       ^
/usr/include/c++/4.8.2/bits/hashtable_policy.h:195:39: note: candidates are:
In file included from /usr/include/c++/4.8.2/utility:70:0,
                 from /usr/include/c++/4.8.2/tuple:38,
                 from /usr/include/c++/4.8.2/functional:55,
                 from ../../gdb/../gdbsupport/ptid.h:35,
                 from ../../gdb/../gdbsupport/common-defs.h:123,
                 from ../../gdb/arch/arc.c:19:
/usr/include/c++/4.8.2/bits/stl_pair.h:206:9: note: template<class ...
_Args1, long unsigned int ..._Indexes1, class ... _Args2, long unsigned int
..._Indexes2> std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&,
std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>,
std::_Index_tuple<_Indexes2 ...>)
         pair(tuple<_Args1...>&, tuple<_Args2...>&,
         ^
-------->8---------

The corresponding line in arc.c must use an explicit ctor:
--------8<---------
 arc_lookup_target_description (...)
 {

   /* Add the newly created target description to the repertoire.  */
-  arc_tdesc_cache.emplace (features, tdesc);
+  arc_tdesc_cache.emplace (features, target_desc_up (tdesc));

   return tdesc;
 }
-------->8---------
See "PR gcc/96537" for more details.

Last but not least, this problem has originally been investigated
by Tom de Vries for RISCV targets (see 38f8aa06d9).

gdb/ChangeLog:

	PR build/27385
	* arch/arc.c (arc_lookup_target_description): Use
	target_desc_up() ctor explicitly.
2021-02-09 18:38:35 +01:00
GDB Administrator
7d375ca308 Automatic date update in version.in 2021-02-09 00:00:35 +00:00
Shahab Vahedi
d8979e81fd gdb: Do not interrupt atomic sequences for ARC
When stepping over thread-lock related codes (in uClibc), the inferior process
gets stuck and never manages to enter the critical section:

------8<-------
 1 size_t fwrite(const void * __restrict ptr, size_t size,
 2               size_t nmemb, register FILE * __restrict stream)
 3 {
 4     size_t retval;
 5     __STDIO_AUTO_THREADLOCK_VAR;
 6
 7 >   __STDIO_AUTO_THREADLOCK(stream);
 8
 9     retval = fwrite_unlocked(ptr, size, nmemb, stream);
10
11     __STDIO_AUTO_THREADUNLOCK(stream);
12
13     return retval;
14 }
------>8-------

Here, we are at line 7.  Using the "next" command leads no where.
However, setting a breakpoint on line 9 and issuing "continue" works.

Looking at the assembly instructions reveals that we're dealing with the
critical section entry code [1] that should never be interrupted, in this
case by the debugger's implicit breakpoints:

------8<-------
  ...
1 add_s   r0,r13,0x38
2 mov_s   r3,1
3 llock   r2,[r0]        <-.
4 brne.nt r2,0,14     --.  |
5 scond   r3,[r0]       |  |
6 bne     -10         --|--'
7 brne_s  r2,0,84     <-'
  ...
------>8-------

Lines 3 until 5 (inclusive) are supposed to be executed atomically.
Therefore, GDB should never (implicitly) insert a breakpoint on lines
4 and 5, else the program will try to acquire the lock again by jumping
back to line 3 and gets stuck in an infinite loop.

The solution is to make GDB aware of these patterns so it inserts
breakpoints after the sequence -- line 6 in this example.

[1]
https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libc/sysdeps/linux/arc/bits/atomic.h#n46
------8<-------
  ({									\
	__typeof(oldval) prev;						\
									\
	__asm__ __volatile__(						\
	"1:	llock   %0, [%1]	\n"				\
	"	brne    %0, %2, 2f	\n"				\
	"	scond   %3, [%1]	\n"				\
	"	bnz     1b		\n"				\
	"2:				\n"				\
	: "=&r"(prev)							\
	: "r"(mem), "ir"(oldval),					\
	  "r"(newval) /* can't be "ir". scond can't take limm for "b" */\
	: "cc", "memory");						\
									\
	prev;								\
  })
------>8-------
"llock" (Load Locked) loads the 32-bit word pointed by the source
operand.  If the load is completed without any interruption or
exception, the physical address is remembered, in Lock Physical Address
(LPA), and the Lock Flag (LF) is set to 1.  LF is a non-architecturally
visible flag and is cleared whenever an interrupt or exception takes
place.  LF is also cleared (atomically) whenever another process writes
to the LPA.

"scond" (Store Conditional) will write to the destination address if
and only if the LF is set to 1.  When finished, with or without a write,
it atomically copies the LF value to ZF (Zero Flag).

These two instructions together provide the mechanism for entering a
critical section.  The code snippet above comes from uClibc:
-----------------------

v3 (after Tom's remarks[2]):
 handle_atomic_sequence()
  - no need to initialize the std::vector with "{}"
  - fix typo in comments: "conditial" -> "conditional"
  - add braces to the body of "if" condition because of the comment line
 arc_linux_software_single_step()
  - make the performance slightly more efficient by moving a few
    variables after the likely "return" point.

v2 (after Simon's remarks[3]):
- handle_atomic_sequence() gets a copy of an instruction instead of
  a reference.
- handle_atomic_sequence() asserts if the given instruction is an llock.

[2]
https://sourceware.org/pipermail/gdb-patches/2021-February/175805.html

[3]
https://sourceware.org/pipermail/gdb-patches/2021-January/175487.html

gdb/ChangeLog:

	PR tdep/27369
	* arc-linux-tdep.c (handle_atomic_sequence): New.
	(arc_linux_software_single_step): Call handle_atomic_sequence().
2021-02-08 13:11:44 +01:00
GDB Administrator
770b89e3aa Automatic date update in version.in 2021-02-08 00:00:21 +00:00
GDB Administrator
be60078888 Automatic date update in version.in 2021-02-07 00:00:22 +00:00
GDB Administrator
2ad61d8c29 Automatic date update in version.in 2021-02-06 00:00:24 +00:00
Tom de Vries
a1cf3cf356 [gdb/breakpoints] Handle glibc with debuginfo in create_exception_master_breakpoint
The test-case nextoverthrow.exp is failing on targets with unstripped libc.

This is a regression since commit 1940319c0e "[gdb] Fix internal-error in
process_event_stop_test".

The problem is that this code in create_exception_master_breakpoint:
...
      for (objfile *sepdebug = obj->separate_debug_objfile;
      	   sepdebug != nullptr; sepdebug = sepdebug->separate_debug_objfile)
        if (create_exception_master_breakpoint_hook (sepdebug))
...
iterates over all the separate debug object files, but fails to handle the
case that obj itself has the debug info we're looking for.

Fix this by using the separate_debug_objfiles () range instead, which does
iterate both over obj and the obj->separate_debug_objfile chain.

Tested on x86_64-linux.

gdb/ChangeLog:

2021-02-05  Tom de Vries  <tdevries@suse.de>

	PR breakpoints/27330
	* breakpoint.c (create_exception_master_breakpoint): Handle case that
	glibc object file has debug info.
2021-02-05 20:54:39 +01:00
GDB Administrator
e1a808d134 Automatic date update in version.in 2021-02-05 00:00:28 +00:00
GDB Administrator
e1591e85dc Automatic date update in version.in 2021-02-04 00:00:22 +00:00
Simon Marchi
2da8a05a92 gdb/testsuite: add test for .debug_{rng,loc}lists section without offset array
It is possible for the tables in the .debug_{rng,loc}lists sections to
not have an array of offsets.  In that case, the offset_entry_count
field of the header is 0.  The forms DW_FORM_{rng,loc}listx (reference
by index) can't be used with that table.  Instead, the
DW_FORM_sec_offset form, which references a {rng,loc}list by direct
offset in the section, must be used.  From what I saw, this is what GCC
currently produces.

Add tests for this case.  I didn't see any bug related to this, I just
think that it would be nice to have coverage for this. A new
`-with-offset-array` option is added to the `table` procs, used when
generating {rng,loc}lists, to decide whether to generate the offset
array.

gdb/testsuite/ChangeLog:

	* lib/dwarf.exp (rnglists): Add -no-offset-array option to
	table proc.
	* gdb.dwarf2/rnglists-sec-offset.exp: Add test for
	.debug_rnglists table without offset array.
	* gdb.dwarf2/loclists-sec-offset.exp: Add test for
	.debug_loclists table without offset array.

Change-Id: I8e34a7bf68c9682215ffbbf66600da5b7db91ef7
2021-02-03 10:32:43 -05:00
Simon Marchi
c974ecf55d gdb/testsuite: add .debug_loclists tests
Add tests for the various issues fixed in the previous patches.

Add a new "loclists" procedure to the DWARF assembler, to allow
generating .debug_loclists sections.

gdb/testsuite/ChangeLog:

	PR gdb/26813
	* lib/dwarf.exp (_handle_DW_FORM): Handle DW_FORM_loclistx.
	(loclists): New proc.
	* gdb.dwarf2/loclists-multiple-cus.c: New.
	* gdb.dwarf2/loclists-multiple-cus.exp: New.
	* gdb.dwarf2/loclists-sec-offset.c: New.
	* gdb.dwarf2/loclists-sec-offset.exp: New.

Change-Id: I209bcb2a9482762ae943e518998d1f7761f76928
2021-02-03 10:31:47 -05:00
Simon Marchi
9b92ac3564 gdb/testsuite: DWARF assembler: add context parameters to _location
The _location proc is used to assemble a location description.  It needs
to know some contextual information:

- size of an address
- size of an offset (into another DWARF section)
- DWARF version

It currently get all this directly from global variables holding the
compilation unit information.  This is fine because as of now, all
location descriptions are generated in the context of creating a
compilation unit.  However, a subsequent patch will generate location
descriptions while generating a .debug_loclists section.  _location
should therefore no longer rely on the current compilation unit's
properties.

Change it to accept these values as parameters instead of accessing the
values for the CU.

No functional changes intended.

gdb/testsuite/ChangeLog:

	* lib/dwarf.exp (_location): Add parameters.
	(_handle_DW_FORM): Adjust.

Change-Id: Ib94981979c83ffbebac838081d645ad71c221637
2021-02-03 10:01:18 -05:00
Simon Marchi
908d9586a6 gdb/testsuite: add .debug_rnglists tests
Add tests for the various issues fixed in the previous patches.

Add a new "rnglists" procedure to the DWARF assembler, to allow
generating .debug_rnglists sections.  A trivial change is required to
support the DWARF 5 CU header layout.

gdb/testsuite/ChangeLog:

	PR gdb/26813
	* lib/dwarf.exp (_handle_DW_FORM): Handle DW_FORM_rnglistx.
	(cu): Generate header for DWARF 5.
	(rnglists): New proc.
	* gdb.dwarf2/rnglists-multiple-cus.exp: New.
	* gdb.dwarf2/rnglists-sec-offset.exp: New.

Change-Id: I5b297e59c370c60cf671dec19796a6c3b9a9f632
2021-02-03 10:01:12 -05:00
Simon Marchi
1211342072 gdb/dwarf: read correct rnglist/loclist header in read_{rng,loc}list_index
When loading the binary from PR 26813 in GDB, we get:

    DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array [in module /home/simark/build/binutils-gdb/gdb/MagicPurse]

... and the symbols fail to load.

In read_rnglist_index and read_loclist_index, we read the header
(documented in sections 7.28 and 7.29 of DWARF 5) of the CU's
contribution to the .debug_rnglists / .debug_loclists sections to
validate that the index we want to read makes sense.  However, we always
read the header at the beginning of the section, rather than the header
for the contribution from which we want to read the index.

To illustrate, here's what the binary from PR 26813 contains.  There are
two compile units:

0x0000000c: DW_TAG_compile_unit 1
              DW_AT_ranges [DW_FORM_rnglistx]: 0x0
              DW_AT_rnglists_base [DW_FORM_sec_offset]: 0xC

0x00003ec9: DW_TAG_compile_unit 2
              DW_AT_ranges [DW_FORM_rnglistx]: 0xB
              DW_AT_rnglists_base [DW_FORM_sec_offset]: 0x85

The layout of the .debug_rnglists is the following:

    [0x00, 0x0B]: header for CU 1's contribution
    [0x0C, 0x0F]: list of offsets for CU 1 (1 element)
    [0x10, 0x78]: range lists data for CU 1

    [0x79, 0x84]: header for CU 2's contribution
    [0x85, 0xB4]: list of offsets for CU 2 (12 elements)
    [0xB5, 0xBD7]: range lists data for CU 2

The DW_AT_rnglists_base attrbute points to the beginning of the list of
offsets for that CU, relative to the start of the .debug_rnglists
section.  That's right after the header for that contribution.

When we try to read the DW_AT_ranges attribute for CU 2,
read_rnglist_index reads the header for CU 1 instead of the one for CU
2.  Since there's only one element in CU 1's offset list, it believes
(wrongfully) that the index 0xB is out of range.

Fix it by reading the header just before where DW_AT_rnglists_base
points to.  With this patch, I am able to load GDB built with clang-11
and -gdwarf-5 in itself, with and without -readnow.

gdb/ChangeLog:

	PR gdb/26813
	* dwarf2/read.c (read_loclists_rnglists_header): Add
	header_offset parameter and use it.
	(read_loclist_index): Read header of the current contribution,
	not the one at the beginning of the section.
	(read_rnglist_index): Likewise.

Change-Id: Ie53ff8251af8c1556f0a83a31aa8572044b79e3d
2021-02-03 10:00:48 -05:00
Simon Marchi
21ef610906 gdb/dwarf: add missing bound check to read_loclist_index
read_rnglist_index has a bound check to make sure that we don't go past
the end of the section while reading the offset, but read_loclist_index
doesn't.  Add it to read_loclist_index.

gdb/ChangeLog:

	* dwarf2/read.c (read_loclist_index): Add bound check for the end
	of the offset.

Change-Id: Ic4b55c88860fdc3e007740949c78ec84cdb4da60
2021-02-03 09:52:42 -05:00
Simon Marchi
39658ce654 gdb/dwarf: fix bound check in read_rnglist_index
I think this check in read_rnglist_index is wrong:

      /* Validate that reading won't go beyond the end of the section.  */
      if (start_offset + cu->header.offset_size > rnglist_base + section->size)
        error (_("Reading DW_FORM_rnglistx index beyond end of"
                 ".debug_rnglists section [in module %s]"),
               objfile_name (objfile));

The addition `rnglist_base + section->size` doesn't make sense.
rnglist_base is an offset into `section`, so it doesn't make sense to
add it to `section`'s size.  `start_offset` also is an offset into
`section`, so we should just compare it to just `section->size`.

gdb/ChangeLog:

	* dwarf2/read.c (read_rnglist_index): Fix bound check.

Change-Id: If0ff7c73f4f80f79aac447518f4e8f131f2db8f2
2021-02-03 09:52:04 -05:00
Simon Marchi
767fbfe95e gdb/dwarf: change read_loclist_index complaints into errors
Unlike read_rnglists_index, read_loclist_index uses complaints when it
detects an inconsistency (a DW_FORM_loclistx value without a
.debug_loclists section or an offset outside of the section).  I really
think they should be errors, since there's no point in continuing if
this situation happens, we will likely segfault or read garbage.

gdb/ChangeLog:

	* dwarf2/read.c (read_loclist_index): Change complaints into
	errors.

Change-Id: Ic3a1cf6e682d47cb6e739dd76fd7ca5be2637e10
2021-02-03 09:51:49 -05:00
GDB Administrator
288ff897b1 Automatic date update in version.in 2021-02-03 00:00:17 +00:00
GDB Administrator
9d21b05676 Automatic date update in version.in 2021-02-02 00:00:23 +00:00
GDB Administrator
83d5d47a5a Automatic date update in version.in 2021-02-01 00:00:24 +00:00
GDB Administrator
93219218fd Automatic date update in version.in 2021-01-31 00:00:32 +00:00
GDB Administrator
7ab9b78176 Automatic date update in version.in 2021-01-30 00:00:20 +00:00
GDB Administrator
a32952edde Automatic date update in version.in 2021-01-29 00:00:17 +00:00
GDB Administrator
1c66b95070 Automatic date update in version.in 2021-01-28 00:00:24 +00:00
GDB Administrator
d459c23b8f Automatic date update in version.in 2021-01-27 00:00:24 +00:00
GDB Administrator
1cdf95e6f1 Automatic date update in version.in 2021-01-26 00:00:24 +00:00
GDB Administrator
6b6b2d104b Automatic date update in version.in 2021-01-25 00:00:25 +00:00
GDB Administrator
7f6d881f34 Automatic date update in version.in 2021-01-24 00:00:20 +00:00
GDB Administrator
b0b98f533b Automatic date update in version.in 2021-01-23 00:00:23 +00:00
GDB Administrator
4d5f61fa3b Automatic date update in version.in 2021-01-22 00:00:30 +00:00
GDB Administrator
345fde490c Automatic date update in version.in 2021-01-21 00:00:41 +00:00
GDB Administrator
b4bd1a9565 Automatic date update in version.in 2021-01-20 00:00:37 +00:00
GDB Administrator
b9e813d879 Automatic date update in version.in 2021-01-19 00:00:43 +00:00
GDB Administrator
0b9cf185f6 Automatic date update in version.in 2021-01-18 00:00:30 +00:00
GDB Administrator
09bc0e8c72 Automatic date update in version.in 2021-01-17 00:00:26 +00:00
Eduard-Mihai Burtescu
f42f69f6f3 libiberty: Support the new ("v0") mangling scheme in rust-demangle
This is the libiberty (mainly for binutils/gdb) counterpart of
https://github.com/alexcrichton/rustc-demangle/pull/23.

Relevant links for the new Rust mangling scheme (aka "v0"):
* Rust RFC: https://github.com/rust-lang/rfcs/pull/2603
* tracking issue: https://github.com/rust-lang/rust/issues/60705
* implementation: https://github.com/rust-lang/rust/pull/57967

This implementation includes full support for UTF-8 identifiers
via punycode, so I've included a testcase for that as well.

libiberty/ChangeLog
2021-01-16  Eduard-Mihai Burtescu  <eddyb@lyken.rs>

	* rust-demangle.c (struct rust_demangler): Add
	skipping_printing and bound_lifetime_depth fields.
	(eat): Add (v0-only).
	(parse_integer_62): Add (v0-only).
	(parse_opt_integer_62): Add (v0-only).
	(parse_disambiguator): Add (v0-only).
	(struct rust_mangled_ident): Add punycode{,_len} fields.
	(parse_ident): Support v0 identifiers.
	(print_str): Respect skipping_printing.
	(print_uint64): Add (v0-only).
	(print_uint64_hex): Add (v0-only).
	(print_ident): Respect skipping_printing,
	Support v0 identifiers.
	(print_lifetime_from_index): Add (v0-only).
	(demangle_binder): Add (v0-only).
	(demangle_path): Add (v0-only).
	(demangle_generic_arg): Add (v0-only).
	(demangle_type): Add (v0-only).
	(demangle_path_maybe_open_generics): Add (v0-only).
	(demangle_dyn_trait): Add (v0-only).
	(demangle_const): Add (v0-only).
	(demangle_const_uint): Add (v0-only).
	(basic_type): Add (v0-only).
	(rust_demangle_callback): Support v0 symbols.
	* testsuite/rust-demangle-expected: Add v0 testcases.
2021-01-16 10:25:55 -07:00
GDB Administrator
a6006e11b4 Automatic date update in version.in 2021-01-16 00:00:29 +00:00
GDB Administrator
43626e8c2c Automatic date update in version.in 2021-01-15 00:00:33 +00:00
GDB Administrator
944a82cd87 Automatic date update in version.in 2021-01-14 00:00:31 +00:00
GDB Administrator
81c1122fe7 Automatic date update in version.in 2021-01-13 00:00:25 +00:00
GDB Administrator
4549169861 Automatic date update in version.in 2021-01-12 00:00:22 +00:00
GDB Administrator
d40664e961 Automatic date update in version.in 2021-01-11 00:00:18 +00:00
GDB Administrator
435bbaa6b7 Automatic date update in version.in 2021-01-10 00:00:21 +00:00
GDB Administrator
126cd362c4 Automatic date update in version.in 2021-01-09 00:00:18 +00:00
Tom de Vries
360ecc5313 [gdb] Fix internal-error in process_event_stop_test
The function create_exception_master_breakpoint in gdb/breakpoint.c attempts
to set a master exception breakpoint in each objfile.  It tries this using
a libgcc/unwind probe, and if that fails then using the
_Unwind_DebugHook symbol:
...
   for (objfile *objfile : current_program_space->objfiles ())
     {
        /* Try using probes.  */
        if (/* successful */)
          continue;

        /* Try using _Unwind_DebugHook */
     }
...

The preference scheme works ok both if the objfile has debug info, and if it's
stripped.

But it doesn't work when the objfile has a .gnu_debuglink to a .debug file
(and the .debug file is present).  What happens is that:
- we first encounter objfile libgcc.debug
- we try using probes, and this fails
- so we try _Unwind_DebugHook, which succeeds
- next we encounter objfile libgcc
- we try using probes, and this succeeds.
So, we end up with a master exception breakpoint in both libgcc (using probes)
and libgcc.debug (using _Unwind_DebugHook).

This eventually causes:
...
(gdb) PASS: gdb.cp/nextoverthrow.exp: post-check - next over a throw 3
next^M
src/gdb/infrun.c:6384: internal-error: \
  void process_event_stop_test(execution_control_state*): \
  Assertion `ecs->event_thread->control.exception_resume_breakpoint != NULL' \
  failed.^M
A problem internal to GDB has been detected,^M
further debugging may prove unreliable.^M
Quit this debugging session? (y or n) FAIL: gdb.cp/nextoverthrow.exp: next
past catch (GDB internal error)
...

To trigger this internal-error, we need to use gcc-10 or later to compile the
test-case, such that it contains the fix for gcc PR97774 - "Incorrect line
info for try/catch".

Fix this by only trying to install the master exception breakpoint in
libgcc.debug using the _Unwind_DebugHook method, if the install using probes
in libgcc failed.

Tested on x86_64-linux.

gdb/ChangeLog:

2021-01-08  Tom de Vries  <tdevries@suse.de>

	PR gdb/26881
	* breakpoint.c (create_exception_master_breakpoint_probe)
	(create_exception_master_breakpoint_hook): Factor out
	of ...
	(create_exception_master_breakpoint): ... here.  Only try to install
	the master exception breakpoint in objfile.debug using the
	_Unwind_DebugHook method, if the install using probes in objfile
	failed.
2021-01-08 11:58:41 +01:00
GDB Administrator
dee26f89a8 Automatic date update in version.in 2021-01-08 00:00:29 +00:00
Pedro Alves
f498adf03f [gdb/remote] Fix invalid pointer in remote_async_serial_handler
On rare occasions, we run into this ERROR/UNRESOLVED on gdb-10-branch:
...
(gdb) PASS: gdb.multi/multi-target.exp: continue: non-stop=on: inferior 2
Remote debugging from host ::1, port 34088^M
Process outputs/gdb.multi/multi-target/multi-target created; pid = 8649^M
monitor exit^M
(gdb) Killing process(es): 8649^M
ERROR: GDB process no longer exists
GDB process exited with wait status 8627 exp14 0 0 CHILDKILLED SIGABRT SIGABRT
UNRESOLVED: gdb.multi/multi-target.exp: continue: non-stop=on: inferior 5
...

A trigger patch makes the crash happen all the time:
...
diff --git a/gdb/remote.c b/gdb/remote.c
index 71f814efb365..53ff8b63a1dc 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -14161,14 +14161,12 @@ remote_target::is_async_p ()
    will be able to delay notifying the client of an event until the
    point where an entire packet has been received.  */

-static serial_event_ftype remote_async_serial_handler;
-
 static void
 remote_async_serial_handler (struct serial *scb, void *context)
 {
-  /* Don't propogate error information up to the client.  Instead let
-     the client find out about the error by querying the target.  */
-  inferior_event_handler (INF_REG_EVENT);
+  remote_state *rs = (remote_state *) context;
+
+  mark_async_event_handler (rs->remote_async_inferior_event_token);
 }

 static void
...

And using -fsanitizer=address we can get a more elaborate error message:
...
==7196==ERROR: AddressSanitizer: heap-use-after-free on address \
  0x6170000bf258 at pc 0x000001481755 bp 0x7fff05b20840 sp 0x7fff05b20838
READ of size 8 at 0x6170000bf258 thread T0
    #0 0x1481754 in std::_Hashtable<gdbarch*, std::pair<gdbarch* const,
    remote_arch_state>, std::allocator<std::pair<gdbarch* const,
    remote_arch_state> >, std::__detail::_Select1st, std::equal_to<gdbarch*>,
    std::hash<gdbarch*>, std::__detail::_Mod_range_hashing,
    std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy,
    std::__detail::_Hashtable_traits<false, false, true>
    >::_M_bucket_index(unsigned long) const
    /usr/include/c++/11/bits/hashtable.h:719
    #1 0x147c8ab in std::_Hashtable<gdbarch*, std::pair<gdbarch* const,
    remote_arch_state>, std::allocator<std::pair<gdbarch* const,
    remote_arch_state> >, std::__detail::_Select1st, std::equal_to<gdbarch*>,
    std::hash<gdbarch*>, std::__detail::_Mod_range_hashing,
    std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy,
    std::__detail::_Hashtable_traits<false, false, true> >::find(gdbarch*
    const&) /usr/include/c++/11/bits/hashtable.h:1500
    #2 0x147852c in std::unordered_map<gdbarch*, remote_arch_state,
    std::hash<gdbarch*>, std::equal_to<gdbarch*>,
    std::allocator<std::pair<gdbarch* const, remote_arch_state> >
    >::find(gdbarch* const&) /usr/include/c++/11/bits/unordered_map.h:869
    #3 0x14306db in remote_state::get_remote_arch_state(gdbarch*)
    src/gdb/remote.c:1203
    #4 0x14309dc in remote_target::get_remote_state() src/gdb/remote.c:1232
    #5 0x1470c08 in remote_async_inferior_event_handler src/gdb/remote.c:14169
    #6 0xaa9f6b in check_async_event_handlers() src/gdb/async-event.c:295
    #7 0x1e93ab4 in gdb_do_one_event() src/gdbsupport/event-loop.cc:194
    #8 0x118f5f9 in start_event_loop src/gdb/main.c:356
    #9 0x118f8ed in captured_command_loop src/gdb/main.c:416
    #10 0x1192d6a in captured_main src/gdb/main.c:1253
    #11 0x1192dfa in gdb_main(captured_main_args*) src/gdb/main.c:1268
    #12 0x97b380 in main src/gdb/gdb.c:32
    #13 0x7f550c211349 in __libc_start_main ../csu/libc-start.c:308
    #14 0x97b199 in _start (build/gdb/gdb+0x97b199)

0x6170000bf258 is located 600 bytes inside of 648-byte region \
  [0x6170000bf000,0x6170000bf288)
freed by thread T0 here:
    #0 0x7f550f516a57 in operator delete(void*, unsigned long)
    (/usr/lib64/libasan.so.6+0xaea57)
    #1 0x148b1fe in extended_remote_target::~extended_remote_target()
    src/gdb/remote.c:958
    #2 0x143b483 in remote_target::close() src/gdb/remote.c:4074
    #3 0x16cb90f in target_close(target_ops*) src/gdb/target.c:3230
    #4 0x16a2635 in decref_target(target_ops*) src/gdb/target.c:557
    #5 0x16a2abb in target_stack::unpush(target_ops*) src/gdb/target.c:645
    #6 0x16d01ef in inferior::unpush_target(target_ops*)
    src/gdb/inferior.h:356
    #7 0x16a2877 in unpush_target(target_ops*) src/gdb/target.c:607
    #8 0x16a2adf in unpush_target_and_assert src/gdb/target.c:655
    #9 0x16a2c57 in pop_all_targets_at_and_above(strata) src/gdb/target.c:678
    #10 0x1442749 in remote_unpush_target src/gdb/remote.c:5522
    #11 0x1458c16 in remote_target::readchar(int) src/gdb/remote.c:9137
    #12 0x145b25b in remote_target::getpkt_or_notif_sane_1(std::vector<char,
    gdb::default_init_allocator<char, std::allocator<char> > >*, int, int,
    int*) src/gdb/remote.c:9683
    #13 0x145bc9a in remote_target::getpkt_sane(std::vector<char,
    gdb::default_init_allocator<char, std::allocator<char> > >*, int)
    src/gdb/remote.c:9790
    #14 0x145b040 in remote_target::getpkt(std::vector<char,
    gdb::default_init_allocator<char, std::allocator<char> > >*, int)
    src/gdb/remote.c:9623
    #15 0x145780b in remote_target::remote_read_bytes_1(unsigned long,
    unsigned char*, unsigned long, int, unsigned long*) src/gdb/remote.c:8860
    #16 0x145805e in remote_target::remote_read_bytes(unsigned long,
    unsigned char*, unsigned long, int, unsigned long*) src/gdb/remote.c:8987
    #17 0x146113a in remote_target::xfer_partial(target_object, char const*,
    unsigned char*, unsigned char const*, unsigned long, unsigned long,
    unsigned long*) src/gdb/remote.c:10987
    #18 0x16a4004 in raw_memory_xfer_partial(target_ops*, unsigned char*,
    unsigned char const*, unsigned long, long, unsigned long*)
    src/gdb/target.c:918
    #19 0x16a4fcf in target_xfer_partial(target_ops*, target_object, char
    const*, unsigned char*, unsigned char const*, unsigned long, unsigned
    long, unsigned long*) src/gdb/target.c:1156
    #20 0x16a5d65 in target_read_partial src/gdb/target.c:1387
    #21 0x16a5f19 in target_read(target_ops*, target_object, char const*,
    unsigned char*, unsigned long, long) src/gdb/target.c:1427
    #22 0x16a5666 in target_read_raw_memory(unsigned long, unsigned char*,
    long) src/gdb/target.c:1260
    #23 0xd22f2a in dcache_read_line src/gdb/dcache.c:336
    #24 0xd232b7 in dcache_peek_byte src/gdb/dcache.c:403
    #25 0xd23845 in dcache_read_memory_partial(target_ops*, dcache_struct*,
    unsigned long, unsigned char*, unsigned long, unsigned long*) src/gdb/dcache.c:484
    #26 0x16a47da in memory_xfer_partial_1 src/gdb/target.c:1041
    #27 0x16a4a1e in memory_xfer_partial src/gdb/target.c:1084
    #28 0x16a4f44 in target_xfer_partial(target_ops*, target_object,
    char const*, unsigned char*, unsigned char const*, unsigned long,
    unsigned long, unsigned long*) src/gdb/target.c:1141
    #29 0x18203d4 in read_value_memory(value*, long, int, unsigned long,
    unsigned char*, unsigned long) src/gdb/valops.c:956

previously allocated by thread T0 here:
    #0 0x7f550f515c37 in operator new(unsigned long)
    (/usr/lib64/libasan.so.6+0xadc37)
    #1 0x14429f0 in remote_target::open_1(char const*, int, int)
    src/gdb/remote.c:5562
    #2 0x14405e6 in extended_remote_target::open(char const*, int)
    src/gdb/remote.c:4907
    #3 0x16a0f3c in open_target src/gdb/target.c:242
    #4 0xc19ff5 in do_sfunc src/gdb/cli/cli-decode.c:111
    #5 0xc221db in cmd_func(cmd_list_element*, char const*, int)
    src/gdb/cli/cli-decode.c:2181
    #6 0x16feda6 in execute_command(char const*, int) src/gdb/top.c:668
    #7 0xee9dc9 in command_handler(char const*) src/gdb/event-top.c:588
    #8 0xeea6a8 in command_line_handler(std::unique_ptr<char,
    gdb::xfree_deleter<char> >&&) src/gdb/event-top.c:773
    #9 0xee8a12 in gdb_rl_callback_handler src/gdb/event-top.c:219
    #10 0x7f550f24aead in rl_callback_read_char
    (/lib64/libreadline.so.7+0x31ead)
...

The problem is here in remote_async_inferior_event_handler:
...
static void
remote_async_inferior_event_handler (gdb_client_data data)
{
  inferior_event_handler (INF_REG_EVENT);

  remote_target *remote = (remote_target *) data;
  remote_state *rs = remote->get_remote_state ();
...

The remote target (passed in the data argument) can be destroyed during the
call to inferior_event_handler.  If so, the call to remote->get_remote_state
() is done using a dangling pointer.

Fix this by increasing the reference count on the remote target before calling
inferior_event_handler, such that it won't get destroyed until right before
returning from remote_async_inferior_event_handler.

Tested on x86_64-linux.

Intended for gdb-10-branch.

The problem has stopped reproducing with the trigger patch since master commit
79952e6963 "Make scoped_restore_current_thread's cdtors exception free
(RFC)".  We could still apply this to master though.

gdb/ChangeLog:

2021-01-07  Pedro Alves  <pedro@palves.net>
	    Simon Marchi  <simon.marchi@polymtl.ca>
	    Tom de Vries  <tdevries@suse.de>

	PR remote/26614
	* remote.c (remote_async_inferior_event_handler):  Hold a strong
	reference to the remote target while handling an event.
2021-01-07 21:41:03 +01:00
GDB Administrator
bfd46c030e Automatic date update in version.in 2021-01-07 00:00:36 +00:00
GDB Administrator
7173ab08ca Automatic date update in version.in 2021-01-06 00:00:27 +00:00
GDB Administrator
4e23936ff1 Automatic date update in version.in 2021-01-05 00:00:23 +00:00
GDB Administrator
8cb021b633 Automatic date update in version.in 2021-01-04 00:00:25 +00:00
GDB Administrator
fbbdd14038 Automatic date update in version.in 2021-01-03 00:00:20 +00:00
GDB Administrator
c504e70057 Automatic date update in version.in 2021-01-02 00:00:20 +00:00
Joel Brobecker
58eb95d632 Manual updates of copyright year range not covered by gdb/copyright.py
gdb/ChangeLog:

        * gdbarch.sh: Update copyright year range.

gdb/doc/ChangeLog:

        * gdb.texinfo, refcard.tex: Update copyright year range.

(cherry picked from commit b5b5650a49)
2021-01-01 12:24:28 +04:00
Joel Brobecker
671a7cab7d Update copyright year range in all GDB files
This commits the result of running gdb/copyright.py as per our Start
of New Year procedure...

gdb/ChangeLog

        Update copyright year range in copyright header of all GDB files.
2021-01-01 12:22:49 +04:00
Joel Brobecker
18b166df9f gdb/copyright.py: Also update sources in "gdbserver" and "gdbsupport"
This commit adjusts GDB's copyright.py script, following two past changes:
  - gdb/gdbserver/ being move to the toplevel directory;
  - gdb/common/ being renamed to gdbsupport/.

gdb/ChangeLog:

        * copyright.py (get_update_list): Add "gdbserver" and "gdbsupport"
        to the list of directories to update.

(cherry picked from commit ff7e39b613)
2021-01-01 12:20:52 +04:00
Joel Brobecker
16d2343d4e Update copyright year in version message for gdb, gdbserver and gdbreplay
gdb/ChangeLog:

        * top.c (print_gdb_version): Update copyright year.

gdbserver/ChangeLog:

        * server.cc (gdbserver_version): Update copyright year.
        * gdbreplay.cc (gdbreplay_version): Likewise.

(cherry picked from commit 2b47c078fd)
2021-01-01 12:20:19 +04:00
GDB Administrator
7e0c60bb71 Automatic date update in version.in 2021-01-01 00:00:17 +00:00
GDB Administrator
9a1097cd1c Automatic date update in version.in 2020-12-31 00:00:29 +00:00
GDB Administrator
8aca6e7bed Automatic date update in version.in 2020-12-30 00:00:22 +00:00
GDB Administrator
cc323ac189 Automatic date update in version.in 2020-12-29 00:00:19 +00:00
GDB Administrator
9fff6cda98 Automatic date update in version.in 2020-12-28 00:00:27 +00:00
GDB Administrator
ed3c75e141 Automatic date update in version.in 2020-12-27 00:00:34 +00:00
Jeanne Rasata
75b2e5a442 Fix capitalization in the GDB manual
gdb/doc/ChangeLog:
2020-12-26  Jeanne Rasata <jeanne@fsf.org>

* gdb.texinfo: Fix capitalization in many sections following CMS
style-guide rules, remove period at end of a few headings.

Copyright-paperwork-exempt: yes
2020-12-26 11:16:38 +02:00
GDB Administrator
1fdfa82c20 Automatic date update in version.in 2020-12-26 00:00:16 +00:00
GDB Administrator
b5978f7dee Automatic date update in version.in 2020-12-25 00:00:22 +00:00
GDB Administrator
065440a290 Automatic date update in version.in 2020-12-24 00:00:31 +00:00
GDB Administrator
cdb04c69ef Automatic date update in version.in 2020-12-23 00:00:23 +00:00
GDB Administrator
4c5df995cb Automatic date update in version.in 2020-12-22 00:00:31 +00:00
GDB Administrator
af40c13550 Automatic date update in version.in 2020-12-21 00:00:17 +00:00
GDB Administrator
bb94a43eac Automatic date update in version.in 2020-12-20 00:00:18 +00:00
GDB Administrator
3639436bef Automatic date update in version.in 2020-12-19 00:00:17 +00:00
GDB Administrator
ab91f7fe0f Automatic date update in version.in 2020-12-18 00:00:30 +00:00
GDB Administrator
081a480696 Automatic date update in version.in 2020-12-17 00:00:33 +00:00
GDB Administrator
20c256c726 Automatic date update in version.in 2020-12-16 00:00:30 +00:00
GDB Administrator
8b0dcfd47c Automatic date update in version.in 2020-12-15 00:00:33 +00:00
GDB Administrator
a05b378489 Automatic date update in version.in 2020-12-14 00:00:28 +00:00
GDB Administrator
125aa25b17 Automatic date update in version.in 2020-12-13 00:00:30 +00:00
GDB Administrator
8030c16ad5 Automatic date update in version.in 2020-12-12 00:00:32 +00:00
GDB Administrator
1757dad1a5 Automatic date update in version.in 2020-12-11 00:00:36 +00:00
GDB Administrator
be4fd5ee3e Automatic date update in version.in 2020-12-10 00:00:35 +00:00
Simon Marchi
969da52cb0 gdb: address review comments of previous series
I forgot to include fixes for review comments I got before pushing the
previous commits (or I pushed the wrong commits).  This one fixes it.

 - Return {} instead of false in get_discrete_low_bound and
   get_discrete_high_bound.
 - Compute high bound after confirming low bound is valid in
   get_discrete_bounds.

gdb/ChangeLog:

	* gdbtypes.c (get_discrete_low_bound, get_discrete_high_bound):
	Return {} instead of false.
	(get_discrete_bounds): Compute high bound only if low bound is
	valid.

Change-Id: I5f9a66b3672adfac9441068c899ab113ab2c331a
2020-12-09 15:36:28 -05:00
Simon Marchi
138084b248 gdb: fix value_subscript when array upper bound is not known
Since commit 7c6f271296 ("gdb: make get_discrete_bounds check for
non-constant range bounds"), subscripting  flexible array member fails:

    struct no_size
    {
      int n;
      int items[];
    };

    (gdb) p *ns
    $1 = {n = 3, items = 0x5555555592a4}
    (gdb) p ns->items[0]
    Cannot access memory at address 0xfffe555b733a0164
    (gdb) p *((int *) 0x5555555592a4)
    $2 = 101  <--- we would expect that
    (gdb) p &ns->items[0]
    $3 = (int *) 0xfffe5559ee829a24  <--- wrong address

Since the flexible array member (items) has an unspecified size, the array type
created for it in the DWARF doesn't have dimensions (this is with gcc 9.3.0,
Ubuntu 20.04):

    0x000000a4:   DW_TAG_array_type
                    DW_AT_type [DW_FORM_ref4]       (0x00000038 "int")
                    DW_AT_sibling [DW_FORM_ref4]    (0x000000b3)

    0x000000ad:     DW_TAG_subrange_type
                      DW_AT_type [DW_FORM_ref4]     (0x00000031 "long unsigned int")

This causes GDB to create a range type (TYPE_CODE_RANGE) with a defined
constant low bound (dynamic_prop with kind PROP_CONST) and an undefined
high bound (dynamic_prop with kind PROP_UNDEFINED).

value_subscript gets both bounds of that range using
get_discrete_bounds.  Before commit 7c6f271296, get_discrete_bounds
didn't check the kind of the dynamic_props and would just blindly read
them as if they were PROP_CONST.  It would return 0 for the high bound,
because we zero-initialize the range_bounds structure.  And it didn't
really matter in this case, because the returned high bound wasn't used
in the end.

Commit 7c6f271296 changed get_discrete_bounds to return a failure if
either the low or high bound is not a constant, to make sure we don't
read a dynamic prop that isn't a PROP_CONST as a PROP_CONST.  This
change made get_discrete_bounds start to return a failure for that
range, and as a result would not set *lowp and *highp.  And since
value_subscript doesn't check get_discrete_bounds' return value, it just
carries on an uses an uninitialized value for the low bound.  If
value_subscript did check the return value of get_discrete_bounds, we
would get an error message instead of a bogus value.  But it would still
be a bug, as we wouldn't be able to print the flexible array member's
elements.

Looking at value_subscript, we see that the low bound is always needed,
but the high bound is only needed if !c_style.  So, change
value_subscript to use get_discrete_low_bound and
get_discrete_high_bound separately.  This fixes the case described
above, where the low bound is known but the high bound isn't (and is not
needed).  This restores the original behavior without accessing a
dynamic_prop in a wrong way.

A test is added.  In addition to the case described above, a case with
an array member of size 0 is added, which is a GNU C extension that
existed before flexible array members were introduced.  That case
currently fails when compiled with gcc <= 8.  gcc <= 8 produces DWARF
similar to the one shown above, while gcc 9 adds a DW_AT_count of 0 in
there, which makes the high bound known.  A case where an array member
of size 0 is the only member of the struct is also added, as that was
how PR 28675 was originally reported, and it's an interesting corner
case that I think could trigger other funny bugs.

Question about the implementation: in value_subscript, I made it such
that if the low or high bound is unknown, we fall back to zero.  That
effectively makes it the same as it was before 7c6f271296.  But should
we instead error() out?

gdb/ChangeLog:

	PR 26875, PR 26901
	* gdbtypes.c (get_discrete_low_bound): Make non-static.
	(get_discrete_high_bound): Make non-static.
	* gdbtypes.h (get_discrete_low_bound): New declaration.
	(get_discrete_high_bound): New declaration.
	* valarith.c (value_subscript): Only fetch high bound if
	necessary.

gdb/testsuite/ChangeLog:

	PR 26875, PR 26901
	* gdb.base/flexible-array-member.c: New test.
	* gdb.base/flexible-array-member.exp: New test.

Change-Id: I832056f80e6c56f621f398b4780d55a3a1e299d7
2020-12-09 15:35:18 -05:00
Simon Marchi
bd1768de21 gdb: split get_discrete_bounds in two
get_discrete_bounds is not flexible for ranges (TYPE_CODE_RANGE), in the
sense that it returns true (success) only if both bounds are present and
constant values.

This is a problem for code that only needs to know the low bound and
fails unnecessarily if the high bound is unknown.

Split the function in two, get_discrete_low_bound and
get_discrete_high_bound, that both return an optional.  Provide a new
implementation of get_discrete_bounds based on the two others, so the
callers don't have to be changed.

gdb/ChangeLog:

	* gdbtypes.c (get_discrete_bounds): Implement with
	get_discrete_low_bound and get_discrete_high_bound.
	(get_discrete_low_bound): New.
	(get_discrete_high_bound): New.

Change-Id: I986b5e9c0dd969800e3fb9546af9c827d52e80d0
2020-12-09 15:31:44 -05:00
Simon Marchi
f47d1c255d gdb: make get_discrete_bounds return bool
get_discrete_bounds currently has three possible return values (see its
current doc for details).  It appears that for all callers, it would be
sufficient to have a boolean "worked" / "didn't work" return value.

Change the return type of get_discrete_bounds to bool and adjust all
callers.  Doing so simplifies the following patch.

gdb/ChangeLog:

	* gdbtypes.h (get_discrete_bounds): Return bool, adjust all
	callers.
	* gdbtypes.c (get_discrete_bounds): Return bool.

Change-Id: Ie51feee23c75f0cd7939742604282d745db59172
2020-12-09 15:23:56 -05:00
Simon Marchi
f5fca0ec15 gdb: make discrete_position return optional
Instead of returning a boolean status and returning the value through a
pointer, return an optional that does both jobs.  This helps in the
following patches, and I think it is an improvement in general.

gdb/ChangeLog:

	* ada-lang.c (ada_value_slice_from_ptr): Adjust.
	(ada_value_slice): Adjust.
	(pos_atr): Adjust.
	* gdbtypes.c (get_discrete_bounds): Adjust.
	(discrete_position): Return optional.
	* gdbtypes.h (discrete_position): Return optional.

Change-Id: I758dbd8858b296ee472ed39ec35db1dbd624a5ae
2020-12-09 14:05:48 -05:00
GDB Administrator
8d55943698 Automatic date update in version.in 2020-12-09 00:00:44 +00:00
GDB Administrator
7205c99163 Automatic date update in version.in 2020-12-08 00:00:47 +00:00
GDB Administrator
eca082c05c Automatic date update in version.in 2020-12-07 00:00:34 +00:00
Giancarlo Frix
47c4623c75 s390: Fix BC instruction breakpoint handling
This fixes a long-lived bug in the s390 port.

When trying to step over a breakpoint set on a BC (branch on condition)
instruction with displaced stepping on IBM Z, gdb would incorrectly
adjust the pc regardless of whether or not the branch was taken. Since
the branch target is an absolute address, this would cause the inferior
to jump around wildly whenever the branch was taken, either crashing it
or causing it to behave unpredictably.

It turns out that the logic to handle BC instructions correctly was in
the code, but that the enum value representing its opcode has always
been incorrect.

This patch corrects the enum value to the actual opcode, fixing the
stepping problem. The enum value is also used in the prologue analysis
code, so this also fixes a minor bug where more of the prologue would
be read than was necessary.

gdb/ChangeLog:

        PR breakpoints/27009
        * s390-tdep.h (op_bc): Correct BC opcode value.
2020-12-06 14:30:53 +04:00
GDB Administrator
bc6989cbd3 Automatic date update in version.in 2020-12-06 00:00:39 +00:00
GDB Administrator
a4245c0961 Automatic date update in version.in 2020-12-05 00:00:28 +00:00
Shahab Vahedi
4cf1920e40 Update gdb/ChangeLog to reflect the PR for a bug fix
This is just an update in the gdb/ChangeLog to reflect a newly
created PR [27015] for a bugfix commit:

abaf3df9  arc: Write correct "eret" value during register collection
2020-12-04 16:28:37 +01:00
Shahab Vahedi
abaf3df98b arc: Write correct "eret" value during register collection
In collect_register() function of arc-linux-tdep.c, the "eret"
(exception return) register value was not being reported correctly.
This patch fixes that.

Background:
When asked for the "pc" value, we have to update the "eret" register
with GDB's STOP_PC.  The "eret" instructs the kernel code where to
jump back when an instruction has stopped due to a breakpoint.  This
is how collect_register() was doing so:

--------------8<--------------
  if (regnum == gdbarch_pc_regnum (gdbarch))
    regnum = ARC_ERET_REGNUM;
  regcache->raw_collect (regnum, buf + arc_linux_core_reg_offsets[regnum]);
-------------->8--------------

Root cause:
Although this is using the correct offset (ERET register's), it is also
changing the REGNUM itself.  Therefore, raw_collect (regnum, ...) is
not reading from "pc" anymore.

v2:
- Fix a copy/paste issue as rightfully addressed by Tom [1].

[1]
https://sourceware.org/pipermail/gdb-patches/2020-November/173208.html

gdb/ChangeLog:

	* arc-linux-tdep.c (collect_register): Populate "eret" by
	"pc" value from the regcache when asked for "pc" value.
2020-12-04 11:41:47 +01:00
GDB Administrator
774f775cad Automatic date update in version.in 2020-12-04 00:00:48 +00:00
GDB Administrator
a2e9100aa8 Automatic date update in version.in 2020-12-03 00:00:34 +00:00
GDB Administrator
866f1b1c9a Automatic date update in version.in 2020-12-02 00:00:42 +00:00
GDB Administrator
2ff9a46fd6 Automatic date update in version.in 2020-12-01 00:00:48 +00:00
GDB Administrator
1429d8beb4 Automatic date update in version.in 2020-11-30 00:00:40 +00:00
Hannes Domani
815c8f80e2 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:11:38 +01:00
Hannes Domani
b03dac541f 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:53:52 +01:00
GDB Administrator
f2fb5e6f21 Automatic date update in version.in 2020-11-29 00:00:41 +00:00
GDB Administrator
9ca51a9034 Automatic date update in version.in 2020-11-28 00:00:45 +00:00
GDB Administrator
8dad16200e Automatic date update in version.in 2020-11-27 00:00:55 +00:00
GDB Administrator
2d409e3adc Automatic date update in version.in 2020-11-26 00:00:47 +00:00
GDB Administrator
fe3088f6ef Automatic date update in version.in 2020-11-25 00:00:35 +00:00
GDB Administrator
12f93c92d0 Automatic date update in version.in 2020-11-24 00:00:47 +00:00
GDB Administrator
08d79fde1a Automatic date update in version.in 2020-11-23 00:00:32 +00:00
GDB Administrator
6427533f8f Automatic date update in version.in 2020-11-22 00:00:35 +00:00
GDB Administrator
a7ca0db2a9 Automatic date update in version.in 2020-11-21 00:00:39 +00:00
GDB Administrator
68f7ee1f46 Automatic date update in version.in 2020-11-20 00:00:37 +00:00
GDB Administrator
77477f6d04 Automatic date update in version.in 2020-11-19 00:00:33 +00:00
GDB Administrator
a90a7eb266 Automatic date update in version.in 2020-11-18 00:00:36 +00:00
GDB Administrator
45c0714276 Automatic date update in version.in 2020-11-17 00:00:36 +00:00
GDB Administrator
c7409b74dd Automatic date update in version.in 2020-11-16 00:00:35 +00:00
GDB Administrator
4028013ab8 Automatic date update in version.in 2020-11-15 00:00:33 +00:00
GDB Administrator
2b8bbb9c5e Automatic date update in version.in 2020-11-14 00:00:40 +00:00
GDB Administrator
8584763bdc Automatic date update in version.in 2020-11-13 00:00:54 +00:00
GDB Administrator
7d73ecece6 Automatic date update in version.in 2020-11-12 00:00:45 +00:00
GDB Administrator
625214b4bc Automatic date update in version.in 2020-11-11 00:00:30 +00:00
GDB Administrator
44f04519db Automatic date update in version.in 2020-11-10 00:00:48 +00:00
GDB Administrator
068a9f4698 Automatic date update in version.in 2020-11-09 00:00:25 +00:00
GDB Administrator
1370d58819 Automatic date update in version.in 2020-11-08 00:00:27 +00:00
GDB Administrator
b99d8d8bfe Automatic date update in version.in 2020-11-07 00:00:37 +00:00
Romain Geissler
60714c0fc0 gdb: better static python detection in configure machinery
In python 3, itertools is a builtin module, so whether or not the
python you link against is a shared or a static one, importing it
works.

Change the import test to use ctypes which is a dynamic module in both
python 2 and 3.

gdb/ChangeLog:

	PR python/26832
	* configure: Regenerate.
	* configure.ac: Check for python modules ctypes instead of
	itertools.
2020-11-06 18:02:24 +00:00
GDB Administrator
2aec92379f Automatic date update in version.in 2020-11-06 00:00:49 +00:00
GDB Administrator
7736ed8327 Automatic date update in version.in 2020-11-05 00:00:39 +00:00
GDB Administrator
923b14f187 Automatic date update in version.in 2020-11-04 00:00:42 +00:00
GDB Administrator
b558fb22bc Automatic date update in version.in 2020-11-03 00:00:41 +00:00
GDB Administrator
8aa3beab03 Automatic date update in version.in 2020-11-02 00:00:39 +00:00
GDB Administrator
3163819a76 Automatic date update in version.in 2020-11-01 00:00:30 +00:00
GDB Administrator
4b8bc9ac85 Automatic date update in version.in 2020-10-31 00:00:31 +00:00
GDB Administrator
82c494b0d1 Automatic date update in version.in 2020-10-30 00:00:32 +00:00
GDB Administrator
805187e6cd Automatic date update in version.in 2020-10-29 00:00:41 +00:00
GDB Administrator
f3fb4a77f2 Automatic date update in version.in 2020-10-28 00:00:35 +00:00
GDB Administrator
32e63cccb8 Automatic date update in version.in 2020-10-27 00:00:27 +00:00
GDB Administrator
eac45cf79a Automatic date update in version.in 2020-10-26 00:00:27 +00:00
GDB Administrator
e8f9da19bc Automatic date update in version.in 2020-10-25 00:00:31 +00:00
Joel Brobecker
4f2b5ace6f Bump GDB version number to 10.1.90.DATE-git.
gdb/ChangeLog:

	* version.in: Set GDB version number to 10.1.90.DATE-git.

gdb/testsuite/ChangeLog:

	* gdb.base/default.exp: Change $_gdb_minor to 2.
2020-10-24 08:41:57 +04:00
Joel Brobecker
606e3fd147 Document the GDB 10.1 release in gdb/ChangeLog
gdb/ChangeLog:

	GDB 10.1 released.
2020-10-24 08:36:33 +04:00
6298 changed files with 10441 additions and 6757 deletions

View File

@@ -16,7 +16,7 @@
In releases, the date is not included in either version strings or
sonames. */
#define BFD_VERSION_DATE 20201024
#define BFD_VERSION_DATE 20210703
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@
#define REPORT_BUGS_TO @report_bugs_to@

View File

@@ -1,5 +1,5 @@
;; Emacs settings.
;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by

View File

@@ -1,3 +1,278 @@
2021-04-23 Tom Tromey <tromey@adacore.com>
PR gdb/27743:
* psymtab.c (partial_map_expand_apply): Expand outermost psymtab.
2021-04-25 Joel Brobecker <brobecker@adacore.com>
* version.in: Set GDB version number to 10.2.90.DATE-git.
2021-04-25 Joel Brobecker <brobecker@adacore.com>
GDB 10.2 released.
2021-04-25 Joel Brobecker <brobecker@adacore.com>
* version.in: Set GDB version number to 10.2.
2021-04-22 Simon Marchi <simon.marchi@polymtl.ca>
PR gdb/27757
* python/py-type.c (typy_range): Check that bounds are constant
before accessing them as such.
* guile/scm-type.c (gdbscm_type_range): Likewise.
2021-04-22 Simon Marchi <simon.marchi@polymtl.ca>
PR gdb/27757
* python/py-type.c (typy_range): Check that bounds are constant
before accessing them as such.
* guile/scm-type.c (gdbscm_type_range): Likewise.
2021-03-30 Simon Marchi <simon.marchi@polymtl.ca>
PR gdb/27541
* dwarf2/read.c (dwarf2_has_info): Don't share dwarf2_per_bfd
with objfiles using READNOW.
2021-03-12 Christian Biesinger <cbiesinger@google.com>
PR threads/27239
* cp-support.c: Use scoped_segv_handler_restore.
* event-top.c (thread_local_segv_handler): Made static.
(scoped_segv_handler_restore::scoped_segv_handler_restore):
New function.
(scoped_segv_handler_restore::~scoped_segv_handler_restore): New
function.
* event-top.h (class scoped_segv_handler_restore): New class.
(thread_local_segv_handler): Removed.
2021-03-07 Tom de Vries <tdevries@suse.de>
PR symtab/27341
* dwarf2/read.c (read_array_type): Return NULL when not being able to
construct an array type. Add assert to ensure that element_type is
not being modified.
2021-03-06 Kevin Buettner <kevinb@redhat.com>
PR build/27536
* nat/aarch64-linux-hw-point.c: Include <asm/ptrace.h> after
<sys/ptrace.h>.
2021-03-06 Kevin Buettner <kevinb@redhat.com>
PR build/27535
* nat/amd64-linux-siginfo.c: Include "gdbsupport/common-defs.h"
(which in turn includes <gnulib/config.h>) before include
of <signal.h>.
2021-03-06 Tom de Vries <tdevries@suse.de>
PR symtab/27333
* dwarf2/read.c (process_psymtab_comp_unit): Handle DW_TAG_type_unit.
2021-03-04 Simon Marchi <simon.marchi@polymtl.ca>
PR gdb/27147
* sparc-nat.h (sparc_fetch_inferior_registers): Add
process_stratum_target parameter,
sparc_store_inferior_registers): update callers.
* sparc-nat.c (sparc_fetch_inferior_registers,
sparc_store_inferior_registers): Add process_stratum_target
parameter. Switch current thread before calling
sparc_supply_gregset / sparc_collect_rwindow.
(sparc_store_inferior_registers): Likewise.
* sparc-obsd-tdep.c (sparc32obsd_supply_uthread): Add assertion.
(sparc32obsd_collect_uthread): Likewise.
* sparc-tdep.c (sparc_supply_rwindow, sparc_collect_rwindow):
Add assertion.
* sparc64-obsd-tdep.c (sparc64obsd_collect_uthread,
sparc64obsd_supply_uthread): Add assertion.
2021-02-25 Simon Marchi <simon.marchi@polymtl.ca>
PR gdb/26861
* target.c (target_mourn_inferior): Only compare pids in
target_mourn_inferior.
2021-02-23 Simon Marchi <simon.marchi@polymtl.ca>
PR gdb/26828
* dwarf2/read.c (dwarf2_queue_guard) <dwarf2_queue_guard>:
Instantiate queue.
(~dwarf2_queue_guard): Clear queue.
(queue_comp_unit): Assert that queue is
instantiated.
(process_queue): Adjust.
* dwarf2/read.h (struct dwarf2_per_bfd) <queue>: Make optional.
2021-02-23 Simon Marchi <simon.marchi@polymtl.ca>
PR gdb/26828
* dwarf2/read.c (maybe_queue_comp_unit): Check if CU is expanded
to decide whether or not to enqueue it for expansion.
(follow_die_offset, follow_die_sig_1): Ensure we load the DIEs
after calling maybe_queue_comp_unit.
2021-02-22 Simon Marchi <simon.marchi@polymtl.ca>
PR gdb/27435
* inf-ptrace.c (struct target_unpusher): Move to target.h.
(target_unpush_up): Likewise.
* procfs.c (procfs_target::attach): Push target early. Use
target_unpush_up to unpush target in case of error.
* target.h (struct target_unpusher): Move here.
(target_unpush_up): Likewise.
2021-02-09 Shahab Vahedi <shahab@synopsys.com>
PR build/27385
* arch/arc.c (arc_lookup_target_description): Use
target_desc_up() ctor explicitly.
2021-02-08 Shahab Vahedi <shahab@synopsys.com>
PR tdep/27369
* arc-linux-tdep.c (handle_atomic_sequence): New.
(arc_linux_software_single_step): Call handle_atomic_sequence().
2021-02-05 Tom de Vries <tdevries@suse.de>
PR breakpoints/27330
* breakpoint.c (create_exception_master_breakpoint): Handle case that
glibc object file has debug info.
2021-02-02 Simon Marchi <simon.marchi@efficios.com>
PR gdb/26813
* dwarf2/read.c (read_loclists_rnglists_header): Add
header_offset parameter and use it.
(read_loclist_index): Read header of the current contribution,
not the one at the beginning of the section.
(read_rnglist_index): Likewise.
2021-02-02 Simon Marchi <simon.marchi@efficios.com>
* dwarf2/read.c (read_loclist_index): Add bound check for the end
of the offset.
2021-02-02 Simon Marchi <simon.marchi@efficios.com>
* dwarf2/read.c (read_rnglist_index): Fix bound check.
2021-02-02 Simon Marchi <simon.marchi@efficios.com>
* dwarf2/read.c (read_loclist_index): Change complaints into
errors.
2021-01-08 Tom de Vries <tdevries@suse.de>
PR gdb/26881
* breakpoint.c (create_exception_master_breakpoint_probe)
(create_exception_master_breakpoint_hook): Factor out
of ...
(create_exception_master_breakpoint): ... here. Only try to install
the master exception breakpoint in objfile.debug using the
_Unwind_DebugHook method, if the install using probes in objfile
failed.
2021-01-07 Pedro Alves <pedro@palves.net>
Simon Marchi <simon.marchi@polymtl.ca>
Tom de Vries <tdevries@suse.de>
PR remote/26614
* remote.c (remote_async_inferior_event_handler): Hold a strong
reference to the remote target while handling an event.
2021-01-01 Joel Brobecker <brobecker@adacore.com>
* gdbarch.sh: Update copyright year range.
2021-01-01 Joel Brobecker <brobecker@adacore.com>
Update copyright year range in copyright header of all GDB files.
2021-01-01 Joel Brobecker <brobecker@adacore.com>
* copyright.py (get_update_list): Add "gdbserver" and "gdbsupport"
to the list of directories to update.
2021-01-01 Joel Brobecker <brobecker@adacore.com>
* top.c (print_gdb_version): Update copyright year.
2020-12-09 Simon Marchi <simon.marchi@polymtl.ca>
* gdbtypes.c (get_discrete_low_bound, get_discrete_high_bound):
Return {} instead of false.
(get_discrete_bounds): Compute high bound only if low bound is
valid.
2020-12-09 Simon Marchi <simon.marchi@efficios.com>
PR 26875, PR 26901
* gdbtypes.c (get_discrete_low_bound): Make non-static.
(get_discrete_high_bound): Make non-static.
* gdbtypes.h (get_discrete_low_bound): New declaration.
(get_discrete_high_bound): New declaration.
* valarith.c (value_subscript): Only fetch high bound if
necessary.
2020-12-09 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.c (get_discrete_bounds): Implement with
get_discrete_low_bound and get_discrete_high_bound.
(get_discrete_low_bound): New.
(get_discrete_high_bound): New.
2020-12-09 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.h (get_discrete_bounds): Return bool, adjust all
callers.
* gdbtypes.c (get_discrete_bounds): Return bool.
2020-12-09 Simon Marchi <simon.marchi@efficios.com>
* ada-lang.c (ada_value_slice_from_ptr): Adjust.
(ada_value_slice): Adjust.
(pos_atr): Adjust.
* gdbtypes.c (get_discrete_bounds): Adjust.
(discrete_position): Return optional.
* gdbtypes.h (discrete_position): Return optional.
2020-12-06 Giancarlo Frix <gfrix@rocketsoftware.com> (tiny change)
PR breakpoints/27009
* s390-tdep.h (op_bc): Correct BC opcode value.
2020-12-04 Shahab Vahedi <shahab@synopsys.com>
PR tdep/27015
* arc-linux-tdep.c (collect_register): Populate "eret" by
"pc" value from the regcache when asked for "pc" value.
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-06 Romain Geissler <romain.geissler@amadeus.com>
PR python/26832
* configure: Regenerate.
* configure.ac: Check for python modules ctypes instead of
itertools.
2020-10-24 Joel Brobecker <brobecker@adacore.com>
* version.in: Set GDB version number to 10.1.90.DATE-git.
2020-10-24 Joel Brobecker <brobecker@adacore.com>
GDB 10.1 released.
2020-10-24 Joel Brobecker <brobecker@adacore.com>
* version.in: Set GDB version number to 10.1.

View File

@@ -1,4 +1,4 @@
# Copyright (C) 1989-2020 Free Software Foundation, Inc.
# Copyright (C) 1989-2021 Free Software Foundation, Inc.
# This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1999-2020 Free Software Foundation, Inc.
/* Copyright (C) 1999-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1999-2020 Free Software Foundation, Inc.
/* Copyright (C) 1999-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2019-2020 Free Software Foundation, Inc.
/* Copyright (C) 2019-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2019-2020 Free Software Foundation, Inc.
/* Copyright (C) 2019-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for FreeBSD/aarch64.
Copyright (C) 2017-2020 Free Software Foundation, Inc.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for FreeBSD/aarch64.
Copyright (C) 2017-2020 Free Software Foundation, Inc.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* FreeBSD/aarch64 target support, prototypes.
Copyright (C) 2017-2020 Free Software Foundation, Inc.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for GNU/Linux AArch64.
Copyright (C) 2011-2020 Free Software Foundation, Inc.
Copyright (C) 2011-2021 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for GNU/Linux AArch64.
Copyright (C) 2009-2020 Free Software Foundation, Inc.
Copyright (C) 2009-2021 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* GNU/Linux on AArch64 target support, prototypes.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for Newlib AArch64.
Copyright (C) 2011-2020 Free Software Foundation, Inc.
Copyright (C) 2011-2021 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Ravenscar Aarch64 target support.
Copyright (C) 2017-2020 Free Software Foundation, Inc.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Ravenscar Aarch64 target support.
Copyright (C) 2017-2020 Free Software Foundation, Inc.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for GDB on AArch64 systems.
Copyright (C) 2009-2020 Free Software Foundation, Inc.
Copyright (C) 2009-2021 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for GDB on AArch64 systems.
Copyright (C) 2009-2020 Free Software Foundation, Inc.
Copyright (C) 2009-2021 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -83,7 +83,7 @@ m4_include([../config/ax_pthread.m4])
## From Franc,ois Pinard ##
## ----------------------------------------- ##
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@@ -1,4 +1,4 @@
# Copyright (C) 1992-2020 Free Software Foundation, Inc.
# Copyright (C) 1992-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without

View File

@@ -1,5 +1,5 @@
/* YACC parser for Ada expressions, for GDB.
Copyright (C) 1986-2020 Free Software Foundation, Inc.
Copyright (C) 1986-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Ada language support routines for GDB, the GNU debugger.
Copyright (C) 1992-2020 Free Software Foundation, Inc.
Copyright (C) 1992-2021 Free Software Foundation, Inc.
This file is part of GDB.
@@ -2097,7 +2097,7 @@ constrained_packed_array_type (struct type *type, long *elt_bits)
if ((check_typedef (index_type)->code () == TYPE_CODE_RANGE
&& is_dynamic_type (check_typedef (index_type)))
|| get_discrete_bounds (index_type, &low_bound, &high_bound) < 0)
|| !get_discrete_bounds (index_type, &low_bound, &high_bound))
low_bound = high_bound = 0;
if (high_bound < low_bound)
*elt_bits = TYPE_LENGTH (new_type) = 0;
@@ -2243,7 +2243,7 @@ value_subscript_packed (struct value *arr, int arity, struct value **ind)
LONGEST lowerbound, upperbound;
LONGEST idx;
if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
if (!get_discrete_bounds (range_type, &lowerbound, &upperbound))
{
lim_warning (_("don't know bounds of array"));
lowerbound = upperbound = 0;
@@ -2759,11 +2759,13 @@ ada_value_slice_from_ptr (struct value *array_ptr, struct type *type,
type0->dyn_prop (DYN_PROP_BYTE_STRIDE),
TYPE_FIELD_BITSIZE (type0, 0));
int base_low = ada_discrete_type_low_bound (type0->index_type ());
LONGEST base_low_pos, low_pos;
gdb::optional<LONGEST> base_low_pos, low_pos;
CORE_ADDR base;
if (!discrete_position (base_index_type, low, &low_pos)
|| !discrete_position (base_index_type, base_low, &base_low_pos))
low_pos = discrete_position (base_index_type, low);
base_low_pos = discrete_position (base_index_type, base_low);
if (!low_pos.has_value () || !base_low_pos.has_value ())
{
warning (_("unable to get positions in slice, use bounds instead"));
low_pos = low;
@@ -2771,7 +2773,7 @@ ada_value_slice_from_ptr (struct value *array_ptr, struct type *type,
}
base = value_as_address (array_ptr)
+ ((low_pos - base_low_pos)
+ ((*low_pos - *base_low_pos)
* TYPE_LENGTH (TYPE_TARGET_TYPE (type0)));
return value_at_lazy (slice_type, base);
}
@@ -2788,10 +2790,13 @@ ada_value_slice (struct value *array, int low, int high)
(NULL, TYPE_TARGET_TYPE (type), index_type,
type->dyn_prop (DYN_PROP_BYTE_STRIDE),
TYPE_FIELD_BITSIZE (type, 0));
LONGEST low_pos, high_pos;
gdb::optional<LONGEST> low_pos, high_pos;
if (!discrete_position (base_index_type, low, &low_pos)
|| !discrete_position (base_index_type, high, &high_pos))
low_pos = discrete_position (base_index_type, low);
high_pos = discrete_position (base_index_type, high);
if (!low_pos.has_value () || !high_pos.has_value ())
{
warning (_("unable to get positions in slice, use bounds instead"));
low_pos = low;
@@ -2799,7 +2804,7 @@ ada_value_slice (struct value *array, int low, int high)
}
return value_cast (slice_type,
value_slice (array, low, high_pos - low_pos + 1));
value_slice (array, low, *high_pos - *low_pos + 1));
}
/* If type is a record type in the form of a standard GNAT array
@@ -8861,15 +8866,15 @@ pos_atr (struct value *arg)
{
struct value *val = coerce_ref (arg);
struct type *type = value_type (val);
LONGEST result;
if (!discrete_type_p (type))
error (_("'POS only defined on discrete types"));
if (!discrete_position (type, value_as_long (val), &result))
gdb::optional<LONGEST> result = discrete_position (type, value_as_long (val));
if (!result.has_value ())
error (_("enumeration value is invalid: can't find 'POS"));
return result;
return *result;
}
static struct value *

View File

@@ -1,6 +1,6 @@
/* Ada language support definitions for GDB, the GNU debugger.
Copyright (C) 1992-2020 Free Software Foundation, Inc.
Copyright (C) 1992-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* FLEX lexer for Ada expressions, for GDB.
Copyright (C) 1994-2020 Free Software Foundation, Inc.
Copyright (C) 1994-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Ada language operator definitions for GDB, the GNU debugger.
Copyright (C) 1992-2020 Free Software Foundation, Inc.
Copyright (C) 1992-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1992-2020 Free Software Foundation, Inc.
/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Support for printing Ada types for GDB, the GNU debugger.
Copyright (C) 1986-2020 Free Software Foundation, Inc.
Copyright (C) 1986-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Support for printing Ada values for GDB, the GNU debugger.
Copyright (C) 1986-2020 Free Software Foundation, Inc.
Copyright (C) 1986-2021 Free Software Foundation, Inc.
This file is part of GDB.
@@ -136,7 +136,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
{
LONGEST high;
if (get_discrete_bounds (index_type, &low, &high) < 0)
if (!get_discrete_bounds (index_type, &low, &high))
len = 1;
else if (low > high)
{

View File

@@ -1,6 +1,6 @@
/* varobj support for Ada.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* addrmap.c --- implementation of address map data structure.
Copyright (C) 2007-2020 Free Software Foundation, Inc.
Copyright (C) 2007-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* addrmap.h --- interface to address map data structure.
Copyright (C) 2007-2020 Free Software Foundation, Inc.
Copyright (C) 2007-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2012-2020 Free Software Foundation, Inc.
/* Copyright (C) 2012-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Low level interface for debugging AIX 4.3+ pthreads.
Copyright (C) 1999-2020 Free Software Foundation, Inc.
Copyright (C) 1999-2021 Free Software Foundation, Inc.
Written by Nick Duffek <nsd@redhat.com>.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Shared allocation functions for GDB, the GNU debugger.
Copyright (C) 1986-2020 Free Software Foundation, Inc.
Copyright (C) 1986-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for Alpha BSD's.
Copyright (C) 2000-2020 Free Software Foundation, Inc.
Copyright (C) 2000-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code Alpha BSD's.
Copyright (C) 2000-2020 Free Software Foundation, Inc.
Copyright (C) 2000-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for Alpha BSD's.
Copyright (C) 2002-2020 Free Software Foundation, Inc.
Copyright (C) 2002-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Low level Alpha GNU/Linux interface, for GDB when running native.
Copyright (C) 2005-2020 Free Software Foundation, Inc.
Copyright (C) 2005-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Target-dependent code for GNU/Linux on Alpha.
Copyright (C) 2002-2020 Free Software Foundation, Inc.
Copyright (C) 2002-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Target-dependent mdebug code for the ALPHA architecture.
Copyright (C) 1993-2020 Free Software Foundation, Inc.
Copyright (C) 1993-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for NetBSD/alpha.
Copyright (C) 2002-2020 Free Software Foundation, Inc.
Copyright (C) 2002-2021 Free Software Foundation, Inc.
Contributed by Wasabi Systems, Inc.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for OpenBSD/alpha.
Copyright (C) 2006-2020 Free Software Foundation, Inc.
Copyright (C) 2006-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for the ALPHA architecture, for GDB, the GNU Debugger.
Copyright (C) 1993-2020 Free Software Foundation, Inc.
Copyright (C) 1993-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Common target dependent code for GDB on Alpha systems.
Copyright (C) 1993-2020 Free Software Foundation, Inc.
Copyright (C) 1993-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for AMD64 BSD's.
Copyright (C) 2003-2020 Free Software Foundation, Inc.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for modern AMD64 BSD's.
Copyright (C) 2018-2020 Free Software Foundation, Inc.
Copyright (C) 2018-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Darwin support for GDB, the GNU debugger.
Copyright (C) 1997-2020 Free Software Foundation, Inc.
Copyright (C) 1997-2021 Free Software Foundation, Inc.
Contributed by Apple Computer, Inc.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for Darwin x86-64.
Copyright (C) 2009-2020 Free Software Foundation, Inc.
Copyright (C) 2009-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for DICOS running on x86-64's, for GDB.
Copyright (C) 2009-2020 Free Software Foundation, Inc.
Copyright (C) 2009-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for FreeBSD/amd64.
Copyright (C) 2003-2020 Free Software Foundation, Inc.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for FreeBSD/amd64.
Copyright (C) 2003-2020 Free Software Foundation, Inc.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for GNU/Linux x86-64.
Copyright (C) 2001-2020 Free Software Foundation, Inc.
Copyright (C) 2001-2021 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for GNU/Linux x86-64.
Copyright (C) 2001-2020 Free Software Foundation, Inc.
Copyright (C) 2001-2021 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for GNU/Linux AMD64.
Copyright (C) 2006-2020 Free Software Foundation, Inc.
Copyright (C) 2006-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for AMD64.
Copyright (C) 2003-2020 Free Software Foundation, Inc.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for AMD64.
Copyright (C) 2003-2020 Free Software Foundation, Inc.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for NetBSD/amd64.
Copyright (C) 2003-2020 Free Software Foundation, Inc.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for NetBSD/amd64.
Copyright (C) 2003-2020 Free Software Foundation, Inc.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Native-dependent code for OpenBSD/amd64.
Copyright (C) 2003-2020 Free Software Foundation, Inc.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for OpenBSD/amd64.
Copyright (C) 2003-2020 Free Software Foundation, Inc.
Copyright (C) 2003-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for AMD64 Solaris.
Copyright (C) 2001-2020 Free Software Foundation, Inc.
Copyright (C) 2001-2021 Free Software Foundation, Inc.
Contributed by Joseph Myers, CodeSourcery, LLC.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for AMD64.
Copyright (C) 2001-2020 Free Software Foundation, Inc.
Copyright (C) 2001-2021 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.

View File

@@ -1,6 +1,6 @@
/* Target-dependent definitions for AMD64.
Copyright (C) 2001-2020 Free Software Foundation, Inc.
Copyright (C) 2001-2021 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2008-2020 Free Software Foundation, Inc.
/* Copyright (C) 2008-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2009-2020 Free Software Foundation, Inc.
/* Copyright (C) 2009-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Annotation routines for GDB.
Copyright (C) 1986-2020 Free Software Foundation, Inc.
Copyright (C) 1986-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Annotation routines for GDB.
Copyright (C) 1986-2020 Free Software Foundation, Inc.
Copyright (C) 1986-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target dependent code for GNU/Linux ARC.
Copyright 2020 Free Software Foundation, Inc.
Copyright 2020-2021 Free Software Foundation, Inc.
This file is part of GDB.
@@ -155,6 +155,78 @@ arc_linux_sw_breakpoint_from_kind (struct gdbarch *gdbarch,
: arc_linux_trap_s_le);
}
/* Check for an atomic sequence of instructions beginning with an
LLOCK instruction and ending with a SCOND instruction.
These patterns are hand coded in libc's (glibc and uclibc). Take
a look at [1] for instance:
main+14: llock r2,[r0]
main+18: brne.nt r2,0,main+30
main+22: scond r3,[r0]
main+26: bne main+14
main+30: mov_s r0,0
If such a sequence is found, attempt to step over it.
A breakpoint is placed at the end of the sequence.
This function expects the INSN to be a "llock(d)" instruction.
[1]
https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libc/ \
sysdeps/linux/arc/bits/atomic.h#n46
*/
static std::vector<CORE_ADDR>
handle_atomic_sequence (arc_instruction insn, disassemble_info &di)
{
const int atomic_seq_len = 24; /* Instruction sequence length. */
std::vector<CORE_ADDR> next_pcs;
/* Sanity check. */
gdb_assert (insn.insn_class == LLOCK);
/* Data size we are dealing with: LLOCK vs. LLOCKD */
arc_ldst_data_size llock_data_size_mode = insn.data_size_mode;
/* Indicator if any conditional branch is found in the sequence. */
bool found_bc = false;
/* Becomes true if "LLOCK(D) .. SCOND(D)" sequence is found. */
bool is_pattern_valid = false;
for (int insn_count = 0; insn_count < atomic_seq_len; ++insn_count)
{
arc_insn_decode (arc_insn_get_linear_next_pc (insn),
&di, arc_delayed_print_insn, &insn);
if (insn.insn_class == BRCC)
{
/* If more than one conditional branch is found, this is not
the pattern we are interested in. */
if (found_bc)
break;
found_bc = true;
continue;
}
/* This is almost a happy ending. */
if (insn.insn_class == SCOND)
{
/* SCOND should match the LLOCK's data size. */
if (insn.data_size_mode == llock_data_size_mode)
is_pattern_valid = true;
break;
}
}
if (is_pattern_valid)
{
/* Get next instruction after scond(d). There is no limm. */
next_pcs.push_back (insn.address + insn.length);
}
return next_pcs;
}
/* Implement the "software_single_step" gdbarch method. */
static std::vector<CORE_ADDR>
@@ -168,8 +240,11 @@ arc_linux_software_single_step (struct regcache *regcache)
struct arc_instruction curr_insn;
arc_insn_decode (regcache_read_pc (regcache), &di, arc_delayed_print_insn,
&curr_insn);
CORE_ADDR next_pc = arc_insn_get_linear_next_pc (curr_insn);
if (curr_insn.insn_class == LLOCK)
return handle_atomic_sequence (curr_insn, di);
CORE_ADDR next_pc = arc_insn_get_linear_next_pc (curr_insn);
std::vector<CORE_ADDR> next_pcs;
/* For instructions with delay slots, the fall thru is not the
@@ -319,8 +394,10 @@ static void
collect_register (const struct regcache *regcache, struct gdbarch *gdbarch,
int regnum, gdb_byte *buf)
{
int offset;
/* Skip non-existing registers. */
if ((arc_linux_core_reg_offsets[regnum] == ARC_OFFSET_NO_REGISTER))
if (arc_linux_core_reg_offsets[regnum] == ARC_OFFSET_NO_REGISTER)
return;
/* The address where the execution has stopped is in pseudo-register
@@ -332,8 +409,10 @@ collect_register (const struct regcache *regcache, struct gdbarch *gdbarch,
the program will continue at the address after the current instruction.
*/
if (regnum == gdbarch_pc_regnum (gdbarch))
regnum = ARC_ERET_REGNUM;
regcache->raw_collect (regnum, buf + arc_linux_core_reg_offsets[regnum]);
offset = arc_linux_core_reg_offsets[ARC_ERET_REGNUM];
else
offset = arc_linux_core_reg_offsets[regnum];
regcache->raw_collect (regnum, buf + offset);
}
void

View File

@@ -1,6 +1,6 @@
/* Target dependent code for GNU/Linux ARC.
Copyright 2020 Free Software Foundation, Inc.
Copyright 2020-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target-dependent code for Newlib ARC.
Copyright (C) 2016-2020 Free Software Foundation, Inc.
Copyright (C) 2016-2021 Free Software Foundation, Inc.
Contributed by Synopsys Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target dependent code for ARC architecture, for GDB.
Copyright 2005-2020 Free Software Foundation, Inc.
Copyright 2005-2021 Free Software Foundation, Inc.
Contributed by Synopsys Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target dependent code for ARC architecture, for GDB.
Copyright 2005-2020 Free Software Foundation, Inc.
Copyright 2005-2021 Free Software Foundation, Inc.
Contributed by Synopsys Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Dynamic architecture support for GDB, the GNU debugger.
Copyright (C) 1998-2020 Free Software Foundation, Inc.
Copyright (C) 1998-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Dynamic architecture support for GDB, the GNU debugger.
Copyright (C) 1998-2020 Free Software Foundation, Inc.
Copyright (C) 1998-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2019-2020 Free Software Foundation, Inc.
/* Copyright (C) 2019-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2019-2020 Free Software Foundation, Inc.
/* Copyright (C) 2019-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2009-2020 Free Software Foundation, Inc.
/* Copyright (C) 2009-2021 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2009-2020 Free Software Foundation, Inc.
/* Copyright (C) 2009-2021 Free Software Foundation, Inc.
Contributed by ARM Ltd.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2020 Free Software Foundation, Inc.
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target-dependent functionality for AArch64.
Copyright (C) 2017-2020 Free Software Foundation, Inc.
Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2020 Free Software Foundation, Inc.
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2020 Free Software Foundation, Inc.
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2020 Free Software Foundation, Inc.
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.
@@ -113,8 +113,9 @@ arc_lookup_target_description (const struct arc_arch_features &features)
target_desc *tdesc = arc_create_target_description (features);
/* Add the newly created target description to the repertoire. */
arc_tdesc_cache.emplace (features, tdesc);
/* Add the newly created target description to the repertoire.
PR build/27385: Use "target_desc_up ()" ctor explicitly. */
arc_tdesc_cache.emplace (features, target_desc_up (tdesc));
return tdesc;
}

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2020 Free Software Foundation, Inc.
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common code for ARM software single stepping support.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
Copyright (C) 1988-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common code for ARM software single stepping support.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
Copyright (C) 1988-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for GNU/Linux on ARM systems.
Copyright (C) 1999-2020 Free Software Foundation, Inc.
Copyright (C) 1999-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for GNU/Linux on ARM systems.
Copyright (C) 1999-2020 Free Software Foundation, Inc.
Copyright (C) 1999-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for GDB on ARM systems.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
Copyright (C) 1988-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,5 +1,5 @@
/* Common target dependent code for GDB on ARM systems.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
Copyright (C) 1988-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2020 Free Software Foundation, Inc.
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2020 Free Software Foundation, Inc.
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for GNU/Linux on PPC systems.
Copyright (C) 2018-2020 Free Software Foundation, Inc.
Copyright (C) 2018-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target dependent code for GNU/Linux on PPC systems.
Copyright (C) 2018-2020 Free Software Foundation, Inc.
Copyright (C) 2018-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Target description declarations shared between gdb, gdbserver and IPA.
Copyright (C) 2018-2020 Free Software Foundation, Inc.
Copyright (C) 2018-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2018-2020 Free Software Foundation, Inc.
/* Copyright (C) 2018-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,6 +1,6 @@
/* Common target-dependent functionality for RISC-V
Copyright (C) 2018-2020 Free Software Foundation, Inc.
Copyright (C) 2018-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2020 Free Software Foundation, Inc.
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2017-2020 Free Software Foundation, Inc.
/* Copyright (C) 2017-2021 Free Software Foundation, Inc.
This file is part of GDB.

Some files were not shown because too many files have changed in this diff Show More