2021-04-27 22:02:42 +08:00
|
|
|
|
2021-04-27 Michael Weghorn <m.weghorn@posteo.de>
|
|
|
|
|
Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* gdb/auto-load.c (_initialize_auto_load): 'Specify token
|
|
|
|
|
when attaching the 'auto_load_new_objfile' observer, so
|
|
|
|
|
other observers can specify it as a dependency.
|
|
|
|
|
* gdb/auto-load.h (struct token): Declare
|
|
|
|
|
'auto_load_new_objfile_observer_token' as token to be used
|
|
|
|
|
for the 'auto_load_new_objfile' observer.
|
|
|
|
|
* gdb/python/py-inferior.c (gdbpy_initialize_inferior): Make
|
|
|
|
|
'python_new_objfile' observer depend on 'auto_load_new_objfile'
|
|
|
|
|
observer, so it gets notified after the latter.
|
|
|
|
|
|
gdbsupport: allow to specify dependencies between observers
Previously, the observers attached to an observable were always notified
in the order in which they had been attached. That order is not easily
controlled, because observers are typically attached in _initialize_*
functions, which are called in an undefined order.
However, an observer may require that another observer attached only
later is called before itself is.
Therefore, extend the 'observable' class to allow explicitly specifying
dependencies when attaching observers, by adding the possibility to
specify tokens for observers that it depends on.
To make sure dependencies are notified before observers depending on
them, the vector holding the observers is sorted in a way that
dependencies come before observers depending on them. The current
implementation for sorting uses the depth-first search algorithm for
topological sorting as described at [1].
Extend the observable unit tests to cover this case as well. Check that
this works for a few different orders in which the observers are
attached.
This newly introduced mechanism to explicitly specify dependencies will
be used in a follow-up commit.
[1] https://en.wikipedia.org/wiki/Topological_sorting#Depth-first_search
Tested on x86_64-linux (Debian testing).
gdb/ChangeLog:
* unittests/observable-selftests.c (dependency_test_counters):
New.
(observer_token0, observer_token1, observer_token2,
observer_token3, observer_token4, observer_token5): New.
(struct dependency_observer_data): New struct.
(observer_dependency_test_callback): New function.
(test_observers): New.
(run_dependency_test): New function.
(test_dependency): New.
(_initialize_observer_selftest): Register dependency test.
gdbsupport/ChangeLog:
* observable.h (class observable): Extend to allow specifying
dependencies between observers, keep vector holding observers
sorted so that dependencies are notified before observers
depending on them.
Change-Id: I5399def1eeb69ca99e28c9f1fdf321d78b530bdb
2021-04-27 21:55:27 +08:00
|
|
|
|
2021-04-27 Michael Weghorn <m.weghorn@posteo.de>
|
|
|
|
|
Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* unittests/observable-selftests.c (dependency_test_counters):
|
|
|
|
|
New.
|
|
|
|
|
(observer_token0, observer_token1, observer_token2,
|
|
|
|
|
observer_token3, observer_token4, observer_token5): New.
|
|
|
|
|
(struct dependency_observer_data): New struct.
|
|
|
|
|
(observer_dependency_test_callback): New function.
|
|
|
|
|
(test_observers): New.
|
|
|
|
|
(run_dependency_test): New function.
|
|
|
|
|
(test_dependency): New.
|
|
|
|
|
(_initialize_observer_selftest): Register dependency test.
|
|
|
|
|
|
2021-04-26 23:27:07 +08:00
|
|
|
|
2021-04-26 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
PR gdb/27773
|
|
|
|
|
* cli/cli-dump.c (dump_binary_file): Check result of
|
|
|
|
|
gdb_fopen_cloexec.
|
|
|
|
|
|
2021-04-26 03:50:38 +08:00
|
|
|
|
2021-04-25 Sergei Trofimovich <siarheit@google.com>
|
|
|
|
|
|
|
|
|
|
* sparc-linux-nat.c (sparc_linux_nat_target): fix sparc build
|
|
|
|
|
by passing `process_stratum_target*` parameter.
|
|
|
|
|
|
2021-04-17 19:10:23 +08:00
|
|
|
|
2021-04-25 Lancelot Six <lsix@lancelotsix.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/22640
|
|
|
|
|
* typeprint.h (struct type_print_options): Add print_in_hex
|
|
|
|
|
flag.
|
|
|
|
|
(struct print_offset_data): Add print_in_hex flag, add a
|
|
|
|
|
constructor accepting a type_print_options* argument.
|
|
|
|
|
* typeprint.c (type_print_raw_options, default_ptype_flags): Set
|
|
|
|
|
default value for print_in_hex.
|
|
|
|
|
(print_offset_data::indentation): Allow more horizontal space.
|
|
|
|
|
(print_offset_data::print_offset_data): Add ctor.
|
|
|
|
|
(print_offset_data::maybe_print_hole, print_offset_data::update):
|
|
|
|
|
Handle the print_in_hex flag.
|
|
|
|
|
(whatis_exp): Handle 'x' and 'd' flags.
|
|
|
|
|
(print_offsets_and_sizes_in_hex): Declare.
|
|
|
|
|
(set_print_offsets_and_sizes_in_hex): Create.
|
|
|
|
|
(show_print_offsets_and_sizes_in_hex): Create.
|
|
|
|
|
(_initialize_typeprint): Update help message for the ptype
|
|
|
|
|
command, register the 'set print type hex' and 'show print type
|
|
|
|
|
hex' commands.
|
|
|
|
|
* c-typeprint.c (c_print_type, c_type_print_base_struct_union)
|
|
|
|
|
(c_type_print_base): Construct the print_offset_data
|
|
|
|
|
object using the type_print_optons parameter.
|
|
|
|
|
* rust-lang.c (rust_language::print_type): Construct the
|
|
|
|
|
print_offset_data object using the type_print_optons parameter.
|
|
|
|
|
* NEWS: Mention the new flags of the ptype command.
|
|
|
|
|
|
2021-04-17 19:10:23 +08:00
|
|
|
|
2021-04-25 Lancelot Six <lsix@lancelotsix.com>
|
|
|
|
|
|
|
|
|
|
* typeprint.h (struct type_print_options): Move before
|
|
|
|
|
print_offset_data.
|
|
|
|
|
|
2021-04-25 12:19:04 +08:00
|
|
|
|
2021-04-25 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
GDB 10.2 released.
|
|
|
|
|
|
2021-04-24 04:28:26 +08:00
|
|
|
|
2021-04-23 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* observable.c (observer_debug): Change to bool.
|
|
|
|
|
|
gdb: remove some caching from the dwarf reader
While working on some changes to 'info sources' I ran into a situation
where I was seeing the same source files reported twice in the output
of the 'info sources' command when using either .gdb_index or the
.debug_name index.
I traced the problem back to some caching in
dwarf2_base_index_functions::map_symbol_filenames; when called GDB
caches the set of filenames, but, filesnames are not removed as the
index entries are expanded into full symtabs. As a result we can end
up seeing filenames reported both from a full symtab _and_ from
a (stale) previously cached index entry.
Now, obviously, when seeing a problem like this the "correct" fix is
to remove the stale entries from the cache, however, I ran a few
experiments to see why this wasn't really hitting us anywhere, and, as
far as I can tell, ::map_symbol_filenames is only called from three
places:
1. The mi command -file-list-exec-source-files,
2. The 'info sources' command, and
3. Filename completion
However, the result of this "bug" is that we will see duplicate
filenames, and readline's completion mechanism already removes
duplicates, so for case #3 we will never see any problems.
Cases #1 and #2 are basically the same, and in each case, to see a
problem we need to ensure we craft the test in a particular way, start
up ensuring we have some unexpected symtabs, then run one of the
commands to populate the cache, then expand one of the symtabs, and
list the sources again. At this point you'll see duplicate entries in
the results. Hardly surprising we haven't randomly hit this situation
in testing.
So, considering that use cases #1 and #2 are certainly not "high
performance" code (i.e. I don't think these justify the need for
caching) this leaves use case #3. Does this use justify the need for
caching? Well the psymbol_functions::map_symbol_filenames function
doesn't seem to do any extra caching, and within
dwarf2_base_index_functions::map_symbol_filenames, the only expensive
bit appears to be the call to dw2_get_file_names, and this already
does its own caching via this_cu->v.quick->file_names.
The upshot of all this analysis was that I'm not convinced the need
for the additional caching is justified, and so, I propose that to fix
the bug in GDB, I just remove the extra caching (for now).
If we later find that the caching _was_ useful, then we can
reintroduce it, but add it back such that it doesn't reintroduce this
bug.
As I was changing dwarf2_base_index_functions::map_symbol_filenames I
replaced the use of htab_up with std::unordered_set.
Tested using target_boards cc-with-debug-names and dwarf4-gdb-index.
gdb/ChangeLog:
* dwarf2/read.c: Add 'unordered_set' include.
(dwarf2_base_index_functions::map_symbol_filenames): Replace
'visited' hash table with 'qfn_cache' unordered_set. Remove use
of per_Bfd->filenames_cache cache, and use function local
filenames_cache instead. Reindent.
* dwarf2/read.h (struct dwarf2_per_bfd) <filenames_cache>: Delete.
gdb/testsuite/ChangeLog:
* gdb.base/info_sources.exp: Add new tests.
2021-04-19 20:14:41 +08:00
|
|
|
|
2021-04-23 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c: Add 'unordered_set' include.
|
|
|
|
|
(dwarf2_base_index_functions::map_symbol_filenames): Replace
|
|
|
|
|
'visited' hash table with 'qfn_cache' unordered_set. Remove use
|
|
|
|
|
of per_Bfd->filenames_cache cache, and use function local
|
|
|
|
|
filenames_cache instead. Reindent.
|
|
|
|
|
* dwarf2/read.h (struct dwarf2_per_bfd) <filenames_cache>: Delete.
|
|
|
|
|
|
2021-04-23 10:00:39 +08:00
|
|
|
|
2021-04-22 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (iterate_over_bp_locations): Change callback to
|
|
|
|
|
function view, remove data parameter.
|
|
|
|
|
* breakpoint.h (iterate_over_bp_locations): Likewise.
|
|
|
|
|
* record-full.c (record_full_sync_record_breakpoints): Remove
|
|
|
|
|
data parameter.
|
|
|
|
|
|
2021-04-23 09:39:56 +08:00
|
|
|
|
2021-04-22 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* c-typeprint.c (c_type_print_base_struct_union): Use
|
|
|
|
|
print_spaces_filtered_with_print_options.
|
|
|
|
|
|
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-23 03:01:28 +08:00
|
|
|
|
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 23:22:39 +08:00
|
|
|
|
2021-04-22 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (COMMON_SFILES): Remove continuations.c.
|
|
|
|
|
* inferior.c (inferior::add_continuation): New method, adapted
|
|
|
|
|
from 'add_inferior_continuation'.
|
|
|
|
|
(inferior::do_all_continuations): New method, adapted from
|
|
|
|
|
'do_all_inferior_continuations'.
|
|
|
|
|
(inferior::~inferior): Clear the list of continuations directly.
|
|
|
|
|
* inferior.h (class inferior) <continuations>: Rename into...
|
|
|
|
|
<m_continuations>: ...this and make private.
|
|
|
|
|
* continuations.c: Remove.
|
|
|
|
|
* continuations.h: Remove.
|
|
|
|
|
* event-top.c: Don't include "continuations.h".
|
|
|
|
|
|
|
|
|
|
Update the users below.
|
|
|
|
|
* inf-loop.c (inferior_event_handler)
|
|
|
|
|
* infcmd.c (attach_command)
|
|
|
|
|
(notice_new_inferior): Update.
|
|
|
|
|
|
2021-04-22 23:22:39 +08:00
|
|
|
|
2021-04-22 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
|
|
|
|
|
|
|
|
|
* inferior.h (class inferior) <continuations>: Change the type
|
|
|
|
|
to be an std::list of std::function's.
|
|
|
|
|
Update the references and uses below.
|
|
|
|
|
* continuations.c (struct continuation): Delete.
|
|
|
|
|
(make_continuation): Delete.
|
|
|
|
|
(do_my_continuations_1): Delete.
|
|
|
|
|
(do_my_continuations): Delete.
|
|
|
|
|
(discard_my_continuations_1): Delete.
|
|
|
|
|
(discard_my_continuations): Delete.
|
|
|
|
|
(add_inferior_continuation): Update.
|
|
|
|
|
(do_all_inferior_continuations): Update.
|
|
|
|
|
(discard_all_inferior_continuations): Update.
|
|
|
|
|
* continuations.h (add_inferior_continuation): Update to take
|
|
|
|
|
an std::function as the parameter.
|
|
|
|
|
* infcmd.c (struct attach_command_continuation_args): Delete.
|
|
|
|
|
(attach_command_continuation): Delete.
|
|
|
|
|
(attach_command_continuation_free_args): Delete.
|
|
|
|
|
(attach_command): Update.
|
|
|
|
|
(notice_new_inferior): Update.
|
|
|
|
|
|
2021-04-22 23:22:39 +08:00
|
|
|
|
2021-04-22 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
|
|
|
|
|
|
|
|
|
* continuations.h: Update the general comment.
|
|
|
|
|
* inferior.h (class inferior) <continuations>: Update the comment.
|
|
|
|
|
* interps.c: Do not include "continuations.h".
|
|
|
|
|
|
2021-04-22 23:22:38 +08:00
|
|
|
|
2021-04-22 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
|
|
|
|
|
|
|
|
|
* continuations.h (do_all_inferior_continuations): Remove the 'err'
|
|
|
|
|
parameter. Update the references below.
|
|
|
|
|
* continuations.c (do_my_continuations_1)
|
|
|
|
|
(do_my_continuations)
|
|
|
|
|
(do_all_inferior_continuations): Update.
|
|
|
|
|
* inf-loop.c (inferior_event_handler): Update.
|
|
|
|
|
* infcmd.c (attach_command_continuation): Update.
|
|
|
|
|
|
2021-04-22 23:22:38 +08:00
|
|
|
|
2021-04-22 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
|
|
|
|
|
|
|
|
|
* infcmd.c (attach_post_wait): Update the function comment.
|
|
|
|
|
|
2021-04-22 23:22:38 +08:00
|
|
|
|
2021-04-22 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
|
|
|
|
|
|
|
|
|
* infcmd.c (attach_post_wait): Remove the unused parameter 'args'.
|
|
|
|
|
Update the references below.
|
|
|
|
|
(struct attach_command_continuation_args)
|
|
|
|
|
(attach_command_continuation)
|
|
|
|
|
(attach_command_continuation_free_args)
|
|
|
|
|
(attach_command)
|
|
|
|
|
(notice_new_inferior): Update to remove the reference to 'args'.
|
|
|
|
|
|
2021-04-22 23:01:00 +08:00
|
|
|
|
2021-04-22 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR remote/27710
|
|
|
|
|
* remote.c (remote_target_is_non_stop_p): New function.
|
|
|
|
|
* remote.h (remote_target_is_non_stop_p): Declare.
|
|
|
|
|
* remote-notif.c (remote_async_get_pending_events_handler): Fix assert
|
|
|
|
|
to check non-stopness using notif_state->remote rather current target.
|
|
|
|
|
|
2021-04-22 21:16:36 +08:00
|
|
|
|
2021-04-22 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-parse.c (rust_parser::parse_sizeof): Remove KW_MUT code.
|
|
|
|
|
(struct typed_val_int) <val>: Now ULONGEST.
|
|
|
|
|
(rust_parser::parse_array_type): Remove negative check.
|
|
|
|
|
(rust_lex_int_test): Change 'value' to ULONGEST.
|
|
|
|
|
|
2021-04-21 17:59:38 +08:00
|
|
|
|
2021-04-22 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* arch-utils.c (default_addressable_memory_unit_size): Return a
|
|
|
|
|
value based on bfd's bits per byte.
|
|
|
|
|
|
2021-04-22 06:10:44 +08:00
|
|
|
|
2021-04-21 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.h (struct dwarf2_per_cu_data) <dwarf_version>: Now
|
|
|
|
|
unsigned char.
|
|
|
|
|
(struct dwarf2_per_cu_data): Rearrange.
|
|
|
|
|
* dwarf2/comp-unit.h (struct comp_unit_head) <version>: Now
|
|
|
|
|
unsigned char.
|
|
|
|
|
(struct comp_unit_head): Rearrange.
|
|
|
|
|
* dwarf2/comp-unit.c (read_comp_unit_head): Update.
|
|
|
|
|
|
[gdb/build] Hardcode --with-included-regex
Currently gdb has a configure option:
...
$ ./src/gdb/configure --help
...
--without-included-regex
don't use included regex; this is the default on
systems with version 2 of the GNU C library (use
with caution on other system)
...
The configure option controls config.h macro USE_INCLUDED_REGEX, which is
used in gdb/gdb_regex.h to choose between:
- using regex from libiberty (which is included in the binutils-gdb.git repo,
hence the 'included' in USE_INCLUDED_REGEX), or
- using regex.h.
In the former case, the symbol regcomp is remapped to a symbol xregcomp, which
is then provided by libiberty.
In the latter case, the symbol regcomp is resolved at runtime, usually binding
to libc. However, there is no mechanism in place to enforce this.
PR27681 is an example of where that causes problems. On openSUSE Tumbleweed,
the ncurses package got the --with-pcre2 configure switch enabled, and solved
the resulting dependencies using:
...
$ cat /usr/lib64/libncursesw.so
/* GNU ld script */
-INPUT(/lib64/libncursesw.so.6 AS_NEEDED(-ltinfo -ldl))
+INPUT(/lib64/libncursesw.so.6 AS_NEEDED(-ltinfo -ldl -lpcre2-posix -lpcre2-8))
...
This lead to regcomp being bound to libpcre2-posix instead of libc.
This causes problems in several ways:
- by compiling using regex.h, we've already chosen a specific regex_t
implementation, and the one from pcre2-posix is not the same.
- in gdb_regex.c we use GNU regex function re_search, which pcre2-posix
doesn't provide, so while regcomp binds to pcre2-posix, re_search binds to
libc.
A note on the latter: it's actually a bug to compile a regex using regcomp and
then pass it to re_search. The GNU regex interface requires one to use
re_compile_pattern or re_compile_fastmap. But as long we're using one of the
GNU regex incarnations in gnulib, glibc or libiberty, we get away with this.
The PR could be fixed by adding -lc in a specific position in the link line,
to force regcomp to be bound to glibc. But this solution was considered
in the discussion in the PR as being brittle, and possibly causing problems
elsewhere.
Another solution offered was to restrict regex usage to posix, and no longer
use the GNU regex API. This however could mean having to reproduce some of
that functionality locally, which would mean maintaining the same
functionality in more than one place.
The solution chosen here, is to hardcode --with-included-regex, that is, using
libiberty.
The option of using glibc for regex was introduced because glibc became the
authorative source for GNU regex, so it offered the possibility to link
against a more up-to-date regex version.
In that aspect, this patch is a step back. But we have the option of using a
more up-to-date regex version as a follow-up step: by using the regex from
gnulib.
Tested on x86_64-linux.
gdb/ChangeLog:
2021-04-21 Tom de Vries <tdevries@suse.de>
PR build/27681
* configure.ac: Remove --without-included-regex/--with-included-regex.
* config.in: Regenerate.
* configure: Regenerate.
* gdb_regex.h: Assume USE_INCLUDED_REGEX is defined.
2021-04-22 03:54:03 +08:00
|
|
|
|
2021-04-21 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR build/27681
|
|
|
|
|
* configure.ac: Remove --without-included-regex/--with-included-regex.
|
|
|
|
|
* config.in: Regenerate.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* gdb_regex.h: Assume USE_INCLUDED_REGEX is defined.
|
|
|
|
|
|
gdb/breakpoint: add a 'force_condition' parameter to 'create_breakpoint'
The 'create_breakpoint' function takes a 'parse_extra' argument that
determines whether the condition, thread, and force-condition
specifiers should be parsed from the extra string or be used from the
function arguments. However, for the case when 'parse_extra' is
false, there is no way to pass the force-condition specifier. This
patch adds it as a new argument.
Also, in the case when parse_extra is false, the current behavior is
as if the condition is being forced. This is a bug. The default
behavior should reject the breakpoint. See below for a demo of this
incorrect behavior. (The MI command '-break-insert' uses the
'create_breakpoint' function with parse_extra=0.)
$ gdb -q --interpreter=mi3 /tmp/simple
=thread-group-added,id="i1"
=cmd-param-changed,param="history save",value="on"
=cmd-param-changed,param="auto-load safe-path",value="/"
~"Reading symbols from /tmp/simple...\n"
(gdb)
-break-insert -c junk -f main
&"warning: failed to validate condition at location 1, disabling:\n "
&"No symbol \"junk\" in current context.\n"
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="<MULTIPLE>",cond="junk",times="0",original-location="main",locations=[{number="1.1",enabled="N",addr="0x000000000000114e",func="main",file="/tmp/simple.c",fullname="/tmp/simple.c",line="2",thread-groups=["i1"]}]}
(gdb)
break main if junk
&"break main if junk\n"
&"No symbol \"junk\" in current context.\n"
^error,msg="No symbol \"junk\" in current context."
(gdb)
break main -force-condition if junk
&"break main -force-condition if junk\n"
~"Note: breakpoint 1 also set at pc 0x114e.\n"
&"warning: failed to validate condition at location 1, disabling:\n "
&"No symbol \"junk\" in current context.\n"
~"Breakpoint 2 at 0x114e: file /tmp/simple.c, line 2.\n"
=breakpoint-created,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<MULTIPLE>",cond="junk",times="0",original-location="main",locations=[{number="2.1",enabled="N",addr="0x000000000000114e",func="main",file="/tmp/simple.c",fullname="/tmp/simple.c",line="2",thread-groups=["i1"]}]}
^done
(gdb)
After applying this patch, we get the behavior below:
(gdb)
-break-insert -c junk -f main
^error,msg="No symbol \"junk\" in current context."
This restores the behavior that is present in the existing releases.
gdb/ChangeLog:
2021-04-21 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* breakpoint.h (create_breakpoint): Add a new parameter,
'force_condition'.
* breakpoint.c (create_breakpoint): Use the 'force_condition'
argument when 'parse_extra' is false to check if the condition
is invalid at all of the breakpoint locations.
Update the users below.
(break_command_1)
(dprintf_command)
(trace_command)
(ftrace_command)
(strace_command)
(create_tracepoint_from_upload): Update.
* guile/scm-breakpoint.c (gdbscm_register_breakpoint_x): Update.
* mi/mi-cmd-break.c (mi_cmd_break_insert_1): Update.
* python/py-breakpoint.c (bppy_init): Update.
* python/py-finishbreakpoint.c (bpfinishpy_init): Update.
gdb/testsuite/ChangeLog:
2021-04-21 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* gdb.mi/mi-break.exp: Extend with checks for invalid breakpoint
conditions.
2021-04-21 22:42:40 +08:00
|
|
|
|
2021-04-21 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.h (create_breakpoint): Add a new parameter,
|
|
|
|
|
'force_condition'.
|
|
|
|
|
* breakpoint.c (create_breakpoint): Use the 'force_condition'
|
|
|
|
|
argument when 'parse_extra' is false to check if the condition
|
|
|
|
|
is invalid at all of the breakpoint locations.
|
|
|
|
|
Update the users below.
|
|
|
|
|
(break_command_1)
|
|
|
|
|
(dprintf_command)
|
|
|
|
|
(trace_command)
|
|
|
|
|
(ftrace_command)
|
|
|
|
|
(strace_command)
|
|
|
|
|
(create_tracepoint_from_upload): Update.
|
|
|
|
|
* guile/scm-breakpoint.c (gdbscm_register_breakpoint_x): Update.
|
|
|
|
|
* mi/mi-cmd-break.c (mi_cmd_break_insert_1): Update.
|
|
|
|
|
* python/py-breakpoint.c (bppy_init): Update.
|
|
|
|
|
* python/py-finishbreakpoint.c (bpfinishpy_init): Update.
|
|
|
|
|
|
2021-04-21 22:42:39 +08:00
|
|
|
|
2021-04-21 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (print_one_breakpoint_location): Display "N" for
|
|
|
|
|
disabled-by-condition locations on MI-like output.
|
|
|
|
|
(breakpoint_1): Do not display the disabled-by-condition footnote
|
|
|
|
|
if the output is MI-like.
|
|
|
|
|
|
2021-04-21 22:05:14 +08:00
|
|
|
|
2021-04-21 Frederic Cambus <fred@statdns.com>
|
|
|
|
|
|
|
|
|
|
* syscalls/update-netbsd.sh: Fix script name display in usage, and
|
|
|
|
|
update year range in generated copyright notices.
|
|
|
|
|
|
2021-04-20 14:44:17 +08:00
|
|
|
|
2021-04-20 Felix Willgerodt <felix.willgerodt@intel.com>
|
|
|
|
|
|
|
|
|
|
* c-exp.y (qualifier_seq_noopt): Replace qualifier_seq with
|
|
|
|
|
qualifier_seq_noopt.
|
|
|
|
|
|
gdb: Allow address space qualifier parsing in C++.
The goal of this patch is to allow target dependent address space qualifiers
in the C++ expression parser. This can be useful for memory examination on
targets that actually use different address spaces in hardware without
having to deep-dive into implementation details of the whole solution.
GDB uses the @ symbol to parse address space qualifiers. The only current
user that I am aware of is the __flash support for avr, which was added in
"Add support for the __flash qualifier on AVR"
(487d975399dfcb2bb2f0998a7d12bd62acdd9fa1)
and only works for C.
One use-case of the AVR patch is:
~~~
const __flash char data_in_flash = 0xab;
int
main (void)
{
const __flash char *pointer_to_flash = &data_in_flash;
}
~~~
~~~
(gdb) print pointer_to_flash
$1 = 0x1e8 <data_in_flash> "\253"
(gdb) print/x *pointer_to_flash
$2 = 0xab
(gdb) x/x pointer_to_flash
0x1e8 <data_in_flash>: 0xXXXXXXab
(gdb)
(gdb) p/x *(char* @flash) pointer_to_flash
$3 = 0xab
~~~
I want to enable a similar usage of e.g. @local in C++.
Before this patch (using "set debug parser on"):
~~~
(gdb) p *(int* @local) 0x1234
(...)
Reading a token: Next token is token '@' ()
Shifting token '@' ()
Entering state 46
Reading a token: Next token is token UNKNOWN_CPP_NAME (ssym<name=local, sym=(null), field_of_this=0>)
A syntax error in expression, near `local) &x'.
~~~
After:
~~~
(gdb) p *(int* @local) 0x1234
(...)
Reading a token: Next token is token '@' ()
Shifting token '@' ()
Entering state 46
Reading a token: Next token is token UNKNOWN_CPP_NAME (ssym<name=local, sym=(null), field_of_this=0>)
Shifting token UNKNOWN_CPP_NAME (ssym<name=local, sym=(null), field_of_this=0>)
Entering state 121
Reducing stack by rule 278 (line 1773):
$1 = token UNKNOWN_CPP_NAME (ssym<name=local, sym=(null), field_of_this=0>)
-> $$ = nterm name ()
Stack now 0 49 52 76 222 337 46
Entering state 167
Reducing stack by rule 131 (line 1225):
$1 = token '@' ()
$2 = nterm name ()
Unknown address space specifier: "local"
~~~
The "Unknown address space qualifier" is the right behaviour, as I ran this
on a target that doesn't have multiple address spaces and therefore obviously
no support for such qualifiers.
gdb/ChangeLog:
2021-04-20 Felix Willgerodt <felix.willgerodt@intel.com>
* c-exp.y (single_qualifier): Handle UNKNOWN_CPP_NAME.
gdb/testsuite/ChangeLog:
2021-04-20 Felix Willgerodt <felix.willgerodt@intel.com>
* gdb.base/address_space_qualifier.exp: New file.
2021-04-20 14:43:08 +08:00
|
|
|
|
2021-04-20 Felix Willgerodt <felix.willgerodt@intel.com>
|
|
|
|
|
|
|
|
|
|
* c-exp.y (single_qualifier): Handle UNKNOWN_CPP_NAME.
|
|
|
|
|
|
2021-04-16 01:30:57 +08:00
|
|
|
|
2021-04-19 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* producer.c: Replace 'regex' include with 'gdb_regex.h'.
|
|
|
|
|
(producer_is_icc): Replace use of std::regex with gdb's
|
|
|
|
|
compiled_regex.
|
|
|
|
|
|
Handle unaligned mapping of .gdb_index
The .gdb_index was designed such that all data would be aligned.
Unfortunately, we neglected to require this alignment in the objcopy
instructions in the manual. As a result, in many cases, a .gdb_index
in the wild will not be properly aligned by mmap. This yields
undefined behavior, which is PR gdb/23743.
This patch fixes the bug by always assuming that the mapping is
unaligned, and using extract_unsigned_integer when needed. A new
helper class is introduced to make this less painful.
gdb/ChangeLog
2021-04-17 Tom Tromey <tom@tromey.com>
PR gdb/23743:
* dwarf2/read.c (class offset_view): New.
(struct symbol_table_slot): Remove.
(struct mapped_index) <symbol_table, constant_pool>: Change type.
<symbol_name_index, symbol_vec_index>: New methods.
<symbol_name_slot_invalid, symbol_name_at, symbol_name_count>:
Rewrite.
(read_gdb_index_from_buffer): Update.
(struct dw2_symtab_iterator) <vec>: Change type.
(dw2_symtab_iter_init_common, dw2_symtab_iter_init)
(dw2_symtab_iter_next, dw2_expand_marked_cus): Update.
* dwarf2/index-write.c (class data_buf) <append_data>: Remove.
<append_array, append_offset>: New methods.
(write_hash_table, add_address_entry, write_gdbindex_1)
(write_debug_names): Update.
* dwarf2/index-common.h (byte_swap, MAYBE_SWAP): Remove.
2021-04-18 03:56:36 +08:00
|
|
|
|
2021-04-17 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/23743:
|
|
|
|
|
* dwarf2/read.c (class offset_view): New.
|
|
|
|
|
(struct symbol_table_slot): Remove.
|
|
|
|
|
(struct mapped_index) <symbol_table, constant_pool>: Change type.
|
|
|
|
|
<symbol_name_index, symbol_vec_index>: New methods.
|
|
|
|
|
<symbol_name_slot_invalid, symbol_name_at, symbol_name_count>:
|
|
|
|
|
Rewrite.
|
|
|
|
|
(read_gdb_index_from_buffer): Update.
|
|
|
|
|
(struct dw2_symtab_iterator) <vec>: Change type.
|
|
|
|
|
(dw2_symtab_iter_init_common, dw2_symtab_iter_init)
|
|
|
|
|
(dw2_symtab_iter_next, dw2_expand_marked_cus): Update.
|
|
|
|
|
* dwarf2/index-write.c (class data_buf) <append_data>: Remove.
|
|
|
|
|
<append_array, append_offset>: New methods.
|
|
|
|
|
(write_hash_table, add_address_entry, write_gdbindex_1)
|
|
|
|
|
(write_debug_names): Update.
|
|
|
|
|
* dwarf2/index-common.h (byte_swap, MAYBE_SWAP): Remove.
|
|
|
|
|
|
2021-04-18 03:40:04 +08:00
|
|
|
|
2021-04-17 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/index-write.c (write_psymtabs_to_index): Check
|
|
|
|
|
partial_symtabs.
|
|
|
|
|
|
2021-04-17 23:35:04 +08:00
|
|
|
|
2021-04-17 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* psymtab.c (psymbol_functions::expand_matching_symbols): Rename
|
|
|
|
|
from map_matching_symbols. Change parameters.
|
|
|
|
|
* psympriv.h (struct psymbol_functions) <expand_matching_symbols>:
|
|
|
|
|
Rename from map_matching_symbols. Change parameters.
|
|
|
|
|
* dwarf2/read.c (struct dwarf2_gdb_index)
|
|
|
|
|
<expand_matching_symbols>: Rename from map_matching_symbols.
|
|
|
|
|
Change parameters.
|
|
|
|
|
(struct dwarf2_debug_names_index) <expand_matching_symbols>:
|
|
|
|
|
Rename from map_matching_symbols. Change parameters.
|
|
|
|
|
(dwarf2_gdb_index::expand_matching_symbols): Rename from
|
|
|
|
|
dw2_map_matching_symbols. Change parameters.
|
|
|
|
|
(dwarf2_gdb_index::expand_matching_symbols): Remove old
|
|
|
|
|
implementation.
|
|
|
|
|
(dwarf2_debug_names_index::expand_matching_symbols): Rename from
|
|
|
|
|
map_matching_symbols. Change parameters.
|
|
|
|
|
* objfiles.h (struct objfile) <expand_matching_symbols>: Rename
|
|
|
|
|
from map_matching_symbols. Change parameters.
|
|
|
|
|
* symfile-debug.c (objfile::expand_matching_symbols): Rename from
|
|
|
|
|
map_matching_symbols. Change parameters.
|
|
|
|
|
* ada-lang.c (map_matching_symbols): New function.
|
|
|
|
|
(add_nonlocal_symbols): Update.
|
|
|
|
|
|
2021-04-17 23:35:04 +08:00
|
|
|
|
2021-04-17 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* quick-symbol.h (struct quick_symbol_functions)
|
|
|
|
|
<expand_symtabs_with_fullname>: Remove.
|
|
|
|
|
* psymtab.c (psymbol_functions::expand_symtabs_with_fullname):
|
|
|
|
|
Remove.
|
|
|
|
|
* psympriv.h (struct psymbol_functions)
|
|
|
|
|
<expand_symtabs_with_fullname>: Remove.
|
|
|
|
|
* dwarf2/read.c (struct dwarf2_base_index_functions)
|
|
|
|
|
<expand_symtabs_with_fullname>: Remove.
|
|
|
|
|
(dwarf2_base_index_functions::expand_symtabs_with_fullname):
|
|
|
|
|
Remove.
|
|
|
|
|
* objfiles.h (struct objfile) <expand_symtabs_with_fullname>:
|
|
|
|
|
Update comment.
|
|
|
|
|
* symfile-debug.c (objfile::expand_symtabs_with_fullname):
|
|
|
|
|
Rewrite.
|
|
|
|
|
|
2021-04-17 23:35:04 +08:00
|
|
|
|
2021-04-17 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symfile-debug.c (objfile::expand_symtabs_for_function):
|
|
|
|
|
Rewrite.
|
|
|
|
|
* quick-symbol.h (struct quick_symbol_functions)
|
|
|
|
|
<expand_symtabs_for_function>: Remove.
|
|
|
|
|
* psymtab.c (psymbol_functions::expand_symtabs_for_function):
|
|
|
|
|
Remove.
|
|
|
|
|
* psympriv.h (struct psymbol_functions)
|
|
|
|
|
<expand_symtabs_for_function>: Remove.
|
|
|
|
|
* objfiles.h (struct objfile) <expand_symtabs_for_function>:
|
|
|
|
|
Update comment.
|
|
|
|
|
* dwarf2/read.c (struct dwarf2_gdb_index)
|
|
|
|
|
<expand_symtabs_for_function>: Remove.
|
|
|
|
|
(struct dwarf2_debug_names_index) <expand_symtabs_for_function>:
|
|
|
|
|
Remove.
|
|
|
|
|
(find_slot_in_mapped_hash): Remove.
|
|
|
|
|
(dw2_symtab_iter_init_common): Merge with dw2_symtab_iter_init.
|
|
|
|
|
(dw2_symtab_iter_init): Remove one overload.
|
|
|
|
|
(dwarf2_gdb_index::expand_symtabs_for_function)
|
|
|
|
|
(dwarf2_debug_names_index::expand_symtabs_for_function): Remove.
|
|
|
|
|
|
2021-04-17 23:35:04 +08:00
|
|
|
|
2021-04-17 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symfile-debug.c (objfile::map_symtabs_matching_filename):
|
|
|
|
|
Rewrite.
|
|
|
|
|
* quick-symbol.h (struct quick_symbol_functions)
|
|
|
|
|
<map_symtabs_matching_filename>: Remove.
|
|
|
|
|
* psymtab.c (partial_map_expand_apply)
|
|
|
|
|
(psymbol_functions::map_symtabs_matching_filename): Remove.
|
|
|
|
|
* psympriv.h (struct psymbol_functions)
|
|
|
|
|
<map_symtabs_matching_filename>: Remove.
|
|
|
|
|
* objfiles.h (struct objfile) <map_symtabs_matching_filename>:
|
|
|
|
|
Update comment.
|
|
|
|
|
* dwarf2/read.c (struct dwarf2_base_index_functions)
|
|
|
|
|
<map_symtabs_matching_filename>: Remove.
|
|
|
|
|
(dw2_map_expand_apply)
|
|
|
|
|
(dwarf2_base_index_functions::map_symtabs_matching_filename):
|
|
|
|
|
Remove.
|
|
|
|
|
|
2021-04-17 23:35:04 +08:00
|
|
|
|
2021-04-17 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symfile-debug.c (objfile::lookup_symbol): Rewrite.
|
|
|
|
|
* quick-symbol.h (struct quick_symbol_functions) <lookup_symbol>:
|
|
|
|
|
Remove.
|
|
|
|
|
* psymtab.c (psymbol_functions::lookup_symbol): Remove.
|
|
|
|
|
* psympriv.h (struct psymbol_functions) <lookup_symbol>: Remove.
|
|
|
|
|
* objfiles.h (struct objfile) <lookup_symbol>: Add comment.
|
|
|
|
|
* dwarf2/read.c (struct dwarf2_gdb_index) <lookup_symbol>:
|
|
|
|
|
Remove.
|
|
|
|
|
(struct dwarf2_debug_names_index) <lookup_symbol>: Remove.
|
|
|
|
|
(dwarf2_gdb_index::lookup_symbol)
|
|
|
|
|
(dwarf2_debug_names_index::lookup_symbol): Remove.
|
|
|
|
|
|
2021-04-17 23:35:04 +08:00
|
|
|
|
2021-04-17 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symtab.c (global_symbol_searcher::expand_symtabs): Update.
|
|
|
|
|
* symmisc.c (maintenance_expand_symtabs): Update.
|
|
|
|
|
* symfile.c (expand_symtabs_matching): Update.
|
|
|
|
|
* symfile-debug.c (objfile::expand_symtabs_matching): Add 'domain'
|
|
|
|
|
parameter.
|
|
|
|
|
* quick-symbol.h (struct quick_symbol_functions)
|
|
|
|
|
<expand_symtabs_matching>: Add 'domain' parameter.
|
|
|
|
|
* psymtab.c (recursively_search_psymtabs)
|
|
|
|
|
(psymbol_functions::expand_symtabs_matching): Add 'domain'
|
|
|
|
|
parameter.
|
|
|
|
|
* psympriv.h (struct psymbol_functions) <expand_symtabs_matching>:
|
|
|
|
|
Add 'domain' parameter.
|
|
|
|
|
* objfiles.h (struct objfile) <expand_symtabs_matching>: Add
|
|
|
|
|
'domain' parameter.
|
|
|
|
|
* linespec.c (iterate_over_all_matching_symtabs): Update.
|
|
|
|
|
* dwarf2/read.c (struct dwarf2_gdb_index)
|
|
|
|
|
<expand_symtabs_matching>: Add 'domain' parameter.
|
|
|
|
|
(struct dwarf2_debug_names_index) <expand_symtabs_matching>: Add
|
|
|
|
|
'domain' parameter.
|
|
|
|
|
(dw2_expand_symtabs_matching)
|
|
|
|
|
(dwarf2_gdb_index::expand_symtabs_matching)
|
|
|
|
|
(dw2_debug_names_iterator)
|
|
|
|
|
(dwarf2_debug_names_index::expand_symtabs_matching): Add 'domain'
|
|
|
|
|
parameter.
|
|
|
|
|
|
2021-04-17 23:35:04 +08:00
|
|
|
|
2021-04-17 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symtab.c (global_symbol_searcher::expand_symtabs)
|
|
|
|
|
(default_collect_symbol_completion_matches_break_on): Update.
|
|
|
|
|
* symmisc.c (maintenance_expand_symtabs): Update.
|
|
|
|
|
* symfile.h (expand_symtabs_matching): Add search_flags
|
|
|
|
|
parameter.
|
|
|
|
|
* symfile.c (expand_symtabs_matching): Add search_flags
|
|
|
|
|
parameter.
|
|
|
|
|
* symfile-debug.c (objfile::expand_symtabs_matching): Add
|
|
|
|
|
search_flags parameter.
|
|
|
|
|
* quick-symbol.h (struct quick_symbol_functions)
|
|
|
|
|
<expand_symtabs_matching>: Add search_flags parameter.
|
|
|
|
|
* python/py-symbol.c (gdbpy_lookup_static_symbols): Update.
|
|
|
|
|
* psymtab.c (recursively_search_psymtabs)
|
|
|
|
|
(psymbol_functions::expand_symtabs_matching): Add search_flags
|
|
|
|
|
parameter.
|
|
|
|
|
* psympriv.h (struct psymbol_functions) <expand_symtabs_matching>:
|
|
|
|
|
Add search_flags parameter.
|
|
|
|
|
* objfiles.h (struct objfile) <expand_symtabs_matching>: Add
|
|
|
|
|
search_flags parameter.
|
|
|
|
|
* linespec.c (iterate_over_all_matching_symtabs): Update.
|
|
|
|
|
* dwarf2/read.c (struct dwarf2_gdb_index)
|
|
|
|
|
<expand_symtabs_matching>: Add search_flags parameter.
|
|
|
|
|
(struct dwarf2_debug_names_index) <expand_symtabs_matching>: Add
|
|
|
|
|
search_flags parameter.
|
|
|
|
|
(dw2_map_matching_symbols): Update.
|
|
|
|
|
(dw2_expand_marked_cus, dw2_expand_symtabs_matching)
|
|
|
|
|
(dwarf2_gdb_index::expand_symtabs_matching): Add search_flags
|
|
|
|
|
parameter.
|
|
|
|
|
(dw2_debug_names_iterator): Change block_index to search flags.
|
|
|
|
|
<m_block_index>: Likewise.
|
|
|
|
|
(dw2_debug_names_iterator::next)
|
|
|
|
|
(dwarf2_debug_names_index::lookup_symbol)
|
|
|
|
|
(dwarf2_debug_names_index::expand_symtabs_for_function)
|
|
|
|
|
(dwarf2_debug_names_index::map_matching_symbols)
|
|
|
|
|
(dwarf2_debug_names_index::map_matching_symbols): Update.
|
|
|
|
|
(dwarf2_debug_names_index::expand_symtabs_matching): Add
|
|
|
|
|
search_flags parameter.
|
|
|
|
|
* ada-lang.c (ada_add_global_exceptions)
|
|
|
|
|
(collect_symbol_completion_matches): Update.
|
|
|
|
|
|
2021-04-17 23:35:04 +08:00
|
|
|
|
2021-04-17 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symtab.c (default_collect_symbol_completion_matches_break_on):
|
|
|
|
|
Update.
|
|
|
|
|
* symfile.h (expand_symtabs_matching): Return bool.
|
|
|
|
|
* symfile.c (expand_symtabs_matching): Return bool.
|
|
|
|
|
* symfile-debug.c (objfile::expand_symtabs_matching): Return
|
|
|
|
|
bool.
|
|
|
|
|
* quick-symbol.h (expand_symtabs_exp_notify_ftype): Return bool.
|
|
|
|
|
(struct quick_symbol_functions) <expand_symtabs_matching>: Return
|
|
|
|
|
bool.
|
|
|
|
|
* psymtab.c (psymbol_functions::expand_symtabs_matching): Return
|
|
|
|
|
bool.
|
|
|
|
|
* psympriv.h (struct psymbol_functions)
|
|
|
|
|
<expand_symtabs_matching>: Return bool.
|
|
|
|
|
* objfiles.h (struct objfile) <expand_symtabs_matching>: Return
|
|
|
|
|
bool.
|
|
|
|
|
* dwarf2/read.c (struct dwarf2_gdb_index)
|
|
|
|
|
<expand_symtabs_matching>: Return bool.
|
|
|
|
|
(struct dwarf2_debug_names_index) <expand_symtabs_matching>:
|
|
|
|
|
Return bool.
|
|
|
|
|
(dw2_expand_symtabs_matching_symbol): Return bool.
|
|
|
|
|
(dw2_expand_symtabs_matching_one, dw2_expand_marked_cus)
|
|
|
|
|
(dw2_expand_symtabs_matching)
|
|
|
|
|
(dwarf2_gdb_index::expand_symtabs_matching)
|
|
|
|
|
(dwarf2_debug_names_index::expand_symtabs_matching)
|
|
|
|
|
(dwarf2_debug_names_index::expand_symtabs_matching): Return bool.
|
|
|
|
|
|
2021-04-17 23:35:04 +08:00
|
|
|
|
2021-04-17 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* quick-symbol.h (enum block_search_flag_values): New.
|
|
|
|
|
(block_search_flags): New enum flags type.
|
|
|
|
|
|
2021-04-17 06:34:07 +08:00
|
|
|
|
2021-04-16 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-parse.c: New file.
|
|
|
|
|
* rust-exp.y: Remove.
|
|
|
|
|
* Makefile.in (COMMON_SFILES): Add rust-parse.c.
|
|
|
|
|
(SFILES): Remove rust-exp.y.
|
|
|
|
|
(YYFILES, local-maintainer-clean): Remove rust-exp.c.
|
|
|
|
|
|
2021-04-14 22:20:18 +08:00
|
|
|
|
2021-04-16 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* arch-utils.c (default_floatformat_for_type): Handle bfloat16.
|
|
|
|
|
|
2021-04-16 06:39:52 +08:00
|
|
|
|
2021-04-15 John Baldwin <jhb@FreeBSD.org>
|
|
|
|
|
|
|
|
|
|
* fbsd-nat.c (fbsd_lwp_debug_printf, fbsd_nat_debug_printf): New,
|
|
|
|
|
use throughout file.
|
|
|
|
|
|
2021-04-16 00:14:11 +08:00
|
|
|
|
2021-04-15 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-valprint.c (ada_value_print_array): Handle optimized-out
|
|
|
|
|
arrays.
|
|
|
|
|
|
2021-04-16 00:14:11 +08:00
|
|
|
|
2021-04-15 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* printcmd.c (print_variable_and_value): Use
|
|
|
|
|
common_val_print_checked.
|
|
|
|
|
|
2021-04-16 00:05:00 +08:00
|
|
|
|
2021-04-15 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* rust-exp.y (rust_parser::convert_ast_to_expression): Update.
|
|
|
|
|
* parse.c (parser_state::push_symbol, parser_state::push_dollar):
|
|
|
|
|
Update.
|
|
|
|
|
* p-exp.y (variable): Update.
|
|
|
|
|
* m2-exp.y (variable): Update.
|
|
|
|
|
* go-exp.y (variable): Update.
|
|
|
|
|
* expprint.c (dump_for_expression): New overload.
|
|
|
|
|
* expop.h (check_objfile): New overload.
|
|
|
|
|
(check_constant): New overload.
|
|
|
|
|
(class var_value_operation): Use block_symbol.
|
|
|
|
|
<get_symbol>: Rewrite.
|
|
|
|
|
* eval.c (var_value_operation::evaluate)
|
|
|
|
|
(var_value_operation::evaluate_funcall)
|
|
|
|
|
(var_value_operation::evaluate_for_address)
|
|
|
|
|
(var_value_operation::evaluate_for_address)
|
|
|
|
|
(var_value_operation::evaluate_with_coercion)
|
|
|
|
|
(var_value_operation::evaluate_for_sizeof)
|
|
|
|
|
(var_value_operation::evaluate_for_cast): Update.
|
|
|
|
|
* d-exp.y (PrimaryExpression): Update.
|
|
|
|
|
* c-exp.y (variable): Update.
|
|
|
|
|
* ax-gdb.c (var_value_operation::do_generate_ax): Update.
|
|
|
|
|
* ada-lang.c (ada_var_value_operation::evaluate_for_cast)
|
|
|
|
|
(ada_var_value_operation::evaluate)
|
|
|
|
|
(ada_var_value_operation::resolve)
|
|
|
|
|
(ada_funcall_operation::resolve): Update.
|
|
|
|
|
* ada-exp.y (write_var_from_sym, write_object_renaming)
|
|
|
|
|
(write_ambiguous_var, write_var_or_type, write_name_assoc)
|
|
|
|
|
(maybe_overload): Update.
|
|
|
|
|
* ada-exp.h (class ada_var_value_operation) <get_block>: Rewrite.
|
|
|
|
|
|
2020-07-06 03:02:40 +08:00
|
|
|
|
2021-04-15 Tom Tromey <tom@tromey.com>
|
|
|
|
|
Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Add entry.
|
|
|
|
|
* main.c (captured_main_1): Call check_quiet_mode.
|
|
|
|
|
* top.c (startup_quiet): New global.
|
|
|
|
|
(check_quiet_mode): New function.
|
|
|
|
|
(show_startup_quiet): New function.
|
|
|
|
|
(init_main): Register new command.
|
|
|
|
|
* top.h (check_quiet_mode): Declare.
|
|
|
|
|
|
2020-09-25 23:28:05 +08:00
|
|
|
|
2021-04-15 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
PR cli/25956
|
|
|
|
|
* NEWS: Mention new early init files and command line options.
|
|
|
|
|
* config.in: Regenerate.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* configure.ac: Define GDBEARLYINIT.
|
|
|
|
|
* main.c (get_earlyinit_files): New function.
|
|
|
|
|
(enum cmdarg_kind): Add CMDARG_EARLYINIT_FILE and
|
|
|
|
|
CMDARG_EARLYINIT_COMMAND.
|
|
|
|
|
(captured_main_1): Add support for new command line flags, and for
|
|
|
|
|
processing startup files.
|
|
|
|
|
(print_gdb_help): Include startup files in the output.
|
|
|
|
|
|
2021-01-14 22:32:35 +08:00
|
|
|
|
2021-04-15 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* main.c (relocate_gdbinit_path_maybe_in_datadir): Rename to...
|
|
|
|
|
(relocate_file_path_maybe_in_datadir): ...this.
|
|
|
|
|
(class gdb_initfile_finder): New class.
|
|
|
|
|
(get_init_files): Now uses gdb_initfile_finder.
|
|
|
|
|
(print_gdb_help): Print 'None found' when there are no init files.
|
|
|
|
|
|
gdb/dwarf2: fix "info locals" for clang-compiled inlined functions
GDB reports duplicate local vars with "<optimized out>" values for
inlined functions that are compiled with Clang.
Suppose we have
__attribute__((always_inline))
static void aFunction() {
int a = 42;
if(a > 2) {
int value = a;
value += 10; /* break here */
}
}
The "info locals" command at the "break here" line gives the following
output:
...
Breakpoint 1, aFunction () at test.c:6
6 value += 10; /* break here */
(gdb) info locals
value = 42
a = 42
value = <optimized out>
(gdb)
The reason is, inlined functions that are compiled by Clang do not
contain DW_AT_abstract_origin attributes in the DW_TAG_lexical_block
entries. See
https://bugs.llvm.org/show_bug.cgi?id=49953
E.g. the DIE of the inlined function above is
0x00000087: DW_TAG_inlined_subroutine
DW_AT_abstract_origin (0x0000002a "aFunction")
DW_AT_low_pc (0x00000000004004b2)
DW_AT_high_pc (0x00000000004004d2)
DW_AT_call_file ("/tmp/test.c")
DW_AT_call_line (11)
DW_AT_call_column (0x03)
0x0000009b: DW_TAG_variable
DW_AT_location (DW_OP_fbreg -4)
DW_AT_abstract_origin (0x00000032 "a")
0x000000a3: DW_TAG_lexical_block
DW_AT_low_pc (0x00000000004004c3)
DW_AT_high_pc (0x00000000004004d2)
0x000000b0: DW_TAG_variable
DW_AT_location (DW_OP_fbreg -8)
DW_AT_abstract_origin (0x0000003e "value")
This causes GDB to fail matching the concrete lexical scope with the
corresponding abstract entry. Hence, the local vars of the abstract
function that are contained in the lexical scope are read separately
(and thus, in addition to) the local vars of the concrete scope.
Because the abstract definitions of the vars do not contain location
information, we see the extra 'value = <optimized out>' above.
This bug is highly related to PR gdb/25695, but the root cause is not
exactly the same. In PR gdb/25695, GCC emits an extra
DW_TAG_lexical_block without an DW_AT_abstract_origin that wraps the
body of the inlined function. That is, the trees of the abstract DIE
for the function and its concrete instance are structurally not the
same. In the case of using Clang, the trees have the same structure.
To tackle the Clang case, when traversing the children of the concrete
instance root, keep a reference to the child of the abstract DIE that
corresponds to the concrete child, so that we can match the two DIEs
heuristically in case of missing DW_AT_abstract_origin attributes.
The updated gdb.opt/inline-locals.exp test has been checked with GCC
5-10 and Clang 5-11.
gdb/ChangeLog:
2021-04-14 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* dwarf2/read.c (inherit_abstract_dies): Keep a reference to the
corresponding child of the abstract DIE when iterating the
children of the concrete DIE.
gdb/testsuite/ChangeLog:
2021-04-14 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* gdb.opt/inline-locals.c (scoped): New function.
(main): Call 'scoped'.
* gdb.opt/inline-locals.exp: Update with "info locals" tests
for scoped variables.
* gdb.dwarf2/dw2-inline-with-lexical-scope.c: New file.
* gdb.dwarf2/dw2-inline-with-lexical-scope.exp: New file.
2021-02-08 23:48:39 +08:00
|
|
|
|
2021-04-14 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (inherit_abstract_dies): Keep a reference to the
|
|
|
|
|
corresponding child of the abstract DIE when iterating the
|
|
|
|
|
children of the concrete DIE.
|
|
|
|
|
|
2021-04-13 23:38:53 +08:00
|
|
|
|
2021-04-13 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
* ui-style.c (read_semi_number, extended_color): Change idx parameter
|
|
|
|
|
type to regoff_t *.
|
|
|
|
|
|
2021-04-13 20:19:52 +08:00
|
|
|
|
2021-04-13 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* rs6000-tdep.c (ppc_displaced_step_fixup): Use %s to print
|
|
|
|
|
hex values.
|
|
|
|
|
|
2021-04-13 03:11:02 +08:00
|
|
|
|
2021-04-12 Will Schmidt <will_schmidt@vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* rs6000-tdep.c: Add support for single-stepping of
|
|
|
|
|
prefixed instructions.
|
|
|
|
|
|
2021-04-13 01:17:52 +08:00
|
|
|
|
2021-04-12 Will Schmidt <will_schmidt@vnet.ibm.com>
|
|
|
|
|
|
2021-04-13 02:35:54 +08:00
|
|
|
|
PR gdb/27525
|
|
|
|
|
* gdb/rs6000-tdep.c (ppc_displaced_step_fixup): Update to
|
|
|
|
|
handle the addpcis/lnia instruction.
|
|
|
|
|
|
|
|
|
|
2021-04-05 Will Schmidt <will_schmidt@vnet.ibm.com>
|
|
|
|
|
|
2021-04-13 01:17:52 +08:00
|
|
|
|
* MAINTAINERS (Write After Approval): Add myself.
|
|
|
|
|
|
2021-03-27 05:54:47 +08:00
|
|
|
|
2021-4-12 Carl Love <cel@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
* rs6000-tdep.c (rs6000_builtin_type_vec128): Add t_float128 variable.
|
|
|
|
|
(rs6000_builtin_type_vec128): Add append_composite_type_field for
|
|
|
|
|
float128.
|
|
|
|
|
|
2021-04-12 23:10:57 +08:00
|
|
|
|
2021-04-12 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* nat/windows-nat.c: Remove all code guarded by _WIN32_WCE.
|
|
|
|
|
* nat/windows-nat.h: Likewise.
|
|
|
|
|
|
2021-04-10 16:33:08 +08:00
|
|
|
|
2021-04-10 Eli Zaretskii <eliz@gnu.org>
|
|
|
|
|
|
|
|
|
|
* windows-nat.c (windows_nat::handle_load_dll): Call
|
|
|
|
|
windows_add_dll if get_image_name failed to glean the name of the
|
|
|
|
|
DLL by using the lpImageName pointer.
|
|
|
|
|
(windows_add_all_dlls): Now a thin wrapper around windows_add_dll.
|
|
|
|
|
(windows_add_dll): Now does what windows_add_all_dlls did before,
|
|
|
|
|
but also accepts an argument LOAD_ADDR, which, if non-NULL,
|
|
|
|
|
specifies the address where the DLL was loaded into the inferior,
|
|
|
|
|
and looks for the single DLL loaded at that address.
|
|
|
|
|
|
2021-04-09 22:19:22 +08:00
|
|
|
|
2021-04-09 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* nat/aarch64-mte-linux-ptrace.c: Update include file order.
|
|
|
|
|
|
2021-04-09 03:22:41 +08:00
|
|
|
|
2021-04-08 Dominique Quatravaux <dominique.quatravaux@epfl.ch>
|
|
|
|
|
|
|
|
|
|
* darwin-nat.c (darwin_nat_target::resume): Remove status
|
|
|
|
|
variable.
|
|
|
|
|
|
2021-04-08 15:16:15 +08:00
|
|
|
|
2021-04-08 Felix Willgerodt <felix.willgerodt@intel.com>
|
|
|
|
|
|
|
|
|
|
* i386-tdep.c (i386_skip_prologue): Use symbol table to find the
|
|
|
|
|
prologue end for Intel compilers.
|
|
|
|
|
* amd64-tdep.c (amd64_skip_prologue): Likewise.
|
|
|
|
|
* producer.c (producer_is_icc_ge_19): New function.
|
|
|
|
|
* producer.h (producer_is_icc_ge_19): New declaration.
|
|
|
|
|
|
2021-04-08 15:15:58 +08:00
|
|
|
|
2021-04-08 Felix Willgerodt <felix.willgerodt@intel.com>
|
|
|
|
|
|
|
|
|
|
* producer.c: (producer_is_icc): Update for new version scheme.
|
|
|
|
|
(producer_parsing_tests): Update names and expected results.
|
|
|
|
|
* producer.h: (producer_is_icc): Update comment accordingly.
|
|
|
|
|
|
2021-04-08 04:57:29 +08:00
|
|
|
|
2021-04-07 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* target.h (struct target_ops) <follow_fork>: Return void.
|
|
|
|
|
(target_follow_fork): Likewise.
|
|
|
|
|
* target.c (default_follow_fork): Likewise.
|
|
|
|
|
(target_follow_fork): Likewise.
|
|
|
|
|
* infrun.c (follow_fork_inferior): Adjust.
|
|
|
|
|
* fbsd-nat.h (class fbsd_nat_target) <follow_fork>: Return void.
|
|
|
|
|
* fbsd-nat.c (fbsd_nat_target:::follow_fork): Likewise.
|
|
|
|
|
* linux-nat.h (class linux_nat_target) <follow_fork>: Likewise.
|
|
|
|
|
* linux-nat.c (linux_nat_target::follow_fork): Return void.
|
|
|
|
|
* obsd-nat.h (class obsd_nat_target) <follow_fork>: Return void.
|
|
|
|
|
* obsd-nat.c (obsd_nat_target::follow_fork): Likewise.
|
|
|
|
|
* remote.c (class remote_target) <follow_fork>: Likewise.
|
|
|
|
|
(remote_target::follow_fork): Likewise.
|
|
|
|
|
* target-delegates.c: Re-generate.
|
|
|
|
|
|
2021-04-08 02:07:48 +08:00
|
|
|
|
2021-04-07 Weimin Pan <weimin.pan@oracle.com>
|
|
|
|
|
|
|
|
|
|
* ctfread.c (fetch_tid_type): New function, use throughout file.
|
|
|
|
|
(read_forward_type): New function.
|
|
|
|
|
(read_type_record): Call read_forward_type.
|
|
|
|
|
|
gdb/fortran: handle dynamic types within arrays and structures
This commit replaces this patch:
https://sourceware.org/pipermail/gdb-patches/2021-January/174933.html
which was itself a replacement for this patch:
https://sourceware.org/pipermail/gdb-patches/2020-July/170335.html
The motivation behind the original patch can be seen in the new test,
which currently gives a GDB session like this:
(gdb) ptype var8
type = Type type6
PTR TO -> ( Type type2 :: ptr_1 )
PTR TO -> ( Type type2 :: ptr_2 )
End Type type6
(gdb) ptype var8%ptr_2
type = PTR TO -> ( Type type2
integer(kind=4) :: spacer
Type type1, allocatable :: t2_array(:) <------ Issue #1
End Type type2 )
(gdb) ptype var8%ptr_2%t2_array
Cannot access memory at address 0x38 <------ Issue #2
(gdb)
Issue #1: Here we see the abstract dynamic type, rather than the
resolved concrete type. Though in some cases the user might be
interested in the abstract dynamic type, I think that in most cases
showing the resolved concrete type will be of more use. Plus, the
user can always figure out the dynamic type (by source code inspection
if nothing else) given the concrete type, but it is much harder to
figure out the concrete type given only the dynamic type.
Issue #2: In this example, GDB evaluates the expression in
EVAL_AVOID_SIDE_EFFECTS mode (due to ptype). The value returned for
var8%ptr_2 will be a non-lazy, zero value of the correct dynamic
type. However, when GDB asks about the type of t2_array this requires
GDB to access the value of var8%ptr_2 in order to read the dynamic
properties. As this value was forced to zero (thanks to the use of
EVAL_AVOID_SIDE_EFFECTS) then GDB ends up accessing memory at a base
of zero plus some offset.
Both this patch, and my previous two attempts, have all tried to
resolve this problem by stopping EVAL_AVOID_SIDE_EFFECTS replacing the
result value with a zero value in some cases.
This new patch is influenced by how Ada handles its tagged typed.
There are plenty of examples in ada-lang.c, but one specific case is
ada_structop_operation::evaluate. When GDB spots that we are dealing
with a tagged (dynamic) type, and we're in EVAL_AVOID_SIDE_EFFECTS
mode, then GDB re-evaluates the child operation in EVAL_NORMAL mode.
This commit handles two cases like this specifically for Fortran, a
new fortran_structop_operation, and the already existing
fortran_undetermined, which is where we handle array accesses.
In these two locations we spot when we are dealing with a dynamic type
and re-evaluate the child operation in EVAL_NORMAL mode so that we
are able to access the dynamic properties of the type.
The rest of this commit message is my attempt to record why my
previous patches failed.
To understand my second patch, and why it failed lets consider two
expressions, this Fortran expression:
(gdb) ptype var8%ptr_2%t2_array --<A>
Operation: STRUCTOP_STRUCT --(1)
Operation: STRUCTOP_STRUCT --(2)
Operation: OP_VAR_VALUE --(3)
Symbol: var8
Block: 0x3980ac0
String: ptr_2
String: t2_array
And this C expression:
(gdb) ptype ptr && ptr->a == 3 --<B>
Operation: BINOP_LOGICAL_AND --(4)
Operation: OP_VAR_VALUE --(5)
Symbol: ptr
Block: 0x45a2a00
Operation: BINOP_EQUAL --(6)
Operation: STRUCTOP_PTR --(7)
Operation: OP_VAR_VALUE --(8)
Symbol: ptr
Block: 0x45a2a00
String: a
Operation: OP_LONG --(9)
Type: int
Constant: 0x0000000000000003
In expression <A> we should assume that t2_array is of dynamic type.
Nothing has dynamic type in expression <B>.
This is how GDB currently handles expression <A>, in all cases,
EVAL_AVOID_SIDE_EFFECTS or EVAL_NORMAL, an OP_VAR_VALUE operation
always returns the real value of the symbol, this is not forced to a
zero value even in EVAL_AVOID_SIDE_EFFECTS mode. This means that (3),
(5), and (8) will always return a real lazy value for the symbol.
However a STRUCTOP_STRUCT will always replace its result with a
non-lazy, zero value with the same type as its result. So (2) will
lookup the field ptr_2 and create a zero value with that type. In
this case the type is a pointer to a dynamic type.
Then, when we evaluate (1) to figure out the resolved type of
t2_array, we need to read the types dynamic properties. These
properties are stored in memory relative to the objects base address,
and the base address is in var8%ptr_2, which we already figured out
has the value zero. GDB then evaluates the DWARF expressions that
take the base address, add an offset and dereference. GDB then ends
up trying to access addresses like 0x16, 0x8, etc.
To fix this, I proposed changing STRUCTOP_STRUCT so that instead of
returning a zero value we instead returned the actual value
representing the structure's field in the target. My thinking was
that GDB would not try to access the value's contents unless it needed
it to resolve a dynamic type. This belief was incorrect.
Consider expression <B>. We already know that (5) and (8) will return
real values for the symbols being referenced. The BINOP_LOGICAL_AND,
operation (4) will evaluate both of its children in
EVAL_AVOID_SIDE_EFFECTS in order to get the types, this is required
for C++ operator lookup. This means that even if the value of (5)
would result in the BINOP_LOGICAL_AND returning false (say, ptr is
NULL), we still evaluate (6) in EVAL_AVOID_SIDE_EFFECTS mode.
Operation (6) will evaluate both children in EVAL_AVOID_SIDE_EFFECTS
mode, operation (9) is easy, it just returns a value with the constant
packed into it, but (7) is where the problem lies. Currently in GDB
this STRUCTOP_STRUCT will always return a non-lazy zero value of the
correct type.
When the results of (7) and (9) are back in the BINOP_LOGICAL_AND
operation (6), the two values are passed to value_equal which performs
the comparison and returns a result. Note, the two things compared
here are the immediate value (9), and a non-lazy zero value from (7).
However, with my proposed patch operation (7) no longer returns a zero
value, instead it returns a lazy value representing the actual value
in target memory. When we call value_equal in (6) this code causes
GDB to try and fetch the actual value from target memory. If `ptr` is
NULL then this will cause GDB to access some invalid address at an
offset from zero, this will most likely fail, and cause GDB to throw
an error instead of returning the expected type.
And so, we can now describe the problem that we're facing. The way
GDB's expression evaluator is currently written we assume, when in
EVAL_AVOID_SIDE_EFFECTS mode, that any value returned from a child
operation can safely have its content read without throwing an
error. If child operations start returning real values (instead of
the fake zero values), then this is simply not true.
If we wanted to work around this then we would need to rewrite almost
all operations (I would guess) so that EVAL_AVOID_SIDE_EFFECTS mode
does not cause evaluation of an operation to try and read the value of
a child operation. As an example, consider this current GDB code from
eval.c:
struct value *
eval_op_equal (struct type *expect_type, struct expression *exp,
enum noside noside, enum exp_opcode op,
struct value *arg1, struct value *arg2)
{
if (binop_user_defined_p (op, arg1, arg2))
{
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
}
else
{
binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2);
int tem = value_equal (arg1, arg2);
struct type *type = language_bool_type (exp->language_defn,
exp->gdbarch);
return value_from_longest (type, (LONGEST) tem);
}
}
We could change this function to be this:
struct value *
eval_op_equal (struct type *expect_type, struct expression *exp,
enum noside noside, enum exp_opcode op,
struct value *arg1, struct value *arg2)
{
if (binop_user_defined_p (op, arg1, arg2))
{
return value_x_binop (arg1, arg2, op, OP_NULL, noside);
}
else
{
struct type *type = language_bool_type (exp->language_defn,
exp->gdbarch);
if (noside == EVAL_AVOID_SIDE_EFFECTS)
return value_zero (type, VALUE_LVAL (arg1));
else
{
binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2);
int tem = value_equal (arg1, arg2);
return value_from_longest (type, (LONGEST) tem);
}
}
}
Now we don't call value_equal unless we really need to. However, we
would need to make the same, or similar change to almost all
operations, which would be a big task, and might not be a direction we
wanted to take GDB in.
So, for now, I'm proposing we go with the more targeted, Fortran
specific solution, that does the minimal required in order to
correctly resolve the dynamic types.
gdb/ChangeLog:
* f-exp.h (class fortran_structop_operation): New class.
* f-exp.y (exp): Create fortran_structop_operation instead of the
generic structop_operation.
* f-lang.c (fortran_undetermined::evaluate): Re-evaluate
expression as EVAL_NORMAL if the result type was dynamic so we can
extract the actual array bounds.
(fortran_structop_operation::evaluate): New function.
gdb/testsuite/ChangeLog:
* gdb.fortran/dynamic-ptype-whatis.exp: New file.
* gdb.fortran/dynamic-ptype-whatis.f90: New file.
2021-01-08 21:07:32 +08:00
|
|
|
|
2021-04-07 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* f-exp.h (class fortran_structop_operation): New class.
|
|
|
|
|
* f-exp.y (exp): Create fortran_structop_operation instead of the
|
|
|
|
|
generic structop_operation.
|
|
|
|
|
* f-lang.c (fortran_undetermined::evaluate): Re-evaluate
|
|
|
|
|
expression as EVAL_NORMAL if the result type was dynamic so we can
|
|
|
|
|
extract the actual array bounds.
|
|
|
|
|
(fortran_structop_operation::evaluate): New function.
|
|
|
|
|
|
|
|
|
|
2021-04-07 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (evaluate_subexp_standard): Remove
|
|
|
|
|
EVAL_AVOID_SIDE_EFFECTS handling from STRUCTOP_STRUCT and
|
|
|
|
|
STRUCTOP_PTR.
|
|
|
|
|
|
gdb: allow casting to rvalue reference in more cases
It is not currently possible to cast some values to an rvaule
reference. This happens when simple scalar values are cast to an
rvalue reference of the same type, e.g.:
int global_var;
Then in GDB:
(gdb) p static_cast<int&&> (global_var)
Attempt to take address of value not located in memory.
Which is clearly silly.
The problem is that as part of the cast an intermediate value is
created within GDB that becomes an lval_none rather than the original
lval_memory. The casting logic basically goes like this:
The call tree that leads to the error looks like this:
value_cast
value_cast
value_ref
value_addr
error
The first value_cast call is casting the value for 'global_var' to
type 'int&&'. GDB spots that the target type is a reference, and so
calls value_cast again, this time casting 'global_var' to type 'int'.
We then call value_ref to convert the result of the second value_cast
into a reference.
Unfortunately, the second cast results in the value (for global_var)
changing from an lval_memory to an lval_none. This is because int to
int casting calls extract_unsigned_integer and then
value_from_longest.
In theory value_cast has a check at its head that should help in this
case, the code is:
if (value_type (arg2) == type)
return arg2;
However, this only works in some cases. In our case
'value_type (arg2)' will be an objfile owned type, while the type from
the expression parser 'int&&' will be gdbarch owned. The pointers
will not be equal, but the meaning of the type will be equal.
I did consider making the int to int casting case smarter, but this
obviously is only one example. We must also consider things like
float to float, or pointer to pointer....
So, I instead decided to try and make the initial check smarter.
Instead of a straight pointer comparison, I now propose that we use
types_deeply_equal. If this is true then we are casting something
back to its current type, in which case we can preserve the lval
setting by using value_copy.
gdb/ChangeLog:
* valops.c (value_cast): Call value_deeply_equal before performing
any cast.
gdb/testsuite/ChangeLog:
* gdb.cp/rvalue-ref-params.cc (f3): New function.
(f4): New function.
(global_int): New global variable.
(global_float): Likeiwse.
(main): Call both new functions.
* gdb.cp/rvalue-ref-params.exp: Add new tests.
2021-03-09 19:11:14 +08:00
|
|
|
|
2021-04-07 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* valops.c (value_cast): Call value_deeply_equal before performing
|
|
|
|
|
any cast.
|
|
|
|
|
|
2021-03-25 01:48:27 +08:00
|
|
|
|
2021-04-07 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.c (types_equal): Move pointer equality check earlier in
|
|
|
|
|
the function.
|
|
|
|
|
|
2021-03-18 06:54:22 +08:00
|
|
|
|
2021-04-07 Caroline Tice <cmtice@google.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (try_open_dwop_file): Add path for the binary to
|
|
|
|
|
the search paths used resolve relative location of .dwo file.
|
|
|
|
|
|
gdb: Handle missing .debug_str section
While messing with the Dwarf assembler (gdb/testsuite/lib/dwarf.exp) I
managed to create an ELF which made use of DW_FORM_strp, but didn't
include a .debug_str section.
When I started GDB on this ELF, GDB crashed. I would have expected to
get an error instead.
I tracked this down to an unfortunate design choice in
dwarf2_section_info, a class which wraps around a bfd section, and is
used for reading in debug information. GBB creates many
dwarf2_section_info objects, one for each debug section that might
need to be read, then as we find the input bfd sections we associate
them with the corresponding dwarf2_section_info.
If no matching input bfd section is found then the dwarf2_section_info
is left in an unassociated state, its internal bfd section pointer is
null.
If later GDB tries to read content from the dwarf2_section_info, for
example, which trying to read the string associated with DW_FORM_strp,
we spot that there is no associated bfd section and issue an error
message.
To make the users life easier, the error message includes the section
name being looked for, and the bfd from which the section was
obtained.
However, we get the section name by calling bfd_section_name on the
associated section, and we get the bfd filename by calling
bfd_get_filename on the owner of the associated section.
Of course, if there is no associated section then both the calls
bfd_section_name and dwarf2_section_info::get_bfd_owner will result in
undefined behaviour (e.g. a crash).
The solution I propose in this patch is, I know, not ideal. I simply
spot the case where there is no associated section, and print a
simpler error message, leaving out the section name and filename.
A better solution would involve redesigning dwarf2_section_info, we
could associate each dwarf2_section_info with the initial bfd being
parsed. We would then display this filename if there's nothing better
to display (e.g. if we find a section in a dwo/dwp split dwarf file
then we would probably use that filename in preference).
Each dwarf2_section_info could also have the concept of the default
section name that would be read for that section, for example, string
data might appear in ".debug_str" or ".zdebug_str", but if neither is
found, then it would probably be OK to just say ".debug_str" is
missing.
Anyway, I didn't do any of that redesign, I just wanted to stop GDB
crashing for now, so instead we get this:
Dwarf Error: DW_FORM_strp used without required section
Which isn't the best, but in context, isn't too bad:
Reading symbols from /path/to/executable...
Dwarf Error: DW_FORM_strp used without required section
(No debugging symbols found in /path/to/executable)
I also added some asserts into dwarf2_section_info which should
trigger before GDB crashes in future, if we trigger any other bad
paths through this code.
And there's a test for the specific issue I hit.
gdb/ChangeLog:
* dwarf2/section.c (dwarf2_section_info::get_bfd_owner): Add an
assert.
(dwarf2_section_info::get_file_name): Add an assert.
(dwarf2_section_info::read_string): Display a minimal, sane error
when the dwarf2_section_info is not associated with a bfd section.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/dw2-using-debug-str.exp: Add an additional test.
2021-03-23 00:37:39 +08:00
|
|
|
|
2021-04-07 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/section.c (dwarf2_section_info::get_bfd_owner): Add an
|
|
|
|
|
assert.
|
|
|
|
|
(dwarf2_section_info::get_file_name): Add an assert.
|
|
|
|
|
(dwarf2_section_info::read_string): Display a minimal, sane error
|
|
|
|
|
when the dwarf2_section_info is not associated with a bfd section.
|
|
|
|
|
|
gdb/py: fix gdb.parameter('data-directory')
It was reported on IRC that using gdb.parameter('data-directory')
doesn't work correctly.
The problem is that the data directory is stored in 'gdb_datadir',
however the set/show command is associated with a temporary
'staged_gdb_datadir'.
When the user does 'set data-directory VALUE', the VALUE is stored in
'staged_gdb_datadir' by GDB, then set_gdb_datadir is called. This in
turn calls set_gdb_data_directory to copy the value from
staged_gdb_datadir into gdb_datadir.
However, set_gdb_data_directory will resolve relative paths, so the
value stored in gdb_datadir might not match the value in
staged_gdb_datadir.
The Python gdb.parameter API fetches the parameter values by accessing
the variable associated with the show command, so in this case
staged_gdb_datadir. This causes two problems:
1. Initially staged_gdb_datadir is NULL, and remains as such until the
user does 'set data-directory VALUE' (which might never happen), but
gdb_datadir starts with GDB's default data-directory value. So
initially from Python gdb.parameter('data-directory') will return the
empty string, even though at GDB's CLI 'show data-directory' prints a
real path.
2. If the user does 'set data-directory ./some/relative/path', GDB
will resolve the relative path, thus, 'show data-directory' at the CLI
will print an absolute path. However, the value is staged_gdb_datadir
will still be the relative path, and gdb.parameter('data-directory')
from Python will return the relative path.
In this commit I fix both of these issues by:
1. Initialising the value in staged_gdb_datadir based on the initial
value in gdb_datadir, and
2. In set_gdb_datadir, after calling set_gdb_data_directory, I copy
the value in gdb_datadir back into staged_gdb_datadir.
With these two changes in place the value in staged_gdb_datadir should
always match the value in gdb_datadir, and accessing data-directory
from Python should now work correctly.
gdb/ChangeLog:
* top.c (staged_gdb_datadir): Update comment.
(set_gdb_datadir): Copy the value of gdb_datadir back into
staged_datadir.
(init_main): Initialise staged_gdb_datadir.
gdb/testsuite/ChangeLog:
* gdb.python/py-parameter.exp: Add test for reading data-directory
using gdb.parameter API.
2021-03-27 01:14:26 +08:00
|
|
|
|
2021-04-07 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* top.c (staged_gdb_datadir): Update comment.
|
|
|
|
|
(set_gdb_datadir): Copy the value of gdb_datadir back into
|
|
|
|
|
staged_datadir.
|
|
|
|
|
(init_main): Initialise staged_gdb_datadir.
|
|
|
|
|
|
2021-04-06 21:12:38 +08:00
|
|
|
|
2021-04-06 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/25884
|
|
|
|
|
* infcmd.c (prepare_one_step): Using inline frame info to narrow
|
|
|
|
|
stepping range.
|
|
|
|
|
|
2021-04-06 16:40:11 +08:00
|
|
|
|
2021-04-06 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR tui/27680
|
|
|
|
|
* tui/tui-disasm.c (len_without_escapes): Pass ptr pointing at escape
|
|
|
|
|
to style.parse.
|
|
|
|
|
|
gdb: fix internal error in avr_frame_unwind_cache
When trying to do pretty much anything that requires unwinding a frame
on AVR, we get
/home/simark/src/wt/avr/gdb/trad-frame.h:143: internal-error: LONGEST trad_frame_saved_reg::addr() const: Assertion `m_kind == trad_frame_saved_reg_kind::ADDR' failed.
This is likely coming from the trad-frame refactor in 098caef485a4
("Refactor struct trad_frame_saved_regs"). Here's an example of how to
reproduce it:
In one terminal:
$ cat test.c
int foo(int x)
{
return x * 7;
}
int main() {
return foo(2);
}
$ avr-gcc -gdwarf-4 -mmcu=atmega2560 test.c
$ /tmp/simavr/bin/simavr --mcu atmega2560 -g a.out
Loaded 330 .text at address 0x0
Loaded 0 .data
And in another one:
$ ./gdb -q -nx --data-directory=data-directory a.out -ex "tar rem :1234" -ex "b foo" -ex c -ex bt
Reading symbols from a.out...
Remote debugging using :1234
0x00000000 in __vectors ()
Breakpoint 1 at 0x110: file test.c, line 3.
Note: automatically using hardware breakpoints for read-only addresses.
Continuing.
Breakpoint 1, foo (x=2) at test.c:3
3 return x * 7;
#0 foo (x=2) at test.c:3
/home/simark/src/wt/avr/gdb/trad-frame.h:143: internal-error: LONGEST trad_frame_saved_reg::addr() const: Assertion `m_kind == trad_frame_saved_reg_kind::ADDR' failed.
What the AVR code does is:
1. In avr_scan_prologue, in the block that says "First stage of the
prologue scanning.", look for "push rX" instructions and note that rX
is saved on the stack. But instead of putting the actual stack
address directly, it puts an offset (from the previous frame's sp).
2. Back in avr_frame_unwind_cache, in the block that says "Adjust all
the saved registers", adjust all these values to be real stack
addresses.
To check whether a register was assigned an address (and therefore if it
needs adjustment), the code does:
if (info->saved_regs[i].addr () > 0)
Since commit 098caef485a4, it's invalid to call the `addr` getter of
trad_frame_saved_reg if the register hasn't been assigned an address.
Instead, the code could use the `is_addr` getter to verify if the
register has been assigned an address. This is what this patch does.
gdb/ChangeLog:
* avr-tdep.c (avr_frame_unwind_cache): Use
trad_frame_saved_reg::is_addr.
Change-Id: I5803089160b829400178746c5e3bca0c1cd11c00
2021-04-05 10:29:34 +08:00
|
|
|
|
2021-04-04 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* avr-tdep.c (avr_frame_unwind_cache): Use
|
|
|
|
|
trad_frame_saved_reg::is_addr.
|
|
|
|
|
|
gdb: remove objfile parameter from get_objfile_bfd_data
I noticed it was unused. I think that makes sense, as it shows that
objfile_per_bfd_storage is not specific to one objfile (it can be shared
by multiple objfiles that have the same bfd).
There is one thing I wonder though, maybe I'm missing something. If
the BFD doesn't require relocation, get_objfile_bfd_data stores the
newly allocated object in objfiles_bfd_data, so we can assume that
objfiles_bfd_data is the owner of the object. When the bfd's refcount
drops to 0, the corresponding objfile_per_bfd_storage object in
objfiles_bfd_data is deleted.
But if the BFD requires relocation, get_objfile_bfd_data returns a newly
allocated object that isn't kept anywhere else (and isn't shared). So
the objfile becomes the owner of the objfile_per_bfd_storage object. In
objfile::~objfile, we have this:
if (obfd)
gdb_bfd_unref (obfd);
else
delete per_bfd;
I'm thinking that obfd could be non-nullptr, and it could require
relocation. In that case, it would never be freed. Anyway, that's not
really connected to this patch.
gdb/ChangeLog:
* objfiles.c (get_objfile_bfd_data): Remove objfile parameter,
adjust callers.
Change-Id: Ifa3158074ea6b42686780ba09d0c964b0cf14cf1
2021-04-02 23:50:45 +08:00
|
|
|
|
2021-04-02 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* objfiles.c (get_objfile_bfd_data): Remove objfile parameter,
|
|
|
|
|
adjust callers.
|
|
|
|
|
|
2021-04-02 23:45:25 +08:00
|
|
|
|
2021-04-02 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* psympriv.h (struct partial_symtab) <partial_symtab>: Change
|
|
|
|
|
objfile parameter for objfile_per_bfd_storage, adjust callers.
|
|
|
|
|
(struct standard_psymtab) <standard_psymtab>: Likewise.
|
|
|
|
|
(struct legacy_psymtab) <legacy_psymtab>: Likewise.
|
|
|
|
|
* psymtab.c (partial_symtab::partial_symtab): Likewise.
|
|
|
|
|
* ctfread.c (struct ctf_psymtab): Likewise.
|
|
|
|
|
* dwarf2/read.h (struct dwarf2_psymtab): Likewise.
|
|
|
|
|
* dwarf2/read.c (struct dwarf2_include_psymtab): Likewise.
|
|
|
|
|
(dwarf2_create_include_psymtab): Likewise.
|
|
|
|
|
* objfiles.h (struct objfile_per_bfd_storage)
|
|
|
|
|
<objfile_per_bfd_storage>: Add bfd parameter, adjust callers.
|
|
|
|
|
<get_bfd>: New method.
|
|
|
|
|
<m_bfd>: New field.
|
|
|
|
|
* objfiles.c (get_objfile_bfd_data): Adjust.
|
|
|
|
|
|
2021-04-02 23:39:55 +08:00
|
|
|
|
2021-04-02 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* psymtab.c (partial_symtab::partial_symtab): Change
|
|
|
|
|
last_objfile_name to be an std::string.
|
|
|
|
|
* symfile.c (allocate_symtab): Likewise.
|
|
|
|
|
|
2021-04-02 23:23:52 +08:00
|
|
|
|
2021-04-02 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* objfiles.h (struct objfile_per_bfd_storage) <intern>: New
|
|
|
|
|
methods.
|
|
|
|
|
(struct objfile) <intern>: Use
|
|
|
|
|
objfile::objfile_per_bfd_storage::intern.
|
|
|
|
|
|
2021-04-02 09:10:09 +08:00
|
|
|
|
2021-04-01 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (TYPE_FLAG_ENUM): Remove, replace all uses
|
|
|
|
|
with type::is_flag_enum.
|
|
|
|
|
|
2021-04-02 09:10:09 +08:00
|
|
|
|
2021-04-01 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (struct type) <is_flag_enum,
|
|
|
|
|
set_is_flag_enum>: New methods.
|
|
|
|
|
(TYPE_FLAG_ENUM): Use type::is_flag_enum, change all
|
|
|
|
|
write call sites to use type::set_is_flag_enum.
|
|
|
|
|
|
2021-04-02 09:10:09 +08:00
|
|
|
|
2021-04-01 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (TYPE_DECLARED_CLASS): Remove, replace all uses
|
|
|
|
|
with type::is_declared_class.
|
|
|
|
|
|
2021-04-02 09:10:08 +08:00
|
|
|
|
2021-04-01 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (struct type) <is_declared_class,
|
|
|
|
|
set_is_declared_class>: New methods.
|
|
|
|
|
(TYPE_DECLARED_CLASS): Use type::is_declared_class, change all
|
|
|
|
|
write call sites to use type::set_is_declared_class.
|
|
|
|
|
|
2021-04-02 02:09:27 +08:00
|
|
|
|
2021-02-28 Boris Staletic <boris.staletic@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb/python/lib/gdb/__init__.py: Use importlib on python 3.4+
|
|
|
|
|
to avoid deprecation warnings.
|
|
|
|
|
|
2021-03-23 17:02:04 +08:00
|
|
|
|
2021-04-01 Martin Liska <mliska@suse.cz>
|
|
|
|
|
|
|
|
|
|
* cp-name-parser.y: Use startswith instead of strncmp.
|
|
|
|
|
* m2-exp.y: Likewise.
|
|
|
|
|
* macroexp.c (substitute_args): Likewise.
|
|
|
|
|
* mi/mi-main.c (command_notifies_uscc_observer): Likewise.
|
|
|
|
|
* rust-exp.y: Likewise.
|
|
|
|
|
|
2021-04-01 08:28:28 +08:00
|
|
|
|
2021-03-31 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (dwarf2_gdb_index::map_matching_symbols): Merge
|
|
|
|
|
with dw2_map_matching_symbols.
|
|
|
|
|
(dwarf2_gdb_index::expand_symtabs_matching): Merge with
|
|
|
|
|
dw2_expand_symtabs_matching.
|
|
|
|
|
|
2021-03-31 23:48:56 +08:00
|
|
|
|
2021-03-31 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/stringify.h: Fix typo.
|
|
|
|
|
|
gdb/dwarf: disable per-BFD resource sharing for -readnow objfiles
New in v2:
- Disable sharing only for -readnow objfiles, not all 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:
efb763a5ea35 ("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-31 01:37:11 +08:00
|
|
|
|
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-29 22:25:13 +08:00
|
|
|
|
2021-03-29 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* top.c (check_frame_language_change): Update.
|
|
|
|
|
* language.c (language_info): Remove parameter.
|
|
|
|
|
* language.h (language_info): Remove parameter.
|
|
|
|
|
|
2021-03-24 22:12:46 +08:00
|
|
|
|
2021-03-29 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* compile/compile.c (get_args): Don't add empty argv entries.
|
|
|
|
|
|
2021-03-29 19:26:35 +08:00
|
|
|
|
2021-03-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
|
|
|
|
|
|
|
|
|
gdb:
|
|
|
|
|
* procfs.c (procfs_target::attach): Define inf.
|
|
|
|
|
Use it.
|
|
|
|
|
(procfs_target::create_inferior): Likewise.
|
|
|
|
|
|
2021-03-29 00:43:15 +08:00
|
|
|
|
2021-03-28 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* elfread.c (can_lazily_read_symbols): Move to dwarf2/read.c.
|
|
|
|
|
(elf_symfile_read): Simplify.
|
|
|
|
|
* dwarf2/read.c (struct lazy_dwarf_reader): Move from elfread.c.
|
|
|
|
|
(make_lazy_dwarf_reader): New function.
|
|
|
|
|
(make_dwarf_gdb_index, make_dwarf_debug_names): Now static.
|
|
|
|
|
(dwarf2_initialize_objfile): Return void. Remove index_kind
|
|
|
|
|
parameter. Push on 'qf' list.
|
|
|
|
|
* dwarf2/public.h (dwarf2_initialize_objfile): Change return
|
|
|
|
|
type. Remove 'index_kind' parameter.
|
|
|
|
|
(make_dwarf_gdb_index, make_dwarf_debug_names): Don't declare.
|
|
|
|
|
|
2021-03-28 06:48:36 +08:00
|
|
|
|
2021-03-27 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* elfread.c (elf_sym_fns_lazy_psyms): Don't declare.
|
|
|
|
|
|
2021-03-28 06:41:53 +08:00
|
|
|
|
2021-03-27 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* elfread.c (elf_symfile_read): Don't clear 'qf'.
|
|
|
|
|
|
2021-03-27 00:46:57 +08:00
|
|
|
|
2021-03-26 Lancelot Six <lsix@lancelotsix.com>
|
|
|
|
|
|
|
|
|
|
* contrib/gdb-add-index.sh: Avoid variable shadowing and get
|
|
|
|
|
rid of 'local'.
|
|
|
|
|
|
2021-03-27 03:44:24 +08:00
|
|
|
|
2021-03-26 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symtab.c (struct output_source_filename_data): Add 'output'
|
|
|
|
|
method and operator().
|
|
|
|
|
(output_source_filename_data::output): Rename from
|
|
|
|
|
output_source_filename.
|
|
|
|
|
(output_partial_symbol_filename): Remove.
|
|
|
|
|
(info_sources_command): Update.
|
|
|
|
|
(struct add_partial_filename_data): Add operator().
|
|
|
|
|
(add_partial_filename_data::operator()): Rename from
|
|
|
|
|
maybe_add_partial_symtab_filename.
|
|
|
|
|
(make_source_files_completion_list): Update.
|
|
|
|
|
* symfile.c (quick_symbol_functions): Update.
|
|
|
|
|
* symfile-debug.c (objfile::map_symbol_filenames): Update.
|
|
|
|
|
* quick-symbol.h (symbol_filename_ftype): Change type of 'fun' and
|
|
|
|
|
'need_fullname'. Remove 'data' parameter.
|
|
|
|
|
(struct quick_symbol_functions) <map_symbol_filenames>: Likewise.
|
|
|
|
|
* psymtab.c (psymbol_functions::map_symbol_filenames): Update.
|
|
|
|
|
* psympriv.h (struct psymbol_functions) <map_symbol_filenames>:
|
|
|
|
|
Change type of 'fun' and 'need_fullname'. Remove 'data'
|
|
|
|
|
parameter.
|
|
|
|
|
* objfiles.h (struct objfile) <map_symbol_filenames>: Change type
|
|
|
|
|
of 'fun' and 'need_fullname'. Remove 'data' parameter.
|
|
|
|
|
* mi/mi-cmd-file.c (print_partial_file_name): Remove 'ignore'
|
|
|
|
|
parameter.
|
|
|
|
|
(mi_cmd_file_list_exec_source_files): Update.
|
|
|
|
|
* dwarf2/read.c
|
|
|
|
|
(dwarf2_base_index_functions::map_symbol_filenames): Update.
|
|
|
|
|
|
2021-03-27 03:44:24 +08:00
|
|
|
|
2021-03-26 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (struct match_data): Add operator().
|
|
|
|
|
(match_data::operator()): Rename from aux_add_nonlocal_symbols.
|
|
|
|
|
(callback): Remove 'callback'.
|
|
|
|
|
|
2021-03-27 03:28:03 +08:00
|
|
|
|
2021-03-26 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* psymtab.c (psymbol_functions::expand_symtabs_matching): Only
|
|
|
|
|
call make_ignore_params once.
|
|
|
|
|
|
2021-03-27 03:28:03 +08:00
|
|
|
|
2021-03-26 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* psymtab.c (psymbol_functions::expand_symtabs_matching): Remove
|
|
|
|
|
"user" check.
|
|
|
|
|
|
gdb: defer commit resume until all available events are consumed
Rationale
---------
Let's say you have multiple threads hitting a conditional breakpoint
at the same time, and all of these are going to evaluate to false.
All these threads will need to be resumed.
Currently, GDB fetches one target event (one SIGTRAP representing the
breakpoint hit) and decides that the thread should be resumed. It
calls resume and commit_resume immediately. It then fetches the
second target event, and does the same, until it went through all
threads.
The result is therefore something like:
- consume event for thread A
- resume thread A
- commit resume (affects thread A)
- consume event for thread B
- resume thread B
- commit resume (affects thread B)
- consume event for thread C
- resume thread C
- commit resume (affects thread C)
For targets where it's beneficial to group resumptions requests (most
likely those that implement target_ops::commit_resume), it would be
much better to have:
- consume event for thread A
- resume thread A
- consume event for thread B
- resume thread B
- consume event for thread C
- resume thread C
- commit resume (affects threads A, B and C)
Implementation details
----------------------
To achieve this, this patch adds another check in
maybe_set_commit_resumed_all_targets to avoid setting the
commit-resumed flag of targets that readily have events to provide to
infrun.
To determine if a target has events readily available to report, this
patch adds an `has_pending_events` target_ops method. The method
returns a simple bool to say whether or not it has pending events to
report.
Testing
=======
To test this, I start GDBserver with a program that spawns multiple
threads:
$ ../gdbserver/gdbserver --once :1234 ~/src/many-threads-stepping-over-breakpoints/many-threads-stepping-over-breakpoints
I then connect with GDB and install a conditional breakpoint that always
evaluates to false (and force the evaluation to be done by GDB):
$ ./gdb -nx --data-directory=data-directory \
/home/simark/src/many-threads-stepping-over-breakpoints/many-threads-stepping-over-breakpoints \
-ex "set breakpoint condition-evaluation host" \
-ex "set pag off" \
-ex "set confirm off" \
-ex "maint set target-non-stop on" \
-ex "tar rem :1234" \
-ex "tb main" \
-ex "b 13 if 0" \
-ex c \
-ex "set debug infrun" \
-ex "set debug remote 1" \
-ex "set debug displaced"
I then do "continue" and look at the log.
The remote target receives a bunch of stop notifications for all
threads that have hit the breakpoint. infrun consumes and processes
one event, decides it should not cause a stop, prepares a displaced
step, after which we should see:
[infrun] maybe_set_commit_resumed_all_process_targets: not requesting commit-resumed for target remote, target has pending events
Same for a second thread (since we have 2 displaced step buffers).
For the following threads, their displaced step is deferred since
there are no more buffers available.
After consuming the last event the remote target has to offer, we get:
[infrun] maybe_set_commit_resumed_all_process_targets: enabling commit-resumed for target remote
[infrun] maybe_call_commit_resumed_all_process_targets: calling commit_resumed for target remote
[remote] Sending packet: $vCont;s:p14d16b.14d1b1;s:p14d16b.14d1b2#55
[remote] Packet received: OK
Without the patch, there would have been one vCont;s just after each
prepared displaced step.
gdb/ChangeLog:
yyyy-mm-dd Simon Marchi <simon.marchi@efficios.com>
Pedro Alves <pedro@palves.net>
* async-event.c (async_event_handler_marked): New.
* async-event.h (async_event_handler_marked): Declare.
* infrun.c (maybe_set_commit_resumed_all_targets): Switch to
inferior before calling target method. Don't commit-resumed if
target_has_pending_events is true.
* remote.c (remote_target::has_pending_events): New.
* target-delegates.c: Regenerate.
* target.c (target_has_pending_events): New.
* target.h (target_ops::has_pending_events): New target method.
(target_has_pending_events): New.
Change-Id: I18112ba19a1ff4986530c660f530d847bb4a1f1d
2020-07-07 03:53:28 +08:00
|
|
|
|
2021-03-26 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* async-event.c: Include "infrun.h".
|
|
|
|
|
(async_event_handler_marked): New.
|
|
|
|
|
* async-event.h (async_event_handler_marked): Declare.
|
|
|
|
|
* infrun.c (maybe_set_commit_resumed_all_targets): Switch to
|
|
|
|
|
inferior before calling target method. Don't commit-resumed if
|
|
|
|
|
target_has_pending_events is true.
|
|
|
|
|
* remote.c (remote_target::has_pending_events): New.
|
|
|
|
|
* target-delegates.c: Regenerate.
|
|
|
|
|
* target.c (target_has_pending_events): New.
|
|
|
|
|
* target.h (target_ops::has_pending_events): New target method.
|
|
|
|
|
(target_has_pending_events): New.
|
|
|
|
|
|
gdb: generalize commit_resume, avoid commit-resuming when threads have pending statuses
The rationale for this patch comes from the ROCm port [1], the goal
being to reduce the number of back and forths between GDB and the
target when doing successive operations. I'll start with explaining
the rationale and then go over the implementation. In the ROCm / GPU
world, the term "wave" is somewhat equivalent to a "thread" in GDB.
So if you read if from a GPU stand point, just s/thread/wave/.
ROCdbgapi, the library used by GDB [2] to communicate with the GPU
target, gives the illusion that it's possible for the debugger to
control (start and stop) individual threads. But in reality, this is
not how it works. Under the hood, all threads of a queue are
controlled as a group. To stop one thread in a group of running ones,
the state of all threads is retrieved from the GPU, all threads are
destroyed, and all threads but the one we want to stop are re-created
from the saved state. The net result, from the point of view of GDB,
is that the library stopped one thread. The same thing goes if we
want to resume one thread while others are running: the state of all
running threads is retrieved from the GPU, they are all destroyed, and
they are all re-created, including the thread we want to resume.
This leads to some inefficiencies when combined with how GDB works,
here are two examples:
- Stopping all threads: because the target operates in non-stop mode,
when the user interface mode is all-stop, GDB must stop all threads
individually when presenting a stop. Let's suppose we have 1000
threads and the user does ^C. GDB asks the target to stop one
thread. Behind the scenes, the library retrieves 1000 thread
states and restores the 999 others still running ones. GDB asks
the target to stop another one. The target retrieves 999 thread
states and restores the 998 remaining ones. That means that to
stop 1000 threads, we did 1000 back and forths with the GPU. It
would have been much better to just retrieve the states once and
stop there.
- Resuming with pending events: suppose the 1000 threads hit a
breakpoint at the same time. The breakpoint is conditional and
evaluates to true for the first thread, to false for all others.
GDB pulls one event (for the first thread) from the target, decides
that it should present a stop, so stops all threads using
stop_all_threads. All these other threads have a breakpoint event
to report, which is saved in `thread_info::suspend::waitstatus` for
later. When the user does "continue", GDB resumes that one thread
that did hit the breakpoint. It then processes the pending events
one by one as if they just arrived. It picks one, evaluates the
condition to false, and resumes the thread. It picks another one,
evaluates the condition to false, and resumes the thread. And so
on. In between each resumption, there is a full state retrieval
and re-creation. It would be much nicer if we could wait a little
bit before sending those threads on the GPU, until it processed all
those pending events.
To address this kind of performance issue, ROCdbgapi has a concept
called "forward progress required", which is a boolean state that
allows its user (i.e. GDB) to say "I'm doing a bunch of operations,
you can hold off putting the threads on the GPU until I'm done" (the
"forward progress not required" state). Turning forward progress back
on indicates to the library that all threads that are supposed to be
running should now be really running on the GPU.
It turns out that GDB has a similar concept, though not as general,
commit_resume. One difference is that commit_resume is not stateful:
the target can't look up "does the core need me to schedule resumed
threads for execution right now". It is also specifically linked to
the resume method, it is not used in other contexts. The target
accumulates resumption requests through target_ops::resume calls, and
then commits those resumptions when target_ops::commit_resume is
called. The target has no way to check if it's ok to leave resumed
threads stopped in other target methods.
To bridge the gap, this patch generalizes the commit_resume concept in
GDB to match the forward progress concept of ROCdbgapi. The current
name (commit_resume) can be interpreted as "commit the previous resume
calls". I renamed the concept to "commit_resumed", as in "commit the
threads that are resumed".
In the new version, we have two things:
- the commit_resumed_state field in process_stratum_target: indicates
whether GDB requires target stacks using this target to have
resumed threads committed to the execution target/device. If
false, an execution target is allowed to leave resumed threads
un-committed at the end of whatever method it is executing.
- the commit_resumed target method: called when commit_resumed_state
transitions from false to true. While commit_resumed_state was
false, the target may have left some resumed threads un-committed.
This method being called tells it that it should commit them back
to the execution device.
Let's take the "Stopping all threads" scenario from above and see how
it would work with the ROCm target with this change. Before stopping
all threads, GDB would set the target's commit_resumed_state field to
false. It would then ask the target to stop the first thread. The
target would retrieve all threads' state from the GPU and mark that
one as stopped. Since commit_resumed_state is false, it leaves all
the other threads (still resumed) stopped. GDB would then proceed to
call target_stop for all the other threads. Since resumed threads are
not committed, this doesn't do any back and forth with the GPU.
To simplify the implementation of targets, this patch makes it so that
when calling certain target methods, the contract between the core and
the targets guarantees that commit_resumed_state is false. This way,
the target doesn't need two paths, one for commit_resumed_state ==
true and one for commit_resumed_state == false. It can just assert
that commit_resumed_state is false and work with that assumption.
This also helps catch places where we forgot to disable
commit_resumed_state before calling the method, which represents a
probable optimization opportunity. The commit adds assertions in the
target method wrappers (target_resume and friends) to have some
confidence that this contract between the core and the targets is
respected.
The scoped_disable_commit_resumed type is used to disable the commit
resumed state of all process targets on construction, and selectively
re-enable it on destruction (see below for criteria). Note that it
only sets the process_stratum_target::commit_resumed_state flag. A
subsequent call to maybe_call_commit_resumed_all_targets is necessary
to call the commit_resumed method on all target stacks with process
targets that got their commit_resumed_state flag turned back on. This
separation is because we don't want to call the commit_resumed methods
in scoped_disable_commit_resumed's destructor, as they may throw.
On destruction, commit-resumed is not re-enabled for a given target
if:
1. this target has no threads resumed, or
2. this target has at least one resumed thread with a pending status
known to the core (saved in thread_info::suspend::waitstatus).
The first point is not technically necessary, because a proper
commit_resumed implementation would be a no-op if the target has no
resumed threads. But since we have a flag do to a quick check, it
shouldn't hurt.
The second point is more important: together with the
scoped_disable_commit_resumed instance added in fetch_inferior_event,
it makes it so the "Resuming with pending events" described above is
handled efficiently. Here's what happens in that case:
1. The user types "continue".
2. Upon destruction, the scoped_disable_commit_resumed in the
`proceed` function does not enable commit-resumed, as it sees some
threads have pending statuses.
3. fetch_inferior_event is called to handle another event, the
breakpoint hit evaluates to false, and that thread is resumed.
Because there are still more threads with pending statuses, the
destructor of scoped_disable_commit_resumed in
fetch_inferior_event still doesn't enable commit-resumed.
4. Rinse and repeat step 3, until the last pending status is handled
by fetch_inferior_event. In that case,
scoped_disable_commit_resumed's destructor sees there are no more
threads with pending statues, so it asks the target to commit
resumed threads.
This allows us to avoid all unnecessary back and forths, there is a
single commit_resumed call once all pending statuses are processed.
This change required remote_target::remote_stop_ns to learn how to
handle stopping threads that were resumed but pending vCont. The
simplest example where that happens is when using the remote target in
all-stop, but with "maint set target-non-stop on", to force it to
operate in non-stop mode under the hood. If two threads hit a
breakpoint at the same time, GDB will receive two stop replies. It
will present the stop for one thread and save the other one in
thread_info::suspend::waitstatus.
Before this patch, when doing "continue", GDB first resumes the thread
without a pending status:
Sending packet: $vCont;c:p172651.172676#f3
It then consumes the pending status in the next fetch_inferior_event
call:
[infrun] do_target_wait_1: Using pending wait status status->kind = stopped, signal = GDB_SIGNAL_TRAP for Thread 1517137.1517137.
[infrun] target_wait (-1.0.0, status) =
[infrun] 1517137.1517137.0 [Thread 1517137.1517137],
[infrun] status->kind = stopped, signal = GDB_SIGNAL_TRAP
It then realizes it needs to stop all threads to present the stop, so
stops the thread it just resumed:
[infrun] stop_all_threads: Thread 1517137.1517137 not executing
[infrun] stop_all_threads: Thread 1517137.1517174 executing, need stop
remote_stop called
Sending packet: $vCont;t:p172651.172676#04
This is an unnecessary resume/stop. With this patch, we don't commit
resumed threads after proceeding, because of the pending status:
[infrun] maybe_commit_resumed_all_process_targets: not requesting commit-resumed for target extended-remote, a thread has a pending waitstatus
When GDB handles the pending status and stop_all_threads runs, we stop a
resumed but pending vCont thread:
remote_stop_ns: Enqueueing phony stop reply for thread pending vCont-resume (1520940, 1520976, 0)
That thread was never actually resumed on the remote stub / gdbserver,
so we shouldn't send a packet to the remote side asking to stop the
thread.
Note that there are paths that resume the target and then do a
synchronous blocking wait, in sort of nested event loop, via
wait_sync_command_done. For example, inferior function calls, or any
run control command issued from a breakpoint command list. We handle
that making wait_sync_command_one a "sync" point -- force forward
progress, or IOW, force-enable commit-resumed state.
gdb/ChangeLog:
yyyy-mm-dd Simon Marchi <simon.marchi@efficios.com>
Pedro Alves <pedro@palves.net>
* infcmd.c (run_command_1, attach_command, detach_command)
(interrupt_target_1): Use scoped_disable_commit_resumed.
* infrun.c (do_target_resume): Remove
target_commit_resume call.
(commit_resume_all_targets): Remove.
(maybe_set_commit_resumed_all_targets): New.
(maybe_call_commit_resumed_all_targets): New.
(enable_commit_resumed): New.
(scoped_disable_commit_resumed::scoped_disable_commit_resumed)
(scoped_disable_commit_resumed::~scoped_disable_commit_resumed)
(scoped_disable_commit_resumed::reset)
(scoped_disable_commit_resumed::reset_and_commit)
(scoped_enable_commit_resumed::scoped_enable_commit_resumed)
(scoped_enable_commit_resumed::~scoped_enable_commit_resumed):
New.
(proceed): Use scoped_disable_commit_resumed and
maybe_call_commit_resumed_all_targets.
(fetch_inferior_event): Use scoped_disable_commit_resumed.
* infrun.h (struct scoped_disable_commit_resumed): New.
(maybe_call_commit_resumed_all_process_targets): New.
(struct scoped_enable_commit_resumed): New.
* mi/mi-main.c (exec_continue): Use scoped_disable_commit_resumed.
* process-stratum-target.h (class process_stratum_target):
<commit_resumed_state>: New.
* record-full.c (record_full_wait_1): Change commit_resumed_state
around calling commit_resumed.
* remote.c (class remote_target) <commit_resume>: Rename to...
<commit_resumed>: ... this.
(struct stop_reply): Move up.
(remote_target::commit_resume): Rename to...
(remote_target::commit_resumed): ... this. Check if there is any
thread pending vCont resume.
(remote_target::remote_stop_ns): Generate stop replies for resumed
but pending vCont threads.
(remote_target::wait_ns): Add gdb_assert.
* target-delegates.c: Regenerate.
* target.c (target_wait, target_resume): Assert that the current
process_stratum target isn't in commit-resumed state.
(defer_target_commit_resume): Remove.
(target_commit_resume): Remove.
(target_commit_resumed): New.
(make_scoped_defer_target_commit_resume): Remove.
(target_stop): Assert that the current process_stratum target
isn't in commit-resumed state.
* target.h (struct target_ops) <commit_resume>: Rename to ...
<commit_resumed>: ... this.
(target_commit_resume): Remove.
(target_commit_resumed): New.
(make_scoped_defer_target_commit_resume): Remove.
* top.c (wait_sync_command_done): Use
scoped_enable_commit_resumed.
[1] https://github.com/ROCm-Developer-Tools/ROCgdb/
[2] https://github.com/ROCm-Developer-Tools/ROCdbgapi
Change-Id: I836135531a29214b21695736deb0a81acf8cf566
2021-01-25 12:57:29 +08:00
|
|
|
|
2021-03-26 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* infcmd.c (run_command_1, attach_command, detach_command)
|
|
|
|
|
(interrupt_target_1): Use scoped_disable_commit_resumed.
|
|
|
|
|
* infrun.c (do_target_resume): Remove
|
|
|
|
|
target_commit_resume call.
|
|
|
|
|
(commit_resume_all_targets): Remove.
|
|
|
|
|
(maybe_set_commit_resumed_all_targets): New.
|
|
|
|
|
(maybe_call_commit_resumed_all_targets): New.
|
|
|
|
|
(enable_commit_resumed): New.
|
|
|
|
|
(scoped_disable_commit_resumed::scoped_disable_commit_resumed)
|
|
|
|
|
(scoped_disable_commit_resumed::~scoped_disable_commit_resumed)
|
|
|
|
|
(scoped_disable_commit_resumed::reset)
|
|
|
|
|
(scoped_disable_commit_resumed::reset_and_commit)
|
|
|
|
|
(scoped_enable_commit_resumed::scoped_enable_commit_resumed)
|
|
|
|
|
(scoped_enable_commit_resumed::~scoped_enable_commit_resumed):
|
|
|
|
|
New.
|
|
|
|
|
(proceed): Use scoped_disable_commit_resumed and
|
|
|
|
|
maybe_call_commit_resumed_all_targets.
|
|
|
|
|
(fetch_inferior_event): Use scoped_disable_commit_resumed.
|
|
|
|
|
* infrun.h (struct scoped_disable_commit_resumed): New.
|
|
|
|
|
(maybe_call_commit_resumed_all_process_targets): New.
|
|
|
|
|
(struct scoped_enable_commit_resumed): New.
|
|
|
|
|
* mi/mi-main.c (exec_continue): Use scoped_disable_commit_resumed.
|
|
|
|
|
* process-stratum-target.h (class process_stratum_target):
|
|
|
|
|
<commit_resumed_state>: New.
|
|
|
|
|
* record-full.c (record_full_wait_1): Change commit_resumed_state
|
|
|
|
|
around calling commit_resumed.
|
|
|
|
|
* remote.c (class remote_target) <commit_resume>: Rename to...
|
|
|
|
|
<commit_resumed>: ... this.
|
|
|
|
|
(struct stop_reply): Move up.
|
|
|
|
|
(remote_target::commit_resume): Rename to...
|
|
|
|
|
(remote_target::commit_resumed): ... this. Check if there is any
|
|
|
|
|
thread pending vCont resume.
|
|
|
|
|
(remote_target::remote_stop_ns): Generate stop replies for resumed
|
|
|
|
|
but pending vCont threads.
|
|
|
|
|
(remote_target::wait_ns): Add gdb_assert.
|
|
|
|
|
* target-delegates.c: Regenerate.
|
|
|
|
|
* target.c (target_wait, target_resume): Assert that the current
|
|
|
|
|
process_stratum target isn't in commit-resumed state.
|
|
|
|
|
(defer_target_commit_resume): Remove.
|
|
|
|
|
(target_commit_resume): Remove.
|
|
|
|
|
(target_commit_resumed): New.
|
|
|
|
|
(make_scoped_defer_target_commit_resume): Remove.
|
|
|
|
|
(target_stop): Assert that the current process_stratum target
|
|
|
|
|
isn't in commit-resumed state.
|
|
|
|
|
* target.h (struct target_ops) <commit_resume>: Rename to ...
|
|
|
|
|
<commit_resumed>: ... this.
|
|
|
|
|
(target_commit_resume): Remove.
|
|
|
|
|
(target_commit_resumed): New.
|
|
|
|
|
(make_scoped_defer_target_commit_resume): Remove.
|
|
|
|
|
* top.c (wait_sync_command_done): Use
|
|
|
|
|
scoped_enable_commit_resumed.
|
|
|
|
|
|
2021-02-22 08:18:10 +08:00
|
|
|
|
2021-03-26 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* target.c (target_always_non_stop_p): Also check whether the
|
|
|
|
|
target can async.
|
|
|
|
|
|
2021-03-26 23:37:22 +08:00
|
|
|
|
2021-03-26 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (dwarf2_read_debug_names)
|
|
|
|
|
(dwarf2_build_psymtabs_hard, create_addrmap_from_aranges)
|
|
|
|
|
(dw2_debug_names_iterator::next, create_type_unit_group):
|
|
|
|
|
Simplify.
|
|
|
|
|
|
Fix bkpt-other-inferior.exp race
When testing with "maint set target-non-stop on",
gdb.server/bkpt-other-inferior.exp sometimes fails like so:
(gdb) inferior 2
[Switching to inferior 2 [process 368191] (<noexec>)]
[Switching to thread 2.1 (Thread 368191.368191)]
[remote] Sending packet: $m7ffff7fd0100,1#5b
[remote] Packet received: 48
[remote] Sending packet: $m7ffff7fd0100,1#5b
[remote] Packet received: 48
[remote] Sending packet: $m7ffff7fd0100,9#63
[remote] Packet received: 4889e7e8e80c000049
#0 0x00007ffff7fd0100 in ?? ()
(gdb) PASS: gdb.server/bkpt-other-inferior.exp: inf 2: switch to inferior
break -q main
Breakpoint 2 at 0x1138: file /home/pedro/gdb/binutils-gdb/src/gdb/testsuite/gdb.server/server.c, line 21.
(gdb) PASS: gdb.server/bkpt-other-inferior.exp: inf 2: set breakpoint
delete breakpoints
Delete all breakpoints? (y or n) y
(gdb) [remote] wait: enter
[remote] wait: exit
FAIL: gdb.server/bkpt-other-inferior.exp: inf 2: delete all breakpoints in delete_breakpoints (timeout)
ERROR: breakpoints not deleted
Remote debugging from host ::1, port 55876
monitor exit
The problem is here:
(gdb) [remote] wait: enter
The testcase isn't expecting any output after the prompt.
Why is that "[remote] wait" output? What happens is that "delete
breakpoints" queries the user, and `query` disables/reenables target
async, which results in the remote target's async event handler ending
up marked:
(top-gdb) bt
#0 mark_async_event_handler (async_handler_ptr=0x556bffffffff) at ../../src/gdb/async-event.c:295
#1 0x0000556bf71b711f in infrun_async (enable=1) at ../../src/gdb/infrun.c:119
#2 0x0000556bf7471387 in target_async (enable=1) at ../../src/gdb/target.c:3684
#3 0x0000556bf748a0bd in gdb_readline_wrapper_cleanup::~gdb_readline_wrapper_cleanup (this=0x7ffe3cf30eb0, __in_chrg=<optimized out>) at ../../src/gdb/top.c:1074
#4 0x0000556bf74874e2 in gdb_readline_wrapper (prompt=0x556bfa17da60 "Delete all breakpoints? (y or n) ") at ../../src/gdb/top.c:1096
#5 0x0000556bf75111c5 in defaulted_query(const char *, char, typedef __va_list_tag __va_list_tag *) (ctlstr=0x556bf7717f34 "Delete all breakpoints? ", defchar=0 '\000', args=0x7ffe3cf31020) at ../../src/gdb/utils.c:893
#6 0x0000556bf751166f in query (ctlstr=0x556bf7717f34 "Delete all breakpoints? ") at ../../src/gdb/utils.c:985
#7 0x0000556bf6f11404 in delete_command (arg=0x0, from_tty=1) at ../../src/gdb/breakpoint.c:13500
...
... which then later results in a target_wait call:
(top-gdb) bt
#0 remote_target::wait_ns (this=0x7ffe3cf30f80, ptid=..., status=0xde530314f0802800, options=...) at ../../src/gdb/remote.c:7937
#1 0x0000556bf7369dcb in remote_target::wait (this=0x556bfa0b2180, ptid=..., status=0x7ffe3cf31568, options=...) at ../../src/gdb/remote.c:8173
#2 0x0000556bf745e527 in target_wait (ptid=..., status=0x7ffe3cf31568, options=...) at ../../src/gdb/target.c:2000
#3 0x0000556bf71be686 in do_target_wait_1 (inf=0x556bfa1573d0, ptid=..., status=0x7ffe3cf31568, options=...) at ../../src/gdb/infrun.c:3463
#4 0x0000556bf71be88b in <lambda(inferior*)>::operator()(inferior *) const (__closure=0x7ffe3cf31320, inf=0x556bfa1573d0) at ../../src/gdb/infrun.c:3526
#5 0x0000556bf71bebcd in do_target_wait (wait_ptid=..., ecs=0x7ffe3cf31540, options=...) at ../../src/gdb/infrun.c:3539
#6 0x0000556bf71bf97b in fetch_inferior_event () at ../../src/gdb/infrun.c:3879
#7 0x0000556bf71a27f8 in inferior_event_handler (event_type=INF_REG_EVENT) at ../../src/gdb/inf-loop.c:42
#8 0x0000556bf71cc8b7 in infrun_async_inferior_event_handler (data=0x0) at ../../src/gdb/infrun.c:9220
#9 0x0000556bf6ecb80f in check_async_event_handlers () at ../../src/gdb/async-event.c:327
#10 0x0000556bf76b011a in gdb_do_one_event () at ../../src/gdbsupport/event-loop.cc:216
...
... which returns TARGET_WAITKIND_IGNORE.
Fix this by only enabling remote output around setting the breakpoint.
gdb/testsuite/ChangeLog:
* gdb.server/bkpt-other-inferior.exp: Only enable remote output
around setting the breakpoint.
Change-Id: I2fd152fd9c46b1c5e7fa678cc4d4054dac0b2bd4
2021-02-14 00:25:26 +08:00
|
|
|
|
2021-03-25 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* gdb.server/bkpt-other-inferior.exp: Only enable remote output
|
|
|
|
|
around setting the breakpoint.
|
|
|
|
|
|
Fix problem exposed by gdb.server/stop-reply-no-thread-multi.exp
Running gdb.server/stop-reply-no-thread-multi.exp with "maint set
target-non-stop on" occasionally hit an internal error like this:
...
continue
Continuing.
warning: multi-threaded target stopped without sending a thread-id, using first non-exited thread
/home/pedro/gdb/binutils-gdb/src/gdb/inferior.c:291: internal-error: inferior* find_inferior_pid(process_stratum_target*, int): Assertion `pid != 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
This is a bug, please report it.
FAIL: gdb.server/stop-reply-no-thread-multi.exp: to_disable=Tthread: continue until exit (GDB internal error)
The backtrace looks like this:
...
#5 0x0000560357b0879c in internal_error (file=0x560357be6c18 "/home/pedro/gdb/binutils-gdb/src/gdb/inferior.c", line=291, fmt=0x560357be6b21 "%s: Assertion `%s' failed.") at /home/pedro/gdb/binutils-gdb/src/gdbsupport/errors.cc:55
#6 0x000056035762061b in find_inferior_pid (targ=0x5603596e9560, pid=0) at /home/pedro/gdb/binutils-gdb/src/gdb/inferior.c:291
#7 0x00005603576206e6 in find_inferior_ptid (targ=0x5603596e9560, ptid=...) at /home/pedro/gdb/binutils-gdb/src/gdb/inferior.c:305
#8 0x00005603577d43ed in remote_target::check_pending_events_prevent_wildcard_vcont (this=0x5603596e9560, may_global_wildcard=0x7fff84fb05f0) at /home/pedro/gdb/binutils-gdb/src/gdb/remote.c:7215
#9 0x00005603577d2a9c in remote_target::commit_resumed (this=0x5603596e9560) at /home/pedro/gdb/binutils-gdb/src/gdb/remote.c:6680
...
pid is 0 in this case because the queued event is a process exit event
with no pid associated:
(top-gdb) p event->ws
During symbol reading: .debug_line address at offset 0x563c9a is 0 [in module /home/pedro/gdb/binutils-gdb/build/gdb/gdb]
$1 = {kind = TARGET_WAITKIND_EXITED, value = {integer = 0, sig = GDB_SIGNAL_0, related_pid = {m_pid = 0, m_lwp = 0, m_tid = 0}, execd_pathname = 0x0, syscall_number = 0}}
(top-gdb)
This fixes it, and adds a "maint set target-non-stop on/off" axis to the testcase.
gdb/ChangeLog:
* remote.c
(remote_target::check_pending_events_prevent_wildcard_vcont):
Check whether the event's ptid is not null_ptid before looking up
the corresponding inferior.
gdb/testsuite/ChangeLog:
* gdb.server/stop-reply-no-thread-multi.exp (run_test): Add
"target_non_stop" parameter and use it.
(top level): Add "maint set target-non-stop on/off" testing axis.
Change-Id: Ia30cf275305ee4dcbbd33f731534cd71d1550eaa
2021-02-14 03:16:44 +08:00
|
|
|
|
2021-03-25 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* remote.c
|
|
|
|
|
(remote_target::check_pending_events_prevent_wildcard_vcont):
|
|
|
|
|
Check whether the event's ptid is not null_ptid before looking up
|
|
|
|
|
the corresponding inferior.
|
|
|
|
|
|
2021-03-25 19:02:23 +08:00
|
|
|
|
2021-03-24 Changbin Du <changbin.du@gmail.com>
|
|
|
|
|
|
|
|
|
|
* riscv-tdep.c (riscv_breakpoint_kind_from_pc): Remove call to
|
|
|
|
|
read_code.
|
|
|
|
|
|
2021-03-25 06:08:12 +08:00
|
|
|
|
2021-03-24 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* target.h (current_top_target): Remove, make callers use the
|
|
|
|
|
current inferior instead.
|
|
|
|
|
* target.c (current_top_target): Remove.
|
|
|
|
|
|
2021-03-25 06:07:30 +08:00
|
|
|
|
2021-03-24 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* target.h (target_shortname): Change to function declaration.
|
|
|
|
|
(target_longname): Likewise.
|
|
|
|
|
(target_attach_no_wait): Likewise.
|
|
|
|
|
(target_post_attach): Likewise.
|
|
|
|
|
(target_prepare_to_store): Likewise.
|
|
|
|
|
(target_supports_enable_disable_tracepoint): Likewise.
|
|
|
|
|
(target_supports_string_tracing): Likewise.
|
|
|
|
|
(target_supports_evaluation_of_breakpoint_conditions): Likewise.
|
|
|
|
|
(target_supports_dumpcore): Likewise.
|
|
|
|
|
(target_dumpcore): Likewise.
|
|
|
|
|
(target_can_run_breakpoint_commands): Likewise.
|
|
|
|
|
(target_files_info): Likewise.
|
|
|
|
|
(target_post_startup_inferior): Likewise.
|
|
|
|
|
(target_insert_fork_catchpoint): Likewise.
|
|
|
|
|
(target_remove_fork_catchpoint): Likewise.
|
|
|
|
|
(target_insert_vfork_catchpoint): Likewise.
|
|
|
|
|
(target_remove_vfork_catchpoint): Likewise.
|
|
|
|
|
(target_insert_exec_catchpoint): Likewise.
|
|
|
|
|
(target_remove_exec_catchpoint): Likewise.
|
|
|
|
|
(target_set_syscall_catchpoint): Likewise.
|
|
|
|
|
(target_rcmd): Likewise.
|
|
|
|
|
(target_can_lock_scheduler): Likewise.
|
|
|
|
|
(target_can_async_p): Likewise.
|
|
|
|
|
(target_is_async_p): Likewise.
|
|
|
|
|
(target_execution_direction): Likewise.
|
|
|
|
|
(target_extra_thread_info): Likewise.
|
|
|
|
|
(target_pid_to_exec_file): Likewise.
|
|
|
|
|
(target_thread_architecture): Likewise.
|
|
|
|
|
(target_find_memory_regions): Likewise.
|
|
|
|
|
(target_make_corefile_notes): Likewise.
|
|
|
|
|
(target_get_bookmark): Likewise.
|
|
|
|
|
(target_goto_bookmark): Likewise.
|
|
|
|
|
(target_stopped_by_watchpoint): Likewise.
|
|
|
|
|
(target_stopped_by_sw_breakpoint): Likewise.
|
|
|
|
|
(target_supports_stopped_by_sw_breakpoint): Likewise.
|
|
|
|
|
(target_stopped_by_hw_breakpoint): Likewise.
|
|
|
|
|
(target_supports_stopped_by_hw_breakpoint): Likewise.
|
|
|
|
|
(target_have_steppable_watchpoint): Likewise.
|
|
|
|
|
(target_can_use_hardware_watchpoint): Likewise.
|
|
|
|
|
(target_region_ok_for_hw_watchpoint): Likewise.
|
|
|
|
|
(target_can_do_single_step): Likewise.
|
|
|
|
|
(target_insert_watchpoint): Likewise.
|
|
|
|
|
(target_remove_watchpoint): Likewise.
|
|
|
|
|
(target_insert_hw_breakpoint): Likewise.
|
|
|
|
|
(target_remove_hw_breakpoint): Likewise.
|
|
|
|
|
(target_can_accel_watchpoint_condition): Likewise.
|
|
|
|
|
(target_can_execute_reverse): Likewise.
|
|
|
|
|
(target_get_ada_task_ptid): Likewise.
|
|
|
|
|
(target_filesystem_is_local): Likewise.
|
|
|
|
|
(target_trace_init): Likewise.
|
|
|
|
|
(target_download_tracepoint): Likewise.
|
|
|
|
|
(target_can_download_tracepoint): Likewise.
|
|
|
|
|
(target_download_trace_state_variable): Likewise.
|
|
|
|
|
(target_enable_tracepoint): Likewise.
|
|
|
|
|
(target_disable_tracepoint): Likewise.
|
|
|
|
|
(target_trace_start): Likewise.
|
|
|
|
|
(target_trace_set_readonly_regions): Likewise.
|
|
|
|
|
(target_get_trace_status): Likewise.
|
|
|
|
|
(target_get_tracepoint_status): Likewise.
|
|
|
|
|
(target_trace_stop): Likewise.
|
|
|
|
|
(target_trace_find): Likewise.
|
|
|
|
|
(target_get_trace_state_variable_value): Likewise.
|
|
|
|
|
(target_save_trace_data): Likewise.
|
|
|
|
|
(target_upload_tracepoints): Likewise.
|
|
|
|
|
(target_upload_trace_state_variables): Likewise.
|
|
|
|
|
(target_get_raw_trace_data): Likewise.
|
|
|
|
|
(target_get_min_fast_tracepoint_insn_len): Likewise.
|
|
|
|
|
(target_set_disconnected_tracing): Likewise.
|
|
|
|
|
(target_set_circular_trace_buffer): Likewise.
|
|
|
|
|
(target_set_trace_buffer_size): Likewise.
|
|
|
|
|
(target_set_trace_notes): Likewise.
|
|
|
|
|
(target_get_tib_address): Likewise.
|
|
|
|
|
(target_set_permissions): Likewise.
|
|
|
|
|
(target_static_tracepoint_marker_at): Likewise.
|
|
|
|
|
(target_static_tracepoint_markers_by_strid): Likewise.
|
|
|
|
|
(target_traceframe_info): Likewise.
|
|
|
|
|
(target_use_agent): Likewise.
|
|
|
|
|
(target_can_use_agent): Likewise.
|
|
|
|
|
(target_augmented_libraries_svr4_read): Likewise.
|
|
|
|
|
(target_log_command): Likewise.
|
|
|
|
|
* target.c (target_shortname): New.
|
|
|
|
|
(target_longname): New.
|
|
|
|
|
(target_attach_no_wait): New.
|
|
|
|
|
(target_post_attach): New.
|
|
|
|
|
(target_prepare_to_store): New.
|
|
|
|
|
(target_supports_enable_disable_tracepoint): New.
|
|
|
|
|
(target_supports_string_tracing): New.
|
|
|
|
|
(target_supports_evaluation_of_breakpoint_conditions): New.
|
|
|
|
|
(target_supports_dumpcore): New.
|
|
|
|
|
(target_dumpcore): New.
|
|
|
|
|
(target_can_run_breakpoint_commands): New.
|
|
|
|
|
(target_files_info): New.
|
|
|
|
|
(target_post_startup_inferior): New.
|
|
|
|
|
(target_insert_fork_catchpoint): New.
|
|
|
|
|
(target_remove_fork_catchpoint): New.
|
|
|
|
|
(target_insert_vfork_catchpoint): New.
|
|
|
|
|
(target_remove_vfork_catchpoint): New.
|
|
|
|
|
(target_insert_exec_catchpoint): New.
|
|
|
|
|
(target_remove_exec_catchpoint): New.
|
|
|
|
|
(target_set_syscall_catchpoint): New.
|
|
|
|
|
(target_rcmd): New.
|
|
|
|
|
(target_can_lock_scheduler): New.
|
|
|
|
|
(target_can_async_p): New.
|
|
|
|
|
(target_is_async_p): New.
|
|
|
|
|
(target_execution_direction): New.
|
|
|
|
|
(target_extra_thread_info): New.
|
|
|
|
|
(target_pid_to_exec_file): New.
|
|
|
|
|
(target_thread_architecture): New.
|
|
|
|
|
(target_find_memory_regions): New.
|
|
|
|
|
(target_make_corefile_notes): New.
|
|
|
|
|
(target_get_bookmark): New.
|
|
|
|
|
(target_goto_bookmark): New.
|
|
|
|
|
(target_stopped_by_watchpoint): New.
|
|
|
|
|
(target_stopped_by_sw_breakpoint): New.
|
|
|
|
|
(target_supports_stopped_by_sw_breakpoint): New.
|
|
|
|
|
(target_stopped_by_hw_breakpoint): New.
|
|
|
|
|
(target_supports_stopped_by_hw_breakpoint): New.
|
|
|
|
|
(target_have_steppable_watchpoint): New.
|
|
|
|
|
(target_can_use_hardware_watchpoint): New.
|
|
|
|
|
(target_region_ok_for_hw_watchpoint): New.
|
|
|
|
|
(target_can_do_single_step): New.
|
|
|
|
|
(target_insert_watchpoint): New.
|
|
|
|
|
(target_remove_watchpoint): New.
|
|
|
|
|
(target_insert_hw_breakpoint): New.
|
|
|
|
|
(target_remove_hw_breakpoint): New.
|
|
|
|
|
(target_can_accel_watchpoint_condition): New.
|
|
|
|
|
(target_can_execute_reverse): New.
|
|
|
|
|
(target_get_ada_task_ptid): New.
|
|
|
|
|
(target_filesystem_is_local): New.
|
|
|
|
|
(target_trace_init): New.
|
|
|
|
|
(target_download_tracepoint): New.
|
|
|
|
|
(target_can_download_tracepoint): New.
|
|
|
|
|
(target_download_trace_state_variable): New.
|
|
|
|
|
(target_enable_tracepoint): New.
|
|
|
|
|
(target_disable_tracepoint): New.
|
|
|
|
|
(target_trace_start): New.
|
|
|
|
|
(target_trace_set_readonly_regions): New.
|
|
|
|
|
(target_get_trace_status): New.
|
|
|
|
|
(target_get_tracepoint_status): New.
|
|
|
|
|
(target_trace_stop): New.
|
|
|
|
|
(target_trace_find): New.
|
|
|
|
|
(target_get_trace_state_variable_value): New.
|
|
|
|
|
(target_save_trace_data): New.
|
|
|
|
|
(target_upload_tracepoints): New.
|
|
|
|
|
(target_upload_trace_state_variables): New.
|
|
|
|
|
(target_get_raw_trace_data): New.
|
|
|
|
|
(target_get_min_fast_tracepoint_insn_len): New.
|
|
|
|
|
(target_set_disconnected_tracing): New.
|
|
|
|
|
(target_set_circular_trace_buffer): New.
|
|
|
|
|
(target_set_trace_buffer_size): New.
|
|
|
|
|
(target_set_trace_notes): New.
|
|
|
|
|
(target_get_tib_address): New.
|
|
|
|
|
(target_set_permissions): New.
|
|
|
|
|
(target_static_tracepoint_marker_at): New.
|
|
|
|
|
(target_static_tracepoint_markers_by_strid): New.
|
|
|
|
|
(target_traceframe_info): New.
|
|
|
|
|
(target_use_agent): New.
|
|
|
|
|
(target_can_use_agent): New.
|
|
|
|
|
(target_augmented_libraries_svr4_read): New.
|
|
|
|
|
(target_log_command): New.
|
|
|
|
|
* bfin-tdep.c (bfin_sw_breakpoint_from_kind): Adjust.
|
|
|
|
|
* infrun.c (set_schedlock_func): Adjust.
|
|
|
|
|
* mi/mi-main.c (exec_reverse_continue): Adjust.
|
|
|
|
|
* reverse.c (exec_reverse_once): Adjust.
|
|
|
|
|
* sh-tdep.c (sh_sw_breakpoint_from_kind): Adjust.
|
|
|
|
|
* tui/tui-stack.c (tui_locator_window::make_status_line): Adjust.
|
|
|
|
|
* remote-sim.c (gdbsim_target::detach): Adjust.
|
|
|
|
|
(gdbsim_target::files_info): Adjust.
|
|
|
|
|
|
2021-03-25 04:41:13 +08:00
|
|
|
|
2021-03-24 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (dw2_map_matching_symbols): Update.
|
|
|
|
|
(dw2_expand_symtabs_matching_symbol): Remove 'kind' parameter.
|
|
|
|
|
(check_match, dw2_expand_symtabs_matching)
|
|
|
|
|
(dwarf2_debug_names_index::map_matching_symbols)
|
|
|
|
|
(dwarf2_debug_names_index::expand_symtabs_matching): Update.
|
|
|
|
|
|
2021-03-25 04:41:14 +08:00
|
|
|
|
2021-03-24 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* compile/compile-cplus-types.c
|
|
|
|
|
(compile_cplus_convert_struct_or_union): Fix TYPE_DECLARED_CLASS
|
|
|
|
|
thinko.
|
|
|
|
|
|
2021-03-25 03:39:11 +08:00
|
|
|
|
2021-03-24 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* gdbarch.sh (gdbarch_data_registry): Make static.
|
|
|
|
|
* gdbarch.c: Re-generate.
|
|
|
|
|
|
2020-06-16 02:54:00 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention memory tagging changes.
|
|
|
|
|
|
2020-06-16 02:50:55 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* printcmd.c (decode_format): Handle the 'm' modifier.
|
|
|
|
|
(do_examine): Display allocation tags when required/supported.
|
|
|
|
|
(should_validate_memtags): New function.
|
|
|
|
|
(print_command_1): Display memory tag mismatches.
|
|
|
|
|
* valprint.c (show_memory_tag_violations): New function.
|
|
|
|
|
(value_print_option_defs): Add new option "memory-tag-violations".
|
|
|
|
|
(user_print_options) <memory_tag_violations>: Initialize to 1.
|
|
|
|
|
* valprint.h (struct format_data) <print_tags>: New field.
|
|
|
|
|
(value_print_options) <memory_tag_violations>: New field.
|
|
|
|
|
|
New memory-tag commands
Add new commands under the "memory-tag" prefix to allow users to inspect,
modify and check memory tags in different ways.
The available subcommands are the following:
- memory-tag print-logical-tag <expression>: Prints the logical tag for a
particular address.
- memory-tag withltag <expression> <tag>: Prints the address tagged with the
logical tag <tag>.
- memory-tag print-allocation-tag <expression>: Prints the allocation tag for
a particular address.
- memory-tag setatag <expression> <length> <tags>: Sets one or more allocation
tags to the specified tags.
- memory-tag check <expression>: Checks if the logical tag in <address>
matches its allocation tag.
These commands make use of the memory tagging gdbarch methods, and are still
available, but disabled, when memory tagging is not supported by the
architecture.
I've pondered about a way to make these commands invisible when memory tagging
is not available, but given the check is at runtime (and support may come and go
based on a process' configuration), that is a bit too late in the process to
either not include the commands or get rid of them.
Ideas are welcome.
gdb/ChangeLog:
2021-03-24 Luis Machado <luis.machado@linaro.org>
* printcmd.c: Include gdbsupport/rsp-low.h.
(memory_tag_list): New static global.
(process_print_command_args): Factored out of
print_command_1.
(print_command_1): Use process_print_command_args.
(show_addr_not_tagged, show_memory_tagging_unsupported)
(memory_tag_command, memory_tag_print_tag_command)
(memory_tag_print_logical_tag_command)
(memory_tag_print_allocation_tag_command, parse_with_logical_tag_input)
(memory_tag_with_logical_tag_command, parse_set_allocation_tag_input)
(memory_tag_set_allocation_tag_command, memory_tag_check_command): New
functions.
(_initialize_printcmd): Add "memory-tag" prefix and subcommands.
gdbsupport/ChangeLog:
2021-03-24 Luis Machado <luis.machado@linaro.org>
* rsp-low.cc (fromhex, hex2bin): Move to ...
* common-utils.cc: ... here.
(fromhex) Change error message text to not be RSP-specific.
* rsp-low.h (fromhex, hex2bin): Move to ...
* common-utils.h: ... here.
2020-06-16 02:49:37 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* printcmd.c: Include gdbsupport/rsp-low.h.
|
|
|
|
|
(memory_tag_list): New static global.
|
|
|
|
|
(process_print_command_args): Factored out of
|
|
|
|
|
print_command_1.
|
|
|
|
|
(print_command_1): Use process_print_command_args.
|
|
|
|
|
(show_addr_not_tagged, show_memory_tagging_unsupported)
|
|
|
|
|
(memory_tag_command, memory_tag_print_tag_command)
|
|
|
|
|
(memory_tag_print_logical_tag_command)
|
|
|
|
|
(memory_tag_print_allocation_tag_command, parse_with_logical_tag_input)
|
|
|
|
|
(memory_tag_with_logical_tag_command, parse_set_allocation_tag_input)
|
|
|
|
|
(memory_tag_set_allocation_tag_command, memory_tag_check_command): New
|
|
|
|
|
functions.
|
|
|
|
|
(_initialize_printcmd): Add "memory-tag" prefix and subcommands.
|
|
|
|
|
|
2020-08-19 03:21:04 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* aarch64-linux-tdep.c
|
|
|
|
|
(aarch64_linux_iterate_over_regset_sections): Handle MTE register set.
|
|
|
|
|
* aarch64-linux-tdep.h (AARCH64_LINUX_SIZEOF_MTE_REGSET): Define.
|
|
|
|
|
|
2020-06-16 02:44:20 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* aarch64-linux-tdep.c
|
|
|
|
|
(aarch64_linux_report_signal_info): New function.
|
|
|
|
|
(aarch64_linux_init_abi): Register
|
|
|
|
|
aarch64_linux_report_signal_info as the report_signal_info hook.
|
|
|
|
|
* arch/aarch64-linux.h (SEGV_MTEAERR): Define.
|
|
|
|
|
(SEGV_MTESERR): Define.
|
|
|
|
|
|
2020-06-16 02:11:07 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* aarch64-linux-tdep.c: Include gdbsupport/selftest.h.
|
|
|
|
|
(aarch64_linux_ltag_tests): New function.
|
|
|
|
|
(_initialize_aarch64_linux_tdep): Register aarch64_linux_ltag_tests.
|
|
|
|
|
|
2020-06-20 04:37:33 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* aarch64-linux-tdep.c: Include target.h, arch-utils.h, value.h.
|
|
|
|
|
(aarch64_mte_get_atag, aarch64_linux_tagged_address_p)
|
|
|
|
|
(aarch64_linux_memtag_mismatch_p, aarch64_linux_set_memtags)
|
|
|
|
|
(aarch64_linux_get_memtag, aarch64_linux_memtag_to_string): New
|
|
|
|
|
functions.
|
|
|
|
|
(aarch64_linux_init_abi): Initialize MTE-related gdbarch hooks.
|
|
|
|
|
* arch/aarch64-mte-linux.c (aarch64_mte_make_ltag_bits)
|
|
|
|
|
(aarch64_mte_make_ltag, aarch64_linux_set_ltag)
|
|
|
|
|
(aarch64_linux_get_ltag): New functions.
|
|
|
|
|
* arch/aarch64-mte-linux.h (AARCH64_MTE_LOGICAL_TAG_START_BIT)
|
|
|
|
|
(AARCH64_MTE_LOGICAL_MAX_VALUE): Define.
|
|
|
|
|
(aarch64_mte_make_ltag_bits, aarch64_mte_make_ltag)
|
|
|
|
|
(aarch64_mte_set_ltag, aarch64_mte_get_ltag): New prototypes.
|
|
|
|
|
|
2020-06-16 01:24:53 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* linux-tdep.c (struct smaps_vmflags) <memory_tagging>: New flag
|
|
|
|
|
bit.
|
|
|
|
|
(struct smaps_data): New struct.
|
|
|
|
|
(decode_vmflags): Handle the 'mt' flag.
|
|
|
|
|
(parse_smaps_data): New function, refactored from
|
|
|
|
|
linux_find_memory_regions_full.
|
|
|
|
|
(linux_address_in_memtag_page): New function.
|
|
|
|
|
(linux_find_memory_regions_full): Refactor into parse_smaps_data.
|
|
|
|
|
* linux-tdep.h (linux_address_in_memtag_page): New prototype.
|
|
|
|
|
|
2020-12-30 21:46:11 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* linux-tdep.c (linux_find_memory_regions_full): Use std::string
|
|
|
|
|
instead of char arrays.
|
|
|
|
|
|
2020-06-20 04:33:13 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (ALL_64_TARGET_OBS): Add arch/aarch64-mte-linux.o.
|
|
|
|
|
(HFILES_NO_SRCDIR): Add arch/aarch64-mte-linux.h and
|
|
|
|
|
nat/aarch64-mte-linux-ptrace.h.
|
|
|
|
|
* aarch64-linux-nat.c: Include nat/aarch64-mte-linux-ptrace.h.
|
|
|
|
|
(aarch64_linux_nat_target) <supports_memory_tagging>: New method
|
|
|
|
|
override.
|
|
|
|
|
<fetch_memtags>: New method override.
|
|
|
|
|
<store_memtags>: New method override.
|
|
|
|
|
(aarch64_linux_nat_target::supports_memory_tagging): New method.
|
|
|
|
|
(aarch64_linux_nat_target::fetch_memtags): New method.
|
|
|
|
|
(aarch64_linux_nat_target::store_memtags): New method.
|
|
|
|
|
* arch/aarch64-mte-linux.c: New file.
|
|
|
|
|
* arch/aarch64-mte-linux.h: Include gdbsupport/common-defs.h.
|
|
|
|
|
(AARCH64_MTE_GRANULE_SIZE): Define.
|
|
|
|
|
(aarch64_memtag_type): New enum.
|
|
|
|
|
(aarch64_mte_get_tag_granules): New prototype.
|
|
|
|
|
* configure.nat (NATDEPFILES): Add nat/aarch64-mte-linux-ptrace.o.
|
|
|
|
|
* configure.tgt (aarch64*-*-linux*): Add arch/aarch64-mte-linux.o.
|
|
|
|
|
* nat/aarch64-mte-linux-ptrace.c: New file.
|
|
|
|
|
* nat/aarch64-mte-linux-ptrace.h: New file.
|
|
|
|
|
|
2020-06-20 03:09:11 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (HFILES_NO_SRCDIR): Add nat/aarch64-mte-linux-ptrace.h.
|
|
|
|
|
* nat/aarch64-mte-linux-ptrace.h: New file.
|
|
|
|
|
|
2020-06-16 00:59:40 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* aarch64-linux-nat.c (fetch_mteregs_from_thread): New function.
|
|
|
|
|
(store_mteregs_to_thread): New function.
|
|
|
|
|
(aarch64_linux_nat_target::fetch_registers): Update to call
|
|
|
|
|
fetch_mteregs_from_thread.
|
|
|
|
|
(aarch64_linux_nat_target::store_registers): Update to call
|
|
|
|
|
store_mteregs_to_thread.
|
|
|
|
|
* aarch64-tdep.c (aarch64_mte_register_names): New struct.
|
|
|
|
|
(aarch64_cannot_store_register): Handle MTE registers.
|
|
|
|
|
(aarch64_gdbarch_init): Initialize and setup MTE registers.
|
|
|
|
|
* aarch64-tdep.h (gdbarch_tdep) <mte_reg_base>: New field.
|
|
|
|
|
<has_mte>: New method.
|
|
|
|
|
* arch/aarch64-linux.h (AARCH64_LINUX_SIZEOF_MTE): Define.
|
|
|
|
|
|
2020-06-16 00:52:27 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* aarch64-linux-nat.c
|
|
|
|
|
(aarch64_linux_nat_target::read_description): Take MTE flag into
|
|
|
|
|
account.
|
|
|
|
|
Slight refactor to hwcap flag checking.
|
|
|
|
|
* aarch64-linux-tdep.c
|
|
|
|
|
(aarch64_linux_core_read_description): Likewise.
|
|
|
|
|
* aarch64-tdep.c (tdesc_aarch64_list): Add one more dimension for
|
|
|
|
|
MTE.
|
|
|
|
|
(aarch64_read_description): Add mte_p parameter and update to use it.
|
|
|
|
|
Update the documentation.
|
|
|
|
|
(aarch64_gdbarch_init): Update call to aarch64_read_description.
|
|
|
|
|
* aarch64-tdep.h (aarch64_read_description): Add mte_p parameter.
|
|
|
|
|
* arch/aarch64.c: Include ../features/aarch64-mte.c.
|
|
|
|
|
(aarch64_create_target_description): Add mte_p parameter and update
|
|
|
|
|
the code to use it.
|
|
|
|
|
* arch/aarch64.h (aarch64_create_target_description): Add mte_p
|
|
|
|
|
parameter.
|
|
|
|
|
* features/Makefile (FEATURE_XMLFILES): Add aarch64-mte.xml.
|
|
|
|
|
* features/aarch64-mte.c: New file, generated.
|
|
|
|
|
* features/aarch64-mte.xml: New file.
|
|
|
|
|
|
2020-06-16 00:39:30 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (HFILES_NO_SRCDIR): Add arch/aarch64-mte-linux.h.
|
|
|
|
|
* aarch64-linux-nat.c: Include arch/aarch64-mte-linux.h.
|
|
|
|
|
* aarch64-linux-tdep.c: Likewise
|
|
|
|
|
* arch/aarch64-mte-linux.h: New file.
|
|
|
|
|
|
2020-06-16 02:22:13 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* remote: Include gdbsupport/selftest.h.
|
|
|
|
|
(test_memory_tagging_functions): New function.
|
|
|
|
|
(_initialize_remote): Register test_memory_tagging_functions.
|
|
|
|
|
|
2020-06-16 02:18:55 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* remote.c (PACKET_memory_tagging_feature): New enum.
|
|
|
|
|
(remote_memory_tagging_p): New function.
|
|
|
|
|
(remote_protocol_features): New "memory-tagging" entry.
|
|
|
|
|
(remote_target::remote_query_supported): Handle memory tagging
|
|
|
|
|
support.
|
|
|
|
|
(remote_target::supports_memory_tagging): Implement.
|
|
|
|
|
(create_fetch_memtags_request, parse_fetch_memtags_reply)
|
|
|
|
|
(create_store_memtags_request): New functions.
|
|
|
|
|
(remote_target::fetch_memtags): Implement.
|
|
|
|
|
(remote_target::store_memtags): Implement.
|
|
|
|
|
(_initialize_remote): Add new "memory-tagging-feature"
|
|
|
|
|
config command.
|
|
|
|
|
|
New gdbarch memory tagging hooks
We need some new gdbarch hooks to help us manipulate memory tags without having
to have GDB call the target methods directly.
This patch adds the following hooks:
gdbarch_memtag_to_string
--
Returns a printable string corresponding to the tag.
gdbarch_tagged_address_p
--
Checks if a particular address is protected with memory tagging.
gdbarch_memtag_matches_p
--
Checks if the logical tag of a pointer and the allocation tag from the address
the pointer points to matches.
gdbarch_set_memtags:
--
Sets either the allocation tag or the logical tag for a particular value.
gdbarch_get_memtag:
--
Gets either the allocation tag or the logical tag for a particular value.
gdbarch_memtag_granule_size
--
Sets the memory tag granule size, which represents the number of bytes a
particular allocation tag covers. For example, this is 16 bytes for
AArch64's MTE.
I've used struct value as opposed to straight CORE_ADDR so other architectures
can use the infrastructure without having to rely on a particular type for
addresses/pointers. Some architecture may use pointers of 16 bytes that don't
fit in a CORE_ADDR, for example.
gdb/ChangeLog:
2021-03-24 Luis Machado <luis.machado@linaro.org>
* arch-utils.c (default_memtag_to_string, default_tagged_address_p)
(default_memtag_matches_p, default_set_memtags)
(default_get_memtag): New functions.
* arch-utils.h (default_memtag_to_string, default_tagged_address_p)
(default_memtag_matches_p, default_set_memtags)
(default_get_memtag): New prototypes.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* gdbarch.sh (memtag_to_string, tagged_address_p, memtag_matches_p)
(set_memtags, get_memtag, memtag_granule_size): New gdbarch hooks.
(enum memtag_type): New enum.
2020-06-20 04:36:14 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* arch-utils.c (default_memtag_to_string, default_tagged_address_p)
|
|
|
|
|
(default_memtag_matches_p, default_set_memtags)
|
|
|
|
|
(default_get_memtag): New functions.
|
|
|
|
|
* arch-utils.h (default_memtag_to_string, default_tagged_address_p)
|
|
|
|
|
(default_memtag_matches_p, default_set_memtags)
|
|
|
|
|
(default_get_memtag): New prototypes.
|
|
|
|
|
* gdbarch.c: Regenerate.
|
|
|
|
|
* gdbarch.h: Regenerate.
|
|
|
|
|
* gdbarch.sh (memtag_to_string, tagged_address_p, memtag_matches_p)
|
|
|
|
|
(set_memtags, get_memtag, memtag_granule_size): New gdbarch hooks.
|
|
|
|
|
(enum memtag_type): New enum.
|
|
|
|
|
|
2020-06-20 04:31:23 +08:00
|
|
|
|
2021-03-24 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* remote.c (remote_target) <supports_memory_tagging>: New method
|
|
|
|
|
override.
|
|
|
|
|
<fetch_memtags>: New method override.
|
|
|
|
|
<store_memtags>: New method override.
|
|
|
|
|
(remote_target::supports_memory_tagging): New method.
|
|
|
|
|
(remote_target::fetch_memtags): New method.
|
|
|
|
|
(remote_target::store_memtags): New method.
|
|
|
|
|
* target-delegates.c: Regenerate.
|
|
|
|
|
* target.h (struct target_ops) <supports_memory_tagging>: New virtual
|
|
|
|
|
method.
|
|
|
|
|
<fetch_memtags>: New virtual method.
|
|
|
|
|
<store_memtags>: New virtual method.
|
|
|
|
|
(target_supports_memory_tagging): Define.
|
|
|
|
|
(target_fetch_memtags): Define.
|
|
|
|
|
(target_store_memtags): Define.
|
|
|
|
|
* target-debug.h (target_debug_print_size_t)
|
|
|
|
|
(target_debug_print_const_gdb_byte_vector_r)
|
|
|
|
|
(target_debug_print_gdb_byte_vector_r): New functions.
|
|
|
|
|
|
2021-03-24 00:03:37 +08:00
|
|
|
|
2021-03-23 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* target.h (target_longname): Remove.
|
|
|
|
|
|
2021-03-23 21:46:49 +08:00
|
|
|
|
2021-03-23 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* target.h (target_is_pushed): Remove, update callers to use
|
|
|
|
|
inferior::target_is_pushed instead.
|
|
|
|
|
* target.c (target_is_pushed): Remove.
|
|
|
|
|
|
2021-03-23 21:50:35 +08:00
|
|
|
|
2021-03-23 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* target.h (push_target): Remove, update callers to use
|
|
|
|
|
inferior::push_target.
|
|
|
|
|
* target.c (push_target): Remove.
|
|
|
|
|
* inferior.h (class inferior) <push_target>: New overload.
|
|
|
|
|
|
2021-03-23 21:50:32 +08:00
|
|
|
|
2021-03-23 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* target.h (unpush_target): Remove, update all callers
|
|
|
|
|
to use `inferior::unpush_target` instead.
|
|
|
|
|
(struct target_unpusher) <operator()>: Just declare.
|
|
|
|
|
* target.c (unpush_target): Remove.
|
|
|
|
|
(target_unpusher::operator()): New.
|
|
|
|
|
|
2021-03-18 00:48:25 +08:00
|
|
|
|
2021-03-22 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (process_psymtab_comp_unit): Replace abort with an
|
|
|
|
|
error.
|
|
|
|
|
(process_full_comp_unit): Validate the top-level tag before
|
|
|
|
|
processing the first DIE.
|
|
|
|
|
(read_func_scope): Ensure we have a valid builder.
|
|
|
|
|
|
2021-03-16 01:50:28 +08:00
|
|
|
|
2021-03-22 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* objc-lang.c (objc_demangle): Renamed to
|
|
|
|
|
objc_language::demangle_symbol, and moved later in the file.
|
|
|
|
|
(objc_language::sniff_from_mangled_name): Call demangle_symbol
|
|
|
|
|
member function.
|
|
|
|
|
(objc_language::demangle_symbol): Defined outside of class
|
|
|
|
|
declaration. The definition is the old objc_demangle with NULL
|
|
|
|
|
changed to nullptr, and if conditions relating to nullptr pointers
|
|
|
|
|
or null character checks made explicit.
|
|
|
|
|
* objc-lang.h (objc_demangle): Delete declaration.
|
|
|
|
|
|
2021-03-19 18:50:26 +08:00
|
|
|
|
2021-03-22 Martin Liska <mliska@suse.cz>
|
|
|
|
|
|
|
|
|
|
* arm-tdep.c (show_disassembly_style_sfunc): Replace usage of CONST_STRNEQ with startswith.
|
|
|
|
|
(_initialize_arm_tdep): Likewise.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* xcoffread.c (xcoff_initial_scan): Create partial symtabs.
|
|
|
|
|
* symfile.c (syms_from_objfile_1, reread_symbols): Update.
|
|
|
|
|
* psymtab.h (make_psymbol_functions): Don't declare.
|
|
|
|
|
* psymtab.c (make_psymbol_functions): Remove.
|
|
|
|
|
(maintenance_print_psymbols): Update.
|
|
|
|
|
* psympriv.h (struct psymbol_functions): Add no-argument
|
|
|
|
|
constructor.
|
|
|
|
|
* objfiles.h (struct objfile) <reset_psymtabs>: Remove.
|
|
|
|
|
<partial_symtabs>: Remove.
|
|
|
|
|
* mdebugread.c (mdebug_build_psymtabs): Create partial symtabs.
|
|
|
|
|
* elfread.c (read_partial_symbols): Update.
|
|
|
|
|
(elf_symfile_read): Remove check for existing partial symbols.
|
|
|
|
|
Don't clear "qf".
|
|
|
|
|
* dwarf2/read.c (dwarf2_has_info): Remove check for existing
|
|
|
|
|
partial symbols.
|
|
|
|
|
(dwarf2_build_psymtabs): Add psymbol_functions parameter. Create
|
|
|
|
|
partial symtabs.
|
|
|
|
|
* dwarf2/public.h (dwarf2_build_psymtabs): Add psymbol_functions
|
|
|
|
|
parameter.
|
|
|
|
|
* dbxread.c (dbx_symfile_read): Create partial symtabs.
|
|
|
|
|
* ctfread.c (elfctf_build_psymtabs): Create partial symtabs.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (dwarf2_build_psymtabs): Update.
|
|
|
|
|
* symfile.c (syms_from_objfile_1, reread_symbols): Update.
|
|
|
|
|
* symfile-debug.c (objfile::has_partial_symbols)
|
|
|
|
|
(objfile::find_last_source_symtab)
|
|
|
|
|
(objfile::forget_cached_source_info)
|
|
|
|
|
(objfile::map_symtabs_matching_filename, objfile::lookup_symbol)
|
|
|
|
|
(objfile::print_stats, objfile::dump)
|
|
|
|
|
(objfile::expand_symtabs_for_function)
|
|
|
|
|
(objfile::expand_all_symtabs)
|
|
|
|
|
(objfile::expand_symtabs_with_fullname)
|
|
|
|
|
(objfile::map_matching_symbols)
|
|
|
|
|
(objfile::expand_symtabs_matching)
|
|
|
|
|
(objfile::find_pc_sect_compunit_symtab)
|
|
|
|
|
(objfile::map_symbol_filenames)
|
|
|
|
|
(objfile::find_compunit_symtab_by_address)
|
|
|
|
|
(objfile::lookup_global_symbol_language)
|
|
|
|
|
(objfile::require_partial_symbols): Update.
|
|
|
|
|
* psymtab.c (maintenance_print_psymbols)
|
|
|
|
|
(maintenance_info_psymtabs, maintenance_check_psymtabs): Update.
|
|
|
|
|
* objfiles.h (struct objfile) <qf>: Now a forward_list.
|
|
|
|
|
* objfiles.c (objfile_relocate1): Update.
|
|
|
|
|
* elfread.c (elf_symfile_read): Update.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* objfiles.h (struct objfile) <psymtabs>: Remove method.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* psymtab.c (psymbol_functions::count_psyms): Rename.
|
|
|
|
|
(psymbol_functions::print_stats): Update.
|
|
|
|
|
* psympriv.h (struct psymbol_functions) <count_psyms>: Declare
|
|
|
|
|
method.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* psymtab.c (psymbol_functions::require_partial_symbols): Rename.
|
|
|
|
|
(psymbol_functions::find_pc_sect_psymtab): Rename.
|
|
|
|
|
(psymbol_functions::find_pc_sect_compunit_symtab)
|
|
|
|
|
(maintenance_print_psymbols, maintenance_check_psymtabs): Update.
|
|
|
|
|
* psympriv.h (struct psymbol_functions) <require_partial_symbols>:
|
|
|
|
|
Declare new method.
|
|
|
|
|
<get_partial_symtabs, find_pc_sect_psymtab>: Likewise.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* xcoffread.c (xcoff_start_psymtab): Add partial_symtabs parameter.
|
|
|
|
|
(xcoff_end_psymtab, scan_xcoff_symtab): Update.
|
|
|
|
|
* psymtab.c (partial_symtab::partial_symtab): Add partial_symtabs
|
|
|
|
|
parameter.
|
|
|
|
|
(add_psymbol_to_bcache): Remove.
|
|
|
|
|
(partial_symtab::add_psymbol): Add partial_symtabs parameter.
|
|
|
|
|
(partial_symtab::add_psymbol, partial_symtab::partial_symtab):
|
|
|
|
|
Likewise.
|
|
|
|
|
* psympriv.h (partial_symtab): Add partial_symtabs parameter.
|
|
|
|
|
<add_psymbol>: Likewise.
|
|
|
|
|
(standard_psymtab, legacy_psymtab): Likewise.
|
|
|
|
|
* mdebugread.c (parse_partial_symbols): Update.
|
|
|
|
|
(handle_psymbol_enumerators): Add partial_symtabs parameter.
|
|
|
|
|
(handle_psymbol_enumerators): Update.
|
|
|
|
|
(new_psymtab): Add partial_symtabs parameter.
|
|
|
|
|
* dwarf2/read.h (dwarf2_psymtab): Add partial_symtabs parameter.
|
|
|
|
|
* dwarf2/read.c (dwarf2_include_psymtab): Add partial_symtabs
|
|
|
|
|
parameter.
|
|
|
|
|
(dwarf2_create_include_psymtab): Add partial_symtabs parameter.
|
|
|
|
|
(create_partial_symtab, add_partial_symbol, dwarf_decode_lines):
|
|
|
|
|
Update.
|
|
|
|
|
* dbxread.c (read_dbx_symtab): Update.
|
|
|
|
|
(start_psymtab): Add partial_symtabs parameter.
|
|
|
|
|
(dbx_end_psymtab): Update.
|
|
|
|
|
* ctfread.c (struct ctf_context) <partial_symtabs>: New member.
|
|
|
|
|
(ctf_psymtab): Add partial_symtabs parameter.
|
|
|
|
|
(create_partial_symtab, ctf_psymtab_type_cb, ctf_psymtab_var_cb):
|
|
|
|
|
Update.
|
|
|
|
|
(scan_partial_symbols): Add partial_symtabs parameter.
|
|
|
|
|
(scan_partial_symbols, elfctf_build_psymtabs)
|
|
|
|
|
(ctf_psymtab_add_enums): Update.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symfile.c (read_symbols): Use objfile method.
|
|
|
|
|
* symfile-debug.c (objfile::require_partial_symbols): New method.
|
|
|
|
|
* psymtab.h (require_partial_symbols): Don't declare.
|
|
|
|
|
* psymtab.c (require_partial_symbols): Use objfile method. Now
|
|
|
|
|
static.
|
|
|
|
|
(psymbol_functions::map_symtabs_matching_filename, OBJFILE)
|
|
|
|
|
(psymbol_functions::lookup_symbol)
|
|
|
|
|
(psymbol_functions::lookup_global_symbol_language)
|
|
|
|
|
(psymbol_functions::find_last_source_symtab)
|
|
|
|
|
(psymbol_functions::forget_cached_source_info)
|
|
|
|
|
(psymbol_functions::print_stats)
|
|
|
|
|
(psymbol_functions::expand_symtabs_for_function)
|
|
|
|
|
(psymbol_functions::expand_all_symtabs)
|
|
|
|
|
(psymbol_functions::expand_symtabs_with_fullname)
|
|
|
|
|
(psymbol_functions::map_symbol_filenames)
|
|
|
|
|
(psymbol_functions::map_matching_symbols)
|
|
|
|
|
(psymbol_functions::expand_symtabs_matching)
|
|
|
|
|
(psymbol_functions::find_compunit_symtab_by_address)
|
|
|
|
|
(maintenance_print_psymbols, maintenance_info_psymtabs)
|
|
|
|
|
(maintenance_check_psymtabs): Update.
|
|
|
|
|
* objfiles.h (struct objfile) <require_partial_symbols>: Declare
|
|
|
|
|
new method.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* xcoffread.c (xcoff_sym_fns): Update.
|
|
|
|
|
* symfile.h (struct sym_fns) <sym_read_psymbols>: Remove.
|
|
|
|
|
* symfile-debug.c (objfile::has_partial_symbols): Use
|
|
|
|
|
can_lazily_read_symbols.
|
|
|
|
|
(debug_sym_read_psymbols): Remove.
|
|
|
|
|
(debug_sym_fns, install_symfile_debug_logging): Update.
|
|
|
|
|
* quick-symbol.h (struct quick_symbol_functions)
|
|
|
|
|
<can_lazily_read_symbols, read_partial_symbols>: New methods.
|
|
|
|
|
* psymtab.c (require_partial_symbols): Use new 'qf' methods.
|
|
|
|
|
* mipsread.c (ecoff_sym_fns): Update.
|
|
|
|
|
* machoread.c (macho_sym_fns): Update.
|
|
|
|
|
* elfread.c (struct lazy_dwarf_reader): New.
|
|
|
|
|
(elf_symfile_read): Update.
|
|
|
|
|
(read_psyms): Now a method of lazy_dwarf_reader.
|
|
|
|
|
(elf_sym_fns): Update.
|
|
|
|
|
(elf_sym_fns_lazy_psyms): Remove.
|
|
|
|
|
* dbxread.c (aout_sym_fns): Update.
|
|
|
|
|
* coffread.c (coff_sym_fns): Update.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symfile.c (syms_from_objfile_1): Call reset_psymtabs.
|
|
|
|
|
(reread_symbols): Move reset_psymtabs call later.
|
|
|
|
|
* objfiles.c (objfile::objfile): Don't initialize
|
|
|
|
|
partial_symtabs.
|
|
|
|
|
|
Attach partial symtab storage to psymbol_functions
Currently, the storage for partial symtabs is attached to the objfile.
Ultimately, though, this direct assocation will be removed, and the
storage will be owned by the psymbol_functions object.
This patch is a step toward this goal. The storage is already managed
as a shared_ptr, to enable cross-objfile sharing, so this adds a
reference from the psymbol_functions, and changes some code in
psymtab.c to use this reference instead.
gdb/ChangeLog
2021-03-20 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (dwarf2_build_psymtabs): Call
set_partial_symtabs.
* symfile.c (syms_from_objfile_1, reread_symbols): Update.
* psymtab.h (make_psymbol_functions): Add partial_symtabs
parameter.
* psymtab.c (find_pc_sect_psymtab): Add partial_symtabs
parameter.
(psymbol_functions::find_pc_sect_compunit_symtab)
(psymbol_functions::print_stats, psymbol_functions::dump)
(psymbol_functions::has_symbols): Update.
(make_psymbol_functions, dump_psymtab_addrmap): Add
partial_symtabs parameter.
(maintenance_print_psymbols): Update.
(psymbol_functions::expand_symtabs_matching): Update.
* psympriv.h (struct psymbol_functions): Add constructor.
<m_partial_symtabs>: New member.
<set_partial_symtabs>: New method.
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (dwarf2_build_psymtabs): Call
|
|
|
|
|
set_partial_symtabs.
|
|
|
|
|
* symfile.c (syms_from_objfile_1, reread_symbols): Update.
|
|
|
|
|
* psymtab.h (make_psymbol_functions): Add partial_symtabs
|
|
|
|
|
parameter.
|
|
|
|
|
* psymtab.c (find_pc_sect_psymtab): Add partial_symtabs
|
|
|
|
|
parameter.
|
|
|
|
|
(psymbol_functions::find_pc_sect_compunit_symtab)
|
|
|
|
|
(psymbol_functions::print_stats, psymbol_functions::dump)
|
|
|
|
|
(psymbol_functions::has_symbols): Update.
|
|
|
|
|
(make_psymbol_functions, dump_psymtab_addrmap): Add
|
|
|
|
|
partial_symtabs parameter.
|
|
|
|
|
(maintenance_print_psymbols): Update.
|
|
|
|
|
(psymbol_functions::expand_symtabs_matching): Update.
|
|
|
|
|
* psympriv.h (struct psymbol_functions): Add constructor.
|
|
|
|
|
<m_partial_symtabs>: New member.
|
|
|
|
|
<set_partial_symtabs>: New method.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (dwarf2_create_include_psymtab): Add per_bfd
|
|
|
|
|
parameter.
|
|
|
|
|
(process_psymtab_comp_unit_reader)
|
|
|
|
|
(build_type_psymtab_dependencies, dwarf2_build_psymtabs_hard)
|
|
|
|
|
(add_partial_subprogram, dwarf2_ranges_read, dwarf_decode_lines):
|
|
|
|
|
Reference psymtabs via per_bfd.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/index-write.c (struct addrmap_index_data) <objfile>:
|
|
|
|
|
Remove.
|
|
|
|
|
(add_address_entry): Remove objfile parameter.
|
|
|
|
|
(add_address_entry_worker): Update.
|
|
|
|
|
(write_address_map): Replace objfile parameter with per_bfd.
|
|
|
|
|
(write_gdbindex, write_psymtabs_to_index): Update.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (dwarf2_base_index_functions::print_stats): Add
|
|
|
|
|
print_bcache parameter.
|
|
|
|
|
* symfile-debug.c (objfile::print_stats): Add print_bcache
|
|
|
|
|
parameter.
|
|
|
|
|
* quick-symbol.h (struct quick_symbol_functions)
|
|
|
|
|
<print_stats>: Add print_bcache parameter.
|
|
|
|
|
* symmisc.c (print_symbol_bcache_statistics, count_psyms): Move
|
|
|
|
|
code to psymtab.c.
|
|
|
|
|
(print_objfile_statistics): Move psymtab code to psymtab.c.
|
|
|
|
|
* psymtab.c (count_psyms): Move from symmisc.c.
|
|
|
|
|
(psymbol_functions::print_stats): Print partial symbol and bcache
|
|
|
|
|
statistics. Add print_bcache parameter.
|
|
|
|
|
* objfiles.h (print_symbol_bcache_statistics): Don't declare.
|
|
|
|
|
(struct objfile) <print_stats>: Add print_bcache parameter.
|
|
|
|
|
* maint.c (maintenance_print_statistics): Update.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.h (struct dwarf2_per_bfd) <psymtabs_addrmap>: New
|
|
|
|
|
member.
|
|
|
|
|
* dwarf2/read.c (create_addrmap_from_index)
|
|
|
|
|
(create_addrmap_from_aranges): Set per_bfd addrmap.
|
|
|
|
|
(dwarf2_read_gdb_index): Don't set partial_symtabs.
|
|
|
|
|
(dwarf2_base_index_functions::find_pc_sect_compunit_symtab): Use
|
|
|
|
|
per_bfd addrmap.
|
|
|
|
|
(dwarf2_read_debug_names): Don't set partial_symtabs.
|
|
|
|
|
(dwarf2_initialize_objfile): Likewise.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (dwarf2_build_psymtabs): Set partial_symtabs
|
|
|
|
|
earlier.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* psympriv.h (psymtab_discarder): Take psymtab_storage parameter.
|
|
|
|
|
(~psymtab_discarder, keep): Update.
|
|
|
|
|
<m_objfile>: Remove.
|
|
|
|
|
<m_partial_symtabs>: New member.
|
|
|
|
|
* dwarf2/read.c (dwarf2_build_psymtabs): Update.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* xcoffread.c (xcoff_end_psymtab): Add partial_symtabs parameter.
|
|
|
|
|
(xcoff_end_psymtab): Update.
|
|
|
|
|
(scan_xcoff_symtab): Add partial_symtabs parameter.
|
|
|
|
|
(xcoff_initial_scan): Update.
|
|
|
|
|
* stabsread.h (dbx_end_psymtab): Add partial_symtabs parameter.
|
|
|
|
|
* mdebugread.c (mdebug_build_psymtabs): Update.
|
|
|
|
|
(parse_partial_symbols): Add partial_symtabs parameter.
|
|
|
|
|
* dbxread.c (dbx_symfile_read): Update.
|
|
|
|
|
(read_dbx_symtab): Add partial_symtabs parameter.
|
|
|
|
|
(read_dbx_symtab): Update.
|
|
|
|
|
(dbx_end_psymtab): Add partial_symtabs parameter.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* quick-symbol.h (struct quick_symbol_functions)
|
|
|
|
|
<relocated>: New method.
|
|
|
|
|
* psymtab.h (struct psymbol_functions) <relocated>: New
|
|
|
|
|
method.
|
|
|
|
|
<fill_psymbol_map>: Declare method.
|
|
|
|
|
<m_psymbol_map>: New member.
|
|
|
|
|
* psymtab.c (psymbol_functions::fill_psymbol_map): Rename.
|
|
|
|
|
(psymbol_functions::find_compunit_symtab_by_address): Update.
|
|
|
|
|
* objfiles.h (reset_psymtabs): Don't clear psymbol_map.
|
|
|
|
|
(struct objfile) <psymbol_map>: Remove.
|
|
|
|
|
* objfiles.c (objfile_relocate1): Update.
|
|
|
|
|
|
Convert quick_symbol_functions to use methods
This changes quick_symbol_functions to be a base class with pure
virtual methods, rather than a struct holding function pointers.
Then, objfile is changed to hold a unique_ptr to an instance of this
class.
struct psymbol_functions is put into psympriv.h, and not psymtab.c,
because that is convenient later in the series.
gdb/ChangeLog
2021-03-20 Tom Tromey <tom@tromey.com>
* psympriv.h (struct psymbol_functions): New.
* symfile.c (syms_from_objfile_1, reread_symbols): Update.
* symfile-debug.c (objfile::find_compunit_symtab_by_address)
(objfile::lookup_global_symbol_language): Update.
* quick-symbol.h (struct quick_symbol_functions): Convert function
pointers to methods. Add virtual destructor.
(quick_symbol_functions_up): New typedef.
* psymtab.h (psym_functions, dwarf2_gdb_index_functions)
(dwarf2_debug_names_functions): Don't declare.
(make_psymbol_functions): Declare.
* psymtab.c (psymbol_functions::map_symtabs_matching_filename)
(psymbol_functions::find_pc_sect_compunit_symtab)
(psymbol_functions::lookup_symbol)
(psymbol_functions::lookup_global_symbol_language)
(psymbol_functions::find_last_source_symtab)
(psymbol_functions::forget_cached_source_info)
(psymbol_functions::print_stats, psymbol_functions::dump)
(psymbol_functions::expand_symtabs_for_function)
(psymbol_functions::expand_all_symtabs)
(psymbol_functions::expand_symtabs_with_fullname)
(psymbol_functions::map_symbol_filenames)
(psymbol_functions::map_matching_symbols)
(psymbol_functions::expand_symtabs_matching)
(psymbol_functions::has_symbols)
(psymbol_functions::find_compunit_symtab_by_address): Rename.
(psym_functions): Remove.
(make_psymbol_functions): New function.
* objfiles.h (struct objfile) <qf>: Change type.
* elfread.c (elf_symfile_read): Update.
* dwarf2/read.c (struct dwarf2_base_index_functions)
(struct dwarf2_gdb_index, struct dwarf2_debug_names_index): New.
(make_dwarf_gdb_index, make_dwarf_debug_names): New functions.
(dwarf2_base_index_functions::find_last_source_symtab)
(dwarf2_base_index_functions::forget_cached_source_info)
(dwarf2_base_index_functions::map_symtabs_matching_filename)
(dwarf2_gdb_index::lookup_symbol)
(dwarf2_base_index_functions::print_stats)
(dwarf2_gdb_index::dump)
(dwarf2_gdb_index::expand_symtabs_for_function)
(dwarf2_base_index_functions::expand_all_symtabs)
(dwarf2_base_index_functions::expand_symtabs_with_fullname):
Rename.
(dwarf2_gdb_index::map_matching_symbols): New method.
(dwarf2_gdb_index::expand_symtabs_matching): New method.
(dwarf2_base_index_functions::find_pc_sect_compunit_symtab)
(dwarf2_base_index_functions::map_symbol_filenames)
(dwarf2_base_index_functions::has_symbols): Rename.
(dwarf2_gdb_index_functions): Remove.
(dwarf2_debug_names_index::lookup_symbol)
(dwarf2_debug_names_index::dump)
(dwarf2_debug_names_index::expand_symtabs_for_function)
(dwarf2_debug_names_index::map_matching_symbols)
(dwarf2_debug_names_index::expand_symtabs_matching): Rename.
(dwarf2_debug_names_functions): Remove.
* dwarf2/public.h (make_dwarf_gdb_index, make_dwarf_debug_names):
Declare.
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* psympriv.h (struct psymbol_functions): New.
|
|
|
|
|
* symfile.c (syms_from_objfile_1, reread_symbols): Update.
|
|
|
|
|
* symfile-debug.c (objfile::find_compunit_symtab_by_address)
|
|
|
|
|
(objfile::lookup_global_symbol_language): Update.
|
|
|
|
|
* quick-symbol.h (struct quick_symbol_functions): Convert function
|
|
|
|
|
pointers to methods. Add virtual destructor.
|
|
|
|
|
(quick_symbol_functions_up): New typedef.
|
|
|
|
|
* psymtab.h (psym_functions, dwarf2_gdb_index_functions)
|
|
|
|
|
(dwarf2_debug_names_functions): Don't declare.
|
|
|
|
|
(make_psymbol_functions): Declare.
|
|
|
|
|
* psymtab.c (psymbol_functions::map_symtabs_matching_filename)
|
|
|
|
|
(psymbol_functions::find_pc_sect_compunit_symtab)
|
|
|
|
|
(psymbol_functions::lookup_symbol)
|
|
|
|
|
(psymbol_functions::lookup_global_symbol_language)
|
|
|
|
|
(psymbol_functions::find_last_source_symtab)
|
|
|
|
|
(psymbol_functions::forget_cached_source_info)
|
|
|
|
|
(psymbol_functions::print_stats, psymbol_functions::dump)
|
|
|
|
|
(psymbol_functions::expand_symtabs_for_function)
|
|
|
|
|
(psymbol_functions::expand_all_symtabs)
|
|
|
|
|
(psymbol_functions::expand_symtabs_with_fullname)
|
|
|
|
|
(psymbol_functions::map_symbol_filenames)
|
|
|
|
|
(psymbol_functions::map_matching_symbols)
|
|
|
|
|
(psymbol_functions::expand_symtabs_matching)
|
|
|
|
|
(psymbol_functions::has_symbols)
|
|
|
|
|
(psymbol_functions::find_compunit_symtab_by_address): Rename.
|
|
|
|
|
(psym_functions): Remove.
|
|
|
|
|
(make_psymbol_functions): New function.
|
|
|
|
|
* objfiles.h (struct objfile) <qf>: Change type.
|
|
|
|
|
* elfread.c (elf_symfile_read): Update.
|
|
|
|
|
* dwarf2/read.c (struct dwarf2_base_index_functions)
|
|
|
|
|
(struct dwarf2_gdb_index, struct dwarf2_debug_names_index): New.
|
|
|
|
|
(make_dwarf_gdb_index, make_dwarf_debug_names): New functions.
|
|
|
|
|
(dwarf2_base_index_functions::find_last_source_symtab)
|
|
|
|
|
(dwarf2_base_index_functions::forget_cached_source_info)
|
|
|
|
|
(dwarf2_base_index_functions::map_symtabs_matching_filename)
|
|
|
|
|
(dwarf2_gdb_index::lookup_symbol)
|
|
|
|
|
(dwarf2_base_index_functions::print_stats)
|
|
|
|
|
(dwarf2_gdb_index::dump)
|
|
|
|
|
(dwarf2_gdb_index::expand_symtabs_for_function)
|
|
|
|
|
(dwarf2_base_index_functions::expand_all_symtabs)
|
|
|
|
|
(dwarf2_base_index_functions::expand_symtabs_with_fullname):
|
|
|
|
|
Rename.
|
|
|
|
|
(dwarf2_gdb_index::map_matching_symbols): New method.
|
|
|
|
|
(dwarf2_gdb_index::expand_symtabs_matching): New method.
|
|
|
|
|
(dwarf2_base_index_functions::find_pc_sect_compunit_symtab)
|
|
|
|
|
(dwarf2_base_index_functions::map_symbol_filenames)
|
|
|
|
|
(dwarf2_base_index_functions::has_symbols): Rename.
|
|
|
|
|
(dwarf2_gdb_index_functions): Remove.
|
|
|
|
|
(dwarf2_debug_names_index::lookup_symbol)
|
|
|
|
|
(dwarf2_debug_names_index::dump)
|
|
|
|
|
(dwarf2_debug_names_index::expand_symtabs_for_function)
|
|
|
|
|
(dwarf2_debug_names_index::map_matching_symbols)
|
|
|
|
|
(dwarf2_debug_names_index::expand_symtabs_matching): Rename.
|
|
|
|
|
(dwarf2_debug_names_functions): Remove.
|
|
|
|
|
* dwarf2/public.h (make_dwarf_gdb_index, make_dwarf_debug_names):
|
|
|
|
|
Declare.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* psymtab.c (require_partial_symbols): Check that 'sf' is not
|
|
|
|
|
null.
|
|
|
|
|
* xcoffread.c (xcoff_sym_fns): Update.
|
|
|
|
|
* symfile.h (struct sym_fns) <qf>: Remove.
|
|
|
|
|
* symfile.c (syms_from_objfile_1, reread_symbols): Update.
|
|
|
|
|
* symfile-debug.c (objfile::has_partial_symbols)
|
|
|
|
|
(objfile::find_last_source_symtab)
|
|
|
|
|
(objfile::forget_cached_source_info)
|
|
|
|
|
(objfile::map_symtabs_matching_filename, objfile::lookup_symbol)
|
|
|
|
|
(objfile::print_stats, objfile::dump)
|
|
|
|
|
(objfile::expand_symtabs_for_function)
|
|
|
|
|
(objfile::expand_all_symtabs)
|
|
|
|
|
(objfile::expand_symtabs_with_fullname)
|
|
|
|
|
(objfile::map_matching_symbols)
|
|
|
|
|
(objfile::expand_symtabs_matching)
|
|
|
|
|
(objfile::find_pc_sect_compunit_symtab)
|
|
|
|
|
(objfile::map_symbol_filenames)
|
|
|
|
|
(objfile::find_compunit_symtab_by_address)
|
|
|
|
|
(objfile::lookup_global_symbol_language, debug_sym_fns)
|
|
|
|
|
(install_symfile_debug_logging): Update.
|
|
|
|
|
* objfiles.h (struct objfile) <qf>: New member.
|
|
|
|
|
* mipsread.c (ecoff_sym_fns): Update.
|
|
|
|
|
* machoread.c (macho_sym_fns): Update.
|
|
|
|
|
* elfread.c (elf_sym_fns_gdb_index, elf_sym_fns_debug_names):
|
|
|
|
|
Don't declare.
|
|
|
|
|
(elf_symfile_read, elf_sym_fns, elf_sym_fns_lazy_psyms): Update.
|
|
|
|
|
* dbxread.c (aout_sym_fns): Update.
|
|
|
|
|
* coffread.c (coff_sym_fns): Update.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symfile.h (symbol_compare_ftype, symbol_filename_ftype)
|
|
|
|
|
(expand_symtabs_file_matcher_ftype)
|
|
|
|
|
(expand_symtabs_symbol_matcher_ftype)
|
|
|
|
|
(expand_symtabs_exp_notify_ftype, struct quick_symbol_functions):
|
|
|
|
|
Move to quick-symbol.h.
|
|
|
|
|
* quick-symbol.h: New file.
|
|
|
|
|
|
Introduce method wrappers for quick_symbol_functions
This introduces wrappers for each function in quick_symbol_functions.
The wrappers are methods on objfile, and are defined in
symfile-debug.c, so that they can use the symfile_debug variable.
Places that call the quick functions are all updated to call these new
wrapper methods.
gdb/ChangeLog
2021-03-20 Tom Tromey <tom@tromey.com>
* symtab.c (iterate_over_symtabs, expand_symtab_containing_pc)
(lookup_symbol_via_quick_fns, find_quick_global_symbol_language)
(basic_lookup_transparent_type_quick)
(find_pc_sect_compunit_symtab, find_symbol_at_address)
(find_line_symtab, global_symbol_searcher::expand_symtabs):
Update.
* symmisc.c (print_objfile_statistics, dump_objfile)
(maintenance_expand_symtabs): Update.
* symfile.c (symbol_file_add_with_addrs)
(expand_symtabs_matching, map_symbol_filenames): Update.
* symfile-debug.c (objfile::has_partial_symbols)
(objfile::find_last_source_symtab)
(objfile::forget_cached_source_info)
(objfile::map_symtabs_matching_filename, objfile::lookup_symbol)
(objfile::print_stats, objfile::dump)
(objfile::expand_symtabs_for_function)
(objfile::expand_all_symtabs)
(objfile::expand_symtabs_with_fullname)
(objfile::map_matching_symbols)
(objfile::expand_symtabs_matching)
(objfile::find_pc_sect_compunit_symtab)
(objfile::map_symbol_filenames)
(objfile::find_compunit_symtab_by_address)
(objfile::lookup_global_symbol_language): New methods.
(debug_sym_quick_functions): Remove.
(debug_sym_fns, install_symfile_debug_logging): Update.
* source.c (forget_cached_source_info_for_objfile)
(select_source_symtab): Update.
* objfiles.h (struct objfile): Add methods corresponding to
quick_symbol_functions.
* objfiles.c (objfile::has_partial_symbols): Move to
symfile-debug.c.
* linespec.c (iterate_over_all_matching_symtabs): Update.
* cp-support.c (add_symbol_overload_list_qualified): Update.
* ada-lang.c (add_nonlocal_symbols): Update.
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symtab.c (iterate_over_symtabs, expand_symtab_containing_pc)
|
|
|
|
|
(lookup_symbol_via_quick_fns, find_quick_global_symbol_language)
|
|
|
|
|
(basic_lookup_transparent_type_quick)
|
|
|
|
|
(find_pc_sect_compunit_symtab, find_symbol_at_address)
|
|
|
|
|
(find_line_symtab, global_symbol_searcher::expand_symtabs):
|
|
|
|
|
Update.
|
|
|
|
|
* symmisc.c (print_objfile_statistics, dump_objfile)
|
|
|
|
|
(maintenance_expand_symtabs): Update.
|
|
|
|
|
* symfile.c (symbol_file_add_with_addrs)
|
|
|
|
|
(expand_symtabs_matching, map_symbol_filenames): Update.
|
|
|
|
|
* symfile-debug.c (objfile::has_partial_symbols)
|
|
|
|
|
(objfile::find_last_source_symtab)
|
|
|
|
|
(objfile::forget_cached_source_info)
|
|
|
|
|
(objfile::map_symtabs_matching_filename, objfile::lookup_symbol)
|
|
|
|
|
(objfile::print_stats, objfile::dump)
|
|
|
|
|
(objfile::expand_symtabs_for_function)
|
|
|
|
|
(objfile::expand_all_symtabs)
|
|
|
|
|
(objfile::expand_symtabs_with_fullname)
|
|
|
|
|
(objfile::map_matching_symbols)
|
|
|
|
|
(objfile::expand_symtabs_matching)
|
|
|
|
|
(objfile::find_pc_sect_compunit_symtab)
|
|
|
|
|
(objfile::map_symbol_filenames)
|
|
|
|
|
(objfile::find_compunit_symtab_by_address)
|
|
|
|
|
(objfile::lookup_global_symbol_language): New methods.
|
|
|
|
|
(debug_sym_quick_functions): Remove.
|
|
|
|
|
(debug_sym_fns, install_symfile_debug_logging): Update.
|
|
|
|
|
* source.c (forget_cached_source_info_for_objfile)
|
|
|
|
|
(select_source_symtab): Update.
|
|
|
|
|
* objfiles.h (struct objfile): Add methods corresponding to
|
|
|
|
|
quick_symbol_functions.
|
|
|
|
|
* objfiles.c (objfile::has_partial_symbols): Move to
|
|
|
|
|
symfile-debug.c.
|
|
|
|
|
* linespec.c (iterate_over_all_matching_symtabs): Update.
|
|
|
|
|
* cp-support.c (add_symbol_overload_list_qualified): Update.
|
|
|
|
|
* ada-lang.c (add_nonlocal_symbols): Update.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* objfiles.h (struct objfile) <has_partial_symbols>: Return bool.
|
|
|
|
|
* symfile.h (struct quick_symbol_functions) <has_symbols>: Return
|
|
|
|
|
bool.
|
|
|
|
|
* symfile-debug.c (debug_qf_has_symbols): Return bool.
|
|
|
|
|
* psymtab.c (psym_has_symbols): Return bool.
|
|
|
|
|
* objfiles.c (objfile::has_partial_symbols): Return bool.
|
|
|
|
|
* dwarf2/read.c (dw2_has_symbols): Return bool.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symfile.c (read_symbols): Update.
|
|
|
|
|
* objfiles.h (struct objfile) <has_partial_symbols>: New method.
|
|
|
|
|
(objfile_has_partial_symbols): Don't declare.
|
|
|
|
|
* objfiles.c (objfile::has_partial_symbols): Rename from
|
|
|
|
|
objfile_has_partial_symbols.
|
|
|
|
|
(objfile_has_symbols, have_partial_symbols): Update.
|
|
|
|
|
* elfread.c (elf_symfile_read): Update.
|
|
|
|
|
* dwarf2/read.c (dwarf2_has_info): Update.
|
|
|
|
|
* coffread.c (coff_symfile_read): Update.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* coffread.c: Include dwarf2/public.h.
|
|
|
|
|
* dwarf2/frame.c: Include dwarf2/public.h.
|
|
|
|
|
* dwarf2/index-write.h: Include dwarf2/public.h, not symfile.h.
|
|
|
|
|
* dwarf2/public.h: New file.
|
|
|
|
|
* dwarf2/read.c: Include dwarf2/public.h.
|
|
|
|
|
* elfread.c: Include dwarf2/public.h.
|
|
|
|
|
* machoread.c: Include dwarf2/public.h.
|
|
|
|
|
* symfile.h (dwarf2_has_info, enum dw_index_kind)
|
|
|
|
|
(dwarf2_initialize_objfile, dwarf2_build_psymtabs)
|
|
|
|
|
(dwarf2_build_frame_info): Move to dwarf2/public.h.
|
|
|
|
|
* xcoffread.c: Include dwarf2/public.h.
|
|
|
|
|
|
2021-03-21 07:23:40 +08:00
|
|
|
|
2021-03-20 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symfile.h (enum dwarf2_section_enum)
|
|
|
|
|
(dwarf2_get_section_info): Move to dwarf2/read.h.
|
|
|
|
|
* dwarf2/read.h (enum dwarf2_section_enum)
|
|
|
|
|
(dwarf2_get_section_info): Move from symfile.h.
|
|
|
|
|
|
Fix any_thread_of_inferior
Running gdb-term.exp against gdbserver with "maint set target-non-stop
on", runs into this:
[infrun] fetch_inferior_event: exit
[infrun] fetch_inferior_event: enter
/home/pedro/gdb/binutils-gdb/src/gdb/thread.c:72: internal-error: thread_info* inferior_thread(): Assertion `current_thread_ != nullptr' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
This is a bug, please report it. For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.
FAIL: gdb.base/gdb-sigterm.exp: expect eof #2 (GDB internal error)
Resyncing due to internal error.
ERROR: : spawn id exp9 not open
while executing
"expect {
-i exp9 -timeout 10
-re "Quit this debugging session\\? \\(y or n\\) $" {
send_gdb "n\n" answer
incr count
}
-re "Create ..."
("uplevel" body line 1)
invoked from within
"uplevel $body" NONE : spawn id exp9 not open
ERROR: Could not resync from internal error (timeout)
gdb.base/gdb-sigterm.exp: expect eof #2: stepped 0 times
UNRESOLVED: gdb.base/gdb-sigterm.exp: 50 SIGTERM passes
The assertion fails here:
...
#5 0x000055af4b4a7164 in internal_error (file=0x55af4b5e5de8 "/home/pedro/gdb/binutils-gdb/src/gdb/thread.c", line=72, fmt=0x55af4b5e5ce9 "%s: Assertion `%s' failed.") at /home/pedro/gdb/binutils-gdb/src/gdbsupport/errors.cc:55
#6 0x000055af4b25fc43 in inferior_thread () at /home/pedro/gdb/binutils-gdb/src/gdb/thread.c:72
#7 0x000055af4b26177e in any_thread_of_inferior (inf=0x55af4cf874f0) at /home/pedro/gdb/binutils-gdb/src/gdb/thread.c:638
#8 0x000055af4b26eec8 in kill_or_detach (inf=0x55af4cf874f0, from_tty=0) at /home/pedro/gdb/binutils-gdb/src/gdb/top.c:1665
#9 0x000055af4b26f37f in quit_force (exit_arg=0x0, from_tty=0) at /home/pedro/gdb/binutils-gdb/src/gdb/top.c:1767
#10 0x000055af4b2f72a7 in quit () at /home/pedro/gdb/binutils-gdb/src/gdb/utils.c:633
#11 0x000055af4b2f730b in maybe_quit () at /home/pedro/gdb/binutils-gdb/src/gdb/utils.c:657
#12 0x000055af4b1adb74 in ser_base_wait_for (scb=0x55af4d02e460, timeout=0) at /home/pedro/gdb/binutils-gdb/src/gdb/ser-base.c:236
#13 0x000055af4b1adf0f in do_ser_base_readchar (scb=0x55af4d02e460, timeout=0) at /home/pedro/gdb/binutils-gdb/src/gdb/ser-base.c:365
#14 0x000055af4b1ae06d in generic_readchar (scb=0x55af4d02e460, timeout=0, do_readchar=0x55af4b1adeb1 <do_ser_base_readchar(serial*, int)>) at /home/pedro/gdb/binutils-gdb/src/gdb/ser-base.c:444
...
The bug is that any_thread_of_inferior incorrectly assumes that
there's always a selected thread. This fixes it.
gdb/ChangeLog:
* thread.c (any_thread_of_inferior): Check if there's a selected
thread before calling inferior_thread().
Change-Id: Ica4b9ec746121a7a7c22bef09baea72103b3853d
2021-02-12 04:16:40 +08:00
|
|
|
|
2021-03-19 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* thread.c (any_thread_of_inferior): Check if there's a selected
|
|
|
|
|
thread before calling inferior_thread().
|
|
|
|
|
|
2021-03-18 23:01:10 +08:00
|
|
|
|
2021-03-18 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/stringify.c (dwarf_unit_type_name): New function. Use
|
|
|
|
|
get_DW_UT_name.
|
|
|
|
|
* dwarf2/stringify.h (dwarf_unit_type_name): Declare.
|
|
|
|
|
* dwarf2/comp-unit.c (dwarf_unit_type_name): Remove.
|
|
|
|
|
|
2021-03-19 00:44:14 +08:00
|
|
|
|
2021-03-18 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* python/py-param.c (get_set_value): Update header comment.
|
|
|
|
|
|
2021-01-13 12:42:12 +08:00
|
|
|
|
2021-03-17 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* infrun.c (check_multi_target_resumption): Remove argument to
|
|
|
|
|
all_non_exited_inferiors.
|
|
|
|
|
|
2021-03-15 21:31:43 +08:00
|
|
|
|
2021-03-16 Christian Biesinger <cbiesinger@google.com>
|
|
|
|
|
|
|
|
|
|
* windows-nat.c (windows_init_thread_list): Add message to
|
|
|
|
|
debug log.
|
|
|
|
|
|
2021-03-15 22:20:13 +08:00
|
|
|
|
2021-03-16 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* python/py-framefilter.c (py_print_frame): Use PyInt_Check as
|
|
|
|
|
well as PyLong_Check for Python 2.
|
|
|
|
|
|
2021-03-15 22:59:17 +08:00
|
|
|
|
2021-03-15 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
PR build/27579:
|
|
|
|
|
* rust-exp.y (maker_map): Use gdb::hash_enum.
|
|
|
|
|
* stap-probe.c (stap_maker_map): Use gdb::hash_enum.
|
|
|
|
|
|
2021-03-16 01:27:03 +08:00
|
|
|
|
2021-03-15 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (create_debug_type_hash_table): Remove colon at
|
|
|
|
|
end of debug print.
|
|
|
|
|
|
2021-03-16 01:22:27 +08:00
|
|
|
|
2021-03-15 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (dw2_get_file_names_reader): Remove info_ptr
|
|
|
|
|
parameter, adjust caller.
|
|
|
|
|
|
2021-03-15 22:20:24 +08:00
|
|
|
|
2021-03-15 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-exp.y (simple_exp): Always push a result for unary '+'.
|
|
|
|
|
|
2021-03-15 20:23:12 +08:00
|
|
|
|
2021-03-15 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_unop_ind_operation::evaluate): Call
|
|
|
|
|
ada_ensure_varsize_limit.
|
|
|
|
|
|
Implement Ada operator overloading
In the expression rewrite, I neglected to carry over support for Ada
operator overloading. It turns out that there were no tests for this
in-tree.
This patch adds support for operator overloading, and adds the missing
test.
gdb/ChangeLog
2021-03-15 Tom Tromey <tromey@adacore.com>
* ada-lang.c (numeric_type_p, integer_type_p): Return true for
fixed-point.
* ada-exp.y (maybe_overload): New function.
(ada_wrap_overload): New function.
(ada_un_wrap2, ada_wrap2, ada_wrap_op): Use maybe_overload.
(exp1, simple_exp, relation, and_exp, and_then_exp, or_exp)
(or_else_exp, xor_exp, primary): Update.
gdb/testsuite/ChangeLog
2021-03-15 Tom Tromey <tromey@adacore.com>
* gdb.ada/operator_call/twovecs.ads: New file.
* gdb.ada/operator_call/twovecs.adb: New file.
* gdb.ada/operator_call/opcall.adb: New file.
* gdb.ada/operator_call.exp: New file.
2021-03-15 20:23:12 +08:00
|
|
|
|
2021-03-15 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (numeric_type_p, integer_type_p): Return true for
|
|
|
|
|
fixed-point.
|
|
|
|
|
* ada-exp.y (maybe_overload): New function.
|
|
|
|
|
(ada_wrap_overload): New function.
|
|
|
|
|
(ada_un_wrap2, ada_wrap2, ada_wrap_op): Use maybe_overload.
|
|
|
|
|
(exp1, simple_exp, relation, and_exp, and_then_exp, or_exp)
|
|
|
|
|
(or_else_exp, xor_exp, primary): Update.
|
|
|
|
|
|
2021-03-15 20:23:12 +08:00
|
|
|
|
2021-03-15 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
PR ada/27545:
|
|
|
|
|
* ada-lang.c (ada_var_value_operation::evaluate): Use recursive
|
|
|
|
|
call for tagged type.
|
|
|
|
|
|
2021-03-15 20:23:12 +08:00
|
|
|
|
2021-03-15 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-exp.y (exp1): Handle resolution of the right hand side of an
|
|
|
|
|
assignment.
|
|
|
|
|
|
2021-03-15 20:23:12 +08:00
|
|
|
|
2021-03-15 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_aggregate_operation::assign_aggregate): Return
|
|
|
|
|
container.
|
|
|
|
|
(ada_assign_operation::evaluate): Update.
|
|
|
|
|
* ada-exp.h (class ada_aggregate_operation) <assign_aggregate>:
|
|
|
|
|
Change return type.
|
|
|
|
|
|
2021-03-15 18:00:28 +08:00
|
|
|
|
2021-03-15 Felix Willgerodt <felix.willgerodt@intel.com>
|
|
|
|
|
|
|
|
|
|
* i386-tdep.c (i386_floatformat_for_type): Add COMPLEX*32 and REAL*16.
|
|
|
|
|
|
2021-03-12 19:07:19 +08:00
|
|
|
|
2021-03-15 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* python/python.c (gdbpy_source_objfile_script): Use
|
|
|
|
|
make_scoped_restore to restore gdbpy_current_objfile.
|
|
|
|
|
(gdbpy_execute_objfile_script): Likewise.
|
|
|
|
|
|
2021-03-15 01:59:37 +08:00
|
|
|
|
2021-03-14 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (read_attribute_value): Use cu_header
|
|
|
|
|
consistently.
|
|
|
|
|
|
2021-03-15 01:42:05 +08:00
|
|
|
|
2021-03-14 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (struct die_reader_specs) <abfd>: Fix formatting.
|
|
|
|
|
(peek_die_abbrev): Use reader.abfd.
|
|
|
|
|
|
2021-03-15 01:41:46 +08:00
|
|
|
|
2021-03-14 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (dwarf2_per_cu_data::get_header): Set
|
|
|
|
|
m_header_read_in.
|
|
|
|
|
|
2021-03-14 00:41:04 +08:00
|
|
|
|
2021-03-13 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (struct partial_die_info): Update.
|
|
|
|
|
(peek_die_abbrev, skip_children, skip_one_die, read_full_die_1)
|
|
|
|
|
(load_partial_dies, partial_die_info::partial_die_info): Update.
|
|
|
|
|
* dwarf2/abbrev.h (lookup_abbrev): Constify.
|
|
|
|
|
|
2021-03-14 00:41:04 +08:00
|
|
|
|
2021-03-13 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/abbrev.c (abbrev_table::read): Remove Irix 6 workaround.
|
|
|
|
|
|
2021-03-09 22:16:23 +08:00
|
|
|
|
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-11 02:50:09 +08:00
|
|
|
|
2021-03-10 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* parser-defs.h (parser_state): Change completion to bool.
|
|
|
|
|
<parse_completion>: Likewise.
|
|
|
|
|
* ada-lang.h (ada_find_operator_symbol, ada_resolve_funcall)
|
|
|
|
|
(ada_resolve_variable, ada_resolve_function): Update.
|
|
|
|
|
* ada-lang.c (ada_find_operator_symbol): Change
|
|
|
|
|
parse_completion to bool.
|
|
|
|
|
(ada_resolve_funcall, ada_resolve_variable)
|
|
|
|
|
(ada_resolve_function): Likewise.
|
|
|
|
|
|
2021-03-09 22:36:26 +08:00
|
|
|
|
2021-03-09 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (operation::evaluate_funcall): Use function formal
|
|
|
|
|
parameter types when evaluating.
|
|
|
|
|
|
2021-02-09 05:24:52 +08:00
|
|
|
|
2021-03-09 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdb-gdb.py.in (StructMainTypePrettyPrinter) <owner_to_string>:
|
|
|
|
|
Updated fields names flag_objfile_owned to m_flag_objfile_owned,
|
|
|
|
|
and owner to m_owner.
|
|
|
|
|
|
2021-03-09 18:34:55 +08:00
|
|
|
|
2021-03-09 Felix Willgerodt <felix.willgerodt@intel.com>
|
|
|
|
|
|
|
|
|
|
* f-exp.h (eval_op_f_loc): Declare.
|
|
|
|
|
(expr::fortran_loc_operation): New typedef.
|
|
|
|
|
* f-exp.y (exp): Handle UNOP_FORTRAN_LOC after parsing an
|
|
|
|
|
UNOP_INTRINSIC.
|
|
|
|
|
(f77_keywords): Add LOC keyword.
|
|
|
|
|
* f-lang.c (eval_op_f_loc): New function.
|
|
|
|
|
* std-operator.def (UNOP_FORTRAN_LOC): New operator.
|
|
|
|
|
|
2021-02-26 19:14:24 +08:00
|
|
|
|
2021-03-09 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* f-exp.h (eval_op_f_array_shape): Declare.
|
|
|
|
|
(fortran_array_shape_operation): New type.
|
|
|
|
|
* f-exp.y (exp): Handle UNOP_FORTRAN_SHAPE after parsing
|
|
|
|
|
UNOP_INTRINSIC.
|
|
|
|
|
(f77_keywords): Add "shape" keyword.
|
|
|
|
|
* f-lang.c (fortran_array_shape): New function.
|
|
|
|
|
(eval_op_f_array_shape): New function.
|
|
|
|
|
* std-operator.def (UNOP_FORTRAN_SHAPE): New operator.
|
|
|
|
|
|
2021-02-26 00:15:52 +08:00
|
|
|
|
2021-03-09 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* f-exp.y (eval_op_f_array_size): Declare 1 and 2 argument forms
|
|
|
|
|
of this function.
|
|
|
|
|
(expr::fortran_array_size_1arg): New type.
|
|
|
|
|
(expr::fortran_array_size_2arg): Likewise.
|
|
|
|
|
* f-exp.y (exp): Handle FORTRAN_ARRAY_SIZE after parsing
|
|
|
|
|
UNOP_OR_BINOP_INTRINSIC.
|
|
|
|
|
(f77_keywords): Add "size" keyword.
|
|
|
|
|
* f-lang.c (fortran_array_size): New function.
|
|
|
|
|
(eval_op_f_array_size): New function, has a 1 arg and 2 arg form.
|
|
|
|
|
* std-operator.def (FORTRAN_ARRAY_SIZE): New operator.
|
|
|
|
|
|
2021-02-25 19:41:57 +08:00
|
|
|
|
2021-03-09 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* f-exp.h (eval_op_f_rank): Declare.
|
|
|
|
|
(expr::fortran_rank_operation): New typedef.
|
|
|
|
|
* f-exp.y (exp): Handle UNOP_FORTRAN_RANK after parsing an
|
|
|
|
|
UNOP_INTRINSIC.
|
|
|
|
|
(f77_keywords): Add "rank" keyword.
|
|
|
|
|
* f-lang.c (eval_op_f_rank): New function.
|
|
|
|
|
* std-operator.def (UNOP_FORTRAN_RANK): New operator.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* printcmd.c (set_command): Remove null check.
|
|
|
|
|
* value.c (init_if_undefined_command): Remove null check.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* parse.c (parser_state::push_symbol, parser_state::push_dollar):
|
|
|
|
|
Update.
|
|
|
|
|
* p-exp.y (variable): Update.
|
|
|
|
|
* go-exp.y (variable): Update.
|
|
|
|
|
* expprint.c (dump_for_expression): Use bound_minimal_symbol.
|
|
|
|
|
Remove overload for objfile.
|
|
|
|
|
* expop.h (eval_op_var_msym_value): Use bound_minimal_symbol
|
|
|
|
|
parameter.
|
|
|
|
|
(check_objfile): Likewise.
|
|
|
|
|
(dump_for_expression): Likewise. Remove overload for objfile.
|
|
|
|
|
(class var_msym_value_operation): Use bound_minimal_symbol.
|
|
|
|
|
* eval.c (eval_op_var_msym_value): Use bound_minimal_symbol
|
|
|
|
|
parameter.
|
|
|
|
|
(var_msym_value_operation::evaluate_for_address)
|
|
|
|
|
(var_msym_value_operation::evaluate_for_sizeof)
|
|
|
|
|
(var_msym_value_operation::evaluate_for_cast): Update.
|
|
|
|
|
* d-exp.y (PrimaryExpression): Update.
|
|
|
|
|
* c-exp.y (variable): Update.
|
|
|
|
|
* ax-gdb.c (var_msym_value_operation::do_generate_ax): Update.
|
|
|
|
|
* ada-lang.c (ada_var_msym_value_operation::evaluate_for_cast):
|
|
|
|
|
Update.
|
|
|
|
|
* ada-exp.y (write_var_or_type): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* parser-defs.h (exp_uses_objfile): Return bool.
|
|
|
|
|
* parse.c (exp_uses_objfile): Return bool.
|
|
|
|
|
|
Remove EVAL_SKIP
EVAL_SKIP was needed in the old expression implementation due to its
linearized tree structure. This is not needed in the new
implementation, because it is trivial to not evaluate a subexpression.
This patch removes the last vestiges of EVAL_SKIP.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* value.h (eval_skip_value): Don't declare.
* opencl-lang.c (eval_opencl_assign): Update.
* m2-lang.c (eval_op_m2_high, eval_op_m2_subscript): Update.
* f-lang.c (eval_op_f_abs, eval_op_f_mod, eval_op_f_ceil)
(eval_op_f_floor, eval_op_f_modulo, eval_op_f_cmplx): Remove.
* expression.h (enum noside) <EVAL_SKIP>: Remove.
* expop.h (typeof_operation::evaluate)
(decltype_operation::evaluate, unop_addr_operation::evaluate)
(unop_sizeof_operation::evaluate, assign_operation::evaluate)
(cxx_cast_operation::evaluate): Update.
* eval.c (eval_skip_value): Remove.
(eval_op_scope, eval_op_var_entry_value)
(eval_op_func_static_var, eval_op_string, eval_op_objc_selector)
(eval_op_concat, eval_op_ternop, eval_op_structop_struct)
(eval_op_structop_ptr, eval_op_member, eval_op_add, eval_op_sub)
(eval_op_binary, eval_op_subscript, eval_op_equal)
(eval_op_notequal, eval_op_less, eval_op_gtr, eval_op_geq)
(eval_op_leq, eval_op_repeat, eval_op_plus, eval_op_neg)
(eval_op_complement, eval_op_lognot, eval_op_ind)
(eval_op_memval, eval_op_preinc, eval_op_predec)
(eval_op_postinc, eval_op_postdec, eval_op_type)
(eval_binop_assign_modify, eval_op_objc_msgcall)
(eval_multi_subscript, logical_and_operation::evaluate)
(logical_or_operation::evaluate, array_operation::evaluate)
(operation::evaluate_for_cast)
(var_msym_value_operation::evaluate_for_cast)
(var_value_operation::evaluate_for_cast): Update.
* c-lang.c (c_string_operation::evaluate): Update.
* c-exp.h (objc_nsstring_operation::evaluate)
(objc_selector_operation::evaluate): Update.
* ada-lang.c (ada_assign_operation::evaluate)
(eval_ternop_in_range, ada_unop_neg, ada_unop_in_range)
(ada_atr_size): Update.
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* value.h (eval_skip_value): Don't declare.
|
|
|
|
|
* opencl-lang.c (eval_opencl_assign): Update.
|
|
|
|
|
* m2-lang.c (eval_op_m2_high, eval_op_m2_subscript): Update.
|
|
|
|
|
* f-lang.c (eval_op_f_abs, eval_op_f_mod, eval_op_f_ceil)
|
|
|
|
|
(eval_op_f_floor, eval_op_f_modulo, eval_op_f_cmplx): Remove.
|
|
|
|
|
* expression.h (enum noside) <EVAL_SKIP>: Remove.
|
|
|
|
|
* expop.h (typeof_operation::evaluate)
|
|
|
|
|
(decltype_operation::evaluate, unop_addr_operation::evaluate)
|
|
|
|
|
(unop_sizeof_operation::evaluate, assign_operation::evaluate)
|
|
|
|
|
(cxx_cast_operation::evaluate): Update.
|
|
|
|
|
* eval.c (eval_skip_value): Remove.
|
|
|
|
|
(eval_op_scope, eval_op_var_entry_value)
|
|
|
|
|
(eval_op_func_static_var, eval_op_string, eval_op_objc_selector)
|
|
|
|
|
(eval_op_concat, eval_op_ternop, eval_op_structop_struct)
|
|
|
|
|
(eval_op_structop_ptr, eval_op_member, eval_op_add, eval_op_sub)
|
|
|
|
|
(eval_op_binary, eval_op_subscript, eval_op_equal)
|
|
|
|
|
(eval_op_notequal, eval_op_less, eval_op_gtr, eval_op_geq)
|
|
|
|
|
(eval_op_leq, eval_op_repeat, eval_op_plus, eval_op_neg)
|
|
|
|
|
(eval_op_complement, eval_op_lognot, eval_op_ind)
|
|
|
|
|
(eval_op_memval, eval_op_preinc, eval_op_predec)
|
|
|
|
|
(eval_op_postinc, eval_op_postdec, eval_op_type)
|
|
|
|
|
(eval_binop_assign_modify, eval_op_objc_msgcall)
|
|
|
|
|
(eval_multi_subscript, logical_and_operation::evaluate)
|
|
|
|
|
(logical_or_operation::evaluate, array_operation::evaluate)
|
|
|
|
|
(operation::evaluate_for_cast)
|
|
|
|
|
(var_msym_value_operation::evaluate_for_cast)
|
|
|
|
|
(var_value_operation::evaluate_for_cast): Update.
|
|
|
|
|
* c-lang.c (c_string_operation::evaluate): Update.
|
|
|
|
|
* c-exp.h (objc_nsstring_operation::evaluate)
|
|
|
|
|
(objc_selector_operation::evaluate): Update.
|
|
|
|
|
* ada-lang.c (ada_assign_operation::evaluate)
|
|
|
|
|
(eval_ternop_in_range, ada_unop_neg, ada_unop_in_range)
|
|
|
|
|
(ada_atr_size): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c: Merge "namespace" scopes.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* parser-defs.h (struct expr_builder) <expr_builder>: Inline.
|
|
|
|
|
<release>: Inline.
|
|
|
|
|
* parse.c (expr_builder::expr_builder, expr_builder::release):
|
|
|
|
|
Remove.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* parse.c (expression::expression, expression::~expression):
|
|
|
|
|
Remove.
|
|
|
|
|
* expression.h (struct expression): Inline constructor. Remove
|
|
|
|
|
destructor.
|
|
|
|
|
|
Remove BINOP_END
BINOP_END is used only as a "meaningless" value in various tables.
This patch changes these to use OP_NULL instead, and removes
BINOP_END.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* std-operator.def (BINOP_END): Remove.
* p-exp.y (tokentab3, tokentab2): Use OP_NULL, not BINOP_END.
* go-exp.y (tokentab2): Use OP_NULL, not BINOP_END.
* f-exp.y (dot_ops, f77_keywords): Use OP_NULL, not BINOP_END.
* d-exp.y (tokentab2, ident_tokens): Use OP_NULL, not BINOP_END.
* c-exp.y (tokentab3, tokentab2, ident_tokens): Use OP_NULL, not
BINOP_END.
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* std-operator.def (BINOP_END): Remove.
|
|
|
|
|
* p-exp.y (tokentab3, tokentab2): Use OP_NULL, not BINOP_END.
|
|
|
|
|
* go-exp.y (tokentab2): Use OP_NULL, not BINOP_END.
|
|
|
|
|
* f-exp.y (dot_ops, f77_keywords): Use OP_NULL, not BINOP_END.
|
|
|
|
|
* d-exp.y (tokentab2, ident_tokens): Use OP_NULL, not BINOP_END.
|
|
|
|
|
* c-exp.y (tokentab3, tokentab2, ident_tokens): Use OP_NULL, not
|
|
|
|
|
BINOP_END.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expression.h (enum exp_opcode) <OP_UNUSED_LAST>: Remove.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* std-operator.def (OP_EXTENDED0): Remove.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* std-operator.def (OP_NAME, OP_ATR_IMAGE, OP_ATR_MODULUS)
|
|
|
|
|
(OP_OTHERS, OP_CHOICES, OP_POSITIONAL, OP_DISCRETE_RANGE):
|
|
|
|
|
Remove.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* std-operator.def (UNOP_CAP, UNOP_CHR, UNOP_ORD, UNOP_FLOAT)
|
|
|
|
|
(UNOP_MAX, UNOP_MIN, UNOP_ODD, UNOP_TRUNC, OP_M2_STRING): Remove.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* std-operator.def (OP_ATR_MIN, OP_ATR_MAX): Remove.
|
|
|
|
|
* ada-lang.c (ada_binop_minmax): Update.
|
|
|
|
|
* ada-exp.h (ada_binop_min_operation, ada_binop_max_operation):
|
|
|
|
|
Use BINOP_MIN and BINOP_MAX.
|
|
|
|
|
|
Remove union exp_element
This removes union exp_element functions that either create such
elements or walk them. struct expression no longer holds
exp_elements. A couple of language_defn methods are also removed, as
they are obsolete.
Note that this patch also removes the print_expression code. The only
in-tree caller of this was from dump_prefix_expression, which is only
called when expression debugging is enabled. Implementing this would
involve a fair amount of code, and it seems to me that prefix dumping
is preferable anyway, as it is unambiguous. So, I have not
reimplemented this feature.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* value.h (evaluate_subexp_with_coercion): Don't declare.
* parse.c (exp_descriptor_standard): Remove.
(expr_builder::expr_builder, expr_builder::release): Update.
(expression::expression): Remove size_t parameter.
(expression::~expression): Simplify.
(expression::resize): Remove.
(write_exp_elt, write_exp_elt_opcode, write_exp_elt_sym)
(write_exp_elt_msym, write_exp_elt_block, write_exp_elt_objfile)
(write_exp_elt_longcst, write_exp_elt_floatcst)
(write_exp_elt_type, write_exp_elt_intern, write_exp_string)
(write_exp_string_vector, write_exp_bitstring): Remove.
* p-lang.h (class pascal_language) <opcode_print_table,
op_print_tab>: Remove.
* p-lang.c (pascal_language::op_print_tab): Remove.
* opencl-lang.c (class opencl_language) <opcode_print_table>:
Remove.
* objc-lang.c (objc_op_print_tab): Remove.
(class objc_language) <opcode_print_table>: Remove.
* m2-lang.h (class m2_language) <opcode_print_table,
op_print_tab>: Remove.
* m2-lang.c (m2_language::op_print_tab): Remove.
* language.h (struct language_defn) <post_parser, expression_ops,
opcode_print_table>: Remove.
* language.c (language_defn::expression_ops)
(auto_or_unknown_language::opcode_print_table): Remove.
* go-lang.h (class go_language) <opcode_print_table,
op_print_tab>: Remove.
* go-lang.c (go_language::op_print_tab): Remove.
* f-lang.h (class f_language) <opcode_print_table>: Remove
<op_print_tab>: Remove.
* f-lang.c (f_language::op_print_tab): Remove.
* expression.h (union exp_element): Remove.
(struct expression): Remove size_t parameter from constructor.
<resize>: Remove.
<first_opcode>: Update.
<nelts, elts>: Remove.
(EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): Remove.
(evaluate_subexp_standard, print_expression, op_string)
(dump_raw_expression): Don't declare.
* expprint.c (print_expression, print_subexp)
(print_subexp_funcall, print_subexp_standard, op_string)
(dump_raw_expression, dump_subexp, dump_subexp_body)
(dump_subexp_body_funcall, dump_subexp_body_standard): Remove.
(dump_prefix_expression): Update.
* eval.c (evaluate_subexp): Remove.
(evaluate_expression, evaluate_type): Update.
(evaluate_subexpression_type): Remove.
(fetch_subexp_value): Remove "pc" parameter. Update.
(extract_field_op, evaluate_struct_tuple, evaluate_funcall)
(evaluate_subexp_standard, evaluate_subexp_for_address)
(evaluate_subexp_with_coercion, evaluate_subexp_for_sizeof)
(evaluate_subexp_for_cast): Remove.
(parse_and_eval_type): Update.
* dtrace-probe.c (dtrace_probe::compile_to_ax): Update.
* d-lang.c (d_op_print_tab): Remove.
(class d_language) <opcode_print_table>: Remove.
* c-lang.h (c_op_print_tab): Don't declare.
* c-lang.c (c_op_print_tab): Remove.
(class c_language, class cplus_language, class asm_language, class
minimal_language) <opcode_print_table>: Remove.
* breakpoint.c (update_watchpoint, watchpoint_check)
(watchpoint_exp_is_const, watch_command_1): Update.
* ax-gdb.h (union exp_element): Don't declare.
* ax-gdb.c (const_var_ref, const_expr, maybe_const_expr)
(gen_repeat, gen_sizeof, gen_expr_for_cast, gen_expr)
(gen_expr_binop_rest): Remove.
(gen_trace_for_expr, gen_eval_for_expr, gen_printf): Update.
* ada-lang.c (ada_op_print_tab): Remove.
(class ada_language) <post_parser, opcode_print_table>: Remove.
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* value.h (evaluate_subexp_with_coercion): Don't declare.
|
|
|
|
|
* parse.c (exp_descriptor_standard): Remove.
|
|
|
|
|
(expr_builder::expr_builder, expr_builder::release): Update.
|
|
|
|
|
(expression::expression): Remove size_t parameter.
|
|
|
|
|
(expression::~expression): Simplify.
|
|
|
|
|
(expression::resize): Remove.
|
|
|
|
|
(write_exp_elt, write_exp_elt_opcode, write_exp_elt_sym)
|
|
|
|
|
(write_exp_elt_msym, write_exp_elt_block, write_exp_elt_objfile)
|
|
|
|
|
(write_exp_elt_longcst, write_exp_elt_floatcst)
|
|
|
|
|
(write_exp_elt_type, write_exp_elt_intern, write_exp_string)
|
|
|
|
|
(write_exp_string_vector, write_exp_bitstring): Remove.
|
|
|
|
|
* p-lang.h (class pascal_language) <opcode_print_table,
|
|
|
|
|
op_print_tab>: Remove.
|
|
|
|
|
* p-lang.c (pascal_language::op_print_tab): Remove.
|
|
|
|
|
* opencl-lang.c (class opencl_language) <opcode_print_table>:
|
|
|
|
|
Remove.
|
|
|
|
|
* objc-lang.c (objc_op_print_tab): Remove.
|
|
|
|
|
(class objc_language) <opcode_print_table>: Remove.
|
|
|
|
|
* m2-lang.h (class m2_language) <opcode_print_table,
|
|
|
|
|
op_print_tab>: Remove.
|
|
|
|
|
* m2-lang.c (m2_language::op_print_tab): Remove.
|
|
|
|
|
* language.h (struct language_defn) <post_parser, expression_ops,
|
|
|
|
|
opcode_print_table>: Remove.
|
|
|
|
|
* language.c (language_defn::expression_ops)
|
|
|
|
|
(auto_or_unknown_language::opcode_print_table): Remove.
|
|
|
|
|
* go-lang.h (class go_language) <opcode_print_table,
|
|
|
|
|
op_print_tab>: Remove.
|
|
|
|
|
* go-lang.c (go_language::op_print_tab): Remove.
|
|
|
|
|
* f-lang.h (class f_language) <opcode_print_table>: Remove
|
|
|
|
|
<op_print_tab>: Remove.
|
|
|
|
|
* f-lang.c (f_language::op_print_tab): Remove.
|
|
|
|
|
* expression.h (union exp_element): Remove.
|
|
|
|
|
(struct expression): Remove size_t parameter from constructor.
|
|
|
|
|
<resize>: Remove.
|
|
|
|
|
<first_opcode>: Update.
|
|
|
|
|
<nelts, elts>: Remove.
|
|
|
|
|
(EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): Remove.
|
|
|
|
|
(evaluate_subexp_standard, print_expression, op_string)
|
|
|
|
|
(dump_raw_expression): Don't declare.
|
|
|
|
|
* expprint.c (print_expression, print_subexp)
|
|
|
|
|
(print_subexp_funcall, print_subexp_standard, op_string)
|
|
|
|
|
(dump_raw_expression, dump_subexp, dump_subexp_body)
|
|
|
|
|
(dump_subexp_body_funcall, dump_subexp_body_standard): Remove.
|
|
|
|
|
(dump_prefix_expression): Update.
|
|
|
|
|
* eval.c (evaluate_subexp): Remove.
|
|
|
|
|
(evaluate_expression, evaluate_type): Update.
|
|
|
|
|
(evaluate_subexpression_type): Remove.
|
|
|
|
|
(fetch_subexp_value): Remove "pc" parameter. Update.
|
|
|
|
|
(extract_field_op, evaluate_struct_tuple, evaluate_funcall)
|
|
|
|
|
(evaluate_subexp_standard, evaluate_subexp_for_address)
|
|
|
|
|
(evaluate_subexp_with_coercion, evaluate_subexp_for_sizeof)
|
|
|
|
|
(evaluate_subexp_for_cast): Remove.
|
|
|
|
|
(parse_and_eval_type): Update.
|
|
|
|
|
* dtrace-probe.c (dtrace_probe::compile_to_ax): Update.
|
|
|
|
|
* d-lang.c (d_op_print_tab): Remove.
|
|
|
|
|
(class d_language) <opcode_print_table>: Remove.
|
|
|
|
|
* c-lang.h (c_op_print_tab): Don't declare.
|
|
|
|
|
* c-lang.c (c_op_print_tab): Remove.
|
|
|
|
|
(class c_language, class cplus_language, class asm_language, class
|
|
|
|
|
minimal_language) <opcode_print_table>: Remove.
|
|
|
|
|
* breakpoint.c (update_watchpoint, watchpoint_check)
|
|
|
|
|
(watchpoint_exp_is_const, watch_command_1): Update.
|
|
|
|
|
* ax-gdb.h (union exp_element): Don't declare.
|
|
|
|
|
* ax-gdb.c (const_var_ref, const_expr, maybe_const_expr)
|
|
|
|
|
(gen_repeat, gen_sizeof, gen_expr_for_cast, gen_expr)
|
|
|
|
|
(gen_expr_binop_rest): Remove.
|
|
|
|
|
(gen_trace_for_expr, gen_eval_for_expr, gen_printf): Update.
|
|
|
|
|
* ada-lang.c (ada_op_print_tab): Remove.
|
|
|
|
|
(class ada_language) <post_parser, opcode_print_table>: Remove.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* go-lang.c (go_language::expression_ops): Don't declare.
|
|
|
|
|
* go-lang.h (class go_language) <expression_ops>: Remove.
|
|
|
|
|
* opencl-lang.c (evaluate_subexp_opencl, exp_descriptor_opencl):
|
|
|
|
|
Remove.
|
|
|
|
|
(class opencl_language) <expression_ops>: Remove.
|
|
|
|
|
* d-lang.c (class d_language) <expression_ops>: Remove.
|
|
|
|
|
* c-lang.h (evaluate_subexp_c, exp_descriptor_c): Don't declare.
|
|
|
|
|
* c-lang.c (evaluate_subexp_c, exp_descriptor_c): Remove.
|
|
|
|
|
(class c_language, class cplus_language, class asm_language)
|
|
|
|
|
(class minimal_language) <expression_ops>: Remove.
|
|
|
|
|
|
Remove now-unused Ada evaluator code
Now that the Ada parser has switched to the new style, there is no
need for the old Ada evaluation code.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* ada-lang.c (resolve_subexp, replace_operator_with_call)
(evaluate_subexp_type, assign_aggregate)
(aggregate_assign_positional, aggregate_assign_from_choices)
(aggregate_assign_others, ada_evaluate_subexp_for_cast)
(ada_evaluate_subexp, ADA_OPERATORS, ada_operator_length)
(ada_operator_check, ada_forward_operator_length)
(ada_dump_subexp_body, ada_print_subexp, ada_exp_descriptor):
Remove.
(post_parser): Update.
(class ada_language) <expresssion_ops>: Remove.
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (resolve_subexp, replace_operator_with_call)
|
|
|
|
|
(evaluate_subexp_type, assign_aggregate)
|
|
|
|
|
(aggregate_assign_positional, aggregate_assign_from_choices)
|
|
|
|
|
(aggregate_assign_others, ada_evaluate_subexp_for_cast)
|
|
|
|
|
(ada_evaluate_subexp, ADA_OPERATORS, ada_operator_length)
|
|
|
|
|
(ada_operator_check, ada_forward_operator_length)
|
|
|
|
|
(ada_dump_subexp_body, ada_print_subexp, ada_exp_descriptor):
|
|
|
|
|
Remove.
|
|
|
|
|
(post_parser): Update.
|
|
|
|
|
(class ada_language) <expresssion_ops>: Remove.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* m2-lang.h (class m2_language) <expresssion_ops,
|
|
|
|
|
exp_descriptor_modula2>: Remove.
|
|
|
|
|
* m2-lang.c (evaluate_subexp_modula2)
|
|
|
|
|
(m2_language::exp_descriptor_modula2): Remove.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.h (class f_language) <expresssion_ops>: Remove.
|
|
|
|
|
<exp_descriptor_tab>: Remove.
|
|
|
|
|
* f-lang.c (fortran_value_subarray, evaluate_subexp_f)
|
|
|
|
|
(operator_length_f, print_unop_subexp_f, print_binop_subexp_f)
|
|
|
|
|
(print_subexp_f, dump_subexp_body_f, operator_check_f)
|
|
|
|
|
(f_language::exp_descriptor_tab, fortran_prepare_argument):
|
|
|
|
|
Remove.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.h (class rust_language) <expression_ops,
|
|
|
|
|
exp_descriptor_tab>: Remove.
|
|
|
|
|
* rust-lang.c (rust_evaluate_funcall): Remove.
|
|
|
|
|
(rust_range, rust_subscript, eval_op_rust_complement): Don't use
|
|
|
|
|
EVAL_SKIP.
|
|
|
|
|
(rust_evaluate_subexp): Remove.
|
|
|
|
|
(rust_aggregate_operation::evaluate): Don't use EVAL_SKIP.
|
|
|
|
|
(rust_operator_length, rust_dump_subexp_body, rust_print_subexp)
|
|
|
|
|
(rust_operator_check, rust_language::exp_descriptor_tab): Remove.
|
|
|
|
|
|
Convert ada-exp.y to use operations
This converts the Ada parser to generate operations rather than
exp_elements.
This was the most difficult of the parser conversions, partly due to
the decision to integrate Ada expression resolution into the parse,
and partly due to Ada aggregregate assignment. A couple of new
per-parse globals are introduced, along with a number of helper
functions. Resolution is done in 'ada_pop', yielding the unfortunate
rule that ada-exp.y should generally not use parser_state::pop
(exceptions are marked).
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* ada-exp.y: Create operations.
(empty_stoken): Remove.
(ada_pop, ada_wrap, ada_addrof, ada_un_wrap2, ada_wrap2)
(ada_wrap_op, ada_wrap3, ada_funcall): New functions.
(components): New global.
(push_component, choice_component, pop_component, pop_components):
New functions.
(associations): New global
(push_association, pop_association, pop_associations): New
functions.
(ada_parse): Update.
(write_var_from_sym, write_int): Create operations.
(write_exp_op_with_string): Remove.
(write_object_renaming, write_selectors, write_ambiguous_var)
(write_var_or_type, write_name_assoc): Create operations.
* ada-lang.h (ada_index_type): Declare.
* ada-lang.c (ada_index_type): No longer static.
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-exp.y: Create operations.
|
|
|
|
|
(empty_stoken): Remove.
|
|
|
|
|
(ada_pop, ada_wrap, ada_addrof, ada_un_wrap2, ada_wrap2)
|
|
|
|
|
(ada_wrap_op, ada_wrap3, ada_funcall): New functions.
|
|
|
|
|
(components): New global.
|
|
|
|
|
(push_component, choice_component, pop_component, pop_components):
|
|
|
|
|
New functions.
|
|
|
|
|
(associations): New global
|
|
|
|
|
(push_association, pop_association, pop_associations): New
|
|
|
|
|
functions.
|
|
|
|
|
(ada_parse): Update.
|
|
|
|
|
(write_var_from_sym, write_int): Create operations.
|
|
|
|
|
(write_exp_op_with_string): Remove.
|
|
|
|
|
(write_object_renaming, write_selectors, write_ambiguous_var)
|
|
|
|
|
(write_var_or_type, write_name_assoc): Create operations.
|
|
|
|
|
* ada-lang.h (ada_index_type): Declare.
|
|
|
|
|
* ada-lang.c (ada_index_type): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-exp.y: Create operations.
|
|
|
|
|
(f_language::parser): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* m2-exp.y: Create operations.
|
|
|
|
|
(m2_language::parser): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* p-exp.y: Create operations.
|
|
|
|
|
(pascal_language::parser): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* d-exp.y: Create operations.
|
|
|
|
|
(d_parse): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* go-exp.y: Create operations.
|
|
|
|
|
(go_language::parser): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* objc-lang.c (end_msglist): Create operations.
|
|
|
|
|
* c-exp.y: Change parser to create operations.
|
|
|
|
|
(write_destructor_name): Remove.
|
|
|
|
|
(c_parse): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-exp.y: Create operations.
|
|
|
|
|
(rust_parser::convert_params_to_expression): Change return type.
|
|
|
|
|
(binop_maker_ftype): New typedef.
|
|
|
|
|
(maker_map): New global.
|
|
|
|
|
(rust_parser::convert_ast_to_expression): Change return type.
|
|
|
|
|
(rust_language::parser): Update.
|
|
|
|
|
(_initialize_rust_exp): Initialize maker_map.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* stap-probe.c (binop_maker_ftype): New typedef.
|
|
|
|
|
(stap_maker_map): New global.
|
|
|
|
|
(stap_make_binop): New function.
|
|
|
|
|
(stap_parse_register_operand): Return operation_up.
|
|
|
|
|
(stap_parse_single_operand, stap_parse_argument_conditionally)
|
|
|
|
|
(stap_parse_argument_1): Likewise.
|
|
|
|
|
(stap_parse_argument): Create operations.
|
|
|
|
|
(stap_probe::parse_arguments): Update.
|
|
|
|
|
(_initialize_stap_probe): Initialize stap_maker_map.
|
|
|
|
|
* ppc-linux-tdep.c (ppc_stap_parse_special_token): Change return
|
|
|
|
|
type.
|
|
|
|
|
* i386-tdep.h (i386_stap_parse_special_token): Change return
|
|
|
|
|
type.
|
|
|
|
|
* i386-tdep.c (i386_stap_parse_special_token_triplet)
|
|
|
|
|
(i386_stap_parse_special_token_three_arg_disp)
|
|
|
|
|
(i386_stap_parse_special_token): Change return type.
|
|
|
|
|
* gdbarch.sh (stap_parse_special_token): Change return type.
|
|
|
|
|
* gdbarch.c: Rebuild.
|
|
|
|
|
* gdbarch.h: Rebuild.
|
|
|
|
|
* arm-linux-tdep.c (arm_stap_parse_special_token): Change return
|
|
|
|
|
type.
|
|
|
|
|
* aarch64-linux-tdep.c (aarch64_stap_parse_special_token): Change
|
|
|
|
|
return type.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* gdbarch.sh (dtrace_parse_probe_argument): Change return type.
|
|
|
|
|
* gdbarch.h: Rebuild.
|
|
|
|
|
* gdbarch.c: Rebuild.
|
|
|
|
|
* dtrace-probe.c (dtrace_probe::build_arg_exprs): Update.
|
|
|
|
|
* amd64-linux-tdep.c (amd64_dtrace_parse_probe_argument): Change
|
|
|
|
|
return type.
|
|
|
|
|
(amd64_dtrace_parse_probe_argument): Update.
|
|
|
|
|
|
Add operation-related methods to parser_state
This adds several operation-related methods to parser_state. These
methods make it more convenient to change the parsers to be
operation-based.
Because byacc has poor support for C++, a stack of operations is added
to parser_state. A parser can push operations, then later pop them
for combination into new operations. This approach avoids the memory
leaks that would result if raw pointers were used in the parsers, at
the cost of parser productions not being type-safe (they can't
indicate that they return an operation).
This also introduces analogs of some write_exp functions, like
write_exp_string_vector, write_dollar_variable, and
write_exp_symbol_reference.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* parser-defs.h (struct parser_state) <push, push_new,
push_c_string, push_symbol, push_dollar, pop, pop_vector, wrap,
wrap2>: New methods.
<m_operations>: New member.
* parse.c (parser_state::push_c_string)
(parser_state::push_symbol, parser_state::push_dollar): New
methods.
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* parser-defs.h (struct parser_state) <push, push_new,
|
|
|
|
|
push_c_string, push_symbol, push_dollar, pop, pop_vector, wrap,
|
|
|
|
|
wrap2>: New methods.
|
|
|
|
|
<m_operations>: New member.
|
|
|
|
|
* parse.c (parser_state::push_c_string)
|
|
|
|
|
(parser_state::push_symbol, parser_state::push_dollar): New
|
|
|
|
|
methods.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* parser-defs.h (struct expr_completion_state) <expout_last_op>:
|
|
|
|
|
New member.
|
|
|
|
|
(struct parser_state) <mark_struct_expression>: New method.
|
|
|
|
|
* parse.c (parser_state::mark_struct_expression): Update assert.
|
|
|
|
|
(parser_state::mark_struct_expression): New method.
|
|
|
|
|
(parser_state::mark_completion_tag): Update assert.
|
|
|
|
|
(parse_expression_for_completion): Handle expout_last_op.
|
|
|
|
|
|
Add an expr::operation_up to struct expression
This adds an expr::operation_up to struct expression, and then
modifies various parts of GDB to use this member when it is non-null.
The list of such spots was a bit surprising to me, and found only
after writing most of the code and then noticing what no longer
compiled.
In a few spots, new accessor methods are added to operation
subclasses, so that code that dissects an expression will work with
the new scheme.
After this change, code that constructs an expression can be switched
to the new form without breaking.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* ada-exp.h (class ada_var_value_operation) <get_symbol>: Remove;
now in superclass.
* value.h (fetch_subexp_value): Add "op" parameter.
* value.c (init_if_undefined_command): Update.
* tracepoint.c (validate_actionline, encode_actions_1): Update.
* stap-probe.c (stap_probe::compile_to_ax): Update.
* printcmd.c (set_command): Update.
* ppc-linux-nat.c (ppc_linux_nat_target::check_condition):
Update.
* parser-defs.h (struct expr_builder) <set_operation>: New
method.
* parse.c (parse_exp_in_context, exp_uses_objfile): Update.
* expression.h (struct expression) <first_opcode>: Update.
<op>: New member.
* expprint.c (dump_raw_expression, dump_prefix_expression):
Update.
* expop.h (class var_value_operation) <get_symbol>: New method.
(class register_operation) <get_name>: New method.
(class equal_operation): No longer a typedef, now a subclass.
(class unop_memval_operation) <get_type>: New method.
(class assign_operation) <get_lhs>: New method.
(class unop_cast_operation) <get_type>: New method.
* eval.c (evaluate_expression, evaluate_type)
(evaluate_subexpression_type): Update.
(fetch_subexp_value): Add "op" parameter.
(parse_and_eval_type): Update.
* dtrace-probe.c (dtrace_probe::compile_to_ax): Update.
* breakpoint.c (update_watchpoint, watchpoint_check)
(watchpoint_exp_is_const, watch_command_1): Update.
* ax-gdb.c (gen_trace_for_expr, gen_eval_for_expr, gen_printf):
Update.
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-exp.h (class ada_var_value_operation) <get_symbol>: Remove;
|
|
|
|
|
now in superclass.
|
|
|
|
|
* value.h (fetch_subexp_value): Add "op" parameter.
|
|
|
|
|
* value.c (init_if_undefined_command): Update.
|
|
|
|
|
* tracepoint.c (validate_actionline, encode_actions_1): Update.
|
|
|
|
|
* stap-probe.c (stap_probe::compile_to_ax): Update.
|
|
|
|
|
* printcmd.c (set_command): Update.
|
|
|
|
|
* ppc-linux-nat.c (ppc_linux_nat_target::check_condition):
|
|
|
|
|
Update.
|
|
|
|
|
* parser-defs.h (struct expr_builder) <set_operation>: New
|
|
|
|
|
method.
|
|
|
|
|
* parse.c (parse_exp_in_context, exp_uses_objfile): Update.
|
|
|
|
|
* expression.h (struct expression) <first_opcode>: Update.
|
|
|
|
|
<op>: New member.
|
|
|
|
|
* expprint.c (dump_raw_expression, dump_prefix_expression):
|
|
|
|
|
Update.
|
|
|
|
|
* expop.h (class var_value_operation) <get_symbol>: New method.
|
|
|
|
|
(class register_operation) <get_name>: New method.
|
|
|
|
|
(class equal_operation): No longer a typedef, now a subclass.
|
|
|
|
|
(class unop_memval_operation) <get_type>: New method.
|
|
|
|
|
(class assign_operation) <get_lhs>: New method.
|
|
|
|
|
(class unop_cast_operation) <get_type>: New method.
|
|
|
|
|
* eval.c (evaluate_expression, evaluate_type)
|
|
|
|
|
(evaluate_subexpression_type): Update.
|
|
|
|
|
(fetch_subexp_value): Add "op" parameter.
|
|
|
|
|
(parse_and_eval_type): Update.
|
|
|
|
|
* dtrace-probe.c (dtrace_probe::compile_to_ax): Update.
|
|
|
|
|
* breakpoint.c (update_watchpoint, watchpoint_check)
|
|
|
|
|
(watchpoint_exp_is_const, watch_command_1): Update.
|
|
|
|
|
* ax-gdb.c (gen_trace_for_expr, gen_eval_for_expr, gen_printf):
|
|
|
|
|
Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_value_binop): Do not use op_string.
|
|
|
|
|
|
Implement Ada assignment
Assignment is the most complicated Ada expression, because
implementing aggregate assignment involves several specialized
opcodes.
This patch does this implementation by introducing new abstract
classes that are used to represent the various parts of aggregate
assignment. This makes the code somewhat cleaner, and, by avoiding
the over-use of 'operation' subclasses, avoids the need for dissection
using dynamic_cast (though a few are still needed here).
I believe this patch fixes a latent bug in the handling of
aggregate_assign_from_choices. That code does:
if (op == OP_DISCRETE_RANGE)
{
choice_pos += 1;
lower = value_as_long (ada_evaluate_subexp (NULL, exp, pos,
EVAL_NORMAL));
upper = value_as_long (ada_evaluate_subexp (NULL, exp, pos,
EVAL_NORMAL));
}
However, I think 'choice_pos' should be used in the calls, rather than
'pos'.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* expprint.c (dump_for_expression): New overload.
* expop.h (check_objfile, dump_for_expression): Declare new
overloads.
* ada-lang.c (check_objfile): New overload.
(assign_component, ada_aggregate_component::uses_objfile)
(ada_aggregate_component::dump, ada_aggregate_component::assign)
(ada_aggregate_component::assign_aggregate)
(ada_positional_component::uses_objfile)
(ada_positional_component::dump, ada_positional_component::assign)
(ada_discrete_range_association::uses_objfile)
(ada_discrete_range_association::dump)
(ada_discrete_range_association::assign)
(ada_name_association::uses_objfile, ada_name_association::dump)
(ada_name_association::assign)
(ada_choices_component::uses_objfile, ada_choices_component::dump)
(ada_choices_component::assign)
(ada_others_component::uses_objfile, ada_others_component::dump)
(ada_others_component::assign, ada_assign_operation::evaluate):
New methods.
* ada-exp.h (ada_string_operation) <get_name>: New method.
(class ada_assign_operation): New.
(class ada_component): New.
(ada_component_up): New typedef.
(class ada_aggregate_operation, class ada_aggregate_component)
(class ada_positional_component, class ada_others_component)
(class ada_association): New.
(ada_association_up): New typedef.
(class ada_choices_component)
(class ada_discrete_range_association)
(class ada_name_association): New.
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expprint.c (dump_for_expression): New overload.
|
|
|
|
|
* expop.h (check_objfile, dump_for_expression): Declare new
|
|
|
|
|
overloads.
|
|
|
|
|
* ada-lang.c (check_objfile): New overload.
|
|
|
|
|
(assign_component, ada_aggregate_component::uses_objfile)
|
|
|
|
|
(ada_aggregate_component::dump, ada_aggregate_component::assign)
|
|
|
|
|
(ada_aggregate_component::assign_aggregate)
|
|
|
|
|
(ada_positional_component::uses_objfile)
|
|
|
|
|
(ada_positional_component::dump, ada_positional_component::assign)
|
|
|
|
|
(ada_discrete_range_association::uses_objfile)
|
|
|
|
|
(ada_discrete_range_association::dump)
|
|
|
|
|
(ada_discrete_range_association::assign)
|
|
|
|
|
(ada_name_association::uses_objfile, ada_name_association::dump)
|
|
|
|
|
(ada_name_association::assign)
|
|
|
|
|
(ada_choices_component::uses_objfile, ada_choices_component::dump)
|
|
|
|
|
(ada_choices_component::assign)
|
|
|
|
|
(ada_others_component::uses_objfile, ada_others_component::dump)
|
|
|
|
|
(ada_others_component::assign, ada_assign_operation::evaluate):
|
|
|
|
|
New methods.
|
|
|
|
|
* ada-exp.h (ada_string_operation) <get_name>: New method.
|
|
|
|
|
(class ada_assign_operation): New.
|
|
|
|
|
(class ada_component): New.
|
|
|
|
|
(ada_component_up): New typedef.
|
|
|
|
|
(class ada_aggregate_operation, class ada_aggregate_component)
|
|
|
|
|
(class ada_positional_component, class ada_others_component)
|
|
|
|
|
(class ada_association): New.
|
|
|
|
|
(ada_association_up): New typedef.
|
|
|
|
|
(class ada_choices_component)
|
|
|
|
|
(class ada_discrete_range_association)
|
|
|
|
|
(class ada_name_association): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_var_value_operation::resolve)
|
|
|
|
|
(ada_funcall_operation::resolve)
|
|
|
|
|
(ada_ternop_slice_operation::resolve): New methods.
|
|
|
|
|
* ada-exp.h (struct ada_resolvable): New.
|
|
|
|
|
(class ada_var_value_operation): Derive from ada_resolvable.
|
|
|
|
|
<get_block, resolve>: New methods.
|
|
|
|
|
(class ada_funcall_operation): Derive from ada_resolvable.
|
|
|
|
|
<resolve>: New method.
|
|
|
|
|
(class ada_ternop_slice_operation): Derive from ada_resolvable.
|
|
|
|
|
<resolve>: New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_funcall_operation::evaluate): New method.
|
|
|
|
|
* ada-exp.h (class ada_var_msym_value_operation) <get_symbol>: New
|
|
|
|
|
method.
|
|
|
|
|
(class ada_funcall_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_structop_operation::evaluate): New method.
|
|
|
|
|
* ada-exp.h (class ada_structop_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_unop_ind_operation::evaluate): New method.
|
|
|
|
|
* ada-exp.h (class ada_unop_ind_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_binop_exp): No longer static.
|
|
|
|
|
* ada-exp.h (ada_binop_exp_operation): New typedef.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_val_atr): No longer static.
|
|
|
|
|
(ada_atr_val_operation::evaluate): New method.
|
|
|
|
|
* ada-exp.h (class ada_atr_val_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_pos_atr): No longer static.
|
|
|
|
|
* ada-exp.h (ada_pos_operation): New typedef.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_pos_atr): Rename from value_pos_atr. Change
|
|
|
|
|
parameters.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_binop_minmax): No longer static.
|
|
|
|
|
* ada-exp.h (ada_binop_min_operation, ada_binop_max_operation):
|
|
|
|
|
New typedefs.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_var_msym_value_operation::evaluate_for_cast):
|
|
|
|
|
New method.
|
|
|
|
|
* ada-exp.h (class ada_var_msym_value_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_var_value_operation::evaluate_for_cast)
|
|
|
|
|
(ada_var_value_operation::evaluate): New methods.
|
|
|
|
|
* ada-exp.h (class ada_var_value_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_unop_atr_operation::evaluate): New method.
|
|
|
|
|
* ada-exp.h (class ada_unop_atr_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_binop_in_bounds): No longer static.
|
|
|
|
|
* ada-exp.h (class ada_binop_in_bounds_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_ternop_slice): No longer static.
|
|
|
|
|
* ada-exp.h (class ada_ternop_slice_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-exp.h (ada_bitwise_operation): New template class.
|
|
|
|
|
(ada_bitwise_and_operation, ada_bitwise_ior_operation)
|
|
|
|
|
(ada_bitwise_xor_operation): New typedefs.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_equal_binop): No longer static.
|
|
|
|
|
* ada-exp.h (class ada_binop_equal_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_mult_binop): No longer static.
|
|
|
|
|
* ada-exp.h (ada_binop_mul_operation ada_binop_div_operation)
|
|
|
|
|
(ada_binop_rem_operation, ada_binop_mod_operation): New typedefs.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_binop_addsub_operation::evaluate): New method.
|
|
|
|
|
* ada-exp.h (class ada_binop_addsub_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.h (ada_find_operator_symbol, ada_resolve_funcall)
|
|
|
|
|
(ada_resolve_variable): Declare.
|
|
|
|
|
* ada-lang.c (ada_find_operator_symbol, ada_resolve_funcall)
|
|
|
|
|
(ada_resolve_variable): New functions.
|
|
|
|
|
(resolve_subexp): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* opencl-lang.c (opencl_ternop_cond_operation::evaluate): New
|
|
|
|
|
method.
|
|
|
|
|
* c-exp.h (class opencl_ternop_cond_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* opencl-lang.c (opencl_logical_binop_operation::evaluate): New
|
|
|
|
|
method.
|
|
|
|
|
* c-exp.h (class opencl_logical_binop_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* opencl-lang.c (opencl_structop_operation::evaluate): New
|
|
|
|
|
method.
|
|
|
|
|
* c-exp.h (class opencl_structop_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* opencl-lang.c (opencl_logical_not): No longer static. Change
|
|
|
|
|
parameters.
|
|
|
|
|
(evaluate_subexp_opencl): Update.
|
|
|
|
|
* c-exp.h (opencl_notequal_operation): New typedef.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* opencl-lang.c (opencl_relop, eval_opencl_assign): No longer
|
|
|
|
|
static. Change parameters.
|
|
|
|
|
(eval_opencl_assign): No longer static. Add "op" parameter.
|
|
|
|
|
(evaluate_subexp_opencl): Update.
|
|
|
|
|
* c-exp.h (opencl_binop_operation): New template class.
|
|
|
|
|
(opencl_assign_operation, opencl_equal_operation)
|
|
|
|
|
(opencl_notequal_operation, opencl_less_operation)
|
|
|
|
|
(opencl_gtr_operation, opencl_geq_operation)
|
|
|
|
|
(opencl_leq_operation): New typedefs.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* opencl-lang.c (opencl_value_cast): No longer static.
|
|
|
|
|
* c-exp.h (opencl_cast_type_operation): New typedef.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-exp.h (eval_op_f_allocated): Declare.
|
|
|
|
|
(fortran_allocated_operation): New typedef.
|
|
|
|
|
* f-lang.c (eval_op_f_allocated): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (eval_op_f_associated): New functions.
|
|
|
|
|
* f-exp.h (fortran_associated_1arg, fortran_associated_2arg): New
|
|
|
|
|
typedefs.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (fortran_bound_1arg::evaluate)
|
|
|
|
|
(fortran_bound_2arg::evaluate): New methods.
|
|
|
|
|
* f-exp.h (class fortran_bound_1arg, class fortran_bound_2arg):
|
|
|
|
|
New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class unop_addr_operation) <get_expression>: New
|
|
|
|
|
method.
|
|
|
|
|
* f-lang.c (fortran_undetermined::value_subarray)
|
|
|
|
|
(fortran_undetermined::evaluate): New methods.
|
|
|
|
|
(fortran_prepare_argument): New overload.
|
|
|
|
|
* f-exp.h (class fortran_range_operation)
|
|
|
|
|
(class fortran_undetermined): New classes.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (rust_structop::evaluate_funcall): New method.
|
|
|
|
|
* rust-exp.h (class rust_structop) <evaluate_funcall>: Declare
|
|
|
|
|
method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expression.h (class operation) <evaluate_funcall>: New methods.
|
|
|
|
|
* expop.h (class scope_operation) <evaluate_funcall>: New method.
|
|
|
|
|
(class var_value_operation) <evaluate_funcall>: New method.
|
|
|
|
|
(class structop_base_operation) <evaluate_funcall>: New method.
|
|
|
|
|
(class var_msym_value_operation) <evaluate_funcall>: New method.
|
|
|
|
|
(class structop_member_base): New class.
|
|
|
|
|
(class structop_member_operation): Derive from
|
|
|
|
|
structop_member_base.
|
|
|
|
|
(class structop_mptr_operation): Derive from
|
|
|
|
|
structop_member_base.
|
|
|
|
|
(class funcall_operation): New class.
|
|
|
|
|
* eval.c (operation::evaluate_funcall)
|
|
|
|
|
(var_value_operation::evaluate_funcall)
|
|
|
|
|
(scope_operation::evaluate_funcall)
|
|
|
|
|
(structop_member_base::evaluate_funcall)
|
|
|
|
|
(structop_base_operation::evaluate_funcall): New methods.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class array_operation): New.
|
|
|
|
|
* eval.c (array_operation::evaluate_struct_tuple)
|
|
|
|
|
(array_operation::evaluate): New methods.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class adl_func_operation): New.
|
|
|
|
|
* eval.c (adl_func_operation::evaluate): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_unop_in_range): No longer static.
|
|
|
|
|
* ada-exp.h (class ada_unop_range_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_unop_neg, ada_atr_tag, ada_atr_size, ada_abs):
|
|
|
|
|
No longer static.
|
|
|
|
|
* ada-exp.h (ada_neg_operation, ada_atr_tag_operation)
|
|
|
|
|
(ada_atr_size_operation, ada_abs_operation): New typedefs.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class logical_and_operation)
|
|
|
|
|
(class logical_or_operation): New.
|
|
|
|
|
* eval.c (logical_and_operation::evaluate)
|
|
|
|
|
(logical_or_operation::evaluate): New methods.
|
|
|
|
|
* ax-gdb.c (logical_and_operation::do_generate_ax)
|
|
|
|
|
(logical_or_operation::do_generate_ax): New methods.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* m2-lang.c (eval_op_m2_high, eval_op_m2_subscript): No longer
|
|
|
|
|
static.
|
|
|
|
|
* m2-exp.h: New file.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (rust_aggregate_operation::evaluate): New method.
|
|
|
|
|
* rust-exp.h (class rust_aggregate_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (eval_op_rust_struct_anon, eval_op_rust_structop):
|
|
|
|
|
No longer static.
|
|
|
|
|
* rust-exp.h (class rust_struct_anon): New.
|
|
|
|
|
(class rust_structop): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (rust_range): No longer static.
|
|
|
|
|
* rust-exp.h (class rust_range_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (rust_subscript): No longer static.
|
|
|
|
|
* rust-exp.h (class rust_subscript_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (eval_op_rust_ind): No longer static. Add "opcode"
|
|
|
|
|
parameter.
|
|
|
|
|
(rust_evaluate_subexp): Update.
|
|
|
|
|
* rust-exp.h (class rust_unop_ind_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (eval_op_rust_complement, eval_op_rust_array): No
|
|
|
|
|
longer static. Add "opcode" parameter.
|
|
|
|
|
(rust_evaluate_subexp): Update.
|
|
|
|
|
* rust-exp.h: New file.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (eval_op_f_abs, eval_op_f_mod, eval_op_f_ceil)
|
|
|
|
|
(eval_op_f_floor, eval_op_f_modulo, eval_op_f_cmplx)
|
|
|
|
|
(eval_op_f_kind): No longer static. Add "opcode" parameter.
|
|
|
|
|
(evaluate_subexp_f): Update.
|
|
|
|
|
* f-exp.h: New file.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_ternop_range_operation::evaluate): New method.
|
|
|
|
|
* ada-exp.h (class ada_ternop_range_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_qual_operation::evaluate): New method.
|
|
|
|
|
* ada-exp.h (class ada_qual_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_string_operation::evaluate): New method.
|
|
|
|
|
* ada-exp.h (class ada_string_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_wrapped_operation::evaluate): New method.
|
|
|
|
|
* ada-exp.h: New file.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class multi_subscript_operation): New.
|
|
|
|
|
* eval.c (multi_subscript_operation::evaluate): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (objc_msgcall_operation::evaluate): New method.
|
|
|
|
|
* c-exp.h (class objc_msgcall_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class var_value_operation): New.
|
|
|
|
|
* eval.c (var_value_operation::evaluate)
|
|
|
|
|
(var_value_operation::evaluate_for_address)
|
|
|
|
|
(var_value_operation::evaluate_with_coercion)
|
|
|
|
|
(var_value_operation::evaluate_for_sizeof)
|
|
|
|
|
(var_value_operation::evaluate_for_cast): New methods.
|
|
|
|
|
* ax-gdb.c (var_value_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (cxx_cast_ftype): New typedef.
|
|
|
|
|
(cxx_cast_operation): New template.
|
|
|
|
|
(dynamic_cast_operation, reinterpret_cast_operation): New
|
|
|
|
|
typedefs.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class unop_cast_type_operation): New.
|
|
|
|
|
* ax-gdb.c (unop_cast_type_operation::do_generate_ax): New
|
|
|
|
|
method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class unop_cast_operation): New.
|
|
|
|
|
* ax-gdb.c (unop_cast_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class assign_modify_operation): New.
|
|
|
|
|
* eval.c (eval_binop_assign_modify): No longer static.
|
|
|
|
|
* ax-gdb.c (assign_modify_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class assign_operation): New.
|
|
|
|
|
* ax-gdb.c (assign_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class type_instance_operation): New.
|
|
|
|
|
* eval.c (type_instance_operation::evaluate): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class op_this_operation): New.
|
|
|
|
|
* ax-gdb.c (op_this_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class unop_memval_operation)
|
|
|
|
|
(class unop_memval_type_operation): New.
|
|
|
|
|
* eval.c (eval_op_memval): No longer static.
|
|
|
|
|
(unop_memval_operation::evaluate_for_address)
|
|
|
|
|
(unop_memval_type_operation::evaluate_for_address)
|
|
|
|
|
(unop_memval_operation::evaluate_for_sizeof)
|
|
|
|
|
(unop_memval_type_operation::evaluate_for_sizeof): New methods.
|
|
|
|
|
* ax-gdb.c (unop_memval_operation::do_generate_ax)
|
|
|
|
|
(unop_memval_type_operation::do_generate_ax): New methods.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class unop_alignof_operation): New.
|
|
|
|
|
* eval.c (eval_op_alignof): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class unop_sizeof_operation): New.
|
|
|
|
|
* ax-gdb.c (unop_sizeof_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class unop_addr_operation): New.
|
|
|
|
|
* ax-gdb.c (gen_expr_unop) <case UNOP_ADDR>: New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class typeid_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class decltype_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class typeof_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class type_operation): New.
|
|
|
|
|
* eval.c (eval_op_type): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class unop_ind_base_operation)
|
|
|
|
|
(class unop_ind_operation): New.
|
|
|
|
|
* eval.c (eval_op_ind): No longer static. Remove "op" parameter.
|
|
|
|
|
(unop_ind_base_operation::evaluate_for_address)
|
|
|
|
|
(unop_ind_base_operation::evaluate_for_sizeof): New method.
|
|
|
|
|
* ax-gdb.c (gen_expr_unop) <case UNOP_IND>: New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (unop_incr_operation): New template.
|
|
|
|
|
(preinc_operation, predec_operation, postinc_operation)
|
|
|
|
|
(postdec_operation): New typedefs.
|
|
|
|
|
* eval.c (eval_op_preinc, eval_op_predec, eval_op_postinc)
|
|
|
|
|
(eval_op_postdec): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (unary_ftype): New typedef.
|
|
|
|
|
(unop_operation, usual_ax_binop_operation): New templates.
|
|
|
|
|
(unary_plus_operation, unary_neg_operation)
|
|
|
|
|
(unary_complement_operation, unary_logical_not_operation): New
|
|
|
|
|
typedefs.
|
|
|
|
|
* eval.c (eval_op_plus, eval_op_neg, eval_op_complement)
|
|
|
|
|
(eval_op_lognot): No longer static.
|
|
|
|
|
* ax-gdb.c (gen_expr_unop): New function.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ax-gdb.c (comma_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class repeat_operation): New.
|
|
|
|
|
* eval.c (eval_op_repeat): No longer static. Remove "op"
|
|
|
|
|
parameter.
|
|
|
|
|
(evaluate_subexp_standard): Update.
|
|
|
|
|
* ax-gdb.c (repeat_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class comparison_operation): New.
|
|
|
|
|
(equal_operation, notequal_operation, less_operation)
|
|
|
|
|
(gtr_operation, geq_operation, leq_operation): New typedefs.
|
|
|
|
|
* eval.c (eval_op_equal, eval_op_notequal, eval_op_less)
|
|
|
|
|
(eval_op_gtr, eval_op_geq, eval_op_leq): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class subscript_operation): New.
|
|
|
|
|
* eval.c (eval_op_subscript): No longer static.
|
|
|
|
|
|
Introduce binop_operation
This adds two new template classes, binop_operation and
usual_ax_binop_operation, and then uses these to implement a number of
binary operations that follow similar patterns.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* expop.h (class binop_operation, class usual_ax_binop_operation):
New.
(exp_operation, intdiv_operation, mod_operation, mul_operation)
(div_operation, rem_operation, lsh_operation, rsh_operation)
(bitwise_and_operation, bitwise_ior_operation)
(bitwise_xor_operation): New typedefs.
* eval.c (eval_op_binary): No longer static.
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class binop_operation, class usual_ax_binop_operation):
|
|
|
|
|
New.
|
|
|
|
|
(exp_operation, intdiv_operation, mod_operation, mul_operation)
|
|
|
|
|
(div_operation, rem_operation, lsh_operation, rsh_operation)
|
|
|
|
|
(bitwise_and_operation, bitwise_ior_operation)
|
|
|
|
|
(bitwise_xor_operation): New typedefs.
|
|
|
|
|
* eval.c (eval_op_binary): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class sub_operation): New.
|
|
|
|
|
* eval.c (eval_op_sub): No longer static. Remove "op" parameter.
|
|
|
|
|
(evaluate_subexp_standard): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class add_operation): New.
|
|
|
|
|
* eval.c (eval_op_add): No longer static. Remove "op" parameter.
|
|
|
|
|
(evaluate_subexp_standard): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class concat_operation): New.
|
|
|
|
|
* eval.c (eval_op_concat): No longer static. Remove "op"
|
|
|
|
|
parameter.
|
|
|
|
|
(evaluate_subexp_standard): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class structop_member_operation)
|
|
|
|
|
(class structop_mptr_operation): New.
|
|
|
|
|
* eval.c (eval_op_member): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class structop_ptr_operation): New.
|
|
|
|
|
* eval.c (eval_op_structop_ptr): No longer static. Remove "op"
|
|
|
|
|
parameter.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class structop_base_operation)
|
|
|
|
|
(class structop_operation): New.
|
|
|
|
|
* eval.c (eval_op_structop_struct): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class complex_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_objc_selector): No longer static.
|
|
|
|
|
* c-exp.h (class objc_selector_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c: Include c-exp.h.
|
|
|
|
|
* c-exp.h (class objc_nsstring_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* c-lang.c (c_string_operation::evaluate): New method.
|
|
|
|
|
* c-exp.h: New file.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class ternop_cond_operation): New.
|
|
|
|
|
* ax-gdb.c (ternop_cond_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class ternop_slice_operation): New.
|
|
|
|
|
* eval.c (eval_op_ternop): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class string_operation): New.
|
|
|
|
|
* eval.c (eval_op_string): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class internalvar_operation): New.
|
|
|
|
|
* ax-gdb.c (internalvar_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class bool_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class register_operation): New.
|
|
|
|
|
* eval.c (eval_op_register): No longer static.
|
|
|
|
|
* ax-gdb.c (register_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class last_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class func_static_var_operation): New.
|
|
|
|
|
* eval.c (eval_op_func_static_var): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class var_entry_value_operation): New.
|
|
|
|
|
* eval.c (eval_op_var_entry_value): No longer static.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expression.h (class operation) <set_outermost>: New method.
|
|
|
|
|
* expop.h (class var_msym_value_operation): New.
|
|
|
|
|
* eval.c (eval_op_var_msym_value): No longer static.
|
|
|
|
|
(var_msym_value_operation::evaluate_for_address)
|
|
|
|
|
(var_msym_value_operation::evaluate_for_sizeof)
|
|
|
|
|
(var_msym_value_operation::evaluate_for_cast): New methods.
|
|
|
|
|
* ax-gdb.c (var_msym_value_operation::do_generate_ax): New
|
|
|
|
|
method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class long_const_operation): New.
|
|
|
|
|
* ax-gdb.c (long_const_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (class scope_operation): New.
|
|
|
|
|
* eval.c (eval_op_scope): No longer static.
|
|
|
|
|
(scope_operation::evaluate_for_address): New method.
|
|
|
|
|
* ax-gdb.c (scope_operation::do_generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expprint.c (float_const_operation::dump): New method.
|
|
|
|
|
* expop.h (float_data): New typedef.
|
|
|
|
|
(class float_const_operation): New.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expop.h (gen_expr_binop, gen_expr_structop): Declare.
|
|
|
|
|
* ax-gdb.c (gen_expr_binop): New function.
|
|
|
|
|
(gen_expr_structop): Likewise.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expprint.c (expr::dump_for_expression): New functions.
|
|
|
|
|
* expop.h (dump_for_expression): New overloads.
|
|
|
|
|
(tuple_holding_operation::dump, tuple_holding_operation::do_dump):
|
|
|
|
|
Update.
|
|
|
|
|
|
Introduce class operation
This patch introduces class operation, the new base class for all
expression operations.
In the new approach, an operation is simply a class that presents a
certain interface. Operations own their operands, and management is
done via unique_ptr.
The operation interface is largely ad hoc, based on the evolution of
expression handling in GDB. Parts (for example,
evaluate_with_coercion) are probably redundant; however I took this
approach to try to avoid mixing different kinds of refactorings.
In some specific situations, rather than add a generic method across
the entire operation class hierarchy, I chose instead to use
dynamic_cast and specialized methods on certain concrete subclasses.
This will appear in some subsequent patches.
One goal of this work is to avoid the kinds of easy-to-make errors
that affected the old implementation. To this end, some helper
subclasses are also added here. These helpers automate the
implementation of the 'dump', 'uses_objfile', and 'constant_p'
methods. Nearly every concrete operation that is subsequently added
will use these facilities. (Note that the 'dump' implementation is
only outlined here, the body appears in the next patch.)
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* expression.h (expr::operation): New class.
(expr::make_operation): New function.
(expr::operation_up): New typedef.
* expop.h: New file.
* eval.c (operation::evaluate_for_cast)
(operation::evaluate_for_address, operation::evaluate_for_sizeof):
New methods.
* ax-gdb.c (operation::generate_ax): New method.
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expression.h (expr::operation): New class.
|
|
|
|
|
(expr::make_operation): New function.
|
|
|
|
|
(expr::operation_up): New typedef.
|
|
|
|
|
* expop.h: New file.
|
|
|
|
|
* eval.c (operation::evaluate_for_cast)
|
|
|
|
|
(operation::evaluate_for_address, operation::evaluate_for_sizeof):
|
|
|
|
|
New methods.
|
|
|
|
|
* ax-gdb.c (operation::generate_ax): New method.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ax-gdb.c (gen_expr_binop_rest): Remove "pc" parameter.
|
|
|
|
|
(gen_expr_binop_rest): New overload.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_multi_subscript): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_binop_exp): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_val_atr): Rename from value_val_atr. Change
|
|
|
|
|
parameters.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_binop_minmax): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_unop_atr): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_binop_in_bounds): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_ternop_slice): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_equal_binop): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_mult_binop): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_abs): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_atr_size): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_atr_tag): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_unop_in_range): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_unop_neg): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (eval_ternop_in_range): New function.
|
|
|
|
|
(ada_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* opencl-lang.c (eval_opencl_assign): New function.
|
|
|
|
|
(evaluate_subexp_opencl): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_objc_msgcall): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_binop_assign_modify): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* m2-lang.c (eval_op_m2_subscript): New function.
|
|
|
|
|
(evaluate_subexp_modula2): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* m2-lang.c (eval_op_m2_high): New function.
|
|
|
|
|
(evaluate_subexp_modula2): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (evaluate_subexp_for_address_base): New function.
|
|
|
|
|
(evaluate_subexp_for_address): Use it.
|
|
|
|
|
(evaluate_subexp_for_sizeof_base): New function.
|
|
|
|
|
(evaluate_subexp_for_sizeof): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (eval_op_rust_structop): New function.
|
|
|
|
|
(rust_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (eval_op_rust_struct_anon): New function.
|
|
|
|
|
(rust_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (eval_op_rust_array): New function.
|
|
|
|
|
(rust_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (eval_op_rust_complement): New function.
|
|
|
|
|
(rust_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (eval_op_rust_ind): New function.
|
|
|
|
|
(rust_evaluate_subexp): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (rust_subscript): Change parameters.
|
|
|
|
|
(rust_evaluate_subexp): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* rust-lang.c (rust_range): Change parameters.
|
|
|
|
|
(rust_evaluate_subexp): Update.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (eval_op_f_allocated): New function.
|
|
|
|
|
(evaluate_subexp_f): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (fortran_require_array): New function.
|
|
|
|
|
(evaluate_subexp_f): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (eval_op_f_kind): New function.
|
|
|
|
|
(evaluate_subexp_f): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (eval_op_f_cmplx): New function.
|
|
|
|
|
(evaluate_subexp_f): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (eval_op_f_modulo): New function.
|
|
|
|
|
(evaluate_subexp_f): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (eval_op_f_floor): New function.
|
|
|
|
|
(evaluate_subexp_f): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (eval_op_f_ceil): New function.
|
|
|
|
|
(evaluate_subexp_f): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (eval_op_f_mod): New function.
|
|
|
|
|
(evaluate_subexp_f): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (eval_op_f_abs): New function.
|
|
|
|
|
(evaluate_subexp_f): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_type): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_postdec): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_postinc): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_predec): New file.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_preinc): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_memval): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_alignof): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_ind): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_lognot): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_complement): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_neg): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_plus): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_repeat): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_leq): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_geq): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_gtr): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_less): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_notequal): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_equal): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_subscript): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_binary): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_sub): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_add): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_member): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_structop_ptr): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_structop_struct): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_ternop): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_concat): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_objc_selector): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_string): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_register): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_func_static_var): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_var_msym_value): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_var_entry_value): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-08 22:27:57 +08:00
|
|
|
|
2021-03-08 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (eval_op_scope): New function.
|
|
|
|
|
(evaluate_subexp_standard): Use it.
|
|
|
|
|
|
2021-03-07 00:38:26 +08:00
|
|
|
|
2021-03-06 Chernov Sergey <klen_s@mail.ru>
|
|
|
|
|
|
|
|
|
|
PR gdb/27528:
|
|
|
|
|
* ada-lang.c (ada_fold_name): Use gdb::to_string.
|
|
|
|
|
|
2021-03-07 00:26:39 +08:00
|
|
|
|
2021-03-06 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/sect-names.h (dwarf2_elf_names): Declare.
|
|
|
|
|
* dwarf2/read.h (dwarf2_get_dwz_file): Move to dwz.h.
|
|
|
|
|
* dwarf2/read.c (dwarf2_elf_names): No longer static.
|
|
|
|
|
(locate_dwz_sections, dwz_search_other_debugdirs)
|
|
|
|
|
(dwarf2_get_dwz_file): Move to dwz.c.
|
|
|
|
|
* dwarf2/dwz.h (dwarf2_get_dwz_file): Move declaration from
|
|
|
|
|
read.h.
|
|
|
|
|
* dwarf2/dwz.c (locate_dwz_sections, dwz_search_other_debugdirs)
|
|
|
|
|
(dwarf2_get_dwz_file): Move from read.c.
|
|
|
|
|
|
2021-03-07 00:26:39 +08:00
|
|
|
|
2021-03-06 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* debuginfod-support.h: Include scoped_fd.h.
|
|
|
|
|
|
2021-03-07 00:26:39 +08:00
|
|
|
|
2021-03-06 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.h (dwarf2_get_dwz_file): Add 'require' parameter.
|
|
|
|
|
* dwarf2/read.c (dwarf2_get_dwz_file): Add 'require' parameter.
|
|
|
|
|
(get_abbrev_section_for_cu, read_attribute_value)
|
|
|
|
|
(get_debug_line_section): Update.
|
|
|
|
|
* dwarf2/macro.c (dwarf_decode_macro_bytes): Update.
|
|
|
|
|
|
2021-03-07 00:26:39 +08:00
|
|
|
|
2021-03-06 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/sect-names.h (struct dwarf2_section_names) <matches>: New
|
|
|
|
|
method.
|
|
|
|
|
* dwarf2/read.c (section_is_p): Remove.
|
|
|
|
|
(dwarf2_per_bfd::locate_sections)
|
|
|
|
|
(dwarf2_per_bfd::locate_sections, locate_dwz_sections)
|
|
|
|
|
(locate_v1_virtual_dwo_sections, dwarf2_locate_dwo_sections)
|
|
|
|
|
(dwarf2_locate_common_dwp_sections)
|
|
|
|
|
(dwarf2_locate_v2_dwp_sections, dwarf2_locate_v5_dwp_sections):
|
|
|
|
|
Update.
|
|
|
|
|
|
2021-03-07 00:26:39 +08:00
|
|
|
|
2021-03-06 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* xcoffread.c: Include sect-names.h.
|
|
|
|
|
* symfile.h (struct dwarf2_section_names, struct
|
|
|
|
|
dwarf2_debug_sections): Move to dwarf2/sect-names.h.
|
|
|
|
|
* dwarf2/sect-names.h: New file, from symfile.h.
|
|
|
|
|
* dwarf2/read.c: Include sect-names.h.
|
|
|
|
|
|
2021-03-07 00:16:59 +08:00
|
|
|
|
2021-03-06 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (read_attribute): Make 'abbrev' const.
|
|
|
|
|
* dwarf2/abbrev.c (abbrev_table::alloc_abbrev): Remove.
|
|
|
|
|
(abbrev_table::read): Update.
|
|
|
|
|
* dwarf2/abbrev.h (struct attr_abbrev): Move earlier.
|
|
|
|
|
(struct abbrev_info): Reformat.
|
|
|
|
|
<attrs>: Now an array.
|
|
|
|
|
(struct abbrev_table) <alloc_abbrev>: Remove.
|
|
|
|
|
|
2021-03-06 08:17:00 +08:00
|
|
|
|
2021-03-06 Weimin Pan <weimin.pan@oracle.com>
|
|
|
|
|
|
|
|
|
|
* ctfread.c (ctf_psymtab_add_enums): New function.
|
|
|
|
|
(ctf_psymtab_type_cb): call ctf_psymtab_add_enums.
|
|
|
|
|
|
2021-03-06 07:31:26 +08:00
|
|
|
|
2021-03-06 Weimin Pan <weimin.pan@oracle.com>
|
|
|
|
|
|
|
|
|
|
* ctfread.c (read_func_kind_type): Set up function arguments.
|
|
|
|
|
|
2020-11-27 22:39:23 +08:00
|
|
|
|
2021-03-05 Craig Blackmore <craig.blackmore@embecosm.com>
|
|
|
|
|
Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* riscv-none-tdep.c: Add 'user-regs.h' and 'target-description.h'
|
|
|
|
|
includes.
|
|
|
|
|
(riscv_csrset): New static global.
|
|
|
|
|
(riscv_update_csrmap): New function.
|
|
|
|
|
(riscv_iterate_over_regset_sections): Process CSRs.
|
|
|
|
|
|
2021-02-16 00:07:48 +08:00
|
|
|
|
2021-03-05 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* riscv-tdep.c (riscv_feature_name_csr): Define.
|
|
|
|
|
(riscv_feature_name_cpu): Define.
|
|
|
|
|
(riscv_feature_name_fpu): Define.
|
|
|
|
|
(riscv_feature_name_virtual): Define.
|
|
|
|
|
(riscv_xreg_feature): Use riscv_feature_name_cpu.
|
|
|
|
|
(riscv_freg_feature): Use riscv_feature_name_fpu.
|
|
|
|
|
(riscv_virtual_feature): Use riscv_feature_name_virtual.
|
|
|
|
|
(riscv_csr_feature): Use riscv_feature_name_csr.
|
|
|
|
|
* riscv-tdep.h (riscv_feature_name_csr): Declare.
|
|
|
|
|
|
gdb/riscv: introduce bare metal core dump support
This commit adds the ability for bare metal RISC-V target to generate
core files from within GDB.
The intended use case is that a user will connect to a remote bare
metal target, debug up to some error condition, then generate a core
file in the normal way using:
(gdb) generate-core-file
This core file can then be used to revisit the state of the remote
target without having to reconnect to the remote target.
The core file creation code is split between two new files. In
elf-none-tdep.c is code for any architecture with the none
ABI (i.e. bare metal) when the BFD library is built with ELF support.
In riscv-none-tdep.c are the RISC-V specific parts. This is where the
regset and regcache_map_entry structures are defined that control how
registers are laid out in the core file. As this file could (in
theory at least) be used for a non-ELF bare metal RISC-V target, the
calls into elf-none-tdep.c are guarded with '#ifdef HAVE_ELF'.
Currently for RISC-V only the x-regs and f-regs (if present) are
written out. In future commits I plan to add support for writing out
the RISC-V CSRs.
The core dump format is based around generating an ELF containing
sections for the writable regions of memory that a user could be
using. Which regions are dumped rely on GDB's existing common core
dumping code, GDB will attempt to figure out the stack and heap as
well as copying out writable data sections as identified by the
original ELF.
Register information is added to the core dump using notes, just as it
is for Linux of FreeBSD core dumps. The note types used consist of
the 3 basic types you would expect in a OS based core dump,
NT_PRPSINFO, NT_PRSTATUS, NT_FPREGSET.
The layout of these notes differs slightly (due to field sizes)
between RV32 and RV64. Below I describe the data layout for each
note. In all cases, all padding fields should be set to zero.
Note NT_PRPSINFO is optional. Its data layout is:
struct prpsinfo32_t /* For RV32. */
{
uint8_t padding[32];
char fname[16];
char psargs[80];
}
struct prpsinfo64_t /* For RV64. */
{
uint8_t padding[40];
char fname[16];
char psargs[80];
}
Field 'fname' - null terminated string consisting of the basename of
(up to the fist 15 characters of) the executable. Any additional
space should be set to zero. If there's no executable name then
this field can be set to all zero.
Field 'psargs' - a null terminated string up to 80 characters in
length. Any additional space should be filled with zero. This
field contains the full executable path and any arguments passed
to the executable. If there's nothing sensible to write in this
field then fill it with zero.
Note NT_PRSTATUS is required, its data layout is:
struct prstatus32_t /* For RV32. */
{
uint8_t padding_1[12];
uint16_t sig;
uint8_t padding_2[10];
uint32_t thread_id;
uint8_t padding_3[44];
uint32_t x_regs[32];
uint8_t padding_4[4];
}
struct prstatus64_t /* For RV64. */
{
uint8_t padding_1[12];
uint16_t sig;
uint8_t padding_2[18];
uint32_t thread_id;
uint8_t padding_3[76];
uint64_t x_regs[32];
uint8_t padding_4[4];
}
Field 'sig' - the signal that stopped this thread. It's implementation
defined what this field actually means. Within GDB this will be
the signal number that the remote target reports as the stop
reason for this thread.
Field 'thread_is' - the thread id for this thread. It's implementation
defined what this field actually means. Within GDB this will be
thread thread-id that is assigned to each remote thread.
Field 'x_regs' - at index 0 we store the program counter, and at
indices 1 to 31 we store x-registers 1 to 31. x-register 0 is not
stored, its value is always zero anyway.
Note NT_FPREGSET is optional, its data layout is:
fpregset32_t /* For targets with 'F' extension. */
{
uint32_t f_regs[32];
uint32_t fcsr;
}
fpregset64_t /* For targets with 'D' extension . */
{
uint64_t f_regs[32];
uint32_t fcsr;
}
Field 'f_regs' - stores f-registers 0 to 31.
Field 'fcsr' - stores the fcsr CSR register, and is always 4-bytes.
The rules for ordering the notes is the same as for Linux. The
NT_PRSTATUS note must come before any other notes about additional
register sets. And for multi-threaded targets all registers for a
single thread should be grouped together. This is because only
NT_PRSTATUS includes a thread-id, all additional register notes after
a NT_PRSTATUS are assumed to belong to the same thread until a
different NT_PRSTATUS is seen.
gdb/ChangeLog:
* Makefile.in (ALL_TARGET_OBS): Add riscv-none-tdep.o.
(ALLDEPFILES): Add riscv-none-tdep.c.
* configure: Regenerate.
* configure.ac (CONFIG_OBS): Add elf-none-tdep.o when BFD has ELF
support.
* configure.tgt (riscv*-*-*): Include riscv-none-tdep.c.
* elf-none-tdep.c: New file.
* elf-none-tdep.h: New file.
* riscv-none-tdep.c: New file.
2020-11-30 20:15:08 +08:00
|
|
|
|
2021-03-05 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
Craig Blackmore <craig.blackmore@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (ALL_TARGET_OBS): Add riscv-none-tdep.o.
|
|
|
|
|
(ALLDEPFILES): Add riscv-none-tdep.c.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* configure.ac (CONFIG_OBS): Add elf-none-tdep.o when BFD has ELF
|
|
|
|
|
support.
|
|
|
|
|
* configure.tgt (riscv*-*-*): Include riscv-none-tdep.c.
|
|
|
|
|
* elf-none-tdep.c: New file.
|
|
|
|
|
* elf-none-tdep.h: New file.
|
|
|
|
|
* riscv-none-tdep.c: New file.
|
|
|
|
|
|
gdb: write target description into core file
When a core file is created from within GDB add the target description
into a note within the core file.
When loading a core file, if the target description note is present
then load the target description from the core file.
The benefit of this is that we can be sure that, when analysing the
core file within GDB, that we are using the exact same target
description as was in use at the time the core file was created.
GDB already supports a mechanism for figuring out the target
description from a given corefile; gdbarch_core_read_description.
This new mechanism (GDB adding the target description) is not going to
replace the old mechanism. Core files generated outside of GDB will
not include a target description, and so GDB still needs to be able to
figure out a target description for these files.
My primary motivation for adding this feature is that, in a future
commit, I will be adding support for bare metal core dumps on some
targets. For RISC-V specifically, I want to be able to dump all the
available control status registers. As different targets will present
different sets of register in their target description, including
registers that are possibly not otherwise known to GDB I wanted a way
to capture these registers in the core dump.
I therefore need a mechanism to write out an arbitrary set of
registers, and to then derive a target description from this arbitrary
set when later loading the core file. The obvious approach (I think)
is to just reuse the target description.
Once I'd decided to add support for writing out the target description
I could either choose to make this RISC-V only, or make it generic. I
figure that having the target description in the core file doesn't
hurt, and _might_ be helpful. So that's how I got here, general
support for including the target description in GDB generated core
files.
In previous versions of this patch I added the target description from
generic code (in gcore.c). However, doing this creates a dependency
between GDB's common code and bfd ELF support. As ELF support in gdb
is optional (for example the target x86_64-apple-darwin20.3.0 does not
include ELF support) then having gcore.c require ELF support would
break the GDB build in some cases.
Instead, in this version of the patch, writing the target description
note is done from each specific targets make notes function. Each of
these now calls a common function in gcore-elf.c (which is only linked
in when bfd has ELF support). And so only targets that are ELF based
will call the new function and we can therefore avoid an unconditional
dependency on ELF support.
gdb/ChangeLog:
* corelow.c: Add 'xml-tdesc.h' include.
(core_target::read_description): Load the target description from
the core file when possible.
* fbsd-tdep.c (fbsd_make_corefile_notes): Add target description
note.
* gcore-elf.c: Add 'gdbsupport/tdesc.h' include.
(gcore_elf_make_tdesc_note): New function.
* gcore-elf.h (gcore_elf_make_tdesc_note): Declare.
* linux-tdep.c (linux_make_corefile_notes): Add target description
note.
2020-11-27 23:41:52 +08:00
|
|
|
|
2021-03-05 Craig Blackmore <craig.blackmore@embecosm.com>
|
|
|
|
|
Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* corelow.c: Add 'xml-tdesc.h' include.
|
|
|
|
|
(core_target::read_description): Load the target description from
|
|
|
|
|
the core file when possible.
|
|
|
|
|
* fbsd-tdep.c (fbsd_make_corefile_notes): Add target description
|
|
|
|
|
note.
|
|
|
|
|
* gcore-elf.c: Add 'gdbsupport/tdesc.h' include.
|
|
|
|
|
(gcore_elf_make_tdesc_note): New function.
|
|
|
|
|
* gcore-elf.h (gcore_elf_make_tdesc_note): Declare.
|
|
|
|
|
* linux-tdep.c (linux_make_corefile_notes): Add target description
|
|
|
|
|
note.
|
|
|
|
|
|
gdb: unify parts of the Linux and FreeBSD core dumping code
While reviewing the Linux and FreeBSD core dumping code within GDB for
another patch series, I noticed that the code that collects the
registers for each thread and writes these into ELF note format is
basically identical between Linux and FreeBSD.
This commit merges this code and moves it into a new file gcore-elf.c.
The function find_signalled_thread is moved from linux-tdep.c to
gcore.c despite not being shared. A later commit will make use of
this function.
I did merge, and then revert a previous version of this patch (commit
82a1fd3a4935 for the original patch and 03642b7189bc for the revert).
The problem with the original patch is that it introduced a
unconditional dependency between GDB and some ELF specific functions
in the BFD library, e.g. elfcore_write_prstatus and
elfcore_write_register_note. It was pointed out in this mailing list
post:
https://sourceware.org/pipermail/gdb-patches/2021-February/175750.html
that this change was breaking any build of GDB for non-ELF targets.
To confirm this breakage, and to test this new version of GDB I
configured and built for the target x86_64-apple-darwin20.3.0.
Where the previous version of this patch placed all of the common code
into gcore.c, which is included in all builds of GDB, this new patch
only places non-ELF specific generic code (i.e. find_signalled_thread)
into gcore.c, the ELF specific code is put into the new gcore-elf.c
file, which is only included in GDB if BFD has ELF support.
The contents of gcore-elf.c are referenced unconditionally from
linux-tdep.c and fbsd-tdep.c, this is fine, we previously always
assumed that these two targets required ELF support, and we continue
to make that assumption after this patch; nothing has changed there.
With my previous version of this patch the darwin target mentioned
above failed to build, but with the new version, the target builds
fine.
There are a couple of minor changes to the FreeBSD target after this
commit, but I believe that these are changes for the better:
(1) For FreeBSD we always used to record the thread-id in the core
file by using ptid_t.lwp (). In contrast the Linux code did this:
/* For remote targets the LWP may not be available, so use the TID. */
long lwp = ptid.lwp ();
if (lwp == 0)
lwp = ptid.tid ();
Both target now do this:
/* The LWP is often not available for bare metal target, in which case
use the tid instead. */
if (ptid.lwp_p ())
lwp = ptid.lwp ();
else
lwp = ptid.tid ();
Which is equivalent for Linux, but is a change for FreeBSD. I think
that all this means is that in some cases where GDB might have
previously recorded a thread-id of 0 for each thread, we might now get
something more useful.
(2) When collecting the registers for Linux we collected into a zero
initialised buffer. By contrast on FreeBSD the buffer is left
uninitialised. In the new code the buffer is always zero initialised.
I suspect once the registers are copied into the buffer there's
probably no gaps left so this makes no difference, but if it does then
using zeros rather than random bits of GDB's memory is probably a good
thing.
Otherwise, there should be no other user visible changes after this
commit.
Tested this on x86-64/GNU-Linux and x86-64/FreeBSD-12.2 with no
regressions.
gdb/ChangeLog:
* Makefile.in (SFILES): Add gcore-elf.c.
(HFILES_NO_SRCDIR): Add gcore-elf.h
* configure: Regenerate.
* configure.ac: Add gcore-elf.o to CONFIG_OBS if we have ELF
support.
* fbsd-tdep.c: Add 'gcore-elf.h' include.
(struct fbsd_collect_regset_section_cb_data): Delete.
(fbsd_collect_regset_section_cb): Delete.
(fbsd_collect_thread_registers): Delete.
(struct fbsd_corefile_thread_data): Delete.
(fbsd_corefile_thread): Delete.
(fbsd_make_corefile_notes): Call
gcore_elf_build_thread_register_notes instead of the now deleted
FreeBSD code.
* gcore-elf.c: New file, the content was moved here from
linux-tdep.c, functions were renamed and given minor cleanup.
* gcore-elf.h: New file.
* gcore.c (gcore_find_signalled_thread): Moved here from
linux-tdep.c and given a new name. Minor cleanups.
* gcore.h (gcore_find_signalled_thread): Declare.
* linux-tdep.c: Add 'gcore.h' and 'gcore-elf.h' includes.
(struct linux_collect_regset_section_cb_data): Delete.
(linux_collect_regset_section_cb): Delete.
(linux_collect_thread_registers): Delete.
(linux_corefile_thread): Call
gcore_elf_build_thread_register_notes.
(find_signalled_thread): Delete.
(linux_make_corefile_notes): Call gcore_find_signalled_thread.
2021-01-19 00:00:38 +08:00
|
|
|
|
2021-03-05 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (SFILES): Add gcore-elf.c.
|
|
|
|
|
(HFILES_NO_SRCDIR): Add gcore-elf.h
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* configure.ac: Add gcore-elf.o to CONFIG_OBS if we have ELF
|
|
|
|
|
support.
|
|
|
|
|
* fbsd-tdep.c: Add 'gcore-elf.h' include.
|
|
|
|
|
(struct fbsd_collect_regset_section_cb_data): Delete.
|
|
|
|
|
(fbsd_collect_regset_section_cb): Delete.
|
|
|
|
|
(fbsd_collect_thread_registers): Delete.
|
|
|
|
|
(struct fbsd_corefile_thread_data): Delete.
|
|
|
|
|
(fbsd_corefile_thread): Delete.
|
|
|
|
|
(fbsd_make_corefile_notes): Call
|
|
|
|
|
gcore_elf_build_thread_register_notes instead of the now deleted
|
|
|
|
|
FreeBSD code.
|
|
|
|
|
* gcore-elf.c: New file, the content was moved here from
|
|
|
|
|
linux-tdep.c, functions were renamed and given minor cleanup.
|
|
|
|
|
* gcore-elf.h: New file.
|
|
|
|
|
* gcore.c (gcore_find_signalled_thread): Moved here from
|
|
|
|
|
linux-tdep.c and given a new name. Minor cleanups.
|
|
|
|
|
* gcore.h (gcore_find_signalled_thread): Declare.
|
|
|
|
|
* linux-tdep.c: Add 'gcore.h' and 'gcore-elf.h' includes.
|
|
|
|
|
(struct linux_collect_regset_section_cb_data): Delete.
|
|
|
|
|
(linux_collect_regset_section_cb): Delete.
|
|
|
|
|
(linux_collect_thread_registers): Delete.
|
|
|
|
|
(linux_corefile_thread): Call
|
|
|
|
|
gcore_elf_build_thread_register_notes.
|
|
|
|
|
(find_signalled_thread): Delete.
|
|
|
|
|
(linux_make_corefile_notes): Call gcore_find_signalled_thread.
|
|
|
|
|
|
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 5b6d1e4fa4fc ("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 23:57:03 +08:00
|
|
|
|
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-03-04 22:30:42 +08:00
|
|
|
|
2021-03-04 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (struct match_data) <found_sym>: Now bool.
|
|
|
|
|
(aux_add_nonlocal_symbols): Update.
|
|
|
|
|
(ada_add_block_symbols): Change "found_sym" to bool.
|
|
|
|
|
|
2021-03-04 03:02:16 +08:00
|
|
|
|
2021-03-03 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_resolve_function): Update comment.
|
|
|
|
|
(is_nonfunction, add_symbols_from_enclosing_procs)
|
|
|
|
|
(remove_extra_symbols): Likewise.
|
|
|
|
|
(struct match_data): Add constructor, initializers.
|
|
|
|
|
(add_nonlocal_symbols): Remove memset.
|
|
|
|
|
(aux_add_nonlocal_symbols): Update comment.
|
|
|
|
|
(ada_add_block_renamings, add_nonlocal_symbols)
|
|
|
|
|
(ada_add_all_symbols): Likewise.
|
|
|
|
|
* ada-exp.y (write_var_or_type): Clean up trailing whitespace.
|
|
|
|
|
|
Rewrite GNAT-encoded fixed point types in DWARF reader
gdb currently supports two different styles of fixed-point. The
original style, where fixed point types are "GNAT encoded", is handled
primarily in the Ada code. The newer style, encoded using DWARF, is
handled by the core of gdb.
This patch changes gdb to read the GNAT encodings in the DWARF reader
as well. This removes some code and unifies the two paths. As a
result, GNAT-encoded fixed-point now works a bit better.
One possible drawback of this change is that, if someone uses stabs,
then fixed-point might now stop working. I consider stabs to be fully
obsolete, though, so I don't intend to address this.
gdb/ChangeLog
2021-03-02 Tom Tromey <tromey@adacore.com>
* ada-lang.c (cast_from_gnat_encoded_fixed_point_type)
(cast_to_gnat_encoded_fixed_point_type): Remove.
(ada_value_cast, ada_evaluate_subexp): Update.
(gnat_encoded_fixed_point_type_info)
(ada_is_gnat_encoded_fixed_point_type)
(gnat_encoded_fixed_point_delta)
(gnat_encoded_fixed_point_scaling_factor): Remove.
* ada-lang.h (ada_is_gnat_encoded_fixed_point_type)
(gnat_encoded_fixed_point_delta)
(gnat_encoded_fixed_point_scaling_factor): Don't declare.
* ada-typeprint.c (print_gnat_encoded_fixed_point_type): Remove.
(ada_print_type): Update.
* ada-valprint.c (ada_value_print_num): Update.
* dwarf2/read.c (ada_get_gnat_encoded_number)
(ada_get_gnat_encoded_ratio): New functions.
(finish_fixed_point_type): Use them. Add parameters.
(GNAT_FIXED_POINT_SUFFIX): New define.
(gnat_encoded_fixed_point_type_info): New function.
(read_base_type): Handle gnat encodings.
gdb/testsuite/ChangeLog
2021-03-02 Tom Tromey <tromey@adacore.com>
* gdb.ada/fixed_points.exp: Remove most special cases for minimal
encodings.
2021-03-03 04:08:24 +08:00
|
|
|
|
2021-03-02 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (cast_from_gnat_encoded_fixed_point_type)
|
|
|
|
|
(cast_to_gnat_encoded_fixed_point_type): Remove.
|
|
|
|
|
(ada_value_cast, ada_evaluate_subexp): Update.
|
|
|
|
|
(gnat_encoded_fixed_point_type_info)
|
|
|
|
|
(ada_is_gnat_encoded_fixed_point_type)
|
|
|
|
|
(gnat_encoded_fixed_point_delta)
|
|
|
|
|
(gnat_encoded_fixed_point_scaling_factor): Remove.
|
|
|
|
|
* ada-lang.h (ada_is_gnat_encoded_fixed_point_type)
|
|
|
|
|
(gnat_encoded_fixed_point_delta)
|
|
|
|
|
(gnat_encoded_fixed_point_scaling_factor): Don't declare.
|
|
|
|
|
* ada-typeprint.c (print_gnat_encoded_fixed_point_type): Remove.
|
|
|
|
|
(ada_print_type): Update.
|
|
|
|
|
* ada-valprint.c (ada_value_print_num): Update.
|
|
|
|
|
* dwarf2/read.c (ada_get_gnat_encoded_number)
|
|
|
|
|
(ada_get_gnat_encoded_ratio): New functions.
|
|
|
|
|
(finish_fixed_point_type): Use them. Add parameters.
|
|
|
|
|
(GNAT_FIXED_POINT_SUFFIX): New define.
|
|
|
|
|
(gnat_encoded_fixed_point_type_info): New function.
|
|
|
|
|
(read_base_type): Handle gnat encodings.
|
|
|
|
|
|
2021-03-03 04:00:45 +08:00
|
|
|
|
2021-03-02 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_fold_name, ada_variant_discrim_name)
|
|
|
|
|
(ada_enum_name, scan_discrim_bound, to_fixed_range_type): Use
|
|
|
|
|
std::string.
|
|
|
|
|
(GROW_VECT): Remove.
|
|
|
|
|
(grow_vect): Remove.
|
|
|
|
|
|
2021-03-03 04:00:45 +08:00
|
|
|
|
2021-03-02 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.h (ada_lookup_symbol_list): Return a vector.
|
|
|
|
|
* ada-lang.c (resolve_subexp): Update.
|
|
|
|
|
(ada_resolve_function): Accept a vector.
|
|
|
|
|
(is_nonfunction, add_defn_to_vec)
|
|
|
|
|
(add_symbols_from_enclosing_procs): Likewise.
|
|
|
|
|
(num_defns_collected, defns_collected): Remove.
|
|
|
|
|
(remove_extra_symbols): Return a vector.
|
|
|
|
|
(remove_irrelevant_renamings): Return void.
|
|
|
|
|
(ada_add_local_symbols): Accept a vector.
|
|
|
|
|
(struct match_data) <obstackp>: Remove.
|
|
|
|
|
<resultp>: New member.
|
|
|
|
|
(aux_add_nonlocal_symbols): Update.
|
|
|
|
|
(ada_add_block_renamings, add_nonlocal_symbols)
|
|
|
|
|
(ada_add_all_symbols): Accept a vector.
|
|
|
|
|
(ada_lookup_symbol_list_worker, ada_lookup_symbol_list): Return a
|
|
|
|
|
vector.
|
|
|
|
|
(ada_lookup_symbol): Update.
|
|
|
|
|
(ada_add_block_symbols): Accept a vector.
|
|
|
|
|
(get_var_value, iterate_over_symbols): Update.
|
|
|
|
|
* ada-exp.y (block_lookup, write_var_or_type, write_name_assoc):
|
|
|
|
|
Update.
|
|
|
|
|
|
2021-03-03 04:00:45 +08:00
|
|
|
|
2021-03-02 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (resolve_subexp): Use any_of and erase-remove idiom.
|
|
|
|
|
|
2021-03-03 04:00:45 +08:00
|
|
|
|
2021-03-02 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (struct ada_symbol_cache) <cache_space>: Now an
|
|
|
|
|
auto_obstack.
|
|
|
|
|
<root>: Initialize.
|
|
|
|
|
(ada_pspace_data): Remove destructor.
|
|
|
|
|
<sym_cache>: Now a unique_ptr.
|
|
|
|
|
(ada_init_symbol_cache, ada_free_symbol_cache): Remove.
|
|
|
|
|
(ada_get_symbol_cache): Use 'new'.
|
|
|
|
|
(ada_clear_symbol_cache): Rewrite.
|
|
|
|
|
|
2021-03-03 02:57:01 +08:00
|
|
|
|
2021-03-02 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (add_nonlocal_symbols): Handle case where objfile->sf
|
|
|
|
|
is null.
|
|
|
|
|
|
2021-02-25 08:30:49 +08:00
|
|
|
|
2021-02-27 Lancelot Six <lsix@lancelotsix.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/27393
|
|
|
|
|
* source.c (add_path): Skip empty dirnames.
|
|
|
|
|
|
2021-02-26 07:00:43 +08:00
|
|
|
|
2021-02-25 Kevin Buettner <kevinb@redhat.com>
|
2021-02-26 06:25:49 +08:00
|
|
|
|
|
|
|
|
|
* nat/aarch64-sve-linux-ptrace.h: Add comment regarding
|
|
|
|
|
include order for <sys/ptrace.h> and <asm/ptrace.h>.
|
|
|
|
|
|
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-26 04:52:29 +08:00
|
|
|
|
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-25 15:27:09 +08:00
|
|
|
|
2021-02-25 Jan Matyas <jmatyas@codasip.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/26819
|
|
|
|
|
* remote.c (remote_target::start_remote): Ensure the single
|
|
|
|
|
thread, automatically added for remote targets without the
|
|
|
|
|
concept of threading, is initially in set to the "resumed"
|
|
|
|
|
state.
|
|
|
|
|
* remote.c (remote_target::add_current_inferior_and_thread):
|
|
|
|
|
Add return value - return the main thread.
|
|
|
|
|
|
2021-02-26 00:22:13 +08:00
|
|
|
|
2021-02-25 Jan Vrany <jan.vrany@labware.com>
|
|
|
|
|
|
|
|
|
|
* gdb/mi/mi-interp.c (mi_traceframe_changed): Remove trailing \n from output.
|
|
|
|
|
(mi_tsv_created): Likewise.
|
|
|
|
|
(mi_tsv_deleted): Likewise.
|
|
|
|
|
|
[gdb/symtab] Fix wrong unit_type Dwarf Error
When running test-case gdb.dwarf2/fission-mix.exp using gcc-11 (and using the
tentative fix for PR27353 to get past that assertion failure), I run into:
...
(gdb) file fission-mix^M
Reading symbols from fission-mix...^M
Dwarf Error: wrong unit_type in compilation unit header \
(is DW_UT_split_compile (0x05), should be DW_UT_type (0x02)) \
[in module fission-mix2.dwo]^M
(No debugging symbols found in fission-mix)^M
...
The compilation unit that is complained about is:
...
Contents of the .debug_info.dwo section (loaded from fission-mix2.dwo):
Compilation Unit @ offset 0x0:
Length: 0x57 (32-bit)
Version: 5
Unit Type: DW_UT_split_compile (5)
Abbrev Offset: 0x0
Pointer Size: 8
DWO ID: 0x3e3930d3cc1805df
<0><14>: Abbrev Number: 1 (DW_TAG_compile_unit)
...
And the dwarf error is triggered here in read_comp_unit_head:
...
case DW_UT_split_compile:
if (section_kind != rcuh_kind::COMPILE)
error (_("Dwarf Error: wrong unit_type in compilation unit header "
"(is %s, should be %s) [in module %s]"),
dwarf_unit_type_name (cu_header->unit_type),
dwarf_unit_type_name (DW_UT_type), filename);
break;
...
due to passing rcuh_kind::TYPE here in open_and_init_dwo_file:
...
create_debug_type_hash_table (per_objfile, dwo_file.get (),
&dwo_file->sections.info, dwo_file->tus,
rcuh_kind::TYPE);
...
Fix this by changing the section_kind argument to create_debug_type_hash_table
to rcuh_kind::COMPILE, to reflect that we're passing &dwo_file->sections.info
rather than &dwo_file->sections.types.
Tested on x86_64-linux.
gdb/ChangeLog:
2021-02-25 Tom de Vries <tdevries@suse.de>
PR symtab/27354
* dwarf2/read.c (open_and_init_dwo_file): Use rcuh_kind::COMPILE as
section_kind for &dwo_file->sections.info.
2021-02-25 22:41:49 +08:00
|
|
|
|
2021-02-25 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR symtab/27354
|
|
|
|
|
* dwarf2/read.c (open_and_init_dwo_file): Use rcuh_kind::COMPILE as
|
|
|
|
|
section_kind for &dwo_file->sections.info.
|
|
|
|
|
|
gdb/fortran: don't access non-existent type fields
When attempting to call a Fortran function for which there is no debug
information we currently trigger undefined behaviour in GDB by
accessing non-existent type fields.
The reason is that in order to prepare the arguments, for a call to a
Fortran function, we need to know the type of each argument. If the
function being called has no debug information then obviously GDB
doesn't know about the argument types and we should either give the
user an error or pick a suitable default. What we currently do is
just assume the field exist and access undefined memory, which is
clearly wrong.
The reason GDB needs to know the argument type is to tell if the
argument is artificial or not, artificial arguments will be passed by
value while non-artificial arguments will be passed by reference.
An ideal solution for this problem would be to allow the user to cast
the function to the correct type, we already do this to some degree
with the return value, for example:
(gdb) print some_func_ ()
'some_func_' has unknown return type; cast the call to its declared return type
(gdb) print (integer) some_func_ ()
$1 = 1
But if we could extend this to allow casting to the full function
type, GDB could figure out from the signature what are real
parameters, and what are artificial parameters. Maybe something like
this:
(gdb) print ((integer () (integer, double)) some_other_func_ (1, 2.3)
Alas, right now the Fortran expression parser doesn't seem to support
parsing function signatures, and we certainly don't have support for
figuring out real vs artificial arguments from a signature.
Still, I think we can prevent GDB from accessing undefined memory and
provide a reasonable default behaviour.
In this commit I:
- Only ask if the argument is artificial if the type of the argument
is actually known.
- Unknown arguments are assumed to be artificial and passed by
value (non-artificial arguments are pass by reference).
- If an artificial argument is prefixed with '&' by the user then we
treat the argument as pass-by-reference.
With these three changes we avoid undefined behaviour in GDB, and
allow the user, in most cases, to get a reasonably natural default
behaviour.
gdb/ChangeLog:
PR fortran/26155
* f-lang.c (fortran_argument_convert): Delete declaration.
(fortran_prepare_argument): New function.
(evaluate_subexp_f): Move logic to new function
fortran_prepare_argument.
gdb/testsuite/ChangeLog:
PR fortran/26155
* gdb.fortran/call-no-debug-func.f90: New file.
* gdb.fortran/call-no-debug-prog.f90: New file.
* gdb.fortran/call-no-debug.exp: New file.
2020-11-13 18:39:23 +08:00
|
|
|
|
2021-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
PR fortran/26155
|
|
|
|
|
* f-lang.c (fortran_argument_convert): Delete declaration.
|
|
|
|
|
(fortran_prepare_argument): New function.
|
|
|
|
|
(evaluate_subexp_f): Move logic to new function
|
|
|
|
|
fortran_prepare_argument.
|
|
|
|
|
|
2021-02-24 20:50:00 +08:00
|
|
|
|
2021-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* f-exp.y (f77_keywords): Add 'associated'.
|
|
|
|
|
* f-lang.c (fortran_associated): New function.
|
|
|
|
|
(evaluate_subexp_f): Handle FORTRAN_ASSOCIATED.
|
|
|
|
|
(operator_length_f): Likewise.
|
|
|
|
|
(print_unop_or_binop_subexp_f): New function.
|
|
|
|
|
(print_subexp_f): Make use of print_unop_or_binop_subexp_f for
|
|
|
|
|
FORTRAN_ASSOCIATED, FORTRAN_LBOUND, and FORTRAN_UBOUND.
|
|
|
|
|
(dump_subexp_body_f): Handle FORTRAN_ASSOCIATED.
|
|
|
|
|
(operator_check_f): Likewise.
|
|
|
|
|
* std-operator.def: Add FORTRAN_ASSOCIATED.
|
|
|
|
|
|
2021-02-25 01:35:18 +08:00
|
|
|
|
2021-02-25 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* f-exp.y (fortran_operators): Add ".xor.".
|
|
|
|
|
|
2021-02-25 06:58:42 +08:00
|
|
|
|
2021-02-24 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR symtab/27336
|
|
|
|
|
* dwarf2/attribute.c (attribute::form_is_signed): New function
|
|
|
|
|
factored out of ...
|
|
|
|
|
* dwarf2/attribute.h (attribute::as_signed): ... here.
|
|
|
|
|
(attribute::is_nonnegative, attribute::as_nonnegative): New function.
|
|
|
|
|
(attribute::form_is_signed): Declare.
|
|
|
|
|
* dwarf2/read.c (new_symbol): Use is_nonnegative and as_nonnegative
|
|
|
|
|
for DW_AT_decl_file.
|
|
|
|
|
|
2021-02-25 05:35:07 +08:00
|
|
|
|
2021-02-24 Kevin Buettner <kevinb@redhat.com>
|
|
|
|
|
|
|
|
|
|
* nat/aarch64-linux-hw-point.c: Add comment regarding include
|
|
|
|
|
order for <sys/ptrace.h> and <asm/ptrace.h>.
|
|
|
|
|
|
2021-02-25 02:48:04 +08:00
|
|
|
|
2021-02-24 Kevin Buettner <kevinb@redhat.com>
|
|
|
|
|
|
|
|
|
|
* nat/aarch64-linux-hw-point.c: Include <asm/ptrace.h> after
|
|
|
|
|
<sys/ptrace.h>.
|
|
|
|
|
|
2021-02-20 01:39:18 +08:00
|
|
|
|
2021-02-24 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* exec.c (set_section_command): Move variable declarations into
|
|
|
|
|
the function body, and use std::string instead of a fixed size
|
|
|
|
|
buffer.
|
|
|
|
|
|
gdb: move get_section_table from exec_target to dummy_target
The only target that implements target_ops::get_section_table in a
meaningful way is exec_target. This target calls back into the
program space to return the current global section_table.
The global section table is populated whenever the user provides GDB
with an executable, or when a symbol file is loaded, e.g. when a
dynamic library is loaded, or when the user does add-symbol-file.
I recently ran into a situation where a user, debugging a remote
target, was not supplying GDB with a main executable at all. Instead
the user attached to the target then did add-symbol-file, and then
proceeded to debug the target.
This works fine, but it was noticed that even when
trust-readonly-sections was on GDB was still accessing the target to
get the contents of readonly sections.
The problem is that by not providing an executable there was no
exec_target in the target stack, and so when GDB calls the
target_ops::get_section_table function GDB ends up in
dummy_target::get_section_table, which just returns NULL.
What I want is that even when GDB doesn't have an exec_target in the
target stack, a call to target_ops::get_section_table will still
return the section_table from the current program space.
When considering how to achieve this my first though was, why is the
request for the section table going via the target stack at all? The
set of sections loaded is a property of the program space, not the
target. This is, after all, why the data is being stored in the
program space.
So I initially tried changing target_get_section_table so that,
instead of calling into the target it just returns
current_program_space->target_sections ().
This would be fine except for one issue, target_bfd (from
bfd-target.c). This code is used from solib-svr4.c to create a
temporary target_ops structure that implements two functions
target_bfd::xfer_partial and target_bfd::get_section_table.
The purpose behind the code is to enable two targets, ppc64 and frv to
decode function descriptors from the dynamic linker, based on the
non-relocated addresses from within the dynamic linker bfd object.
Both of the implemented functions in target_bfd rely on the target_bfd
object holding a section table, and the ppc64 target requires that the
target_bfd implement ::get_section_table.
The frv target doesn't require ::get_section_table, instead it
requires the ::xfer_partial. We could in theory change the ppc64
target to use the same approach as frv, however, this would be a bad
idea. I believe that the frv target approach is broken. I'll
explain:
The frv target calls get_target_memory_unsigned to read the function
descriptor. The address being read is the non-relocated address read
from the dynamic linker in solib-srv4.c:enable_break. Calling
get_target_memory_unsigned eventually ends up in target_xfer_partial
with an object type of TARGET_OBJECT_RAW_MEMORY. This will then call
memory_xfer_check_region. I believe that it is quite possible that a
the non-relocated addresses pulled from the dynamic linker could be in
a memory region that is not readable, while the relocated addresses
are in a readable memory region. If this was ever the case for the
frv target then GDB would reject the attempt to read the non-relocated
function pointer.
In contrast the ppc64 target calls target_section_by_addr, which calls
target_get_section_table, which then calls the ::get_section_table
function on the target.
Thus, when reflecting on target_bfd we see two functions,
::xfer_partial and ::get_section_table. The former is required by the
frv target, but that target is (I think) potentially broken. While
the latter is required by the ppc64 target, but this forces
::get_section_table to exist as a target_ops member function.
So my original plan, have target_get_section_table NOT call a
target_ops member function appears to be flawed.
My next idea was to remove exec_target::get_section_table, and instead
move the implementation into dummy_target::get_section_table.
Currently the dummy_target implementation always returns NULL
indicating no section table, but plenty of other dummy_target member
functions do more than just return null values.
So now, dummy_target::get_section_table returns the section table from
the current program space. This allows target_bfd to remain
unchanged, so ppc64 and frv should not be affected.
Making this change removes the requirement for the user to provide an
executable, GDB can now always access the section_table, as the
dummy_target always exists in the target stack.
Finally, there's a test that the target_section table is not empty in
the case where the user does add-symbol-file without providing an
executable.
gdb/ChangeLog:
* exec.c (exec_target::get_section_table): Delete member function.
(section_table_read_available_memory): Use current_top_target, not
just the exec_ops target.
* target-delegates.c: Regenerate.
* target.c (default_get_section_table): New function.
* target.h (target_ops::get_section_table): Change default
behaviour to call default_get_section_table.
(default_get_section_table): Declare.
2021-02-12 19:39:31 +08:00
|
|
|
|
2021-02-24 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* exec.c (exec_target::get_section_table): Delete member function.
|
|
|
|
|
(section_table_read_available_memory): Use current_top_target, not
|
|
|
|
|
just the exec_ops target.
|
|
|
|
|
* target-delegates.c: Regenerate.
|
|
|
|
|
* target.c (default_get_section_table): New function.
|
|
|
|
|
* target.h (target_ops::get_section_table): Change default
|
|
|
|
|
behaviour to call default_get_section_table.
|
|
|
|
|
(default_get_section_table): Declare.
|
|
|
|
|
|
2021-02-12 20:06:15 +08:00
|
|
|
|
2021-02-24 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* exec.c (exec_target::close): Call new clear_target_sections
|
|
|
|
|
function.
|
|
|
|
|
(program_space::add_target_sections): Update name of member
|
|
|
|
|
variable.
|
|
|
|
|
(program_space::add_target_sections): Update name of member
|
|
|
|
|
variable.
|
|
|
|
|
(program_space::remove_target_sections): Likewise.
|
|
|
|
|
(exec_one_fork): Use new target_sections member function.
|
|
|
|
|
(exec_target::get_section_table): Likewise.
|
|
|
|
|
(exec_target::files_info): Likewise.
|
|
|
|
|
(set_section_command): Likewise.
|
|
|
|
|
(exec_set_section_address): Likewise.
|
|
|
|
|
(exec_target::has_memory): Use new target_sections member
|
|
|
|
|
function.
|
|
|
|
|
* progspace.h (program_space::clear_target_sections): New member
|
|
|
|
|
function.
|
|
|
|
|
(program_space::target_sections): Rename member variable to
|
|
|
|
|
m_target_sections, replace with a new member function.
|
|
|
|
|
(program_space::m_target_sections): New member variable.
|
|
|
|
|
* solib-dsbt.c (scan_dyntag): Use new member function.
|
|
|
|
|
* solib-svr4.c (scan_dyntag): Likewise.
|
|
|
|
|
|
2021-02-12 19:39:23 +08:00
|
|
|
|
2021-02-24 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdb/bfd-target.c (class target_bfd) <get_section_table>: Make
|
|
|
|
|
return type const.
|
|
|
|
|
* gdb/exec.c (struct exec_target) <get_section_table>: Likewise.
|
|
|
|
|
(section_table_read_available_memory): Make local const.
|
|
|
|
|
(exec_target::xfer_partial): Make local const.
|
|
|
|
|
(print_section_info): Make parameter const.
|
|
|
|
|
* gdb/exec.h (print_section_info): Likewise.
|
|
|
|
|
* gdb/ppc64-tdep.c (ppc64_convert_from_func_ptr_addr): Make local
|
|
|
|
|
const.
|
|
|
|
|
* gdb/record-btrace.c (record_btrace_target::xfer_partial):
|
|
|
|
|
Likewise.
|
|
|
|
|
* gdb/remote.c (remote_target::remote_xfer_live_readonly_partial):
|
|
|
|
|
Likewise.
|
|
|
|
|
* gdb/s390-tdep.c (s390_load): Likewise.
|
|
|
|
|
* gdb/solib-dsbt.c (scan_dyntag): Likewise.
|
|
|
|
|
* gdb/solib-svr4.c (scan_dyntag): Likewise.
|
|
|
|
|
* gdb/target-debug.h (target_debug_print_target_section_table_p):
|
|
|
|
|
Rename to...
|
|
|
|
|
(target_debug_print_const_target_section_table_p): ...this.
|
|
|
|
|
* gdb/target-delegates.c: Regenerate.
|
|
|
|
|
* gdb/target.c (target_get_section_table): Make return type const.
|
|
|
|
|
(target_section_by_addr): Likewise. Also make some locals const.
|
|
|
|
|
(memory_xfer_partial_1): Make some locals const.
|
|
|
|
|
* gdb/target.h (struct target_ops) <get_section_table>: Make
|
|
|
|
|
return type const.
|
|
|
|
|
(target_section_by_addr): Likewise.
|
|
|
|
|
(target_get_section_table): Likewise.
|
|
|
|
|
|
2021-02-13 00:10:56 +08:00
|
|
|
|
2021-02-24 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention new 'maint info target-sections' command.
|
|
|
|
|
* maint.c (maintenance_info_target_sections): New function.
|
|
|
|
|
(_initialize_maint_cmds): Register new command.
|
|
|
|
|
|
2021-02-05 02:34:13 +08:00
|
|
|
|
2021-02-24 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* riscv-tdep.c (riscv_features_from_gdbarch_info): Rename to...
|
|
|
|
|
(riscv_features_from_bfd): ...this. Change parameter type to
|
|
|
|
|
'bfd*', and update as required.
|
|
|
|
|
(riscv_find_default_target_description): Update call to
|
|
|
|
|
riscv_features_from_bfd. Select a default xlen based on
|
|
|
|
|
info.bfd_arch_info.
|
|
|
|
|
(riscv_gdbarch_init): Update call to riscv_features_from_bfd.
|
|
|
|
|
|
gdb: call value_ind for pointers to dynamic types in UNOP_IND evaluation
When evaluating and expression containing UNOP_IND in mode
EVAL_AVOID_SIDE_EFFECTS, GDB currently (mostly) returns the result of
a call to value_zero meaning we get back an object with the correct
type, but its contents are all zero.
If the target type contains fields with dynamic type then in order to
resolve these dynamic fields GDB will need to read the value of the
field from within the parent object. In this case the field value
will be zero as a result of the call to value_zero mentioned above.
The idea behind EVAL_AVOID_SIDE_EFFECTS is to avoid the chance that
doing something like `ptype` will modify state within the target, for
example consider: ptype i++.
However, there is already precedence within GDB that sometimes, in
order to get accurate type results, we can't avoid reading from the
target, even when EVAL_AVOID_SIDE_EFFECTS is in effect. For example I
would point to eval.c:evaluate_var_value, the handling of OP_REGISTER,
the handling of value_x_unop in many places. I believe the Ada
expression evaluator also ignore EVAL_AVOID_SIDE_EFFECTS in some
cases.
I am therefor proposing that, in the case where a pointer points at a
dynamic type, we allow UNOP_IND to perform the actual indirection.
This allows accurate types to be displayed in more cases.
gdb/ChangeLog:
* eval.c (evaluate_subexp_standard): Call value_ind for points to
dynamic types in UNOP_IND.
gdb/testsuite/ChangeLog:
* gdb.fortran/pointer-to-pointer.exp: Additional tests.
2021-01-08 22:00:45 +08:00
|
|
|
|
2021-02-24 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* eval.c (evaluate_subexp_standard): Call value_ind for points to
|
|
|
|
|
dynamic types in UNOP_IND.
|
|
|
|
|
|
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-24 02:37:44 +08:00
|
|
|
|
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.
|
|
|
|
|
|
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-24 01:07:10 +08:00
|
|
|
|
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-23 23:56:41 +08:00
|
|
|
|
2021-02-23 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (linux_nat_filter_event): Return void.
|
|
|
|
|
|
2021-02-23 00:47:37 +08:00
|
|
|
|
2021-02-22 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* solib-svr4.c (enable_break): Update.
|
|
|
|
|
* bfd-target.c (class target_bfd) <target_bfd>: Change parameter
|
|
|
|
|
type.
|
|
|
|
|
(target_bfd_reopen): Change parameter type.
|
|
|
|
|
* bfd-target.h (target_bfd_reopen): Change parameter type.
|
|
|
|
|
|
2021-02-23 00:42:03 +08:00
|
|
|
|
2021-02-22 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* thread.c (add_thread_silent): Add assert.
|
|
|
|
|
(find_thread_ptid): Add assert.
|
|
|
|
|
|
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-23 00:41:32 +08:00
|
|
|
|
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-19 13:46:58 +08:00
|
|
|
|
2021-02-19 Kevin Buettner <kevinb@redhat.com>
|
|
|
|
|
|
|
|
|
|
* nat/amd64-linux-siginfo.c: Include "gdbsupport/common-defs.h"
|
|
|
|
|
(which in turn includes <gnulib/config.h>) before include
|
|
|
|
|
of <signal.h>.
|
|
|
|
|
|
2021-01-26 18:02:38 +08:00
|
|
|
|
2021-02-19 Nelson Chu <nelson.chu@sifive.com>
|
|
|
|
|
|
|
|
|
|
PR 27158
|
|
|
|
|
* riscv-tdep.c (decode_ci_type_insn): Updated encoding macros.
|
|
|
|
|
(decode_j_type_insn): Likewise.
|
|
|
|
|
(decode_cj_type_insn): Likewise.
|
|
|
|
|
(decode_b_type_insn): Likewise.
|
|
|
|
|
(decode): Likewise.
|
|
|
|
|
|
2021-02-19 02:23:33 +08:00
|
|
|
|
2021-02-18 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* expression.h (struct expression) <evaluate>: Declare method.
|
|
|
|
|
* eval.c (evaluate_subexp): Simplify.
|
|
|
|
|
(expression::evaluate): New method.
|
|
|
|
|
(evaluate_expression, evaluate_type): Use expression::evaluate.
|
|
|
|
|
|
Fix completion related libstdc++ assert when using -D_GLIBCXX_DEBUG
This commit fixes a libstdc++ assertion failure encountered when
running gdb.base/completion.exp. In order to see this problem,
GDB must be built with the follow CFLAGS and CXXFLAGS as part
of the configure line:
CFLAGS='-D_GLIBCXX_DEBUG' CXXFLAGS='-D_GLIBCXX_DEBUG'
(Also, this problem was encountered using Fedora rawhide. It might
not be reproducible in Fedora versions prior to Fedora 34.)
Using the gdb.base/completion.exp test program, the problem can be
observed as follows:
[kev@rawhide-1 gdb]$ ./gdb -q testsuite/outputs/gdb.base/completion/completion
Reading symbols from testsuite/outputs/gdb.base/completion/completion...
(gdb) start
Temporary breakpoint 1 at 0x401179: file ../../worktree-master/gdb/testsuite/gdb.base/break.c, line 43.
Starting program: testsuite/outputs/gdb.base/completion/completion
Temporary breakpoint 1, main (argc=1, argv=0x7fffffffd718, envp=0x7fffffffd728) at ../../worktree-master/gdb/testsuite/gdb.base/break.c:43
43 if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
(gdb) p <TAB>/usr/include/c++/11/string_view:211: constexpr const value_type& std::basic_string_view<_CharT, _Traits>::operator[](std::basic_string_view<_CharT, _Traits>::size_type) const [with _CharT = char; _Traits = std::char_traits<char>; std::basic_string_view<_CharT, _Traits>::const_reference = const char&; std::basic_string_view<_CharT, _Traits>::size_type = long unsigned int]: Assertion '__pos < this->_M_len' failed.
Aborted (core dumped)
(Note that I added "<TAB>" to make it clear where the tab key was
pressed.)
gdb/ChangeLog:
* ada-lang.c (ada_fold_name): Check for non-empty string prior
to accessing it.
(ada_lookup_name_info): Likewise.
2021-02-13 08:53:51 +08:00
|
|
|
|
2021-02-17 Kevin Buettner <kevinb@redhat.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_fold_name): Check for non-empty string prior
|
|
|
|
|
to accessing it.
|
|
|
|
|
(ada_lookup_name_info): Likewise.
|
|
|
|
|
|
2021-02-07 08:24:29 +08:00
|
|
|
|
2021-02-13 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* aclocal.m4: Regenerate.
|
|
|
|
|
|
[gdb/threads] Fix lin_thread_get_thread_signals for glibc 2.28
When running test-case gdb.threads/create-fail.exp on openSUSE Factory
(with glibc version 2.32) I run into:
...
(gdb) continue
Continuing.
[New Thread 0x7ffff7c83700 (LWP 626354)]
[New Thread 0x7ffff7482700 (LWP 626355)]
[Thread 0x7ffff7c83700 (LWP 626354) exited]
[New Thread 0x7ffff6c81700 (LWP 626356)]
[Thread 0x7ffff7482700 (LWP 626355) exited]
[New Thread 0x7ffff6480700 (LWP 626357)]
[Thread 0x7ffff6c81700 (LWP 626356) exited]
[New Thread 0x7ffff5c7f700 (LWP 626358)]
[Thread 0x7ffff6480700 (LWP 626357) exited]
pthread_create: 22: Invalid argument
Thread 6 "create-fail" received signal SIG32, Real-time event 32.
[Switching to Thread 0x7ffff5c7f700 (LWP 626358)]
0x00007ffff7d87695 in clone () from /lib64/libc.so.6
(gdb) FAIL: gdb.threads/create-fail.exp: iteration 1: run till end
...
The problem is that glibc-internal signal SIGCANCEL is not recognized by gdb.
There's code in check_thread_signals that is supposed to take care of that,
but it's not working because this code in lin_thread_get_thread_signals has
stopped working:
...
/* NPTL reserves the first two RT signals, but does not provide any
way for the debugger to query the signal numbers - fortunately
they don't change. */
sigaddset (set, __SIGRTMIN);
sigaddset (set, __SIGRTMIN + 1);
...
Since glibc commit d2dc5467c6 "Filter out NPTL internal signals (BZ #22391)"
(first released as part of glibc 2.28), a sigaddset with a glibc-internal
signal has no other effect than setting errno to EINVALID.
Fix this by eliminating the usage of sigset_t in check_thread_signals and
lin_thread_get_thread_signals.
The same problem was observed on Ubuntu 20.04.
Tested on x86_64-linux, openSUSE Factory.
Tested on aarch64-linux, Ubuntu 20.04 and Ubuntu 18.04.
gdb/ChangeLog:
2021-02-12 Tom de Vries <tdevries@suse.de>
PR threads/26228
* linux-nat.c (lin_thread_get_thread_signals): Remove.
(lin_thread_signals): New static var.
(lin_thread_get_thread_signal_num, lin_thread_get_thread_signal):
New function.
* linux-nat.h (lin_thread_get_thread_signals): Remove.
(lin_thread_get_thread_signal_num, lin_thread_get_thread_signal):
Declare.
* linux-thread-db.c (check_thread_signals): Use
lin_thread_get_thread_signal_num and lin_thread_get_thread_signal.
2021-02-13 03:12:37 +08:00
|
|
|
|
2021-02-12 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR threads/26228
|
|
|
|
|
* linux-nat.c (lin_thread_get_thread_signals): Remove.
|
|
|
|
|
(lin_thread_signals): New static var.
|
|
|
|
|
(lin_thread_get_thread_signal_num, lin_thread_get_thread_signal):
|
|
|
|
|
New function.
|
|
|
|
|
* linux-nat.h (lin_thread_get_thread_signals): Remove.
|
|
|
|
|
(lin_thread_get_thread_signal_num, lin_thread_get_thread_signal):
|
|
|
|
|
Declare.
|
|
|
|
|
* linux-thread-db.c (check_thread_signals): Use
|
|
|
|
|
lin_thread_get_thread_signal_num and lin_thread_get_thread_signal.
|
|
|
|
|
|
2021-02-11 21:34:06 +08:00
|
|
|
|
2021-02-12 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* f-exp.y (f77_keywords): Add allocated.
|
|
|
|
|
* f-lang.c (evaluate_subexp_f): Handle UNOP_FORTRAN_ALLOCATED.
|
|
|
|
|
(operator_length_f): Likewise.
|
|
|
|
|
(print_subexp_f): Likewise.
|
|
|
|
|
(dump_subexp_body_f): Likewise.
|
|
|
|
|
(operator_check_f): Likewise.
|
|
|
|
|
* std-operator.def (UNOP_FORTRAN_ALLOCATED): New operator.
|
|
|
|
|
|
2021-02-12 04:03:03 +08:00
|
|
|
|
2021-02-11 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR symtab/27353
|
|
|
|
|
* dwarf2/attribute.c (attribute::form_requires_reprocessing):
|
|
|
|
|
Return true for DW_FORM_strx.
|
|
|
|
|
|
2021-02-11 23:27:46 +08:00
|
|
|
|
2021-02-11 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/27383:
|
|
|
|
|
* parse.c (write_exp_symbol_reference): Write sym.block.
|
|
|
|
|
|
gdb: change 'maint info section' to use command options
The 'maintenance info sections' command currently takes a list of
filters on the command line. It can also accept the magic string
'ALLOBJ' which acts more like a command line flag, telling the command
to print information about all objfiles.
The manual has this to say about the options and filters:
... In addition, 'maint info sections' provides the following
command options (which may be arbitrarily combined): ...
Implying (to me at least) that I can do this:
(gdb) maint info sections ALLOBJ READONLY
to list all the read-only sections from all currently loaded object
files.
Unfortunately, this doesn't work. The READONLY filter will work, but
ALLOBJ will not be detected correctly.
It would be fairly simple to fix the ALLOBJ detection. However, I
dislike this mixing of command options (ALLOBJ) with command data (the
filters, e.g. READONLY, etc).
As this is a maintenance command, so not really intended for end
users, I think we can be a little more aggressive in "fixing" the
option parsing. So that's what I do in this commit.
The ALLOBJ mechanism is replaced with a real command
option (-all-objects). The rest of the command operates just as
before. The example above would now become:
(gdb) maint info sections -all-objects READONLY
The manual has been updated, and I added a NEWS entry to document the
change.
gdb/ChangeLog:
* NEWS: Mention changes to 'maint info sections'.
* maint.c (match_substring): Return a bool, fix whitespace issue.
(struct single_bfd_flag_info): New struct.
(bfd_flag_info): New static global.
(match_bfd_flags): Return a bool, use bfd_flag_info.
(print_bfd_flags): Use bfd_flag_info.
(maint_print_section_info): Delete trailing whitespace.
(struct maint_info_sections_opts): New struct.
(maint_info_sections_option_defs): New static global.
(maint_info_sections_completer): New function.
(maintenance_info_sections): Use option parsing mechanism.
(_initialize_maint_cmds): Register command completer.
gdb/doc/ChangeLog:
* gdb.texinfo (Files): Update documentation for 'maint info
sections'.
gdb/testsuite/ChangeLog:
* gdb.base/maint-info-sections.exp: Update expected output, and
add additional tests. Again.
2021-02-05 21:51:34 +08:00
|
|
|
|
2021-02-11 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* NEWS: Mention changes to 'maint info sections'.
|
|
|
|
|
* maint.c (match_substring): Return a bool, fix whitespace issue.
|
|
|
|
|
(struct single_bfd_flag_info): New struct.
|
|
|
|
|
(bfd_flag_info): New static global.
|
|
|
|
|
(match_bfd_flags): Return a bool, use bfd_flag_info.
|
|
|
|
|
(print_bfd_flags): Use bfd_flag_info.
|
|
|
|
|
(maint_print_section_info): Delete trailing whitespace.
|
|
|
|
|
(struct maint_info_sections_opts): New struct.
|
|
|
|
|
(maint_info_sections_option_defs): New static global.
|
|
|
|
|
(maint_info_sections_completer): New function.
|
|
|
|
|
(maintenance_info_sections): Use option parsing mechanism.
|
|
|
|
|
(_initialize_maint_cmds): Update command help text for 'maint info
|
|
|
|
|
sections' and register a command completer.
|
|
|
|
|
|
gdb: 'maint info sections' - handle the no executable case
The 'maint info sections' command is split into two blocks or work,
first if there's an executable then the sections from the executable,
and optionally all other loaded object files are printed. Then all
the sections from any core file are printed.
I ran into a situation where (for various reasons) I wasn't using a
main executable. Instead I connected to a remote target and used
add-symbol-file. This allowed me to debug an image that was already
loaded on the remote system.
Unfortunately, when I tried to use 'maint info sections' I saw
nothing. The reason is that the loop over all object files is hidden
behind a check that we have a main executable.
This commit removes this check and merges together some duplicate
code. I also (I think) made the output of this command cleaner.
Here is the original output of 'maint info sections':
Exec file:
`/tmp/hello.x', file type elf64-x86-64.
[0] 0x004002a8->0x004002c4 at 0x000002a8: .interp ALLOC LOAD READONLY DATA HAS_CONTENTS
[1] 0x004002c4->0x004002e8 at 0x000002c4: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS
...
And my modified output:
Exec file: `/home/andrew/tmp/hello.x', file type elf64-x86-64.
[0] 0x004002a8->0x004002c4 at 0x000002a8: .interp ALLOC LOAD READONLY DATA HAS_CONTENTS
[1] 0x004002c4->0x004002e8 at 0x000002c4: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS
...
The forced newline after 'Exec file: ' has been removed. This is now
a wrap point (in case the filename is very long).
Here is the original output of 'maint info sections ALLOBJ':
Exec file:
`/tmp/hello.x', file type elf64-x86-64.
Object file: /tmp/hello.x
[0] 0x004002a8->0x004002c4 at 0x000002a8: .interp ALLOC LOAD READONLY DATA HAS_CONTENTS
[1] 0x004002c4->0x004002e8 at 0x000002c4: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS
...
Object file: /lib64/ld-linux-x86-64.so.2
[0] 0x7ffff7fd12a8->0x7ffff7fd12c8 at 0x000002a8: .note.gnu.property ALLOC LOAD READONLY DATA HAS_CONTENTS
[1] 0x7ffff7fd12c8->0x7ffff7fd12ec at 0x000002c8: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS
...
And my modified output:
Exec file: `/tmp/hello.x', file type elf64-x86-64.
[0] 0x004002a8->0x004002c4 at 0x000002a8: .interp ALLOC LOAD READONLY DATA HAS_CONTENTS
[1] 0x004002c4->0x004002e8 at 0x000002c4: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS
...
Object file: `/lib64/ld-linux-x86-64.so.2', file type elf64-x86-64.
[0] 0x7ffff7fd12a8->0x7ffff7fd12c8 at 0x000002a8: .note.gnu.property ALLOC LOAD READONLY DATA HAS_CONTENTS
[1] 0x7ffff7fd12c8->0x7ffff7fd12ec at 0x000002c8: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS
...
The executable now only gets a single header line. The header line
for the additional object files is no longer indented as it was
before, and the line is laid out in a similar style to the main
executable line (with quotes and file type information).
And of course, the biggest change. If GDB is started with no
executable, but then the user does 'add-symbol-file ....' followed by
'maint info sections ALLOBJ', previously they got nothing, now they
get:
Object file: `/tmp/hello.x', file type elf64-x86-64.
[0] 0x004002a8->0x004002c4 at 0x000002a8: .interp ALLOC LOAD READONLY DATA HAS_CONTENTS
[1] 0x004002c4->0x004002e8 at 0x000002c4: .note.gnu.build-id ALLOC LOAD READONLY DATA HAS_CONTENTS
...
gdb/ChangeLog:
* maint.c (print_bfd_section_info_maybe_relocated): Delete,
functionality merged into...
(maint_print_all_sections): ...this new function.
(maintenance_info_sections): Make use of maint_print_all_sections,
allow all objects to be printed even where there's no executable.
gdb/testsuite/ChangeLog:
* gdb.base/maint-info-sections.exp: Update expected output, and
add additional tests.
2021-02-05 19:16:31 +08:00
|
|
|
|
2021-02-11 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* maint.c (print_bfd_section_info_maybe_relocated): Delete,
|
|
|
|
|
functionality merged into...
|
|
|
|
|
(maint_print_all_sections): ...this new function.
|
|
|
|
|
(maintenance_info_sections): Make use of maint_print_all_sections,
|
|
|
|
|
allow all objects to be printed even where there's no executable.
|
|
|
|
|
|
2021-02-10 23:07:04 +08:00
|
|
|
|
2021-02-11 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (resolve_sal_pc): Make use of
|
|
|
|
|
bound_minimal_symbol::obj_section.
|
|
|
|
|
* maint.c (maintenance_translate_address): Likewise.
|
|
|
|
|
* minsyms.c (minimal_symbol_upper_bound): Likewise.
|
|
|
|
|
* minsyms.h (struct bound_minimal_symbol) <obj_section>: New
|
|
|
|
|
member function.
|
|
|
|
|
* printcmd.c (info_address_command): Make use of
|
|
|
|
|
bound_minimal_symbol::obj_section.
|
|
|
|
|
|
2021-02-10 10:08:47 +08:00
|
|
|
|
2021-02-11 Alan Modra <amodra@gmail.com>
|
|
|
|
|
|
|
|
|
|
* arm-symbian-tdep.c: Delete.
|
|
|
|
|
* NEWS: Mention arm-symbian removal.
|
|
|
|
|
* Makefile.in: Remove arm-symbian-tdep entries.
|
|
|
|
|
* configure.tgt: Remove arm*-*-symbianelf*.
|
|
|
|
|
* doc/gdb.texinfo: Remove mention of SymbianOS.
|
|
|
|
|
* osabi.c (gdb_osabi_names): Remove "Symbian".
|
|
|
|
|
* osabi.h (enum gdb_osabi): Remove GDB_OSABI_SYMBIAN.
|
|
|
|
|
* testsuite/gdb.base/ending-run.exp: Remove E32Main handling.
|
|
|
|
|
* testsuite/gdb.ada/catch_ex_std.exp: Remove arm*-*-symbianelf*
|
|
|
|
|
handling.
|
|
|
|
|
* testsuite/gdb.base/dup-sect.exp: Likewise.
|
|
|
|
|
* testsuite/gdb.base/long_long.exp: Likewise.
|
|
|
|
|
* testsuite/gdb.base/solib-weak.exp: Likewise.
|
|
|
|
|
* testsuite/gdb.guile/scm-section-script.exp: Likewise.
|
|
|
|
|
* testsuite/gdb.python/py-section-script.exp: Likewise.
|
|
|
|
|
* testsuite/lib/dwarf.exp: Likewise.
|
|
|
|
|
* testsuite/lib/gdb.exp: Likewise.
|
|
|
|
|
|
2021-02-09 23:46:13 +08:00
|
|
|
|
2021-02-10 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* f-exp.y (UNOP_OR_BINOP_INTRINSIC): New token.
|
|
|
|
|
(exp): New pattern using UNOP_OR_BINOP_INTRINSIC.
|
|
|
|
|
(one_or_two_args): New pattern.
|
|
|
|
|
(f77_keywords): Add lbound and ubound.
|
|
|
|
|
* f-lang.c (fortran_bounds_all_dims): New function.
|
|
|
|
|
(fortran_bounds_for_dimension): New function.
|
|
|
|
|
(evaluate_subexp_f): Handle FORTRAN_LBOUND and FORTRAN_UBOUND.
|
|
|
|
|
(operator_length_f): Likewise.
|
|
|
|
|
(print_subexp_f): Likewise.
|
|
|
|
|
(dump_subexp_body_f): Likewise.
|
|
|
|
|
(operator_check_f): Likewise.
|
|
|
|
|
* std-operator.def (FORTRAN_LBOUND): Define.
|
|
|
|
|
(FORTRAN_UBOUND): Define.
|
|
|
|
|
|
2021-02-08 05:15:12 +08:00
|
|
|
|
2021-02-10 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* coff-pe-read.c (add_pe_forwarded_sym): Make use of section_index
|
|
|
|
|
and set_section_index member functions where appropriate.
|
|
|
|
|
* coffread.c (coff_symtab_read): Likewise.
|
|
|
|
|
(process_coff_symbol): Likewise.
|
|
|
|
|
* ctfread.c (set_symbol_address): Likewise.
|
|
|
|
|
* dwarf2/read.c (add_partial_symbol): Likewise.
|
|
|
|
|
(var_decode_location): Likewise.
|
|
|
|
|
* language.c: Likewise.
|
|
|
|
|
* minsyms.c (minimal_symbol_reader::record_full): Likewise.
|
|
|
|
|
(compact_minimal_symbols): Likewise.
|
|
|
|
|
(minimal_symbol_upper_bound): Likewise.
|
|
|
|
|
* objfiles.c (relocate_one_symbol): Likewise.
|
|
|
|
|
* psympriv.h (partial_symbol::obj_section): Likewise.
|
|
|
|
|
(partial_symbol::address): Likewise.
|
|
|
|
|
* psymtab.c (partial_symtab::add_psymbol): Likewise.
|
|
|
|
|
* stabsread.c (scan_file_globals): Likewise.
|
|
|
|
|
* symmisc.c (dump_msymbols): Likewise.
|
|
|
|
|
* symtab.c (general_symbol_info::obj_section): Likewise.
|
|
|
|
|
(fixup_section): Likewise.
|
|
|
|
|
(get_msymbol_address): Likewise.
|
|
|
|
|
* symtab.h (general_symbol_info::section): Rename to...
|
|
|
|
|
(general_symbol_info::m_section): ...this.
|
|
|
|
|
(general_symbol_info::set_section_index): New member function.
|
|
|
|
|
(general_symbol_info::section_index): Likewise.
|
|
|
|
|
(SYMBOL_SECTION): Delete.
|
|
|
|
|
(MSYMBOL_VALUE_ADDRESS): Make use of section_index and
|
|
|
|
|
set_section_index member functions where appropriate.
|
|
|
|
|
(MSYMBOL_SECTION): Delete.
|
|
|
|
|
(symbol::symbol): Update to initialize 'm_section'.
|
|
|
|
|
* xcoffread.c (read_xcoff_symtab): Make use of set_section_index.
|
|
|
|
|
(process_xcoff_symbol): Likewise.
|
|
|
|
|
|
2021-02-06 06:01:48 +08:00
|
|
|
|
2021-02-10 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* breakpoint.c (resolve_sal_pc): Replace SYMBOL_OBJ_SECTION and
|
|
|
|
|
MSYMBOL_OBJ_SECTION.
|
|
|
|
|
* findvar.c (language_defn::read_var_value): Likewise.
|
|
|
|
|
* infcmd.c (jump_command): Likewise.
|
|
|
|
|
* linespec.c (minsym_found): Likewise.
|
|
|
|
|
* maint.c (maintenance_translate_address): Likewise.
|
|
|
|
|
* minsyms.c (lookup_minimal_symbol_by_pc_section): Likewise.
|
|
|
|
|
(minimal_symbol_upper_bound): Likewise.
|
|
|
|
|
* parse.c (find_minsym_type_and_address): Likewise.
|
|
|
|
|
(operator_check_standard): Likewise.
|
|
|
|
|
* printcmd.c (info_address_command): Likewise.
|
|
|
|
|
* symmisc.c (dump_msymbols): Likewise.
|
|
|
|
|
(print_symbol): Likewise.
|
|
|
|
|
* symtab.c (general_symbol_info::obj_section): Define new
|
|
|
|
|
function.
|
|
|
|
|
(fixup_symbol_section): Replace SYMBOL_OBJ_SECTION.
|
|
|
|
|
(find_pc_sect_compunit_symtab): Likewise.
|
|
|
|
|
(find_function_start_sal): Likewise.
|
|
|
|
|
(skip_prologue_sal): Replace SYMBOL_OBJ_SECTION and
|
|
|
|
|
MSYMBOL_OBJ_SECTION.
|
|
|
|
|
* symtab.h (struct general_symbol_info) <obj_section>: Declare new
|
|
|
|
|
function.
|
|
|
|
|
(SYMBOL_OBJ_SECTION): Delete.
|
|
|
|
|
(MSYMBOL_OBJ_SECTION): Delete.
|
|
|
|
|
|
2021-02-10 08:35:59 +08:00
|
|
|
|
2021-02-09 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* stap-probe.c (stap_parse_argument_conditionally): Fix typo.
|
|
|
|
|
|
2021-02-10 06:28:16 +08:00
|
|
|
|
2021-02-09 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-02-10 05:41:30 +08:00
|
|
|
|
2021-02-09 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gcore.c (struct gcore_collect_regset_section_cb_data): Delete.
|
|
|
|
|
(gcore_collect_regset_section_cb): Delete.
|
|
|
|
|
(gcore_collect_thread_registers): Delete.
|
|
|
|
|
(gcore_build_thread_register_notes): Delete.
|
|
|
|
|
(gcore_find_signalled_thread): Delete.
|
|
|
|
|
* gcore.h: Remove 'gdbsupport/gdb_signals.h' include and delete
|
|
|
|
|
'gdbarch' and 'thread_info' declarations.
|
|
|
|
|
(gcore_build_thread_register_notes): Delete declaration.
|
|
|
|
|
(gcore_find_signalled_thread): Likewise.
|
|
|
|
|
* fbsd-tdep.c: Remove 'gcore.h' include.
|
|
|
|
|
(struct fbsd_collect_regset_section_cb_data): New struct.
|
|
|
|
|
(fbsd_collect_regset_section_cb): New function.
|
|
|
|
|
(fbsd_collect_thread_registers): New function.
|
|
|
|
|
(struct fbsd_corefile_thread_data): New struct.
|
|
|
|
|
(fbsd_corefile_thread): New function.
|
|
|
|
|
(fbsd_make_corefile_notes): Call FreeBSD specific code.
|
|
|
|
|
* linux-tdep.c: Remove 'gcore.h' include.
|
|
|
|
|
(struct linux_collect_regset_section_cb_data): New struct.
|
|
|
|
|
(linux_collect_regset_section_cb): New function.
|
|
|
|
|
(linux_collect_thread_registers): New function.
|
|
|
|
|
(linux_corefile_thread): Call Linux specific code.
|
|
|
|
|
(find_signalled_thread): New function.
|
|
|
|
|
(linux_make_corefile_notes): Call find_signalled_thread.
|
|
|
|
|
|
Avoid crash from coerce_unspec_val_to_type
With a certain Ada program, ada-lang.c:coerce_unspec_val_to_type can
cause a crash. This function may copy a value, and in the particular
case in the crash, the new value's type is smaller than the original
type. This causes coerce_unspec_val_to_type to create a lazy value --
but the original value is also not_lval, so later, when the value is
un-lazied, gdb asserts.
As with the previous patch, we believe there is a compiler bug here,
but it is difficult to reproduce, so we're not completely certain.
In the particular case we saw, the original value has record type, and
the record holds some variable-length arrays. This leads to the
type's length being 0. At the same time, the value is optimized out.
This patch changes coerce_unspec_val_to_type to handle an
optimized-out value correctly.
It also slightly restructures this code to avoid a crash should a
not_lval value wind up here. This is a purely defensive change.
This change also made it clear that value_contents_copy_raw can now be
made static, so that is also done.
gdb/ChangeLog
2021-02-09 Tom Tromey <tromey@adacore.com>
* ada-lang.c (coerce_unspec_val_to_type): Avoid making lazy
not_lval value.
* value.c (value_contents_copy_raw): Now static.
* value.h (value_contents_copy_raw): Don't declare.
2021-02-10 03:15:39 +08:00
|
|
|
|
2021-02-09 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (coerce_unspec_val_to_type): Avoid making lazy
|
|
|
|
|
not_lval value.
|
|
|
|
|
* value.c (value_contents_copy_raw): Now static.
|
|
|
|
|
* value.h (value_contents_copy_raw): Don't declare.
|
|
|
|
|
|
2021-02-10 03:15:39 +08:00
|
|
|
|
2021-02-09 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.c (resolve_dynamic_struct): Handle structure with no
|
|
|
|
|
fields.
|
|
|
|
|
|
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().
2019-11-01 00:33:08 +08:00
|
|
|
|
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().
|
|
|
|
|
|
gdb: return true in TuiWindow.is_valid only if TUI is enabled
If the user implements a TUI window in Python, and this window
responds to GDB events and then redraws its window contents then there
is currently an edge case which can lead to problems.
The Python API documentation suggests that calling methods like erase
or write on a TUI window (from Python code) will raise an exception if
the window is not valid.
And the description for is_valid says:
This method returns True when this window is valid. When the user
changes the TUI layout, windows no longer visible in the new layout
will be destroyed. At this point, the gdb.TuiWindow will no longer
be valid, and methods (and attributes) other than is_valid will
throw an exception.
From this I, as a user, would expect that if I did 'tui disable' to
switch back to CLI mode, then the window would no longer be valid.
However, this is not the case.
When the TUI is disabled the windows in the TUI are not deleted, they
are simply hidden. As such, currently, the is_valid method continues
to return true.
This means that if the users Python code does something like:
def event_handler (e):
global tui_window_object
if tui_window_object->is_valid ():
tui_window_object->erase ()
tui_window_object->write ("Hello World")
gdb.events.stop.connect (event_handler)
Then when a stop event arrives GDB will try to draw the TUI window,
even when the TUI is disabled.
This exposes two bugs. First, is_valid should be returning false in
this case, second, if the user forgot to add the is_valid call, then I
believe the erase and write calls should be throwing an
exception (when the TUI is disabled).
The solution to both of these issues is I think bound together, as it
depends on having a working 'is_valid' check.
There's a rogue assert added into tui-layout.c as part of this
commit. While working on this commit I managed to break GDB such that
TUI_CMD_WIN was nullptr, this was causing GDB to abort. I'm leaving
the assert in as it might help people catch issues in the future.
This patch is inspired by the work done here:
https://sourceware.org/pipermail/gdb-patches/2020-December/174338.html
gdb/ChangeLog:
* python/py-tui.c (gdbpy_tui_window) <is_valid>: New member
function.
(REQUIRE_WINDOW): Call is_valid member function.
(REQUIRE_WINDOW_FOR_SETTER): New define.
(gdbpy_tui_is_valid): Call is_valid member function.
(gdbpy_tui_set_title): Call REQUIRE_WINDOW_FOR_SETTER instead.
* tui/tui-data.h (struct tui_win_info) <is_visible>: Check
tui_active too.
* tui/tui-layout.c (tui_apply_current_layout): Add an assert.
* tui/tui.c (tui_enable): Move setting of tui_active earlier in
the function.
gdb/doc/ChangeLog:
* python.texinfo (TUI Windows In Python): Extend description of
TuiWindow.is_valid.
gdb/testsuite/ChangeLog:
* gdb.python/tui-window-disabled.c: New file.
* gdb.python/tui-window-disabled.exp: New file.
* gdb.python/tui-window-disabled.py: New file.
2021-01-15 18:31:19 +08:00
|
|
|
|
2021-02-08 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* python/py-tui.c (gdbpy_tui_window) <is_valid>: New member
|
|
|
|
|
function.
|
|
|
|
|
(REQUIRE_WINDOW): Call is_valid member function.
|
|
|
|
|
(REQUIRE_WINDOW_FOR_SETTER): New define.
|
|
|
|
|
(gdbpy_tui_is_valid): Call is_valid member function.
|
|
|
|
|
(gdbpy_tui_set_title): Call REQUIRE_WINDOW_FOR_SETTER instead.
|
|
|
|
|
* tui/tui-data.h (struct tui_win_info) <is_visible>: Check
|
|
|
|
|
tui_active too.
|
|
|
|
|
* tui/tui-layout.c (tui_apply_current_layout): Add an assert.
|
|
|
|
|
* tui/tui.c (tui_enable): Move setting of tui_active earlier in
|
|
|
|
|
the function.
|
|
|
|
|
|
2021-02-08 19:44:51 +08:00
|
|
|
|
2021-02-08 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* python/py-tui.c (gdbpy_tui_set_title): Check that the new value
|
|
|
|
|
for the title is not nullptr.
|
|
|
|
|
|
gdb/tui: don't add windows to global list from tui_layout:window::apply
This commit was inspired by this mailing list patch:
https://sourceware.org/pipermail/gdb-patches/2021-January/174713.html
Currently, calling tui_layout_window::apply will add the window from
the layout object to the global tui_windows list.
Unfortunately, when the user runs the 'winheight' command, this calls
tui_adjust_window_height, which calls the tui_layout_base::adjust_size
function, which can then call tui_layout_base::apply. The consequence
of this is that when the user does 'winheight' duplicate copies of a
window can be added to the global tui_windows list.
The original patch fixed this by changing the apply function to only
update the global list some of the time.
This patch takes a different approach. The apply function no longer
updates the global tui_windows list. Instead a new virtual function
is added to tui_layout_base which is used to gather all the currently
applied windows into a vector. Finally tui_apply_current_layout is
updated to make use of this new function to update the tui_windows
list.
The benefits I see in this approach are, (a) the apply function now no
longer touches global state, this solves the immediate problem,
and (b) now that tui_windows is updated directly in the function
tui_apply_current_layout, we can drop the saved_tui_windows global.
gdb/ChangeLog:
* tui-layout.c (saved_tui_windows): Delete.
(tui_apply_current_layout): Don't make use of saved_tui_windows,
call new get_windows member function instead.
(tui_get_window_by_name): Check in tui_windows.
(tui_layout_window::apply): Don't add to tui_windows.
* tui-layout.h (tui_layout_base::get_windows): New member function.
(tui_layout_window::get_windows): Likewise.
(tui_layout_split::get_windows): Likewise.
gdb/testsuite/ChangeLog:
* gdb.tui/winheight.exp: Add more tests.
2021-01-25 23:46:58 +08:00
|
|
|
|
2021-02-08 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* tui-layout.c (saved_tui_windows): Delete.
|
|
|
|
|
(tui_apply_current_layout): Don't make use of saved_tui_windows,
|
|
|
|
|
call new get_windows member function instead.
|
|
|
|
|
(tui_get_window_by_name): Check in tui_windows.
|
|
|
|
|
(tui_layout_window::apply): Don't add to tui_windows.
|
|
|
|
|
* tui-layout.h (tui_layout_base::get_windows): New member function.
|
|
|
|
|
(tui_layout_window::get_windows): Likewise.
|
|
|
|
|
(tui_layout_split::get_windows): Likewise.
|
|
|
|
|
|
2021-02-08 19:11:24 +08:00
|
|
|
|
2021-02-08 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* tui/tui-layout.c (tui_apply_current_layout): Restore the delete
|
|
|
|
|
of the window objects.
|
|
|
|
|
|
gdb/python: reformat an error string
While working on another patch I noticed an oddly formatted error
message in the Python code.
When 'set python print-stack message' is in effect then consider this
Python script:
class TestCommand (gdb.Command):
def __init__ (self):
gdb.Command.__init__ (self, "test-cmd", gdb.COMMAND_DATA)
def invoke(self, args, from_tty):
raise RuntimeError ("bad")
TestCommand ()
And this GDB session:
(gdb) source path/to/python/script.py
(gdb) test-cmd
Python Exception <class 'RuntimeError'> bad:
Error occurred in Python: bad
The line 'Python Exception <class 'RuntimeError'> bad:' doesn't look
terrible in this situation, the colon at the end of the first line
makes sense given the second line.
However, there are places in GDB where there is no second line
printed, for example consider this python script:
def stop_listener (e):
raise RuntimeError ("bad")
gdb.events.stop.connect (stop_listener)
Then this GDB session:
(gdb) file helloworld.exe
(gdb) start
Temporary breakpoint 1 at 0x40112a: file hello.c, line 6.
Starting program: helloworld.exe
Temporary breakpoint 1, main () at hello.c:6
6 printf ("Hello World\n");
Python Exception <class 'RuntimeError'> bad:
(gdb) si
0x000000000040112f 6 printf ("Hello World\n");
Python Exception <class 'RuntimeError'> bad:
In this case there is no auxiliary information displayed after the
warning, and the line ending in the colon looks weird to me.
A quick survey of the code seems to indicate that it is not uncommon
for there to be no auxiliary information line printed, its not just
the one case I found above.
I propose that the line that currently looks like this:
Python Exception <class 'RuntimeError'> bad:
Be reformatted like this:
Python Exception <class 'RuntimeError'>: bad
I think this looks fine then in either situation. The first now looks
like this:
(gdb) test-cmd
Python Exception <class 'RuntimeError'>: bad
Error occurred in Python: bad
And the second like this:
(gdb) si
0x000000000040112f 6 printf ("Hello World\n");
Python Exception <class 'RuntimeError'>: bad
There's just two tests that needed updating. Errors are checked for
in many more tests, but most of the time the pattern doesn't care
about the colon.
gdb/ChangeLog:
* python/python.c (gdbpy_print_stack): Reformat an error message.
gdb/testsuite/ChangeLog:
* gdb.python/py-framefilter.exp: Update expected results.
* gdb.python/python.exp: Update expected results.
2021-01-18 18:03:21 +08:00
|
|
|
|
2021-02-08 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* python/python.c (gdbpy_print_stack): Reformat an error message.
|
|
|
|
|
|
gdb/tui: fix issue with handling the return character
My initial goal was to fix our gdb/testsuite/lib/tuiterm.exp such that
it would correctly support (some limited) scrolling of the command
window.
What I observe is that when sending commands to the tui command window
in a test script with:
Term::command "p 1"
The command window would be left looking like this:
(gdb)
(gdb) p 1$1 = 1
(gdb)
When I would have expected it to look like this:
(gdb) p 1
$1 = 1
(gdb)
Obviously a bug in our tuiterm.exp library, right???
Wrong!
Turns out there's a bug in GDB.
If in GDB I enable the tui and then type (slowly) the 'p 1\r' (the \r
is pressing the return key at the end of the string), then you do
indeed get the "expected" terminal output.
However, if instead I copy the 'p 1\r' string and paste it into the
tui in one go then I now see the same corrupted output as we do when
using tuiterm.exp.
It turns out the problem is that GDB fails when handling lots of input
arriving quickly with a \r (or \n) on the end.
The reason for this bug is as follows:
When the tui is active the terminal is in no-echo mode, so characters
sent to the terminal are not echoed out again. This means that when
the user types \r, this is not echoed to the terminal.
The characters read in are passed to readline and \r indicates that
the command line is complete and ready to be processed. However, the
\r is not included in readlines command buffer, and is NOT printed by
readline when is displays its buffer to the screen.
So, in GDB we have to manually spot the \r when it is read in and
update the display. Printing a newline character to the output and
moving the cursor to the next line. This is done in tui_getc_1.
Now readline tries to reduce the number of write calls. So if we very
quickly (as in paste in one go) the text 'p 1' to readline (this time
with no \r on the end), then readline will fetch the fist character
and add it to its internal buffer. But before printing the character
out readline checks to see if there's more input incoming. As we
pasted multiple characters, then yes, readline sees the ' ' and adds
this to its buffer, and finally the '1', this too is added to the
buffer.
Now if at this point we take a break, readline sees there is no more
input available, and so prints its buffer out.
Now when we press \r the code in tui_getc_1 kicks in, adds a \n to the
output and moves the cursor to the next line.
But, if instead we paste 'p 1\r' in one go then readline adds 'p 1' to
its buffer as before, but now it sees that there is still more input
available. Now it fetches the '\r', but this triggers the newline
behaviour, we print '\n' and move to the next line - however readline
has not printed its buffer yet!
So finally we end up on the next line. There's no more input
available so readline prints its buffer, then GDB gets passed the
buffer, handles it, and prints the result.
The solution I think is to put of our special newline insertion code
until we know that readline has finished printing its buffer. Handily
we know when this is - the next thing readline does is pass us the
command line buffer for processing. So all we need to do is hook in
to the command line processing, and before we pass the command line to
GDB's internals we do all of the magic print a newline and move the
cursor to the next line stuff.
Luckily, GDB's interpreter mechanism already provides the hooks we
need to do this. So all I do here is move the newline printing code
from tui_getc_1 into a new function, setup a new input_handler hook
for the tui, and call my new newline printing function.
After this I can enable the tui and paste in 'p 1\r' and see the
correct output.
Also the tuiterm.exp library will now see non-corrupted output.
gdb/ChangeLog:
* tui/tui-interp.c (tui_command_line_handler): New function.
(tui_interp::resume): Register tui_command_line_handler as the
input_handler.
* tui/tui-io.c (tui_inject_newline_into_command_window): New
function.
(tui_getc_1): Delete handling of '\n' and '\r'.
* tui-io.h (tui_inject_newline_into_command_window): Declare.
gdb/testsuite/ChangeLog:
* gdb.tui/scroll.exp: Tighten expected results. Remove comment
about bug in GDB, update expected results, and add more tests.
2021-01-23 01:40:19 +08:00
|
|
|
|
2021-02-08 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* tui/tui-interp.c (tui_command_line_handler): New function.
|
|
|
|
|
(tui_interp::resume): Register tui_command_line_handler as the
|
|
|
|
|
input_handler.
|
|
|
|
|
* tui/tui-io.c (tui_inject_newline_into_command_window): New
|
|
|
|
|
function.
|
|
|
|
|
(tui_getc_1): Delete handling of '\n' and '\r'.
|
|
|
|
|
* tui-io.h (tui_inject_newline_into_command_window): Declare.
|
|
|
|
|
|
2021-01-06 00:29:02 +08:00
|
|
|
|
2021-02-07 Hannes Domani <ssbssa@yahoo.de>
|
|
|
|
|
|
|
|
|
|
* tui/tui-regs.c (tui_data_window::display_registers_from):
|
|
|
|
|
Mark invisible register sub windows.
|
|
|
|
|
(tui_data_window::check_register_values): Ignore invisible
|
|
|
|
|
register sub windows.
|
|
|
|
|
|
2021-01-06 00:10:15 +08:00
|
|
|
|
2021-02-07 Hannes Domani <ssbssa@yahoo.de>
|
|
|
|
|
|
|
|
|
|
* tui/tui-regs.c (tui_data_item_window::rerender): Don't call
|
|
|
|
|
n_spaces with a negative value.
|
|
|
|
|
|
2021-01-05 23:56:01 +08:00
|
|
|
|
2021-02-07 Hannes Domani <ssbssa@yahoo.de>
|
|
|
|
|
|
|
|
|
|
* tui/tui-regs.c (tui_data_window::display_registers_from):
|
|
|
|
|
Add refresh_window call.
|
|
|
|
|
|
2020-12-19 01:23:41 +08:00
|
|
|
|
2021-02-07 Hannes Domani <ssbssa@yahoo.de>
|
|
|
|
|
|
|
|
|
|
* python/py-frame.c (frapy_richcompare): Compare frame_id_is_next.
|
|
|
|
|
|
2021-02-06 02:06:33 +08:00
|
|
|
|
2021-02-05 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* symmisc.c (std_in, std_out, std_err): Remove.
|
|
|
|
|
(_initialize_symmisc): Don't set std_in, std_out and std_err.
|
|
|
|
|
|
2021-02-06 00:47:07 +08:00
|
|
|
|
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-06 00:47:07 +08:00
|
|
|
|
2021-02-05 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR symtab/27333
|
|
|
|
|
* dwarf2/read.c (process_psymtab_comp_unit): Handle DW_TAG_type_unit.
|
|
|
|
|
|
2021-02-06 00:47:07 +08:00
|
|
|
|
2021-02-05 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/27313
|
|
|
|
|
* break-catch-syscall.c (catch_syscall_split_args): Reject negative
|
|
|
|
|
syscall numbers.
|
|
|
|
|
|
2021-02-05 22:17:11 +08:00
|
|
|
|
2021-02-05 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* compile/compile-c-support.c (get_compile_context)
|
|
|
|
|
(c_get_compile_context, cplus_get_compile_context): Change return
|
|
|
|
|
type.
|
|
|
|
|
* language.c (language_defn::get_compile_instance): New method.
|
|
|
|
|
* language.h (language_defn::get_compile_instance): Change return
|
|
|
|
|
type. No longer inline.
|
|
|
|
|
* c-lang.c (c_language::get_compile_instance): Change return type.
|
|
|
|
|
(cplus_language::get_compile_instance): Change return type.
|
|
|
|
|
* c-lang.h (c_get_compile_context, cplus_get_compile_context):
|
|
|
|
|
Change return type.
|
|
|
|
|
* compile/compile.c (compile_to_object): Update.
|
|
|
|
|
|
2021-02-05 22:11:01 +08:00
|
|
|
|
2021-02-05 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* parser-defs.h (write_exp_symbol_reference): Declare.
|
|
|
|
|
* parse.c (write_exp_symbol_reference): New function.
|
|
|
|
|
* p-exp.y (variable): Use write_exp_symbol_reference.
|
|
|
|
|
* m2-exp.y (variable): Use write_exp_symbol_reference.
|
|
|
|
|
* f-exp.y (variable): Use write_exp_symbol_reference.
|
|
|
|
|
* d-exp.y (PrimaryExpression): Use write_exp_symbol_reference.
|
|
|
|
|
* c-exp.y (variable): Use write_exp_symbol_reference.
|
|
|
|
|
|
2021-02-05 17:56:39 +08:00
|
|
|
|
2021-02-05 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR exp/27265
|
|
|
|
|
* valarith.c (complex_binop): Throw an error if complex type can't
|
|
|
|
|
be created.
|
|
|
|
|
|
2021-02-05 16:14:25 +08:00
|
|
|
|
2021-02-05 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR symtab/27307
|
|
|
|
|
* dwarf2/read.c (create_cus_from_debug_names_list): Add missing
|
|
|
|
|
return.
|
|
|
|
|
|
2021-02-05 16:14:25 +08:00
|
|
|
|
2021-02-05 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (create_cus_from_debug_names_list): Fix indentation.
|
|
|
|
|
|
2015-06-16 23:44:48 +08:00
|
|
|
|
2021-02-04 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* configure.tgt (riscv*-*-*): Set gdb_sim.
|
|
|
|
|
|
2021-02-05 04:45:20 +08:00
|
|
|
|
2021-02-04 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* target.c (target_is_non_stop_p): Return bool.
|
|
|
|
|
* target.h (target_is_non_stop_p): Return bool.
|
|
|
|
|
|
2021-02-05 02:35:37 +08:00
|
|
|
|
2021-02-04 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* record-full.c (record_full_async_inferior_event_handler):
|
|
|
|
|
Don't clear async event handler.
|
|
|
|
|
(record_full_base_target::wait): Clear async event handler at
|
|
|
|
|
beginning.
|
|
|
|
|
|
2021-02-05 02:35:09 +08:00
|
|
|
|
2021-02-04 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* record-btrace.c (record_btrace_handle_async_inferior_event):
|
|
|
|
|
Don't clear async event handler.
|
|
|
|
|
(record_btrace_target::wait): Clear async event handler at
|
|
|
|
|
beginning.
|
|
|
|
|
|
gdb: make remote target clear its handler in remote_target::wait
The remote target's remote_async_inferior_event_token is a flag that
tells when it wants the infrun loop to call its wait method. The flag
is cleared in the async_event_handler's callback
(remote_async_inferior_event_handler), just before calling
inferior_event_handler. However, since inferior_event_handler may
actually call another target's wait method, there needs to be code that
checks if we need to re-raise the flag.
It would be simpler instead for remote_target::wait to clear the flag
when it returns an event and there are no more to report after that. If
another target's wait method gets called by inferior_event_handler, the
remote target's flag will stay naturally stay marked.
Note that this is already partially implemented in remote_target::wait,
since the remote target may have multiple events to report (and it can
only report one at the time):
if (target_is_async_p ())
{
remote_state *rs = get_remote_state ();
/* If there are are events left in the queue tell the event loop
to return here. */
if (!rs->stop_reply_queue.empty ())
mark_async_event_handler (rs->remote_async_inferior_event_token);
}
The code in remote_async_inferior_event_handler also checks for pending
events as well, in addition to the stop reply queue, so I've made
remote_target::wait check for that as well. I'm not completely sure
this is ok, since I don't understand very well how the pending events
mechanism works. But I figured it was safer to do this, worst case it
just leads to unnecessary calls to remote_target::wait.
gdb/ChangeLog:
* remote.c (remote_target::wait): Clear async event handler at
beginning, mark if needed at the end.
(remote_async_inferior_event_handler): Don't set or clear async
event handler.
Change-Id: I20117f5b5acc8a9972c90f16280249b766c1bf37
2021-02-05 02:34:11 +08:00
|
|
|
|
2021-02-04 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* remote.c (remote_target::wait): Clear async event handler at
|
|
|
|
|
beginning, mark if needed at the end.
|
|
|
|
|
(remote_async_inferior_event_handler): Don't set or clear async
|
|
|
|
|
event handler.
|
|
|
|
|
|
gdb: make async event handlers clear themselves
The `ready` flag of async event handlers is cleared by the async event
handler system right before invoking the associated callback, in
check_async_event_handlers.
This is not ideal with how the infrun subsystem consumes events: all
targets' async event handler callbacks essentially just invoke
`inferior_event_handler`, which eventually calls `fetch_inferior_event`
and `do_target_wait`. `do_target_wait` picks an inferior at random,
and thus a target at random (it could be the target whose `ready` flag
was cleared, or not), and pulls one event from it.
So it's possible that:
- the async event handler for a target A is called
- we end up consuming an event for target B
- all threads of target B are stopped, target_async(0) is called on it,
so its async event handler is cleared (e.g.
record_btrace_target::async)
As a result, target A still has events to report while its async event
handler is left unmarked, so these events are not consumed. To counter
this, at the end of their async event handler callbacks, targets check
if they still have something to report and re-mark their async event
handler (e.g. remote_async_inferior_event_handler).
The linux_nat target does not suffer from this because it doesn't use an
async event handler at the moment. It only uses a pipe registered with
the event loop. It is written to in the SIGCHLD handler (and in other
spots that want to get target wait method called) and read from in
the target's wait method. So if linux_nat happened to be target A in
the example above, the pipe would just stay readable, and the event loop
would wake up again, until linux_nat's wait method is finally called and
consumes the contents of the pipe.
I think it would be nicer if targets using async_event_handler worked in
a similar way, where the flag would stay set until the target's wait
method is actually called. As a first step towards that, this patch
moves the responsibility of clearing the ready flags of async event
handlers to the invoked callback.
All async event handler callbacks are modified to clear their ready flag
before doing anything else. So in practice, nothing changes with this
patch. It's only the responsibility of clearing the flag that is
shifted toward the callee.
gdb/ChangeLog:
* async-event.h (async_event_handler_func): Add documentation.
* async-event.c (check_async_event_handlers): Don't clear
async_event_handler ready flag.
* infrun.c (infrun_async_inferior_event_handler): Clear ready
flag.
* record-btrace.c (record_btrace_handle_async_inferior_event):
Likewise.
* record-full.c (record_full_async_inferior_event_handler):
Likewise.
* remote-notif.c (remote_async_get_pending_events_handler):
Likewise.
* remote.c (remote_async_inferior_event_handler): Likewise.
Change-Id: I179ef8e99580eae642d332846fd13664dbddc0c1
2021-02-05 02:13:30 +08:00
|
|
|
|
2021-02-04 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* async-event.h (async_event_handler_func): Add documentation.
|
|
|
|
|
* async-event.c (check_async_event_handlers): Don't clear
|
|
|
|
|
async_event_handler ready flag.
|
|
|
|
|
* infrun.c (infrun_async_inferior_event_handler): Clear ready
|
|
|
|
|
flag.
|
|
|
|
|
* record-btrace.c (record_btrace_handle_async_inferior_event):
|
|
|
|
|
Likewise.
|
|
|
|
|
* record-full.c (record_full_async_inferior_event_handler):
|
|
|
|
|
Likewise.
|
|
|
|
|
* remote-notif.c (remote_async_get_pending_events_handler):
|
|
|
|
|
Likewise.
|
|
|
|
|
* remote.c (remote_async_inferior_event_handler): Likewise.
|
|
|
|
|
|
2021-02-04 03:36:54 +08:00
|
|
|
|
2021-02-03 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* infrun.c (handle_inferior_event): Move stop_soon variable to
|
|
|
|
|
inner scope.
|
|
|
|
|
|
detach in all-stop with threads running
A following patch will add a testcase that has a number of threads
constantly stepping over a breakpoint, and then has GDB detach the
process, while threads are running. If we have more than one inferior
running, and we detach from just one of the inferiors, we expect that
the remaining inferior continues running. However, in all-stop, if
GDB needs to pause the target for the detach, nothing is re-resuming
the other inferiors after the detach. "info threads" shows the
threads as running, but they really aren't. This fixes it.
gdb/ChangeLog:
* infcmd.c (detach_command): Hold strong reference to target, and
if all-stop on entry, restart threads on exit.
* infrun.c (switch_back_to_stepped_thread): Factor out bits to ...
(restart_stepped_thread): ... this new function. Also handle
trap_expected.
(restart_after_all_stop_detach): New function.
* infrun.h (restart_after_all_stop_detach): Declare.
2021-01-12 04:01:58 +08:00
|
|
|
|
2021-02-03 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* infcmd.c (detach_command): Hold strong reference to target, and
|
|
|
|
|
if all-stop on entry, restart threads on exit.
|
|
|
|
|
* infrun.c (switch_back_to_stepped_thread): Factor out bits to ...
|
|
|
|
|
(restart_stepped_thread): ... this new function. Also handle
|
|
|
|
|
trap_expected.
|
|
|
|
|
(restart_after_all_stop_detach): New function.
|
|
|
|
|
* infrun.h (restart_after_all_stop_detach): Declare.
|
|
|
|
|
|
2021-01-12 07:11:57 +08:00
|
|
|
|
2021-02-03 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* infrun.c (struct step_over_info): Initialize fields.
|
|
|
|
|
(prepare_for_detach): Handle ongoing in-line step over.
|
|
|
|
|
|
detach and breakpoint removal
A following patch will add a testcase that has a number of threads
constantly stepping over a breakpoint, and then has GDB detach the
process. That testcase sometimes fails with the inferior crashing
with SIGTRAP after the detach because of the bug fixed by this patch,
when tested with the native target.
The problem is that target_detach removes breakpoints from the target
immediately, and that does not work with the native GNU/Linux target
(and probably no other native target) currently. The test wouldn't
fail with this issue when testing against gdbserver, because gdbserver
does allow accessing memory while the current thread is running, by
transparently pausing all threads temporarily, without GDB noticing.
Implementing that in gdbserver was a lot of work, so I'm not looking
forward right now to do the same in the native target. Instead, I
came up with a simpler solution -- push the breakpoints removal down
to the targets. The Linux target conveniently already pauses all
threads before detaching them, since PTRACE_DETACH only works with
stopped threads, so we move removing breakpoints to after that. Only
the remote and GNU/Linux targets support support async execution, so
no other target should really need this.
gdb/ChangeLog:
* linux-nat.c (linux_nat_target::detach): Remove breakpoints
here...
* remote.c (remote_target::remote_detach_1): ... and here ...
* target.c (target_detach): ... instead of here.
* target.h (target_ops::detach): Add comment.
2020-12-13 09:35:05 +08:00
|
|
|
|
2021-02-03 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* linux-nat.c (linux_nat_target::detach): Remove breakpoints
|
|
|
|
|
here...
|
|
|
|
|
* remote.c (remote_target::remote_detach_1): ... and here ...
|
|
|
|
|
* target.c (target_detach): ... instead of here.
|
|
|
|
|
* target.h (target_ops::detach): Add comment.
|
|
|
|
|
|
prepare_for_detach and ongoing displaced stepping
I noticed that "detach" while a program was running sometimes resulted
in the process crashing. I tracked it down to this change to
prepare_for_detach in commit 187b041e ("gdb: move displaced stepping
logic to gdbarch, allow starting concurrent displaced steps"):
/* Is any thread of this process displaced stepping? If not,
there's nothing else to do. */
- if (displaced->step_thread == nullptr)
+ if (displaced_step_in_progress (inf))
return;
The problem above is that the condition was inadvertently flipped. It
should have been:
if (!displaced_step_in_progress (inf))
So I fixed it, and wrote a testcase to exercise it. The testcase has
a number of threads constantly stepping over a breakpoint, and then
GDB detaches the process, while threads are running and stepping over
the breakpoint. And then I was surprised that my testcase would hang
-- GDB would get stuck in an infinite loop in prepare_for_detach,
here:
while (displaced_step_in_progress (inf))
{
...
What is going on is that since we now have two displaced stepping
buffers, as one displaced step finishes, GDB starts another, and
there's another one already in progress, and on and on, so the
displaced_step_in_progress condition never turns false. This happens
because we go via the whole handle_inferior_event, which tries to
start new step overs when one finishes. And also because while we
remove breakpoints from the target before prepare_for_detach is
called, handle_inferior_event ends up calling insert_breakpoints via
e.g. keep_going.
Thinking through all this, I came to the conclusion that going through
the whole handle_inferior_event isn't ideal. A _lot_ is done by that
function, e.g., some thread may get a signal which is passed to the
inferior, and gdb decides to try to get over the signal handler, which
reinstalls breakpoints. Or some process may exit. We can end up
reporting these events via normal_stop while detaching, maybe end up
running some breakpoint commands, or maybe even something runs an
inferior function call. Etc. All this after the user has already
declared they don't want to debug the process anymore, by asking to
detach.
I came to the conclusion that it's better to do the minimal amount of
work possible, in a more controlled fashion, without going through
handle_inferior_event. So in the new approach implemented by this
patch, if there are threads of the inferior that we're detaching in
the middle of a displaced step, stop them, and cancel the displaced
step. This is basically what stop_all_threads already does, via
wait_one and (the now factored out) handle_one, so I'm reusing those.
gdb/ChangeLog:
* infrun.c (struct wait_one_event): Move higher up.
(prepare_for_detach): Abort in-progress displaced steps instead of
letting them complete.
(handle_one): If the inferior is detaching, don't add the thread
back to the global step-over chain.
(restart_threads): Don't restart threads if detaching.
(handle_signal_stop): Remove inferior::detaching reference.
2020-12-13 09:35:05 +08:00
|
|
|
|
2021-02-03 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* infrun.c (struct wait_one_event): Move higher up.
|
|
|
|
|
(prepare_for_detach): Abort in-progress displaced steps instead of
|
|
|
|
|
letting them complete.
|
|
|
|
|
(handle_one): If the inferior is detaching, don't add the thread
|
|
|
|
|
back to the global step-over chain.
|
|
|
|
|
(restart_threads): Don't restart threads if detaching.
|
|
|
|
|
(handle_signal_stop): Remove inferior::detaching reference.
|
|
|
|
|
|
2021-01-12 02:52:12 +08:00
|
|
|
|
2021-02-03 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* infrun.c (prepare_for_detach): Don't release scoped_restore
|
|
|
|
|
before returning.
|
|
|
|
|
|
2020-12-13 09:35:05 +08:00
|
|
|
|
2021-02-03 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* infrun.c (handle_one): New function, factored out from ...
|
|
|
|
|
(stop_all_threads): ... here.
|
|
|
|
|
|
Fix a couple vStopped pending ack bugs
A following patch will add a testcase that has two processes with
threads stepping over a breakpoint continuously, and then detaches
from one of the processes while threads are running. The other
process continues stepping over its breakpoint. And then the testcase
sends a SIGUSR1, expecting that GDB reports it. That would sometimes
hang against gdbserver, due to the bugs fixed here. Both bugs are
related, in that they're about remote protocol asynchronous Stop
notifications. There's a bug in GDB, and another in GDBserver.
The GDB bug:
- when we detach from a process, the remote target discards any
pending RSP notification related to that process, including the
in-flight, yet-unacked notification. Discarding the in-flight
notification is the problem. Until the in-flight notification is
acked with a vStopped packet, the server won't send another %Stop
notification. As a result, the debug session gets messed up. In
the new testcase's case, GDB would hang inside stop_all_threads,
waiting for a stop for one of the process'es threads, which never
arrived -- its stop reply was permanently stuck in the stop reply
queue, waiting for a vStopped packet that never arrived.
In summary:
1. GDBserver sends stop notification about thread X, the remote
target receives it and stores it
2. At the same time, GDB detaches thread X's inferior
3. The remote target discards the received stop notification
4. GDBserver waits forever for the ack
The GDBserver bug:
GDBserver has the opposite bug. It also discards notifications for
the process being detached. If that discards the head of the
notification queue, when gdb sends an ack, it ends up acking the
_next_ notification. Meaning, gdb loses one notification. In the
testcase, this results in a similar hang in stop_all_threads.
So we have two very similar bugs in GDB and GDBserver, both resulting
in a similar symptom. That's why I'm fixing them both at the same
time.
gdb/ChangeLog:
* remote.c (remote_notif_stop_ack): Don't error out on
TARGET_WAITKIND_IGNORE; instead, just ignore the notification.
(remote_target::discard_pending_stop_replies): Don't delete
in-flight notification; instead, clear its contents.
gdbserver/ChangeLog:
* server.cc (discard_queued_stop_replies): Don't ever discard the
notification at the head of the list.
2021-01-06 10:19:38 +08:00
|
|
|
|
2021-02-03 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* remote.c (remote_notif_stop_ack): Don't error out on
|
|
|
|
|
TARGET_WAITKIND_IGNORE; instead, just ignore the notification.
|
|
|
|
|
(remote_target::discard_pending_stop_replies): Don't delete
|
|
|
|
|
in-flight notification; instead, clear its contents.
|
|
|
|
|
|
2020-12-24 20:26:20 +08:00
|
|
|
|
2021-02-03 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
* remote.c (extended_remote_target::attach): Set target async in
|
|
|
|
|
the target-non-stop path too.
|
|
|
|
|
|
Fix attaching in non-stop mode (PR gdb/27055)
Attaching in non-stop mode currently misbehaves, like so:
(gdb) attach 1244450
Attaching to process 1244450
[New LWP 1244453]
[New LWP 1244454]
[New LWP 1244455]
[New LWP 1244456]
[New LWP 1244457]
[New LWP 1244458]
[New LWP 1244459]
[New LWP 1244461]
[New LWP 1244462]
[New LWP 1244463]
No unwaited-for children left.
At this point, GDB's stopped/running thread state is out of sync with
the inferior:
(gdb) info threads
Id Target Id Frame
* 1 LWP 1244450 "attach-non-stop" 0xf1b443bf in ?? ()
2 LWP 1244453 "attach-non-stop" (running)
3 LWP 1244454 "attach-non-stop" (running)
4 LWP 1244455 "attach-non-stop" (running)
5 LWP 1244456 "attach-non-stop" (running)
6 LWP 1244457 "attach-non-stop" (running)
7 LWP 1244458 "attach-non-stop" (running)
8 LWP 1244459 "attach-non-stop" (running)
9 LWP 1244461 "attach-non-stop" (running)
10 LWP 1244462 "attach-non-stop" (running)
11 LWP 1244463 "attach-non-stop" (running)
(gdb)
(gdb) interrupt -a
(gdb)
*nothing*
The problem is that attaching installs an inferior continuation,
called when the target reports the initial attach stop, here, in
inf-loop.c:inferior_event_handler:
/* Do all continuations associated with the whole inferior (not
a particular thread). */
if (inferior_ptid != null_ptid)
do_all_inferior_continuations (0);
However, currently in non-stop mode, inferior_ptid is still null_ptid
when we get here.
If you try to do "set debug infrun 1" to debug the problem, however,
then the attach completes correctly, with GDB reporting a stop for
each thread.
The bug is that we're missing a switch_to_thread/context_switch call
when handling the initial stop, here:
if (stop_soon == STOP_QUIETLY_NO_SIGSTOP
&& (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_STOP
|| ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP
|| ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_0))
{
stop_print_frame = true;
stop_waiting (ecs);
ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
return;
}
Note how the STOP_QUIETLY / STOP_QUIETLY_REMOTE case above that does
call context_switch.
And the reason "set debug infrun 1" "fixes" it, is that the debug path
has a switch_to_thread call.
This patch fixes it by moving the main context_switch call earlier.
It also removes the:
if (ecs->ptid != inferior_ptid)
check at the same time because:
#1 - that is half of what context_switch already does
#2 - deprecated_context_hook is only used in Insight, and all it does
is set an int. It won't care if we call it when the current
thread hasn't actually changed.
A testcase exercising this will be added in a following patch.
gdb/ChangeLog:
PR gdb/27055
* infrun.c (handle_signal_stop): Move main context_switch call
earlier, before STOP_QUIETLY_NO_SIGSTOP.
2020-12-23 08:34:54 +08:00
|
|
|
|
2021-02-03 Pedro Alves <pedro@palves.net>
|
|
|
|
|
|
|
|
|
|
PR gdb/27055
|
|
|
|
|
* infrun.c (handle_signal_stop): Move main context_switch call
|
|
|
|
|
earlier, before STOP_QUIETLY_NO_SIGSTOP.
|
|
|
|
|
|
2021-01-07 04:58:04 +08:00
|
|
|
|
2021-02-02 Lancelot SIX <lsix@lancelotsix.com>
|
|
|
|
|
|
|
|
|
|
* NEWS (Changed commands): Add entry for the behavior change of
|
|
|
|
|
the inferior command.
|
|
|
|
|
* inferior.c (inferior_command): When no argument is given to the
|
|
|
|
|
inferior command, display info about the currently selected
|
|
|
|
|
inferior.
|
|
|
|
|
|
2021-02-02 23:40:52 +08:00
|
|
|
|
2021-02-02 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (read_loclist_index, read_rnglist_index): Return
|
|
|
|
|
a sect_offset.
|
|
|
|
|
(read_attribute_reprocess): Adjust.
|
|
|
|
|
|
gdb/dwarf: split dwarf2_cu::ranges_base in two
Consider the test case added in this patch. It defines a compilation
unit with a DW_AT_rnglists_base attribute (used for attributes of form
DW_FORM_rnglistx), but also uses DW_AT_ranges of form
DW_FORM_sec_offset:
0x00000027: DW_TAG_compile_unit
DW_AT_ranges [DW_FORM_sec_offset] (0x0000004c
[0x0000000000005000, 0x0000000000006000))
DW_AT_rnglists_base [DW_FORM_sec_offset] (0x00000044)
The DW_AT_rnglists_base does not play a role in reading the DW_AT_ranges of
form DW_FORM_sec_offset, but it should also not do any harm.
This case is currently not handled correctly by GDB. This is not
something that a compiler is likely to emit, but in my opinion there's
no reason why GDB should fail reading it.
The problem is that in partial_die_info::read and a few other places
where the same logic is replicated, the cu->ranges_base value,
containing the DW_AT_rnglists_base value, is wrongfully added to the
DW_AT_ranges value.
It is quite messy how to decide whether cu->ranges_base should be added
to the attribute's value or not. But to summarize, the only time we
want to add it is when the attribute comes from a pre-DWARF 5 split unit
file (a .dwo) [1]. In this case, the DW_AT_ranges attribute from the
split unit file will have form DW_FORM_sec_offset, pointing somewhere in
the linked file's .debug_ranges section. *But* it's not a "true"
DW_FORM_sec_offset, in that it's an offset relative to the beginning of
that CU's contribution in the section, not relative to the beginning of
the section. So in that case, and only that case, do we want to add the
ranges base value, which we found from the DW_AT_GNU_ranges_base
attribute on the skeleton unit.
Almost all instances of the DW_AT_ranges attribute will be found in the
split unit (on DW_TAG_subprogram, for example), and therefore need to
have the ranges base added. However, the DW_TAG_compile_unit DIE in the
skeleton may also have a DW_AT_ranges attribute. For that one, the
ranges base must not be added. Once the DIEs have been loaded in GDB,
however, the distinction between what's coming from the skeleton and
what's coming from the split unit is not clear. It is all merged in one
big happy tree. So how do we know if a given attribute comes from the
split unit or not?
We use the fact that in pre-DWARF 5 split DWARF, DW_AT_ranges is found
on the skeleton's DW_TAG_compile_unit (in the linked file) and never in
the split unit's DW_TAG_compile_unit. This is why you have this in
partial_die_info::read:
int need_ranges_base = (tag != DW_TAG_compile_unit
&& attr.form != DW_FORM_rnglistx);
However, with the corner case described above (where we have a
DW_AT_rnglists_base attribute and a DW_AT_ranges attribute of form
DW_FORM_sec_offset) the condition gets it wrong when it encounters an
attribute like DW_TAG_subprogram with a DW_AT_ranges attribute of
DW_FORM_sec_offset form: it thinks that it is necessary to add the base,
when it reality it is not.
The problem boils down to failing to differentiate these cases:
- a DW_AT_ranges attribute of form DW_FORM_sec_offset in a
pre-DWARF 5 split unit (in which case we need to add the base)
- a DW_AT_ranges attribute of form DW_FORM_sec_offset in a DWARF 5
non-split unit (in which case we must not add the base)
What makes it unnecessarily complex is that the cu->ranges_base field is
overloaded, used to hold the pre-DWARF 5, non-standard
DW_AT_GNU_ranges_base and the DWARF 5 DW_AT_rnglists_base. In reality,
these two are called "bases" but are not the same thing. The result is
that we need twisted conditions to try to determine whether or not we
should add the base to the attribute's value.
To fix it, split the field in two distinct fields. I renamed everything
related to the "old" ranges base to "gnu_ranges_base", to make it clear
that it's about the non-standard, pre-DWARF 5 thing. And everything
related to the DWARF 5 thing gets renamed "rnglists". I think it
becomes much easier to reason this way.
The issue described above gets fixed by the fact that the
DW_AT_rnglists_base value does not end up in cu->gnu_ranges_base, so
cu->gnu_ranges_base stays 0. The condition to determine whether
gnu_ranges_base should be added can therefore be simplified back to:
tag != DW_TAG_compile_unit
... as it was before rnglistx support was added.
Extend the gdb.dwarf2/rnglists-sec-offset.exp to cover this case. I
also extended the test case for loclists similarly, just to see if there
would be some similar problem. There wasn't, but I think it's not a bad
idea to test that case for loclists as well, so I left it in the patch.
[1] https://gcc.gnu.org/wiki/DebugFission
gdb/ChangeLog:
* dwarf2/die.h (struct die_info) <ranges_base>: Split in...
<gnu_ranges_base>: ... this...
<rnglists_base>: ... and this.
* dwarf2/read.c (struct dwarf2_cu) <ranges_base>: Split in...
<gnu_ranges_base>: ... this...
<rnglists_base>: ... and this.
(read_cutu_die_from_dwo): Adjust
(dwarf2_get_pc_bounds): Adjust
(dwarf2_record_block_ranges): Adjust.
(read_full_die_1): Adjust
(partial_die_info::read): Adjust.
(read_rnglist_index): Adjust.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/rnglists-sec-offset.exp: Add test for DW_AT_ranges
of DW_FORM_sec_offset form plus DW_AT_rnglists_base attribute.
* gdb.dwarf2/loclists-sec-offset.exp: Add test for
DW_AT_location of DW_FORM_sec_offset plus DW_AT_loclists_base
attribute
Change-Id: Icd109038634b75d0e6e9d7d1dcb62fb9eb951d83
2021-02-02 23:41:59 +08:00
|
|
|
|
2021-02-02 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/die.h (struct die_info) <ranges_base>: Split in...
|
|
|
|
|
<gnu_ranges_base>: ... this...
|
|
|
|
|
<rnglists_base>: ... and this.
|
|
|
|
|
* dwarf2/read.c (struct dwarf2_cu) <ranges_base>: Split in...
|
|
|
|
|
<gnu_ranges_base>: ... this...
|
|
|
|
|
<rnglists_base>: ... and this.
|
|
|
|
|
(read_cutu_die_from_dwo): Adjust
|
|
|
|
|
(dwarf2_get_pc_bounds): Adjust
|
|
|
|
|
(dwarf2_record_block_ranges): Adjust.
|
|
|
|
|
(read_full_die_1): Adjust
|
|
|
|
|
(partial_die_info::read): Adjust.
|
|
|
|
|
(read_rnglist_index): Adjust.
|
|
|
|
|
|
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-02 23:40:51 +08:00
|
|
|
|
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.
|
|
|
|
|
|
gdb/dwarf: few fixes for handling DW_FORM_{rng,loc}listx
We hit an assertion when loading the binary from PR 26813. When fixing
it, execution goes a up bit further but then hits another assert, and
another, and another. With these fours fixes, I am able to load the
binary and get to the prompt. An error is shown (index pointing outside
of the section), because the DW_FORM_rnglistx attribute is not read
correctly, but that one is taken care of by the next patch.
The four fixes are:
- attribute::form_requires_reprocessing needs to handle forms
DW_FORM_rnglistx and DW_FORM_loclistx, because set_unsigned_reprocess
is called for them in read_attribute_value.
- read_attribute_reprocess must call set_unsigned for them, not
set_address. The parameter of set_address is a CORE_ADDR, meaning
it's for program addresses. Post-reprocess, DW_FORM_rnglistx and
DW_FORM_loclistx are offsets into their respective sections
(.debug_rnglists and .debug_loclists). set_unsigned is the current
attribute value setter that fits the best. But perhaps we should have
a setter that takes a sect_offset?
- read_attribute_process must call as_unsigned_reprocess instead of
as_unsigned to get the pre-reprocess value, otherwise we hit the
assert inside as_unsigned that makes sure the attribute doesn't need
reprocessing.
- attribute::set_unsigned needs to clear the requires_reprocessing flag,
otherwise it stays set when reprocessing DW_FORM_rnglistx and
DW_FORM_loclistx attributes.
There's another assert that we hit once the next patch is applied, but
since it's in the same vein as the changes in this patch, I included it
in this patch:
- attribute::form_is_unsigned must handle form DW_FORM_loclistx,
otherwise we hit the assert when trying to call set_unsigned for an
attribute of this form. DW_FORM_rnglistx is already handled.
gdb/ChangeLog:
PR gdb/26813
* dwarf2/attribute.h (struct attribute) <set_unsigned>: Clear
requires_reprocessing flag.
* dwarf2/attribute.c (attribute::form_is_unsigned): Handle
DW_FORM_loclistx.
(attribute::form_requires_reprocessing): Handle DW_FORM_rnglistx
and DW_FORM_loclistx.
* dwarf2/read.c (read_attribute_reprocess): Use set_unsigned
instead of set_address for DW_FORM_loclistx and
DW_FORM_rnglistx.
Change-Id: I06c156fa3913ca98e4e39085f4ef171645b4bc1e
2021-02-02 23:40:51 +08:00
|
|
|
|
2021-02-02 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/26813
|
|
|
|
|
* dwarf2/attribute.h (struct attribute) <set_unsigned>: Clear
|
|
|
|
|
requires_reprocessing flag.
|
|
|
|
|
* dwarf2/attribute.c (attribute::form_is_unsigned): Handle
|
|
|
|
|
DW_FORM_loclistx.
|
|
|
|
|
(attribute::form_requires_reprocessing): Handle DW_FORM_rnglistx
|
|
|
|
|
and DW_FORM_loclistx.
|
|
|
|
|
* dwarf2/read.c (read_attribute_reprocess): Use set_unsigned
|
|
|
|
|
instead of set_address for DW_FORM_loclistx and
|
|
|
|
|
DW_FORM_rnglistx.
|
|
|
|
|
|
2021-02-02 23:40:51 +08:00
|
|
|
|
2021-02-02 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (read_loclist_index): Remove bound check for
|
|
|
|
|
start of offset.
|
|
|
|
|
(read_rnglist_index): Likewise.
|
|
|
|
|
|
2021-02-02 23:40:51 +08:00
|
|
|
|
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 23:40:50 +08:00
|
|
|
|
2021-02-02 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (read_rnglist_index): Fix bound check.
|
|
|
|
|
|
2021-02-02 23:40:50 +08:00
|
|
|
|
2021-02-02 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (read_loclist_index): Change complaints into
|
|
|
|
|
errors.
|
|
|
|
|
|
2021-02-02 15:37:45 +08:00
|
|
|
|
2021-02-02 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR symtab/24620
|
|
|
|
|
* dwarf2/index-write.c (write_one_signatured_type): Skip if
|
|
|
|
|
psymtab == nullptr.
|
|
|
|
|
|
2021-01-19 00:00:38 +08:00
|
|
|
|
2021-02-01 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (HFILES_NO_SRCDIR): Add corefile.h.
|
|
|
|
|
* gcore.c (struct gcore_collect_regset_section_cb_data): Moved
|
|
|
|
|
here from linux-tdep.c and given a new name. Minor cleanups.
|
|
|
|
|
(gcore_collect_regset_section_cb): Likewise.
|
|
|
|
|
(gcore_collect_thread_registers): Likewise.
|
|
|
|
|
(gcore_build_thread_register_notes): Likewise.
|
|
|
|
|
(gcore_find_signalled_thread): Likewise.
|
|
|
|
|
* gcore.h (gcore_build_thread_register_notes): Declare.
|
|
|
|
|
(gcore_find_signalled_thread): Declare.
|
|
|
|
|
* fbsd-tdep.c: Add 'gcore.h' include.
|
|
|
|
|
(struct fbsd_collect_regset_section_cb_data): Delete.
|
|
|
|
|
(fbsd_collect_regset_section_cb): Delete.
|
|
|
|
|
(fbsd_collect_thread_registers): Delete.
|
|
|
|
|
(struct fbsd_corefile_thread_data): Delete.
|
|
|
|
|
(fbsd_corefile_thread): Delete.
|
|
|
|
|
(fbsd_make_corefile_notes): Call
|
|
|
|
|
gcore_build_thread_register_notes instead of the now deleted
|
|
|
|
|
FreeBSD code.
|
|
|
|
|
* linux-tdep.c: Add 'gcore.h' include.
|
|
|
|
|
(struct linux_collect_regset_section_cb_data): Delete.
|
|
|
|
|
(linux_collect_regset_section_cb): Delete.
|
|
|
|
|
(linux_collect_thread_registers): Delete.
|
|
|
|
|
(linux_corefile_thread): Call
|
|
|
|
|
gcore_build_thread_register_notes.
|
|
|
|
|
(find_signalled_thread): Delete.
|
|
|
|
|
(linux_make_corefile_notes): Call gcore_find_signalled_thread.
|
|
|
|
|
|
[gdb/breakpoint] Fix stepping past non-stmt line-table entries
Consider the test-case small.c:
...
$ cat -n small.c
1 __attribute__ ((noinline, noclone))
2 int foo (char *c)
3 {
4 asm volatile ("" : : "r" (c) : "memory");
5 return 1;
6 }
7
8 int main ()
9 {
10 char tpl1[20] = "/tmp/test.XXX";
11 char tpl2[20] = "/tmp/test.XXX";
12 int fd1 = foo (tpl1);
13 int fd2 = foo (tpl2);
14 if (fd1 == -1) {
15 return 1;
16 }
17
18 return 0;
19 }
...
Compiled with gcc-8 and optimization:
...
$ gcc-8 -O2 -g small.c
...
We step through the calls to foo, but fail to visit line 13:
...
12 int fd1 = foo (tpl1);
(gdb) step
foo (c=c@entry=0x7fffffffdea0 "/tmp/test.XXX") at small.c:5
5 return 1;
(gdb) step
foo (c=c@entry=0x7fffffffdec0 "/tmp/test.XXX") at small.c:5
5 return 1;
(gdb) step
main () at small.c:14
14 if (fd1 == -1) {
(gdb)
...
This is caused by the following. The calls to foo are implemented by these
insns:
....
4003df: 0f 29 04 24 movaps %xmm0,(%rsp)
4003e3: 0f 29 44 24 20 movaps %xmm0,0x20(%rsp)
4003e8: e8 03 01 00 00 callq 4004f0 <foo>
4003ed: 48 8d 7c 24 20 lea 0x20(%rsp),%rdi
4003f2: 89 c2 mov %eax,%edx
4003f4: e8 f7 00 00 00 callq 4004f0 <foo>
4003f9: 31 c0 xor %eax,%eax
...
with corresponding line table entries:
...
INDEX LINE ADDRESS IS-STMT
8 12 0x00000000004003df Y
9 10 0x00000000004003df
10 11 0x00000000004003e3
11 12 0x00000000004003e8
12 13 0x00000000004003ed
13 12 0x00000000004003f2
14 13 0x00000000004003f4 Y
15 13 0x00000000004003f4
16 14 0x00000000004003f9 Y
17 14 0x00000000004003f9
...
Once we step out of the call to foo at 4003e8, we land at 4003ed, and gdb
enters process_event_stop_test to figure out what to do.
That entry has is-stmt=n, so it's not the start of a line, so we don't stop
there. However, we do update ecs->event_thread->current_line to line 13,
because the frame has changed (because we stepped out of the function).
Next we land at 4003f2. Again the entry has is-stmt=n, so it's not the start
of a line, so we don't stop there. However, because the frame hasn't changed,
we don't update update ecs->event_thread->current_line, so it stays 13.
Next we land at 4003f4. Now is-stmt=y, so it's the start of a line, and we'd
like to stop here.
But we don't stop because this test fails:
...
if ((ecs->event_thread->suspend.stop_pc == stop_pc_sal.pc)
&& (ecs->event_thread->current_line != stop_pc_sal.line
|| ecs->event_thread->current_symtab != stop_pc_sal.symtab))
{
...
because ecs->event_thread->current_line == 13 and stop_pc_sal.line == 13.
Fix this by resetting ecs->event_thread->current_line to 0 if is-stmt=n and
the frame has changed, such that we have:
...
12 int fd1 = foo (tpl1);
(gdb) step
foo (c=c@entry=0x7fffffffdbc0 "/tmp/test.XXX") at small.c:5
5 return 1;
(gdb) step
main () at small.c:13
13 int fd2 = foo (tpl2);
(gdb)
...
Tested on x86_64-linux, with gcc-7 and gcc-8.
gdb/ChangeLog:
2021-01-29 Tom de Vries <tdevries@suse.de>
PR breakpoints/26063
* infrun.c (process_event_stop_test): Reset
ecs->event_thread->current_line to 0 if is-stmt=n and frame has
changed.
gdb/testsuite/ChangeLog:
2021-01-29 Tom de Vries <tdevries@suse.de>
PR breakpoints/26063
* gdb.dwarf2/dw2-step-out-of-function-no-stmt.c: New test.
* gdb.dwarf2/dw2-step-out-of-function-no-stmt.exp: New file.
2021-01-29 20:36:52 +08:00
|
|
|
|
2021-01-29 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/26063
|
|
|
|
|
* infrun.c (process_event_stop_test): Reset
|
|
|
|
|
ecs->event_thread->current_line to 0 if is-stmt=n and frame has
|
|
|
|
|
changed.
|
|
|
|
|
|
2021-01-28 02:20:35 +08:00
|
|
|
|
2021-01-28 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* thread.c (thr_try_catch_cmd): Replace swith_to_thread with an
|
|
|
|
|
assert. Extend the header comment.
|
|
|
|
|
|
gdb/tui: remove special handling of locator/status window
The locator window, or status window as it is sometimes called is
handled differently to all the other windows.
The reason for this is that the class representing this
window (tui_locator_window) does two jobs, first this class represents
a window just like any other that has space on the screen and fills
the space with content. The second job is that this class serves as a
storage area to hold information about the current location that the
TUI windows represent, so the class has members like 'addr' and
'line_no', for example which are used within this class, and others
when they want to know which line/address the TUI windows should be
showing to the user.
Because of this dual purpose we must always have an instance of the
tui_locator_window so that there is somewhere to store this location
information.
The result of this is that the locator window must never be deleted
like other windows, which results in some special case code.
In this patch I propose splitting the two roles of the
tui_locator_window class. The tui_locator_window class will retain
just its window drawing parts, and will be treated just like any other
window. This should allow all special case code for this window to be
deleted.
The other role, that of tracking the current tui location will be
moved into a new class (tui_location_tracker), of which there will be
a single global instance. All of the places where we previously use
the locator window to get location information will now be updated to
get this from the tui_location_tracker.
There should be no user visible changes after this commit.
gdb/ChangeLog:
* Makefile.in (SUBDIR_TUI_SRCS): Add tui/tui-location.c.
(HFILES_NO_SRCDIR): Add tui/tui-location.h.
* tui/tui-data.h (TUI_STATUS_WIN): Define.
(tui_locator_win_info_ptr): Delete declaration.
* tui/tui-disasm.c: Add 'tui/tui-location.h' include.
(tui_disasm_window::set_contents): Fetch state from tui_location
global.
(tui_get_begin_asm_address): Likewise.
* tui/tui-layout.c (tui_apply_current_layout): Remove special case
for locator window.
(get_locator_window): Delete.
(initialize_known_windows): Treat locator window just like all the
rest.
* tui/tui-source.c: Add 'tui/tui-location.h' include.
(tui_source_window::set_contents): Fetch state from tui_location
global.
(tui_source_window::showing_source_p): Likewise.
* tui/tui-stack.c: Add 'tui/tui-location.h' include.
(_locator): Delete.
(tui_locator_win_info_ptr): Delete.
(tui_locator_window::make_status_line): Fetch state from
tui_location global.
(tui_locator_window::rerender): Remove check of 'handle',
reindent function body.
(tui_locator_window::set_locator_fullname): Delete.
(tui_locator_window::set_locator_info): Delete.
(tui_update_locator_fullname): Delete.
(tui_show_frame_info): Likewise.
(tui_show_locator_content): Access window through TUI_STATUS_WIN.
* tui/tui-stack.h (tui_locator_window::set_locator_info): Moved to
tui/tui-location.h and renamed to
tui_location_tracker::set_location.
(tui_locator_window::set_locator_fullname): Moved to
tui/tui-location.h and renamed to
tui_location_tracker::set_fullname.
(tui_locator_window::full_name): Delete.
(tui_locator_window::proc_name): Delete.
(tui_locator_window::line_no): Delete.
(tui_locator_window::addr): Delete.
(tui_locator_window::gdbarch): Delete.
(tui_update_locator_fullname): Delete declaration.
* tui/tui-wingeneral.c (tui_refresh_all): Removed special handling
for locator window.
* tui/tui-winsource.c: Add 'tui/tui-location.h' include.
(tui_display_main): Call function on tui_location directly.
* tui/tui.h (enum tui_win_type): Add STATUS_WIN.
* tui/tui-location.c: New file.
* tui/tui-location.h: New file.
2021-01-26 02:43:19 +08:00
|
|
|
|
2021-01-28 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (SUBDIR_TUI_SRCS): Add tui/tui-location.c.
|
|
|
|
|
(HFILES_NO_SRCDIR): Add tui/tui-location.h.
|
|
|
|
|
* tui/tui-data.h (TUI_STATUS_WIN): Define.
|
|
|
|
|
(tui_locator_win_info_ptr): Delete declaration.
|
|
|
|
|
* tui/tui-disasm.c: Add 'tui/tui-location.h' include.
|
|
|
|
|
(tui_disasm_window::set_contents): Fetch state from tui_location
|
|
|
|
|
global.
|
|
|
|
|
(tui_get_begin_asm_address): Likewise.
|
|
|
|
|
* tui/tui-layout.c (tui_apply_current_layout): Remove special case
|
|
|
|
|
for locator window.
|
|
|
|
|
(get_locator_window): Delete.
|
|
|
|
|
(initialize_known_windows): Treat locator window just like all the
|
|
|
|
|
rest.
|
|
|
|
|
* tui/tui-source.c: Add 'tui/tui-location.h' include.
|
|
|
|
|
(tui_source_window::set_contents): Fetch state from tui_location
|
|
|
|
|
global.
|
|
|
|
|
(tui_source_window::showing_source_p): Likewise.
|
|
|
|
|
* tui/tui-stack.c: Add 'tui/tui-location.h' include.
|
|
|
|
|
(_locator): Delete.
|
|
|
|
|
(tui_locator_win_info_ptr): Delete.
|
|
|
|
|
(tui_locator_window::make_status_line): Fetch state from
|
|
|
|
|
tui_location global.
|
|
|
|
|
(tui_locator_window::rerender): Remove check of 'handle',
|
|
|
|
|
reindent function body.
|
|
|
|
|
(tui_locator_window::set_locator_fullname): Delete.
|
|
|
|
|
(tui_locator_window::set_locator_info): Delete.
|
|
|
|
|
(tui_update_locator_fullname): Delete.
|
|
|
|
|
(tui_show_frame_info): Likewise.
|
|
|
|
|
(tui_show_locator_content): Access window through TUI_STATUS_WIN.
|
|
|
|
|
* tui/tui-stack.h (tui_locator_window::set_locator_info): Moved to
|
|
|
|
|
tui/tui-location.h and renamed to
|
|
|
|
|
tui_location_tracker::set_location.
|
|
|
|
|
(tui_locator_window::set_locator_fullname): Moved to
|
|
|
|
|
tui/tui-location.h and renamed to
|
|
|
|
|
tui_location_tracker::set_fullname.
|
|
|
|
|
(tui_locator_window::full_name): Delete.
|
|
|
|
|
(tui_locator_window::proc_name): Delete.
|
|
|
|
|
(tui_locator_window::line_no): Delete.
|
|
|
|
|
(tui_locator_window::addr): Delete.
|
|
|
|
|
(tui_locator_window::gdbarch): Delete.
|
|
|
|
|
(tui_update_locator_fullname): Delete declaration.
|
|
|
|
|
* tui/tui-wingeneral.c (tui_refresh_all): Removed special handling
|
|
|
|
|
for locator window.
|
|
|
|
|
* tui/tui-winsource.c: Add 'tui/tui-location.h' include.
|
|
|
|
|
(tui_display_main): Call function on tui_location directly.
|
|
|
|
|
* tui/tui.h (enum tui_win_type): Add STATUS_WIN.
|
|
|
|
|
* tui/tui-location.c: New file.
|
|
|
|
|
* tui/tui-location.h: New file.
|
|
|
|
|
|
2021-01-28 23:12:10 +08:00
|
|
|
|
2021-01-28 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (get_type_arch): Rename to...
|
|
|
|
|
(struct type) <arch>: ... this, update all users.
|
|
|
|
|
|
2021-01-28 23:09:02 +08:00
|
|
|
|
2021-01-28 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (struct type) <arch>: Rename to...
|
|
|
|
|
<arch_owner>: ... this, update all users.
|
|
|
|
|
<objfile>: Rename to...
|
|
|
|
|
<objfile_owner>: ... this, update all users.
|
|
|
|
|
|
2021-01-28 17:58:43 +08:00
|
|
|
|
2021-01-28 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdbcmd.h (execute_command_to_string): Update comment.
|
|
|
|
|
* top.c (execute_command_to_string): Update header comment.
|
|
|
|
|
|
[gdb/breakpoints] Fix longjmp master breakpoint with separate debug info
When running test-case gdb.base/longjmp.exp with target board unix/-m32, we
run into:
...
(gdb) next^M
Warning:^M
Cannot insert breakpoint 0.^M
Cannot access memory at address 0x7dbf7353^M
^M
__libc_siglongjmp (env=0x804a040 <env>, val=1) at longjmp.c:28^M
28 longjmps++;^M
(gdb) FAIL: gdb.base/longjmp.exp: next over longjmp(1)
...
The failure to access memory happens in i386_get_longjmp_target and is due to
glibc having pointer encryption (aka "pointer mangling" or "pointer guard") of
the long jump buffer. This is a known problem.
In create_longjmp_master_breakpoint (which attempts to install a master
longjmp breakpoint) a preference scheme is present, which installs a
probe breakpoint if a libc:longjmp probe is present, and otherwise falls back
to setting breakpoints at the names in the longjmp_names array.
But in fact, both the probe breakpoint and the longjmp_names breakpoints are
set. The latter ones are set when processing libc.so.debug, and the former
one when processing libc.so. In other words, this is the longjmp variant of
PR26881, which describes the same problem for master exception breakpoints.
This problem only triggers when the glibc debug info package is installed,
which is not due to the debug info itself in libc.so.debug, but due to the
minimal symbols (because create_longjmp_master_breakpoint uses minimal symbols
to translate the longjmp_names to addresses).
The problem doesn't trigger for -m64, because there tdep->jb_pc_offset is not
set.
Fix this similar to commit 1940319c0ef (the fix for PR26881): only install
longjmp_names breakpoints in libc.so/libc.so.debug if installing the
libc:longjmp probe in libc.so failed.
Tested on x86_64-linux.
gdb/ChangeLog:
2021-01-28 Tom de Vries <tdevries@suse.de>
PR breakpoints/27205
* breakpoint.c (create_longjmp_master_breakpoint_probe)
(create_longjmp_master_breakpoint_names): New function, factored out
of ...
(create_longjmp_master_breakpoint): ... here. Only try to install
longjmp_names breakpoints in libc.so/libc.so.debug if installing probe
breakpoint in libc.so failed.
2021-01-28 17:59:42 +08:00
|
|
|
|
2021-01-28 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/27205
|
|
|
|
|
* breakpoint.c (create_longjmp_master_breakpoint_probe)
|
|
|
|
|
(create_longjmp_master_breakpoint_names): New function, factored out
|
|
|
|
|
of ...
|
|
|
|
|
(create_longjmp_master_breakpoint): ... here. Only try to install
|
|
|
|
|
longjmp_names breakpoints in libc.so/libc.so.debug if installing probe
|
|
|
|
|
breakpoint in libc.so failed.
|
|
|
|
|
|
2021-01-02 04:11:28 +08:00
|
|
|
|
2021-01-27 Lancelot SIX <lsix@lancelotsix.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/27133
|
|
|
|
|
* cli/cli-interp.c (cli_interp_base::set_logging): Ensure the
|
|
|
|
|
unique_ptr is released when the wrapped pointer is kept for later
|
|
|
|
|
use.
|
|
|
|
|
|
GDB: aarch64: Add ability to displaced step over a BR/BLR instruction
Enable displaced stepping over a BR/BLR instruction
Displaced stepping over an instruction executes a instruction in a
scratch area and then manually fixes up the PC address to leave
execution where it would have been if the instruction were in its
original location.
The BR instruction does not need modification in order to run correctly
at a different address, but the displaced step fixup method should not
manually adjust the PC since the BR instruction sets that value already.
The BLR instruction should also avoid such a fixup, but must also have
the link register modified to point to just after the original code
location rather than back to the scratch location.
This patch adds the above functionality.
We add this functionality by modifying aarch64_displaced_step_others
rather than by adding a new visitor method to aarch64_insn_visitor.
We choose this since it seems that visitor approach is designed
specifically for PC relative instructions (which must always be modified
when executed in a different location).
It seems that the BR and BLR instructions are more like the RET
instruction which is already handled specially in
aarch64_displaced_step_others.
This also means the gdbserver code to relocate an instruction when
creating a fast tracepoint does not need to be modified, since nothing
special is needed for the BR and BLR instructions there.
Regression tests showed nothing untoward on native aarch64 (though it
took a while for me to get the testcase to account for PIE).
------#####
Original observed (mis)behaviour before was that displaced stepping over
a BR or BLR instruction would not execute the function they called.
Most easily seen by putting a breakpoint with a condition on such an
instruction and a print statement in the functions they called.
When run with the breakpoint enabled the function is not called and
"numargs called" is not printed.
When run with the breakpoint disabled the function is called and the
message is printed.
--- GDB Session
~ [15:57:14] % gdb ../using-blr
Reading symbols from ../using-blr...done.
(gdb) disassemble blr_call_value
Dump of assembler code for function blr_call_value:
...
0x0000000000400560 <+28>: blr x2
...
0x00000000004005b8 <+116>: ret
End of assembler dump.
(gdb) break *0x0000000000400560
Breakpoint 1 at 0x400560: file ../using-blr.c, line 22.
(gdb) condition 1 10 == 0
(gdb) run
Starting program: /home/matmal01/using-blr
[Inferior 1 (process 33279) exited with code 012]
(gdb) disable 1
(gdb) run
Starting program: /home/matmal01/using-blr
numargs called
[Inferior 1 (process 33289) exited with code 012]
(gdb)
Test program:
---- using-blr ----
\#include <stdio.h>
typedef int (foo) (int, int);
typedef void (bar) (int, int);
struct sls_testclass {
foo *x;
bar *y;
int left;
int right;
};
__attribute__ ((noinline))
int blr_call_value (struct sls_testclass x)
{
int retval = x.x(x.left, x.right);
if (retval % 10)
return 100;
return 9;
}
__attribute__ ((noinline))
int blr_call (struct sls_testclass x)
{
x.y(x.left, x.right);
if (x.left % 10)
return 100;
return 9;
}
int
numargs (__attribute__ ((unused)) int left, __attribute__ ((unused)) int right)
{
printf("numargs called\n");
return 10;
}
void
altfunc (__attribute__ ((unused)) int left, __attribute__ ((unused)) int right)
{
printf("altfunc called\n");
}
int main(int argc, char **argv)
{
struct sls_testclass x = { .x = numargs, .y = altfunc, .left = 1, .right = 2 };
if (argc > 2)
{
blr_call (x);
}
else
blr_call_value (x);
return 10;
}
2021-01-28 01:09:46 +08:00
|
|
|
|
2021-01-27 Matthew Malcomson <matthew.malcomson@arm.com>
|
|
|
|
|
|
|
|
|
|
* aarch64-tdep.c (aarch64_displaced_step_others): Account for
|
|
|
|
|
BLR and BR instructions.
|
|
|
|
|
* arch/aarch64-insn.h (enum aarch64_opcodes): Add BR opcode.
|
|
|
|
|
(enum aarch64_masks): New.
|
|
|
|
|
|
2021-01-26 23:49:09 +08:00
|
|
|
|
2021-01-26 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* windows-nat.c (DEBUG_EXEC, DEBUG_EVENTS, DEBUG_MEM)
|
|
|
|
|
(DEBUG_EXCEPT): Use debug_prefixed_printf_cond.
|
|
|
|
|
(windows_init_thread_list, windows_nat::handle_load_dll)
|
|
|
|
|
(windows_nat::handle_unload_dll, windows_nat_target::resume)
|
|
|
|
|
(windows_nat_target::resume)
|
|
|
|
|
(windows_nat_target::get_windows_debug_event)
|
|
|
|
|
(windows_nat_target::interrupt, windows_xfer_memory)
|
|
|
|
|
(windows_nat_target::close): Update.
|
|
|
|
|
* nat/windows-nat.c (DEBUG_EVENTS): Use
|
|
|
|
|
debug_prefixed_printf_cond.
|
|
|
|
|
(matching_pending_stop, fetch_pending_stop)
|
|
|
|
|
(continue_last_debug_event): Update.
|
|
|
|
|
|
2020-12-17 03:36:15 +08:00
|
|
|
|
2020-12-17 Mihails Strasuns <mihails.strasuns@intel.com>
|
|
|
|
|
|
|
|
|
|
* linux-tdep.c (linux_make_mappings_corefile_notes): Start using
|
|
|
|
|
elfcore_write_file_note.
|
|
|
|
|
|
2020-01-15 07:14:24 +08:00
|
|
|
|
2021-01-26 Shahab Vahedi <shahab@synopsys.com>
|
|
|
|
|
|
|
|
|
|
* arc-tdep.c (arc_add_reggroups): New function.
|
|
|
|
|
(arc_gdbarch_init): Call arc_add_reggroups.
|
|
|
|
|
|
2021-01-26 18:00:38 +08:00
|
|
|
|
2021-01-26 Anton Kolesov <anton.kolesov@synopsys.com>
|
2017-06-28 18:15:46 +08:00
|
|
|
|
|
|
|
|
|
* arc-tdep.c (arc_skip_prologue): Log "pc" address.
|
|
|
|
|
|
2021-01-25 23:32:31 +08:00
|
|
|
|
2021-01-25 Bernd Edlinger <bernd.edlinger@hotmail.de>
|
|
|
|
|
Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (partial_die_info::read): Use as_unsigned () for
|
|
|
|
|
DW_AT_ranges.
|
|
|
|
|
|
2021-01-25 23:13:51 +08:00
|
|
|
|
2021-01-25 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (get_mpz): New function.
|
|
|
|
|
(get_dwarf2_rational_constant): Use it.
|
|
|
|
|
|
2021-01-25 22:38:21 +08:00
|
|
|
|
2021-01-25 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (resolve_subexp): Handle array context.
|
|
|
|
|
|
2021-01-24 03:20:11 +08:00
|
|
|
|
2021-01-23 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
PR compile/25575
|
|
|
|
|
* compile/compile-loc2c.c (note_register): New function.
|
|
|
|
|
(pushf_register_address, pushf_register): Use it.
|
|
|
|
|
|
2021-01-24 03:20:11 +08:00
|
|
|
|
2021-01-23 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* symtab.h (struct symbol_computed_ops) <generate_c_location>:
|
|
|
|
|
Change type of "registers_used".
|
|
|
|
|
* dwarf2/loc.h (dwarf2_compile_property_to_c): Update.
|
|
|
|
|
* dwarf2/loc.c (dwarf2_compile_property_to_c)
|
|
|
|
|
(locexpr_generate_c_location, loclist_generate_c_location): Change
|
|
|
|
|
type of "registers_used".
|
|
|
|
|
* compile/compile.h (compile_dwarf_expr_to_c)
|
|
|
|
|
(compile_dwarf_bounds_to_c): Update.
|
|
|
|
|
* compile/compile-loc2c.c (pushf_register_address)
|
|
|
|
|
(pushf_register, do_compile_dwarf_expr_to_c)
|
|
|
|
|
(compile_dwarf_expr_to_c, compile_dwarf_bounds_to_c): Change type
|
|
|
|
|
of "registers_used".
|
|
|
|
|
* compile/compile-c.h (generate_c_for_variable_locations):
|
|
|
|
|
Update.
|
|
|
|
|
* compile/compile-c-symbols.c (generate_vla_size)
|
|
|
|
|
(generate_c_for_for_one_variable): Change type of
|
|
|
|
|
"registers_used".
|
|
|
|
|
(generate_c_for_variable_locations): Return std::vector.
|
|
|
|
|
* compile/compile-c-support.c (generate_register_struct): Change
|
|
|
|
|
type of "registers_used".
|
|
|
|
|
(compute): Update.
|
|
|
|
|
|
2021-01-24 08:48:32 +08:00
|
|
|
|
2021-01-23 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* compile/compile-internal.h (class compile_instance)
|
|
|
|
|
<set_arguments>: Change return type.
|
|
|
|
|
* compile/compile.c (compile_to_object): Remove call to reset.
|
|
|
|
|
(compile_instance::set_arguments): Change return type.
|
|
|
|
|
|
gdb: fix regression in copy_type_recursive
Commit 5b7d941b90d1 ("gdb: add owner-related methods to struct type")
introduced a regression when running gdb.base/jit-reader-simple.exp and
others. A NULL pointer dereference happens here:
#3 0x0000557b7e9e8650 in gdbarch_obstack (arch=0x0) at /home/simark/src/binutils-gdb/gdb/gdbarch.c:484
#4 0x0000557b7ea5b138 in copy_type_recursive (objfile=0x614000006640, type=0x62100018da80, copied_types=0x62100018e280) at /home/simark/src/binutils-gdb/gdb/gdbtypes.c:5537
#5 0x0000557b7ea5dcbb in copy_type_recursive (objfile=0x614000006640, type=0x62100018e200, copied_types=0x62100018e280) at /home/simark/src/binutils-gdb/gdb/gdbtypes.c:5598
#6 0x0000557b802cef51 in preserve_one_value (value=0x6110000b3640, objfile=0x614000006640, copied_types=0x62100018e280) at /home/simark/src/binutils-gdb/gdb/value.c:2518
#7 0x0000557b802cf787 in preserve_values (objfile=0x614000006640) at /home/simark/src/binutils-gdb/gdb/value.c:2562
#8 0x0000557b7fbaf19b in reread_symbols () at /home/simark/src/binutils-gdb/gdb/symfile.c:2489
#9 0x0000557b7ec65d1d in run_command_1 (args=0x0, from_tty=1, run_how=RUN_NORMAL) at /home/simark/src/binutils-gdb/gdb/infcmd.c:439
#10 0x0000557b7ec67a97 in run_command (args=0x0, from_tty=1) at /home/simark/src/binutils-gdb/gdb/infcmd.c:546
This is inside a TYPE_ALLOC macro. The fact that gdbarch_obstack is
called means that the type is flagged as being arch-owned, but arch=0x0
means that type::arch returned NULL, probably meaning that the m_owner
field contains NULL.
If we look at the code before the problematic patch, in the
copy_type_recursive function, we see:
if (! TYPE_OBJFILE_OWNED (type))
return type;
...
TYPE_OBJFILE_OWNED (new_type) = 0;
TYPE_OWNER (new_type).gdbarch = get_type_arch (type);
The last two lines were replaced with:
new_type->set_owner (type->arch ());
get_type_arch and type->arch isn't the same thing: get_type_arch gets
the type's arch owner if it is arch-owned, and gets the objfile's arch
if the type is objfile owned. So it always returns non-NULL.
type->arch returns the type's arch if the type is arch-owned, else NULL.
So since the original type is objfile owned, it effectively made the new
type arch-owned (that is good) but set the owner to NULL (that is bad).
Fix this by using get_type_arch again there.
I spotted one other similar change in lookup_array_range_type, in the
original patch. But that one appears to be correct, as it is executed
only if the type is arch-owned.
Add some asserts in type::set_owner to ensure we never set a NULL owner.
That would have helped catch the issue a little bit earlier, so it could
help in the future.
gdb/ChangeLog:
* gdbtypes.c (copy_type_recursive): Use get_type_arch.
* gdbtypes.h (struct type) <set_owner>: Add asserts.
Change-Id: I5d8bc7bfc83b3abc579be0b5aadeae4241179a00
2021-01-24 06:36:55 +08:00
|
|
|
|
2021-01-23 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.c (copy_type_recursive): Use get_type_arch.
|
|
|
|
|
* gdbtypes.h (struct type) <set_owner>: Add asserts.
|
|
|
|
|
|
2021-01-12 06:40:59 +08:00
|
|
|
|
2021-01-23 Lancelot SIX <lsix@lancelotsix.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (SELFTESTS_SRCS): Add
|
|
|
|
|
unittests/gdb_tilde_expand-selftests.c.
|
|
|
|
|
* unittests/gdb_tilde_expand-selftests.c: New file.
|
|
|
|
|
|
gdb: add new version style
This commit adds a new 'version' style, which replaces the hard coded
styling currently used for GDB's version string. GDB's version number
is displayed:
1. In the output of 'show version', and
2. When GDB starts up (without the --quiet option).
This new style can only ever affect the first of these two cases as
the second case is printed before GDB has processed any initialization
files, or processed any GDB commands passed on the command line.
However, because the first case exists I think this commit makes
sense, it means the style is no longer hard coded into GDB, and we can
add some tests that the style can be enabled/disabled correctly.
This commit is an alternative to a patch Tom posted here:
https://sourceware.org/pipermail/gdb-patches/2020-June/169820.html
I've used the style name 'version' instead of 'startup' to reflect
what the style is actually used for. If other parts of the startup
text end up being highlighted I imagine they would get their own
styles based on what is being highlighted. I feel this is more inline
with the other style names that are already in use within GDB.
I also decoupled adding this style from the idea of startup options,
and the possibility of auto-saving startup options. Those ideas can
be explored in later patches.
This commit should probably be considered only a partial solution to
issue PR cli/25956. The colours of the style are no longer hard
coded, however, it is still impossible to change the styling of the
version string displayed during startup, so in one sense, the styling
of that string is still "hard coded". A later patch will hopefully
extend GDB to allow it to adjust the version styling before the
initial version string is printed.
gdb/ChangeLog:
PR cli/25956
* cli/cli-style.c: Add 'cli/cli-setshow.h' include.
(version_style): Define.
(cli_style_option::cli_style_option): Add intensity parameter, and
use as appropriate.
(_initialize_cli_style): Register version style set/show commands.
* cli/cli-style.h (cli_style_option): Add intensity parameter.
(version_style): Declare.
* top.c (print_gdb_version): Use version_stype, and styled_string
to print the GDB version string.
gdb/doc/ChangeLog:
PR cli/25956
* gdb.texinfo (Output Styling): Document version style.
gdb/testsuite/ChangeLog:
PR cli/25956
* gdb.base/style.exp (run_style_tests): Add version string test.
(test_startup_version_string): Use version style name.
* lib/gdb-utils.exp (style): Handle version style name.
2021-01-14 04:08:51 +08:00
|
|
|
|
2021-01-22 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
PR cli/25956
|
|
|
|
|
* NEWS: Mention new command.
|
|
|
|
|
* cli/cli-style.c: Add 'cli/cli-setshow.h' include.
|
|
|
|
|
(version_style): Define.
|
|
|
|
|
(cli_style_option::cli_style_option): Add intensity parameter, and
|
|
|
|
|
use as appropriate.
|
|
|
|
|
(_initialize_cli_style): Register version style set/show commands.
|
|
|
|
|
* cli/cli-style.h (cli_style_option): Add intensity parameter.
|
|
|
|
|
(version_style): Declare.
|
|
|
|
|
* top.c (print_gdb_version): Use version_stype, and styled_string
|
|
|
|
|
to print the GDB version string.
|
|
|
|
|
|
gdb: don't print escape characters when a style is disabled
While working on another patch I noticed that if I disable a single
style with, for example:
set style filename background none
set style filename foreground none
set style filename intensity normal
Then in some places escape characters are still injected into the
output stream. This is a bit of an edge case, and I can't think when
this would actually cause problems, but it still felt like a bit of an
annoyance.
One place where this does impact is in testing, where it becomes
harder to write tight test patterns if it is not obvious when GDB will
decide to inject escape sequences.
It's especially annoying because depending on how something is printed
then GDB might, or might not, add escape characters. So this would
not add escape characters if the filename style was disabled:
fprintf_filtered (file, "%ps",
styled_string (file_name_style.style (),
"This is a test"));
But this would add escape characters:
fprintf_styled (file, file_name_style.style (),
"%s", "This is a test");
I tracked this down to some calls to set_output_style in utils.c.
Currently some calls to set_output_style (in utils.c) are guarded like
this:
if (!STYLE.is_default ())
set_output_style (stream, STYLE);
But some calls are not. It is the calls that are NOT guarded that
cause the extra escape sequences to be emitted.
My initial proposal to resolve this issue was simply to ensure that
all calls to set_output_style were guarded. The patch I posted for
this can be found here:
https://sourceware.org/pipermail/gdb-patches/2021-January/175096.html
The feedback on this proposal was that it might be better to guard
against the escape sequences being emitted at a later lever, right
down at emit_style_escape.
So this is what this version does. In emit_style_escape we already
track the currently applied style, so if the style we are being asked
to switch to is the same as the currently applied style then no escape
sequence needs to be emitted.
Making this change immediately exposed some issues in
fputs_maybe_filtered related to line wrapping. The best place to start
to understand what's going on with the styling and wrapping is look at
the test:
gdb.base/style.exp: all styles enabled: frame when width=20
If you run this test and then examine the output in an editor so the
escape sequences can be seen you'll see the duplicate escape sequences
that are emitted before this patch, the compare to after this patch
you'll see the set of escape sequences should be the minimum required.
In order to test these changes I have rewritten the gdb.base/style.exp
test script. The core of the script is now run multiple times. The
first time the test is run things are as they were before, all styles
are on.
After that the test is rerun multiple times. Each time through a
single style is disabled using the 3 explicit set calls listed above.
I then repeat all the tests, however, I arrange so that the patterns
for the disabled style now require no escape sequences.
gdb/ChangeLog:
* utils.c (emit_style_escape): Only emit an escape sequence if the
requested style is different than the current applied style.
(fputs_maybe_filtered): Adjust the juggling of the wrap_style, and
current applied_style.
(fputs_styled): Remove is_default check.
(fputs_styled_unfiltered): Likewise.
(vfprintf_styled_no_gdbfmt): Likewise.
gdb/testsuite/ChangeLog:
* gdb.base/style.exp (limited_style): New proc.
(clean_restart_and_disable): New proc.
(run_style_tests): New proc. Most of the old tests from this file
are now in this proc.
(test_startup_version_string): New proc. Reamining test from the
old file is in this proc.
2021-01-14 04:08:42 +08:00
|
|
|
|
2021-01-22 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* utils.c (emit_style_escape): Only emit an escape sequence if the
|
|
|
|
|
requested style is different than the current applied style.
|
|
|
|
|
(fputs_maybe_filtered): Adjust the juggling of the wrap_style, and
|
|
|
|
|
current applied_style.
|
|
|
|
|
(fputs_styled): Remove is_default check.
|
|
|
|
|
(fputs_styled_unfiltered): Likewise.
|
|
|
|
|
(vfprintf_styled_no_gdbfmt): Likewise.
|
|
|
|
|
|
gdb: add remote_debug_printf
This is the next in the new-style debug macro series.
For this one, I decided to omit the function name from the "Sending packet" /
"Packet received" kind of prints, just because it's not very useful in that
context and hinders readability more than anything else. This is completely
arbitrary.
This is with:
[remote] putpkt_binary: Sending packet: $qTStatus#49...
[remote] getpkt_or_notif_sane_1: Packet received: T0;tnotrun:0;tframes:0;tcreated:0;tfree:500000;tsize:500000;circular:0;disconn:0;starttime:0;stoptime:0;username:;notes::
and without:
[remote] Sending packet: $qTStatus#49...
[remote] Packet received: T0;tnotrun:0;tframes:0;tcreated:0;tfree:500000;tsize:500000;circular:0;disconn:0;starttime:0;stoptime:0;username:;notes::
A difference is that previously, the query packet and its reply would be
printed on the same line, like this:
Sending packet: $qTStatus#49...Packet received: T0;tnotrun:0;tframes:0;tcreated:0;tfree:500000;tsize:500000;circular:0;disconn:0;starttime:0;stoptime:0;username:;notes::
Now, they are printed on two lines, since each remote_debug_printf{,_nofunc}
prints its own complete message including an end of line. It's probably
a matter of taste, but I prefer the two-line version, it's easier to
follow, especially when the query packet is long.
As a result, lib/range-stepping-support.exp needs to be updated, as it
currently expects the vCont packet and the reply to be on the same line.
I think it's sufficient in that context to just expect the vCont packet
and not the reply, since the goal is just to count how many vCont;r GDB
sends.
gdb/ChangeLog:
* remote.h (remote_debug_printf): New.
(remote_debug_printf_nofunc): New.
(REMOTE_SCOPED_DEBUG_ENTER_EXIT): New.
* remote.c: Use above macros throughout file.
gdbsupport/ChangeLog:
* common-debug.h (debug_prefixed_printf_cond_nofunc): New.
* common-debug.c (debug_prefixed_vprintf): Handle a nullptr
func.
gdb/testsuite/ChangeLog:
* lib/range-stepping-support.exp (exec_cmd_expect_vCont_count):
Adjust to "set debug remote" changes.
Change-Id: Ica6dead50d3f82e855c7d763f707cef74bed9fee
2021-01-23 01:43:27 +08:00
|
|
|
|
2021-01-22 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* remote.h (remote_debug_printf): New.
|
|
|
|
|
(remote_debug_printf_nofunc): New.
|
|
|
|
|
(REMOTE_SCOPED_DEBUG_ENTER_EXIT): New.
|
|
|
|
|
* remote.c: Use above macros throughout file.
|
|
|
|
|
|
2021-01-23 01:40:48 +08:00
|
|
|
|
2021-01-22 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* remote.h (remote_debug): Change to bool.
|
|
|
|
|
* remote.c (remote_debug): Change to bool.
|
|
|
|
|
(_initialize_remote): Adjust.
|
|
|
|
|
|
2021-01-23 01:39:08 +08:00
|
|
|
|
2021-01-22 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* target.h (remote_debug): Move to...
|
|
|
|
|
* remote.h (remote_debug): ... here.
|
|
|
|
|
* top.c (remote_debug): Move to...
|
|
|
|
|
* remote.c (remote_debug): ... here.
|
|
|
|
|
* remote-sim.c: Include remote.h.
|
|
|
|
|
|
2021-01-23 01:35:54 +08:00
|
|
|
|
2021-01-22 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* cli/cli-cmds.c (show_remote_debug): Remove.
|
|
|
|
|
(show_remote_timeout): Remove.
|
|
|
|
|
(_initialize_cli_cmds): Don't register commands.
|
|
|
|
|
* remote.c (show_remote_debug): Move here.
|
|
|
|
|
(show_remote_timeout): Move here.
|
|
|
|
|
(_initialize_remote): Register commands.
|
|
|
|
|
|
2021-01-23 01:23:53 +08:00
|
|
|
|
2021-01-22 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (TYPE_OBJFILE): Remove, change all users to use the
|
|
|
|
|
type::objfile method instead.
|
|
|
|
|
|
2021-01-23 01:23:40 +08:00
|
|
|
|
2021-01-22 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (TYPE_OBJFILE_OWNED): Remove, update all users to
|
|
|
|
|
use the type::is_objfile_owned method.
|
|
|
|
|
|
2021-01-23 01:21:09 +08:00
|
|
|
|
2021-01-22 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* gdbtypes.h (TYPE_OBJFILE_OWNED): Adjust.
|
|
|
|
|
(TYPE_OWNER): Remove.
|
|
|
|
|
(TYPE_OBJFILE): Adjust.
|
|
|
|
|
(struct main_type) <flag_objfile_owned>: Rename to...
|
|
|
|
|
<m_flag_objfile_owned>: ... this.
|
|
|
|
|
<owner>: Rename to...
|
|
|
|
|
<m_owner>: ... this.
|
|
|
|
|
(struct type) <is_objfile_owned, set_owner, objfile, arch>: New
|
|
|
|
|
methods.
|
|
|
|
|
(TYPE_ALLOC): Adjust.
|
|
|
|
|
* gdbtypes.c (alloc_type): Adjust.
|
|
|
|
|
(alloc_type_arch): Adjust.
|
|
|
|
|
(alloc_type_copy): Adjust.
|
|
|
|
|
(get_type_arch): Adjust.
|
|
|
|
|
(smash_type): Adjust.
|
|
|
|
|
(lookup_array_range_type): Adjust.
|
|
|
|
|
(recursive_dump_type): Adjust.
|
|
|
|
|
(copy_type_recursive): Adjust.
|
|
|
|
|
* compile/compile-c-types.c (convert_func): Adjust.
|
|
|
|
|
(convert_type_basic): Adjust.
|
|
|
|
|
* compile/compile-cplus-types.c (compile_cplus_convert_func):
|
|
|
|
|
Adjust.
|
|
|
|
|
* language.c
|
|
|
|
|
(language_arch_info::type_and_symbol::alloc_type_symbol):
|
|
|
|
|
Adjust.
|
|
|
|
|
|
2021-01-21 21:27:12 +08:00
|
|
|
|
2021-01-21 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* coffread.c (enter_linenos): Passing string to complaint.
|
|
|
|
|
* valops.c (value_assign): Make array view.
|
|
|
|
|
|
2021-01-22 03:12:22 +08:00
|
|
|
|
2021-01-21 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* auto-load.h (debug_auto_load): Move here.
|
|
|
|
|
(auto_load_debug_printf): New.
|
|
|
|
|
* auto-load.c: Use auto_load_debug_printf.
|
|
|
|
|
(debug_auto_load): Move to header.
|
|
|
|
|
* linux-thread-db.c (try_thread_db_load): Use
|
|
|
|
|
auto_load_debug_printf.
|
|
|
|
|
* main.c (captured_main_1): Likewise.
|
|
|
|
|
|
2021-01-22 03:07:45 +08:00
|
|
|
|
2021-01-21 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* f-valprint.c (f77_array_offset_tbl): Remove.
|
|
|
|
|
|
2021-01-22 03:05:54 +08:00
|
|
|
|
2021-01-21 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* gdb_bfd.c (bfd_cache_debug_printf): New, use throughout file.
|
|
|
|
|
|
gdb: use interruptible_select when connecting to a remote
When GDB is waiting trying to connect to a remote target and it receives
a SIGWINCH (terminal gets resized), the blocking system call gets
interrupted and we abort.
For example, I connect to some port (on which nothing listens):
(gdb) tar rem :1234
... GDB blocks here, resize the terminal ...
:1234: Interrupted system call.
The backtrace where GDB is blocked while waiting for the connection to
establish is:
#0 0x00007fe9db805b7b in select () from /usr/lib/libc.so.6
#1 0x000055f2472e9c42 in gdb_select (n=0, readfds=0x0, writefds=0x0, exceptfds=0x0, timeout=0x7ffe8fafe050) at /home/simark/src/binutils-gdb/gdb/posix-hdep.c:31
#2 0x000055f24759c212 in wait_for_connect (sock=-1, polls=0x7ffe8fafe300) at /home/simark/src/binutils-gdb/gdb/ser-tcp.c:147
#3 0x000055f24759d0e8 in net_open (scb=0x62500015b900, name=0x6020000601d8 ":1234") at /home/simark/src/binutils-gdb/gdb/ser-tcp.c:356
#4 0x000055f2475a0395 in serial_open_ops_1 (ops=0x55f24892ca60 <tcp_ops>, open_name=0x6020000601d8 ":1234") at /home/simark/src/binutils-gdb/gdb/serial.c:244
#5 0x000055f2475a01d6 in serial_open (name=0x6020000601d8 ":1234") at /home/simark/src/binutils-gdb/gdb/serial.c:231
#6 0x000055f2474d5274 in remote_serial_open (name=0x6020000601d8 ":1234") at /home/simark/src/binutils-gdb/gdb/remote.c:5019
#7 0x000055f2474d7025 in remote_target::open_1 (name=0x6020000601d8 ":1234", from_tty=1, extended_p=0) at /home/simark/src/binutils-gdb/gdb/remote.c:5571
#8 0x000055f2474d47d5 in remote_target::open (name=0x6020000601d8 ":1234", from_tty=1) at /home/simark/src/binutils-gdb/gdb/remote.c:4898
#9 0x000055f24776379f in open_target (args=0x6020000601d8 ":1234", from_tty=1, command=0x611000042bc0) at /home/simark/src/binutils-gdb/gdb/target.c:242
Fix that by using interruptible_select in wait_for_connect, instead of
gdb_select. Resizing the terminal now no longer aborts the connection.
It is still possible to interrupt the connection using ctrl-c.
gdb/ChangeLog:
* ser-tcp.c (wait_for_connect): Use interruptible_select instead
of gdb_select.
Change-Id: Ie25577bd1e5699e4847b6b53fdfa10b8c0dc5c89
2021-01-22 03:04:52 +08:00
|
|
|
|
2021-01-21 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* ser-tcp.c (wait_for_connect): Use interruptible_select instead
|
|
|
|
|
of gdb_select.
|
|
|
|
|
|
2021-01-02 20:51:27 +08:00
|
|
|
|
2021-01-21 Hannes Domani <ssbssa@yahoo.de>
|
|
|
|
|
|
|
|
|
|
PR python/19151
|
|
|
|
|
* python/py-breakpoint.c (bppy_get_location): Handle
|
|
|
|
|
bp_hardware_breakpoint.
|
|
|
|
|
(bppy_init): Likewise.
|
|
|
|
|
(gdbpy_breakpoint_created): Likewise.
|
|
|
|
|
|
2021-01-21 22:26:44 +08:00
|
|
|
|
2021-01-21 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* arm-tdep.c (arm_debug_printf): Add and use throughout file.
|
|
|
|
|
|
2021-01-21 11:38:20 +08:00
|
|
|
|
2021-01-20 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* gdb_bfd.c (debug_bfd_cache): Change type to bool.
|
|
|
|
|
(_initialize_gdb_bfd): Adjust.
|
|
|
|
|
|
gdb/dwarf: add assertion in maybe_queue_comp_unit
The symptom that leads to this is the crash described in PR 26828:
/home/simark/src/binutils-gdb/gdb/dwarf2/read.c:23478:25: runtime error: member access within null pointer of type 'struct dwarf2_cu'
The line of the crash is the following, in follow_die_offset:
if (target_cu != cu)
target_cu->ancestor = cu; <--- HERE
The line that assign nullptr to `target_cu` is the `per_objfile->get_cu`
call after having called maybe_queue_comp_unit:
/* If necessary, add it to the queue and load its DIEs. */
if (maybe_queue_comp_unit (cu, per_cu, per_objfile, cu->language))
load_full_comp_unit (per_cu, per_objfile, per_objfile->get_cu (per_cu),
false, cu->language);
target_cu = per_objfile->get_cu (per_cu); <--- HERE
Some background: there is an invariant, documented in
maybe_queue_comp_unit's doc, that if a CU is queued for expansion
(present in dwarf2_per_bfd::queue), then its DIEs are loaded in memory.
"its DIEs are loaded in memory" is a synonym for saying that a dwarf2_cu
object exists for this CU. Yet another way to say it is that
`per_objfile->get_cu (per_cu)` returns something not nullptr for that
CU.
The crash documented in PR 26828 triggers some hard-to-reproduce
sequence that ends up violating the invariant:
- dwarf2_fetch_die_type_sect_off gets called for a DIE in CU A
- The DIE in CU A requires some DIE in CU B
- follow_die_offset calls maybe_queue_comp_unit. maybe_queue_comp_unit
sees CU B is not queued and its DIEs are not loaded, so it enqueues it
and returns 1 to its caller - meaning "the DIEs are not loaded, you
should load them" - prompting follow_die_offset to load the DIEs by
calling load_full_comp_unit
- Note that CU B is enqueued by maybe_queue_comp_unit even if it has
already been expanded. It's a bit useless (and causes trouble, see
next patch), but that's how it works right now.
- Since we entered the dwarf2/read code through
dwarf2_fetch_die_type_sect_off, nothing processes the queue, so we
exit the dwarf2/read code with CU B still lingering in the queue.
- dwarf2_fetch_die_type_sect_off gets called for a DIE in CU A, again
- The DIE in CU A requires some DIE in CU B, again
- This time, maybe_queue_comp_unit sees that CU B is in the queue.
Because of the invariant that if a CU is in the queue, its DIEs are
loaded in the memory, it returns 0 to its caller, meaning "you don't
need to load the DIEs!".
- That happens to be true, so everything is fine for now.
- Time passes, some things call dwarf2_per_objfile::age_comp_units
enough so that CU B's age becomes past the dwarf_max_cache_age
threshold. age_comp_units proceeds to free CU B's DIEs. Remember
that CU B is still lingering in the queue (oops, the invariant just
got violated).
- dwarf2_fetch_die_type_sect_off gets called for a DIE in CU A, again
- The DIE in CU A requires some DIE in CU B, again
- maybe_queue_comp_unit sees that CU B is in the queue, so returns to
its caller "you don't need to load the DIEs!". However, we know at
this point this is false.
- follow_die_offset doesn't load the DIEs and tries to obtain the DIEs for
CU B:
target_cu = per_objfile->get_cu (per_cu);
But since they are not loaded, target_cu is nullptr, and we get the
crash mentioned above a few lines after that.
This patch adds an assertions in maybe_queue_comp_unit to verify the
invariant, to make sure it doesn't return a falsehood to its caller.
The current patch doesn't fix the issue (the next patch does), but it
makes it so we catch the problem earlier and get this assertion failure
instead of a segmentation fault:
/home/simark/src/binutils-gdb/gdb/dwarf2/read.c:9100: internal-error:
int maybe_queue_comp_unit(dwarf2_cu*, dwarf2_per_cu_data*, dwarf2_per_objfile*, language):
Assertion `per_objfile->get_cu (per_cu) != nullptr' failed.
gdb/ChangeLog:
PR gdb/26828
* dwarf2/read.c (maybe_queue_comp_unit): Add assertion.
Change-Id: I4e51bd7bd58773f9fadf480179cbc4bae61508fe
2021-01-21 10:04:43 +08:00
|
|
|
|
2021-01-20 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
PR gdb/26828
|
|
|
|
|
* dwarf2/read.c (maybe_queue_comp_unit): Add assertion.
|
|
|
|
|
|
2021-01-21 09:57:49 +08:00
|
|
|
|
2021-01-20 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* dwarf2/read.c (follow_die_offset): Add logging.
|
|
|
|
|
(dwarf2_per_objfile::age_comp_units): Add logging.
|
|
|
|
|
|
gdb: make some variables static
I'm trying to enable clang's -Wmissing-variable-declarations warning.
This patch fixes all the obvious spots where we can simply add "static"
(at least, found when building on x86-64 Linux).
gdb/ChangeLog:
* aarch64-linux-tdep.c (aarch64_linux_record_tdep): Make static.
* aarch64-tdep.c (tdesc_aarch64_list, aarch64_prologue_unwind,
aarch64_stub_unwind, aarch64_normal_base, ): Make static.
* arm-linux-tdep.c (arm_prologue_unwind): Make static.
* arm-tdep.c (struct frame_unwind): Make static.
* auto-load.c (auto_load_safe_path_vec): Make static.
* csky-tdep.c (csky_stub_unwind): Make static.
* gdbarch.c (gdbarch_data_registry): Make static.
* gnu-v2-abi.c (gnu_v2_abi_ops): Make static.
* i386-netbsd-tdep.c (i386nbsd_mc_reg_offset): Make static.
* i386-tdep.c (i386_frame_setup_skip_insns,
i386_tramp_chain_in_reg_insns, i386_tramp_chain_on_stack_insns):
Make static.
* infrun.c (observer_mode): Make static.
* linux-nat.c (sigchld_action): Make static.
* linux-thread-db.c (thread_db_list): Make static.
* maint-test-options.c (maintenance_test_options_list):
* mep-tdep.c (mep_csr_registers): Make static.
* mi/mi-cmds.c (struct mi_cmd_stats): Remove struct type name.
(stats): Make static.
* nat/linux-osdata.c (struct osdata_type): Make static.
* ppc-netbsd-tdep.c (ppcnbsd_reg_offsets): Make static.
* progspace.c (last_program_space_num): Make static.
* python/py-param.c (struct parm_constant): Remove struct type
name.
(parm_constants): Make static.
* python/py-record-btrace.c (btpy_list_methods): Make static.
* python/py-record.c (recpy_gap_type): Make static.
* record.c (record_goto_cmdlist): Make static.
* regcache.c (regcache_descr_handle): Make static.
* registry.h (DEFINE_REGISTRY): Make definition static.
* symmisc.c (std_in, std_out, std_err): Make static.
* top.c (previous_saved_command_line): Make static.
* tracepoint.c (trace_user, trace_notes, trace_stop_notes): Make
static.
* unittests/command-def-selftests.c (nr_duplicates,
nr_invalid_prefixcmd, lists): Make static.
* unittests/observable-selftests.c (test_notification): Make
static.
* unittests/optional/assignment/1.cc (counter): Make static.
* unittests/optional/assignment/2.cc (counter): Make static.
* unittests/optional/assignment/3.cc (counter): Make static.
* unittests/optional/assignment/4.cc (counter): Make static.
* unittests/optional/assignment/5.cc (counter): Make static.
* unittests/optional/assignment/6.cc (counter): Make static.
gdbserver/ChangeLog:
* ax.cc (bytecode_address_table): Make static.
* debug.cc (debug_file): Make static.
* linux-low.cc (stopping_threads): Make static.
(step_over_bkpt): Make static.
* linux-x86-low.cc (amd64_emit_ops, i386_emit_ops): Make static.
* tracepoint.cc (stop_tracing_bkpt, flush_trace_buffer_bkpt,
alloced_trace_state_variables, trace_buffer_ctrl,
tracing_start_time, tracing_stop_time, tracing_user_name,
tracing_notes, tracing_stop_note): Make static.
Change-Id: Ic1d8034723b7802502bda23770893be2338ab020
2021-01-21 09:55:05 +08:00
|
|
|
|
2021-01-20 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* aarch64-linux-tdep.c (aarch64_linux_record_tdep): Make static.
|
|
|
|
|
* aarch64-tdep.c (tdesc_aarch64_list, aarch64_prologue_unwind,
|
|
|
|
|
aarch64_stub_unwind, aarch64_normal_base, ): Make static.
|
|
|
|
|
* arm-linux-tdep.c (arm_prologue_unwind): Make static.
|
|
|
|
|
* arm-tdep.c (struct frame_unwind): Make static.
|
|
|
|
|
* auto-load.c (auto_load_safe_path_vec): Make static.
|
|
|
|
|
* csky-tdep.c (csky_stub_unwind): Make static.
|
|
|
|
|
* gdbarch.c (gdbarch_data_registry): Make static.
|
|
|
|
|
* gnu-v2-abi.c (gnu_v2_abi_ops): Make static.
|
|
|
|
|
* i386-netbsd-tdep.c (i386nbsd_mc_reg_offset): Make static.
|
|
|
|
|
* i386-tdep.c (i386_frame_setup_skip_insns,
|
|
|
|
|
i386_tramp_chain_in_reg_insns, i386_tramp_chain_on_stack_insns):
|
|
|
|
|
Make static.
|
|
|
|
|
* infrun.c (observer_mode): Make static.
|
|
|
|
|
* linux-nat.c (sigchld_action): Make static.
|
|
|
|
|
* linux-thread-db.c (thread_db_list): Make static.
|
|
|
|
|
* maint-test-options.c (maintenance_test_options_list):
|
|
|
|
|
* mep-tdep.c (mep_csr_registers): Make static.
|
|
|
|
|
* mi/mi-cmds.c (struct mi_cmd_stats): Remove struct type name.
|
|
|
|
|
(stats): Make static.
|
|
|
|
|
* nat/linux-osdata.c (struct osdata_type): Make static.
|
|
|
|
|
* ppc-netbsd-tdep.c (ppcnbsd_reg_offsets): Make static.
|
|
|
|
|
* progspace.c (last_program_space_num): Make static.
|
|
|
|
|
* python/py-param.c (struct parm_constant): Remove struct type
|
|
|
|
|
name.
|
|
|
|
|
(parm_constants): Make static.
|
|
|
|
|
* python/py-record-btrace.c (btpy_list_methods): Make static.
|
|
|
|
|
* python/py-record.c (recpy_gap_type): Make static.
|
|
|
|
|
* record.c (record_goto_cmdlist): Make static.
|
|
|
|
|
* regcache.c (regcache_descr_handle): Make static.
|
|
|
|
|
* registry.h (DEFINE_REGISTRY): Make definition static.
|
|
|
|
|
* symmisc.c (std_in, std_out, std_err): Make static.
|
|
|
|
|
* top.c (previous_saved_command_line): Make static.
|
|
|
|
|
* tracepoint.c (trace_user, trace_notes, trace_stop_notes): Make
|
|
|
|
|
static.
|
|
|
|
|
* unittests/command-def-selftests.c (nr_duplicates,
|
|
|
|
|
nr_invalid_prefixcmd, lists): Make static.
|
|
|
|
|
* unittests/observable-selftests.c (test_notification): Make
|
|
|
|
|
static.
|
|
|
|
|
* unittests/optional/assignment/1.cc (counter): Make static.
|
|
|
|
|
* unittests/optional/assignment/2.cc (counter): Make static.
|
|
|
|
|
* unittests/optional/assignment/3.cc (counter): Make static.
|
|
|
|
|
* unittests/optional/assignment/4.cc (counter): Make static.
|
|
|
|
|
* unittests/optional/assignment/5.cc (counter): Make static.
|
|
|
|
|
* unittests/optional/assignment/6.cc (counter): Make static.
|
|
|
|
|
|
2021-01-21 09:38:57 +08:00
|
|
|
|
2021-01-20 Joel Sherrill <joel@rtems.org>
|
|
|
|
|
|
|
|
|
|
PR gdb/27219
|
|
|
|
|
* remote.c (struct remote_thread_info) <resume_state>: Rename
|
|
|
|
|
to...
|
|
|
|
|
<get_resume_state>: ... this.
|
|
|
|
|
(remote_target::resume): Adjust.
|
|
|
|
|
(remote_target::commit_resume): Adjust.
|
|
|
|
|
(remote_target::select_thread_for_ambiguous_stop_reply): Adjust.
|
|
|
|
|
|
2021-01-03 15:42:52 +08:00
|
|
|
|
2021-01-20 Sergio Durigan Junior <sergiodj@sergiodj.net>
|
|
|
|
|
Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* stap-probe.c (stap_parse_single_operand): Handle '!'
|
|
|
|
|
operator.
|
|
|
|
|
(stap_parse_argument_conditionally): Likewise.
|
|
|
|
|
Skip spaces after processing open-parenthesis sub-expression.
|
|
|
|
|
(stap_parse_argument_1): Skip spaces after call to
|
|
|
|
|
stap_parse_argument_conditionally.
|
|
|
|
|
Handle case when right-side expression is a parenthesized
|
|
|
|
|
sub-expression.
|
|
|
|
|
Skip spaces after call to stap_parse_argument_1.
|
|
|
|
|
|
2021-01-16 03:35:36 +08:00
|
|
|
|
2021-01-19 Lancelot SIX <lsix@lancelotsix.com>
|
|
|
|
|
|
|
|
|
|
* top.h (switch_thru_all_uis): Use DISABLE_COPY_AND_ASSIGN.
|
|
|
|
|
|
trad-frame cleanups
With the new member functions for struct trad_frame_saved_reg, there is no
need to invoke some of the set/get functions anymore. This patch removes
those and adjusts all callers.
Even though the most natural initial state of a saved register value is
UNKNOWN, there are target backends relying on the previous initial state
of REALREG set to a register's own number. I noticed this in at least a
couple targets: aarch64 and riscv.
Because of that, I decided to keep the reset function that sets the set of
register values to REALREG. I can't exercise all the targets to make sure
the initial state change won't break things, hence why it is risky to change
the default.
Validated with --enable-targets=all on aarch64-linux Ubuntu 18.04/20.04.
gdb/ChangeLog
2021-01-19 Luis Machado <luis.machado@linaro.org>
* trad-frame.h (trad_frame_saved_reg) <set_value_bytes>: Allocate
memory and save data.
(trad_frame_set_value, trad_frame_set_realreg, trad_frame_set_addr)
(trad_frame_set_unknown, trad_frame_set_value_bytes)
(trad_frame_value_p, trad_frame_addr_p, trad_frame_realreg_p)
(trad_frame_value_bytes_p): Remove.
(trad_frame_reset_saved_regs): Adjust documentation.
* trad-frame.c (trad_frame_alloc_saved_regs): Initialize via a
constructor and reset the state of the registers.
(trad_frame_value_p, trad_frame_addr_p, trad_frame_realreg_p)
(trad_frame_value_bytes_p, trad_frame_set_value)
(trad_frame_set_realreg, trad_frame_set_addr)
(trad_frame_set_unknown, trad_frame_set_value_bytes): Remove.
(trad_frame_set_reg_realreg): Update to call member function.
(trad_frame_set_reg_addr, trad_frame_set_reg_value_bytes): Likewise.
(trad_frame_get_prev_register): Likewise.
* aarch64-tdep.c (aarch64_analyze_prologue)
(aarch64_analyze_prologue_test, aarch64_make_prologue_cache_1)
(aarch64_prologue_prev_register): Update to use member functions.
* alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise.
* alpha-tdep.c (alpha_heuristic_frame_unwind_cache): Likewise.
* arc-tdep.c (arc_print_frame_cache, arc_make_frame_cache): Likewise.
* arm-tdep.c (arm_make_prologue_cache, arm_exidx_fill_cache)
(arm_make_epilogue_frame_cache): Likewise.
* avr-tdep.c (avr_frame_unwind_cache)
(avr_frame_prev_register): Likewise.
* cris-tdep.c (cris_scan_prologue): Likewise.
* csky-tdep.c (csky_frame_unwind_cache): Likewise.
* frv-tdep.c (frv_analyze_prologue): Likewise.
* hppa-tdep.c (hppa_frame_cache, hppa_fallback_frame_cache): Likewise.
* lm32-tdep.c (lm32_frame_cache): Likewise.
* m32r-tdep.c (m32r_frame_unwind_cache): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise.
* mips-tdep.c (set_reg_offset, mips_insn16_frame_cache)
(mips_micro_frame_cache, mips_insn32_frame_cache): Likewise.
(reset_saved_regs): Adjust to set realreg.
* riscv-tdep.c (riscv_scan_prologue, riscv_frame_cache): Adjust to
call member functions.
* rs6000-tdep.c (rs6000_frame_cache, rs6000_epilogue_frame_cache)
* s390-tdep.c (s390_prologue_frame_unwind_cache)
(s390_backchain_frame_unwind_cache): Likewise.
* score-tdep.c (score7_analyze_prologue)
(score3_analyze_prologue, score_make_prologue_cache): Likewise.
* sparc-netbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise.
* sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_cache): Likewise.
* sparc64-netbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise.
* sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_cache): Likewise.
* tilegx-tdep.c (tilegx_analyze_prologue)
(tilegx_frame_cache): Likewise.
* v850-tdep.c (v850_frame_cache): Likewise.
* vax-tdep.c (vax_frame_cache): Likewise.
2021-01-15 02:43:28 +08:00
|
|
|
|
2021-01-19 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* trad-frame.h (trad_frame_saved_reg) <set_value_bytes>: Allocate
|
|
|
|
|
memory and save data.
|
|
|
|
|
(trad_frame_set_value, trad_frame_set_realreg, trad_frame_set_addr)
|
|
|
|
|
(trad_frame_set_unknown, trad_frame_set_value_bytes)
|
|
|
|
|
(trad_frame_value_p, trad_frame_addr_p, trad_frame_realreg_p)
|
|
|
|
|
(trad_frame_value_bytes_p): Remove.
|
|
|
|
|
(trad_frame_reset_saved_regs): Adjust documentation.
|
|
|
|
|
* trad-frame.c (trad_frame_alloc_saved_regs): Initialize via a
|
|
|
|
|
constructor and reset the state of the registers.
|
|
|
|
|
(trad_frame_value_p, trad_frame_addr_p, trad_frame_realreg_p)
|
|
|
|
|
(trad_frame_value_bytes_p, trad_frame_set_value)
|
|
|
|
|
(trad_frame_set_realreg, trad_frame_set_addr)
|
|
|
|
|
(trad_frame_set_unknown, trad_frame_set_value_bytes): Remove.
|
|
|
|
|
(trad_frame_set_reg_realreg): Update to call member function.
|
|
|
|
|
(trad_frame_set_reg_addr, trad_frame_set_reg_value_bytes): Likewise.
|
|
|
|
|
(trad_frame_get_prev_register): Likewise.
|
|
|
|
|
|
|
|
|
|
* aarch64-tdep.c (aarch64_analyze_prologue)
|
|
|
|
|
(aarch64_analyze_prologue_test, aarch64_make_prologue_cache_1)
|
|
|
|
|
(aarch64_prologue_prev_register): Update to use member functions.
|
|
|
|
|
* alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise.
|
|
|
|
|
* alpha-tdep.c (alpha_heuristic_frame_unwind_cache): Likewise.
|
|
|
|
|
* arc-tdep.c (arc_print_frame_cache, arc_make_frame_cache): Likewise.
|
|
|
|
|
* arm-tdep.c (arm_make_prologue_cache, arm_exidx_fill_cache)
|
|
|
|
|
(arm_make_epilogue_frame_cache): Likewise.
|
|
|
|
|
* avr-tdep.c (avr_frame_unwind_cache)
|
|
|
|
|
(avr_frame_prev_register): Likewise.
|
|
|
|
|
* cris-tdep.c (cris_scan_prologue): Likewise.
|
|
|
|
|
* csky-tdep.c (csky_frame_unwind_cache): Likewise.
|
|
|
|
|
* frv-tdep.c (frv_analyze_prologue): Likewise.
|
|
|
|
|
* hppa-tdep.c (hppa_frame_cache, hppa_fallback_frame_cache): Likewise.
|
|
|
|
|
* lm32-tdep.c (lm32_frame_cache): Likewise.
|
|
|
|
|
* m32r-tdep.c (m32r_frame_unwind_cache): Likewise.
|
|
|
|
|
* m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise.
|
|
|
|
|
* mips-tdep.c (set_reg_offset, mips_insn16_frame_cache)
|
|
|
|
|
(mips_micro_frame_cache, mips_insn32_frame_cache): Likewise.
|
|
|
|
|
(reset_saved_regs): Adjust to set realreg.
|
|
|
|
|
* riscv-tdep.c (riscv_scan_prologue, riscv_frame_cache): Adjust to
|
|
|
|
|
call member functions.
|
|
|
|
|
* rs6000-tdep.c (rs6000_frame_cache, rs6000_epilogue_frame_cache)
|
|
|
|
|
* s390-tdep.c (s390_prologue_frame_unwind_cache)
|
|
|
|
|
(s390_backchain_frame_unwind_cache): Likewise.
|
|
|
|
|
* score-tdep.c (score7_analyze_prologue)
|
|
|
|
|
(score3_analyze_prologue, score_make_prologue_cache): Likewise.
|
|
|
|
|
* sparc-netbsd-tdep.c (sparc32nbsd_sigcontext_saved_regs): Likewise.
|
|
|
|
|
* sparc-sol2-tdep.c (sparc32_sol2_sigtramp_frame_cache): Likewise.
|
|
|
|
|
* sparc64-netbsd-tdep.c (sparc64nbsd_sigcontext_saved_regs): Likewise.
|
|
|
|
|
* sparc64-sol2-tdep.c (sparc64_sol2_sigtramp_frame_cache): Likewise.
|
|
|
|
|
* tilegx-tdep.c (tilegx_analyze_prologue)
|
|
|
|
|
(tilegx_frame_cache): Likewise.
|
|
|
|
|
* v850-tdep.c (v850_frame_cache): Likewise.
|
|
|
|
|
* vax-tdep.c (vax_frame_cache): Likewise.
|
|
|
|
|
|
2021-01-16 00:16:04 +08:00
|
|
|
|
2021-01-19 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* frame.h (get_frame_register_bytes): Pass a gdb::array_view instead
|
|
|
|
|
of buffer + length.
|
|
|
|
|
(put_frame_register_bytes): Likewise.
|
|
|
|
|
Adjust documentation.
|
|
|
|
|
(get_frame_memory): Pass a gdb::array_view instead of buffer + length.
|
|
|
|
|
(safe_frame_unwind_memory): Likewise.
|
|
|
|
|
* frame.c (get_frame_register_bytes, put_frame_register_bytes)
|
|
|
|
|
(get_frame_memory, safe_frame_unwind_memory): Adjust to use
|
|
|
|
|
gdb::array_view.
|
|
|
|
|
* amd64-fbsd-tdep.c (amd64fbsd_sigtramp_p): Likewise.
|
|
|
|
|
* amd64-linux-tdep.c (amd64_linux_sigtramp_start): Likewise.
|
|
|
|
|
* amd64-obsd-tdep.c (amd64obsd_sigtramp_p): Likewise.
|
|
|
|
|
* arc-linux-tdep.c (arc_linux_is_sigtramp): Likewise.
|
|
|
|
|
* cris-tdep.c (cris_sigtramp_start, cris_rt_sigtramp_start): Likewise.
|
|
|
|
|
* dwarf2/loc.c (rw_pieced_value): Likewise.
|
|
|
|
|
* hppa-tdep.c (hppa_frame_cache): Likewise.
|
|
|
|
|
* i386-fbsd-tdep.c (i386fbsd_sigtramp_p): Likewise.
|
|
|
|
|
* i386-gnu-tdep.c (i386_gnu_sigtramp_start): Likewise.
|
|
|
|
|
* i386-linux-tdep.c (i386_linux_sigtramp_start)
|
|
|
|
|
(i386_linux_rt_sigtramp_start): Likewise.
|
|
|
|
|
* i386-obsd-tdep.c (i386obsd_sigtramp_p): Likewise.
|
|
|
|
|
* i386-tdep.c (i386_register_to_value): Likewise.
|
|
|
|
|
* i387-tdep.c (i387_register_to_value): Likewise.
|
|
|
|
|
* ia64-tdep.c (ia64_register_to_value): Likewise.
|
|
|
|
|
* m32r-linux-tdep.c (m32r_linux_sigtramp_start)
|
|
|
|
|
(m32r_linux_rt_sigtramp_start): Likewise.
|
|
|
|
|
* m68k-linux-tdep.c (m68k_linux_pc_in_sigtramp): Likewise.
|
|
|
|
|
* m68k-tdep.c (m68k_register_to_value): Likewise.
|
|
|
|
|
* mips-tdep.c (mips_register_to_value)
|
|
|
|
|
(mips_value_to_register): Likewise.
|
|
|
|
|
* ppc-fbsd-tdep.c (ppcfbsd_sigtramp_frame_sniffer)
|
|
|
|
|
(ppcfbsd_sigtramp_frame_cache): Likewise.
|
|
|
|
|
* ppc-obsd-tdep.c (ppcobsd_sigtramp_frame_sniffer)
|
|
|
|
|
(ppcobsd_sigtramp_frame_cache): Likewise.
|
|
|
|
|
* rs6000-tdep.c (rs6000_in_function_epilogue_frame_p)
|
|
|
|
|
(rs6000_register_to_value): Likewise.
|
|
|
|
|
* tilegx-tdep.c (tilegx_analyze_prologue): Likewise.
|
|
|
|
|
* tramp-frame.c (tramp_frame_start): Likewise.
|
|
|
|
|
* valops.c (value_assign): Likewise.
|
|
|
|
|
|
2020-12-24 03:06:11 +08:00
|
|
|
|
2021-01-19 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
* aarch64-linux-tdep.c (aarch64_linux_restore_vreg): Pass in an
|
|
|
|
|
array_view.
|
|
|
|
|
* trad-frame.c (trad_frame_set_value_bytes): Use gdb::array_view
|
|
|
|
|
instead of buffer and size.
|
|
|
|
|
(trad_frame_set_reg_value_bytes): Likewise.
|
|
|
|
|
* trad-frame.h (trad_frame_set_reg_value_bytes): Likewise.
|
|
|
|
|
(trad_frame_set_value_bytes): Likewise.
|
|
|
|
|
|
2021-01-19 10:28:20 +08:00
|
|
|
|
2021-01-18 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* copyright.py (NOT_FSF_LIST): Delete sim/testsuite/sim/bfin/s21.s.
|
|
|
|
|
|
2020-12-02 23:10:06 +08:00
|
|
|
|
2021-01-18 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* riscv-fbsd-tdep.c (riscv_fbsd_supply_gregset): Delete.
|
|
|
|
|
(riscv_fbsd_gregset): Use riscv_supply_regset.
|
|
|
|
|
(riscv_fbsd_fpregset): Likewise.
|
|
|
|
|
* riscv-linux-tdep.c (riscv_linux_gregset): Likewise.
|
|
|
|
|
(riscv_linux_fregset): Likewise.
|
|
|
|
|
* riscv-tdep.c (riscv_supply_regset): Define new function.
|
|
|
|
|
* riscv-tdep.h (riscv_supply_regset): Declare new function.
|
|
|
|
|
|
[gdb/tdep] Handle si_addr_bnd in compat_siginfo_from_siginfo
When running test-case gdb.arch/i386-mpx-sigsegv.exp with target board
unix/-m32, we run into:
...
(gdb) continue^M
Continuing.^M
Saw a #BR! status 1 at 0x8048c2d^M
^M
Program received signal SIGSEGV, Segmentation fault^M
Upper bound violation while accessing address 0x0804c15c^M
Bounds: [lower = 0x00000000, upper = 0x00000000].^M
0x08048a4f in lower (p=0x804c160, a=0x804c180, b=0x804c1a0, c=0x804c1c0, \
d=0x804c1e0, len=1) at i386-mpx-sigsegv.c:79^M
79 value = *(p - len);^M
(gdb) FAIL: gdb.arch/i386-mpx-sigsegv.exp: MPX signal segv Lower: 0
...
The problem is that lower and upper in the Bounds message are 0x0, which is
caused by $_siginfo._sifields._sigfault._addr_bnd.{_lower,_upper} evaluating
to 0x0.
Fix this by copying the si_lower/si_upper fields in
compat_siginfo_from_siginfo.
Tested on x86_64-linux, with target board unix/-m32.
gdb/ChangeLog:
2021-01-18 Tom de Vries <tdevries@suse.de>
PR tdep/27172
* nat/amd64-linux-siginfo.c (cpt_si_lower, cpt_si_upper, SEGV_BNDERR):
New macro.
(compat_siginfo_from_siginfo): Copy cpt_si_lower and cpt_si_upper
for SEGV_BNDERR.
2021-01-18 16:32:38 +08:00
|
|
|
|
2021-01-18 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR tdep/27172
|
|
|
|
|
* nat/amd64-linux-siginfo.c (cpt_si_lower, cpt_si_upper, SEGV_BNDERR):
|
|
|
|
|
New macro.
|
|
|
|
|
(compat_siginfo_from_siginfo): Copy cpt_si_lower and cpt_si_upper
|
|
|
|
|
for SEGV_BNDERR.
|
|
|
|
|
|
2021-01-18 13:46:13 +08:00
|
|
|
|
2021-01-18 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* remote.c (class remote_target) <remote_hostio_send_command,
|
|
|
|
|
remote_hostio_parse_result>: Constify parameter.
|
|
|
|
|
(remote_hostio_parse_result): Likewise.
|
|
|
|
|
(remote_target::remote_hostio_send_command): Adjust.
|
|
|
|
|
(remote_target::remote_hostio_pread_vFile): Adjust.
|
|
|
|
|
(remote_target::fileio_readlink): Adjust.
|
|
|
|
|
(remote_target::fileio_fstat): Adjust.
|
|
|
|
|
|
2021-01-18 13:46:13 +08:00
|
|
|
|
2021-01-18 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* remote.c (remote_target::start_remote): Move wait_status to
|
|
|
|
|
narrower scope.
|
|
|
|
|
|
2021-01-18 13:46:13 +08:00
|
|
|
|
2021-01-18 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* remote.c (class remote_target):
|
|
|
|
|
<add_current_inferior_and_thread>: Constify parameter.
|
|
|
|
|
(stop_reply_extract_thread): Likewise.
|
|
|
|
|
(remote_target::get_current_thread): Likewise.
|
|
|
|
|
(remote_target::add_current_inferior_and_thread): Likewise.
|
|
|
|
|
|
2021-01-18 13:46:13 +08:00
|
|
|
|
2021-01-18 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* remote.c (class remote_target)
|
|
|
|
|
<remote_unpack_thread_info_response,
|
|
|
|
|
parse_threadlist_response>: Constify parameter and/or return
|
|
|
|
|
value and or local variable.
|
|
|
|
|
(stub_unpack_int): Likewise.
|
|
|
|
|
(unpack_nibble): Likewise.
|
|
|
|
|
(unpack_byte): Likewise.
|
|
|
|
|
(unpack_int): Likewise.
|
|
|
|
|
(unpack_string): Likewise.
|
|
|
|
|
(unpack_threadid): Likewise.
|
|
|
|
|
(remote_target::remote_unpack_thread_info_response): Likewise.
|
|
|
|
|
(remote_target::parse_threadlist_response): Likewise.
|
|
|
|
|
|
2021-01-16 04:21:04 +08:00
|
|
|
|
2021-01-15 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* tui/tui.c (tui_is_window_visible): Compare to nullptr, not 0.
|
|
|
|
|
|
2021-01-15 06:52:00 +08:00
|
|
|
|
2021-01-14 Lancelot Six <lsix@lancelotsix.com>
|
|
|
|
|
|
|
|
|
|
* MAINTAINERS (Write After Approval): Add myself.
|
|
|
|
|
|
2021-01-05 04:40:41 +08:00
|
|
|
|
2021-01-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
|
|
|
|
|
|
|
|
|
|
* trad-frame.c (trad_frame_alloc_saved_regs): Avoid compile-error
|
|
|
|
|
because is_trivially_default_constructible was first implemented with
|
|
|
|
|
gcc-5.
|
|
|
|
|
|
[gdb/breakpoint] Handle .plt.sec in in_plt_section
Consider the following test-case small.c:
...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main (void) {
int *p = (int *)malloc (sizeof(int) * 4);
memset (p, 0, sizeof(p));
printf ("p[0] = %d; p[3] = %d\n", p[0], p[3]);
return 0;
}
...
On Ubuntu 20.04, we get:
...
$ gcc -O0 -g small.c
$ gdb -batch a.out -ex start -ex step
Temporary breakpoint 1, main () at small.c:6
6 int *p = (int *) malloc(sizeof(int) * 4);
p[0] = 0; p[3] = 0
[Inferior 1 (process $dec) exited normally]
...
but after switching off the on-by-default fcf-protection, we get the desired
behaviour:
...
$ gcc -O0 -g small.c -fcf-protection=none
$ gdb -batch a.out -ex start -ex step
Temporary breakpoint 1, main () at small.c:6
6 int *p = (int *) malloc(sizeof(int) * 4);
7 memset (p, 0, sizeof(p));
...
Using "set debug infrun 1", the first observable difference between the two
debug sessions is that with -fcf-protection=none we get:
...
[infrun] process_event_stop_test: stepped into dynsym resolve code
...
In this case, "in_solib_dynsym_resolve_code (malloc@plt)" returns true because
"in_plt_section (malloc@plt)" returns true.
With -fcf-protection=full, "in_solib_dynsym_resolve_code (malloc@plt)" returns
false because "in_plt_section (malloc@plt)" returns false, because the section
name for malloc@plt is .plt.sec instead of .plt, which is not handled in
in_plt_section:
...
static inline int
in_plt_section (CORE_ADDR pc)
{
return pc_in_section (pc, ".plt");
}
...
Fix this by handling .plt.sec in in_plt_section.
Tested on x86_64-linux.
[ Another requirement to be able to reproduce this is to have a dynamic linker
with a "malloc" minimal symbol, which causes find_solib_trampoline_target to
find it, such that skip_language_trampoline returns the address for the
dynamic linkers malloc. This causes the step machinery to set a breakpoint
there, and to continue, expecting to hit it. Obviously, we execute glibc's
malloc instead, so the breakpoint is not hit and we continue to program
completion. ]
gdb/ChangeLog:
2021-01-14 Tom de Vries <tdevries@suse.de>
PR breakpoints/27151
* objfiles.h (in_plt_section): Handle .plt.sec.
2021-01-14 17:35:34 +08:00
|
|
|
|
2021-01-14 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/27151
|
|
|
|
|
* objfiles.h (in_plt_section): Handle .plt.sec.
|
|
|
|
|
|
gdb: better handling of 'S' packets
This commit builds on work started in the following two commits:
commit 24ed6739b699f329c2c45aedee5f8c7d2f54e493
Date: Thu Jan 30 14:35:40 2020 +0000
gdb/remote: Restore support for 'S' stop reply packet
commit cada5fc921e39a1945c422eea055c8b326d8d353
Date: Wed Mar 11 12:30:13 2020 +0000
gdb: Handle W and X remote packets without giving a warning
This is related to how GDB handles remote targets that send back 'S'
packets.
In the first of the above commits we fixed GDB's ability to handle a
single process, single threaded target that sends back 'S' packets.
Although the 'T' packet would always be preferred to 'S' these days,
there's nothing really wrong with 'S' for this situation.
The second commit above fixed an oversight in the first commit, a
single-process, multi-threaded target can send back a process wide
event, for example the process exited event 'W' without including a
process-id, this also is fine as there is no ambiguity in this case.
In PR gdb/26819 we run into yet another problem with the above
commits. In this case we have a single process with two threads, GDB
hits a breakpoint in thread 2 and then performs a stepi:
(gdb) b main
Breakpoint 1 at 0x1212340830: file infinite_loop.S, line 10.
(gdb) c
Continuing.
Thread 2 hit Breakpoint 1, main () at infinite_loop.S:10
10 in infinite_loop.S
(gdb) set debug remote 1
(gdb) stepi
Sending packet: $vCont;s:2#24...Packet received: S05
../binutils-gdb/gdb/infrun.c:5807: internal-error: int finish_step_over(execution_control_state*): Assertion `ecs->event_thread->control.trap_expected' failed.
What happens in this case is that on the RISC-V target displaced
stepping is not supported, so when the stepi is issued GDB steps just
thread 2. As only a single thread was set running the target decides
that is can get away with sending back an 'S' packet without a
thread-id. GDB then associates the stop with thread 1 (the first
non-exited thread), but as thread 1 was not previously set executing
the assertion seen above triggers.
As an aside I am surprised that the target sends pack 'S' in this
situation. The target is happy to send back 'T' (including thread-id)
when multiple threads are set running, so (to me) it would seem easier
to just always use the 'T' packet when multiple threads are in use.
However, the target only uses 'T' when multiple threads are actually
executing, otherwise an 'S' packet it used.
Still, when looking at the above situation we can see that GDB should
be able to understand which thread the 'S' reply is referring too.
The problem is that is that in commit 24ed6739b699 (above) when a stop
reply comes in with no thread-id we look for the first non-exited
thread and select that as the thread the stop applies too.
What we should really do is select the first non-exited, resumed thread,
and associate the stop event with this thread. In the above example
both thread 1 and 2 are non-exited, but only thread 2 is resumed, so
this is what we should use.
There's a test for this issue included which works with stock
gdbserver by disabling use of the 'T' packet, and enabling
'scheduler-locking' within GDB so only one thread is set running.
gdb/ChangeLog:
PR gdb/26819
* remote.c
(remote_target::select_thread_for_ambiguous_stop_reply): New
member function.
(remote_target::process_stop_reply): Call
select_thread_for_ambiguous_stop_reply.
gdb/testsuite/ChangeLog:
PR gdb/26819
* gdb.server/stop-reply-no-thread-multi.c: New file.
* gdb.server/stop-reply-no-thread-multi.exp: New file.
Change-Id: I9b49d76c2a99063dcc76203fa0f5270a72825d15
2021-01-14 09:26:58 +08:00
|
|
|
|
2021-01-13 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/26819
|
|
|
|
|
* remote.c
|
|
|
|
|
(remote_target::select_thread_for_ambiguous_stop_reply): New
|
|
|
|
|
member function.
|
|
|
|
|
(remote_target::process_stop_reply): Call
|
|
|
|
|
select_thread_for_ambiguous_stop_reply.
|
|
|
|
|
|
2021-01-14 09:25:58 +08:00
|
|
|
|
2021-01-13 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* record-btrace.c (class record_btrace_target): Remove.
|
|
|
|
|
(record_btrace_target::commit_resume): Remove.
|
|
|
|
|
* record-full.c (class record_full_target): Remove.
|
|
|
|
|
(record_full_target::commit_resume): Remove.
|
|
|
|
|
|
gdb: make the remote target track its own thread resume state
The next patch moves the target commit_resume method to be a
process_stratum_target-only method. The only non-process targets that
currently implement the commit_resume method are the btrace and full
record targets. The only reason they need to do so is to prevent a
commit resume from reaching the beneath (process) target if they are
currently replaying.
This is important if a record target is used on top of the remote target
(the only process target implementing the commit_resume method).
Currently, the remote target checks the `thread_info::executing` flag of
a thread to know if it should commit resume that thread:
if (!tp->executing || remote_thr->vcont_resumed)
continue;
The `tp->executing` flag is set by infrun when it has asked the target
stack to resume the thread, and therefore if the thread is executing,
from its point of view. It _not_ equivalent to whether the remote
target was asked to resume this thread.
Indeed, if infrun asks the target stack to resume some thread while the
record target is replaying, the record target won't forward the resume
request the remote target beneath, because we don't actually want to
resume the thread on the execution target. But the `tp->executing` flag
is still set, because from the point of view of infrun, the thread
executes. So, if the commit_resume call wasn't intercepted by the
record target as it is today and did reach the remote target, the remote
target would say "Oh, this thread should be executing and I haven't
vCont-resumed it! I must vCont-resume it!". But that would be wrong,
because it was never asked to resume this thread, the resume request did
not reach it. This is why the record targets currently need to
implement commit_resume: to prevent the beneath target from
commit_resuming threads it wasn't asked to resume.
Since commit_resume will become a method on process_stratum_target in
the following patch, record targets won't have a chance to intercept the
calls and that would result in the remote target commit_resuming threads
it shouldn't. To avoid this, this patch makes the remote target track
its own thread resumption state. That means, tracking which threads it
was asked to resume via target_ops::resume. Regardless of the context
of this patch, I think this change makes it easier to understand how
resume / commit_resume works in the remote target. It makes the target
more self-contained, as it only depends on what it gets asked to do via
the target methods, and not on tp->executing, which is a flag maintained
from the point of view of infrun.
I initially made it so this state was only used when the remote target
operates in non-stop mode, since commit_resume is only used when the
target is non-stop. However, it's more consistent and it can be useful
to maintain this state even in all-stop too. In all-stop, receiving a
stop notification for one thread means all threads of the target are
considered stopped.
From the point of view of the remote target, there are three states a
thread can be in:
1. not resumed
2. resumed but pending vCont-resume
3. resumed
State 2 only exists when the target is non-stop.
As of this patch, valid state transitions are:
- 1 -> 2 (through the target resume method if in non-stop)
- 2 -> 3 (through the target commit_resume method if in non-stop)
- 1 -> 3 (through the target resume method if in all-stop)
- 3 -> 1 (through a remote stop notification / reporting an event to the
event loop)
A subsequent patch will make it possible to go from 2 to 1, in case
infrun asks to stop a thread that was resumed but not commit-resumed
yet. I don't think it can happen as of now.
In terms of code, this patch replaces the vcont_resumed field with an
enumeration that explicitly represents the three states described above.
The last_resume_sig and last_resume_step fields are moved to a structure
which is clearly identified as only used when the thread is in the
"resumed but pending vCont-resume" state.
gdb/ChangeLog:
* remote.c (enum class resume_state): New.
(struct resumed_pending_vcont_info): New.
(struct remote_thread_info) <resume_state, set_not_resumed,
set_resumed_pending_vcont, resumed_pending_vcont_info,
set_resumed, m_resume_state, m_resumed_pending_vcont_info>:
New.
<last_resume_step, last_resume_sig, vcont_resumed>: Remove.
(remote_target::remote_add_thread): Adjust.
(remote_target::process_initial_stop_replies): Adjust.
(remote_target::resume): Adjust.
(remote_target::commit_resume): Rely on state in
remote_thread_info and not on tp->executing.
(remote_target::process_stop_reply): Adjust.
Change-Id: I10480919ccb4552faa62575e447a36dbe7c2d523
2021-01-14 09:20:43 +08:00
|
|
|
|
2021-01-13 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* remote.c (enum class resume_state): New.
|
|
|
|
|
(struct resumed_pending_vcont_info): New.
|
|
|
|
|
(struct remote_thread_info) <resume_state, set_not_resumed,
|
|
|
|
|
set_resumed_pending_vcont, resumed_pending_vcont_info,
|
|
|
|
|
set_resumed, m_resume_state, m_resumed_pending_vcont_info>:
|
|
|
|
|
New.
|
|
|
|
|
<last_resume_step, last_resume_sig, vcont_resumed>: Remove.
|
|
|
|
|
(remote_target::remote_add_thread): Adjust.
|
|
|
|
|
(remote_target::process_initial_stop_replies): Adjust.
|
|
|
|
|
(remote_target::resume): Adjust.
|
|
|
|
|
(remote_target::commit_resume): Rely on state in
|
|
|
|
|
remote_thread_info and not on tp->executing.
|
|
|
|
|
(remote_target::process_stop_reply): Adjust.
|
|
|
|
|
|
2021-01-14 03:32:39 +08:00
|
|
|
|
2021-01-13 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* arc-tdep.h (arc_debug_printf): New.
|
|
|
|
|
* arc-tdep.c: Use arc_debug_printf.
|
|
|
|
|
* arc-linux-nat.c (arc_linux_nat_debug_printf): Add and use.
|
|
|
|
|
* arc-linux-tdep.c (arc_linux_debug_printf): Add and use.
|
|
|
|
|
* arc-newlib-tdep.c (arc_newlib_debug_printf): Add and use.
|
|
|
|
|
|
2021-01-14 03:32:23 +08:00
|
|
|
|
2021-01-13 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* arc-tdep.h (arc_debug): Change type to bool.
|
|
|
|
|
* arc-tdep.c (arc_debug): Change type to bool.
|
|
|
|
|
(arc_analyze_prologue): Adjust.
|
|
|
|
|
(_initialize_arc_tdep): Use add_setshow_boolean_cmd.
|
|
|
|
|
* arc-linux-nat.c (ps_get_thread_area): Adjust.
|
|
|
|
|
|
2021-01-14 01:00:37 +08:00
|
|
|
|
2021-01-13 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* auto-load.c (auto_load_objfile_script_1): Use bool.
|
|
|
|
|
(execute_script_contents): Use bool.
|
|
|
|
|
|
2021-01-14 00:57:24 +08:00
|
|
|
|
2021-01-13 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* auto-load.h (auto_load_gdb_scripts_enabled): Return bool, move
|
|
|
|
|
comment here.
|
|
|
|
|
* auto-load.c (auto_load_gdb_scripts_enabled): Return bool, move
|
|
|
|
|
comment to header.
|
|
|
|
|
* extension-priv.h (struct extension_language_script_ops)
|
|
|
|
|
<auto_load_enabled>: Return bool.
|
|
|
|
|
* extension.h (ext_lang_auto_load_enabled): Return bool, move
|
|
|
|
|
comment here.
|
|
|
|
|
* extension.c (ext_lang_auto_load_enabled): Return bool, move
|
|
|
|
|
comment to header.
|
|
|
|
|
* guile/guile-header.h (gdbscm_auto_load_enabled): Return bool,
|
|
|
|
|
move comment here.
|
|
|
|
|
* guile/scm-auto-load.c (gdbscm_auto_load_enabled): Return bool,
|
|
|
|
|
move comment to header.
|
|
|
|
|
* python/python-header.h (gdbpy_auto_load_enabled): Return bool,
|
|
|
|
|
move comment here.
|
|
|
|
|
* python/py-auto-load.c (gdbpy_auto_load_enabled): Return bool,
|
|
|
|
|
move comment to header.
|
|
|
|
|
|
2021-01-14 00:44:24 +08:00
|
|
|
|
2021-01-13 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* auto-load.h (file_is_auto_load_safe): Change return type to
|
|
|
|
|
bool, move comment here.
|
|
|
|
|
* auto-load.c (file_is_auto_load_safe): Change return type and
|
|
|
|
|
advice_printed to bool. Move comment to header.
|
|
|
|
|
|
gdb: convert jit to new-style debug macros
Here's a sample output, with infrun debug enabled as well to show
nesting:
[infrun] fetch_inferior_event: enter
[infrun] print_target_wait_results: target_wait (-1.0.0 [process -1], status) =
[infrun] print_target_wait_results: 4116727.4116727.0 [process 4116727],
[infrun] print_target_wait_results: status->kind = stopped, signal = GDB_SIGNAL_TRAP
[infrun] handle_inferior_event: status->kind = stopped, signal = GDB_SIGNAL_TRAP
[infrun] start_step_over: enter
[infrun] start_step_over: stealing global queue of threads to step, length = 0
[infrun] operator(): step-over queue now empty
[infrun] start_step_over: exit
[infrun] handle_signal_stop: stop_pc=0x555555555229
[infrun] handle_jit_event: handling bp_jit_event
[jit] jit_read_descriptor: descriptor_addr = 0x5555555580b0
[jit] jit_register_code: symfile_addr = 0x7000000, symfile_size = 15560
[jit] jit_bfd_try_read_symtab: symfile_addr = 0x7000000, symfile_size = 15560
[jit] jit_breakpoint_re_set_internal: breakpoint_addr = 0x555555555229
[infrun] process_event_stop_test: BPSTAT_WHAT_SINGLE
[infrun] process_event_stop_test: no stepping, continue
[infrun] resume_1: step=1, signal=GDB_SIGNAL_0, trap_expected=1, current thread [process 4116727] at 0x555555555229
[infrun] prepare_to_wait: prepare_to_wait
[infrun] fetch_inferior_event: exit
gdb/ChangeLog:
* jit.c (jit_debug_printf): New, use throughout file.
Change-Id: Ic0f5eb3ffc926fb555de4914e7dc1076ada63a97
2021-01-13 23:48:51 +08:00
|
|
|
|
2021-01-13 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* jit.c (jit_debug_printf): New, use throughout file.
|
|
|
|
|
|
2021-01-13 07:09:51 +08:00
|
|
|
|
2021-01-12 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* infrun.c (normal_stop): Fix indentation.
|
|
|
|
|
|
2021-01-13 03:19:49 +08:00
|
|
|
|
2021-01-12 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* top.h (readnow_symbol_files, readnever_symbol_files): Move
|
|
|
|
|
declarations to ...
|
|
|
|
|
* symfile.h: ... here.
|
|
|
|
|
* symfile.c: Update doc.
|
|
|
|
|
|
2021-01-13 03:19:49 +08:00
|
|
|
|
2021-01-12 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* target.h (baud_rate, serial_parity): Move declarations...
|
|
|
|
|
* serial.h: ... here.
|
|
|
|
|
* main.c: Include serial.h.
|
|
|
|
|
* serial.c (baud_rate, serial_parity): Update doc.
|
|
|
|
|
|
2021-01-12 23:42:43 +08:00
|
|
|
|
2021-01-12 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* top.c (pre_init_ui_hook): Remove.
|
|
|
|
|
|
aarch64: Add support for bfloat16 in gdb.
This patch adds support for bfloat16 in AArch64 gdb.
Also adds the field "bf" to vector registers h0-h31.
Also adds the vector "bf" to h field in vector registers v0-v31.
The following is how the vector register h and v looks like.
Before this patch:
(gdb) p $h0
$1 = {f = 0, u = 0, s = 0}
(gdb) p/x $h0
$2 = {f = 0x0, u = 0x0, s = 0x0}
(gdb) p $v0.h
$3 = {f = {0, 0, 0, 0, 0, 0, 0, 0}, u = {0, 0, 0, 0, 0, 0, 0, 0}, s = {0, 0, 0, 0, 0, 0, 0, 0}}
(gdb) p/x $v0.h
$4 = {f = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
s = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
After this patch:
(gdb) p $h0
$1 = {bf = 0, f = 0, u = 0, s = 0}
(gdb) p/x $h0
$2 = {bf = 0x0, f = 0x0, u = 0x0, s = 0x0}
(gdb) p $v0.h
$3 = {bf = {0, 0, 0, 0, 0, 0, 0, 0}, f = {0, 0, 0, 0, 0, 0, 0, 0}, u = {0, 0, 0, 0, 0, 0, 0, 0},
s = {0, 0, 0, 0, 0, 0, 0, 0}}
(gdb) p/x $v0.h
$4 = {bf = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, f = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
u = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, s = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
gdb/ChangeLog:
2021-01-12 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
* aarch64-tdep.c (aarch64_vnh_type): Add "bf" field in h registers.
(aarch64_vnv_type): Add "bf" type in h field of v registers.
* features/aarch64-fpu.c (create_feature_aarch64_fpu): Regenerated.
* features/aarch64-fpu.xml: Add bfloat16 type.
gdb/testsuite/ChangeLog:
2021-01-12 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
* gdb.arch/aarch64-fp.exp: Modify to test bfloat16 support.
2021-01-12 21:57:23 +08:00
|
|
|
|
2021-01-12 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
|
|
|
|
|
|
|
|
|
|
* aarch64-tdep.c (aarch64_vnh_type): Add "bf" field in h registers.
|
|
|
|
|
(aarch64_vnv_type): Add "bf" type in h field of v registers.
|
|
|
|
|
* features/aarch64-fpu.c (create_feature_aarch64_fpu): Regenerated.
|
|
|
|
|
* features/aarch64-fpu.xml: Add bfloat16 type.
|
|
|
|
|
|
gdb: fix debug dump of OP_BOOL expressions
Consider this GDB session:
(gdb) set language fortran
(gdb) set debug expression 1
(gdb) p .TRUE.
Dump of expression @ 0x4055d90, before conversion to prefix form:
Language fortran, 3 elements, 16 bytes each.
Index Opcode Hex Value String Value
0 OP_BOOL 79 O...............
1 BINOP_ADD 1 ................
2 OP_BOOL 79 O...............
Dump of expression @ 0x4055d90, after conversion to prefix form:
Expression: `TRUE'
Language fortran, 3 elements, 16 bytes each.
0 OP_BOOL Unknown format
1 BINOP_ADD
2 OP_BOOL Unknown format
3 OP_NULL Unknown format
$1 = .TRUE.
The final dump of the OP_BOOL is completely wrong. After this patch
we now get:
(gdb) set language fortran
(gdb) set debug expression 1
(gdb) p .TRUE.
Dump of expression @ 0x2d07470, before conversion to prefix form:
Language fortran, 3 elements, 16 bytes each.
Index Opcode Hex Value String Value
0 OP_BOOL 79 O...............
1 BINOP_ADD 1 ................
2 OP_BOOL 79 O...............
Dump of expression @ 0x2d07470, after conversion to prefix form:
Expression: `TRUE'
Language fortran, 3 elements, 16 bytes each.
0 OP_BOOL TRUE
$1 = .TRUE.
Much better. I added a test for this into the Fortran testsuite.
gdb/ChangeLog:
* expprint.c (dump_subexp_body_standard): Handle OP_BOOL.
gdb/testsuite/ChangeLog:
* gdb.fortran/debug-expr.exp: Add new tests.
2021-01-11 23:40:18 +08:00
|
|
|
|
2021-01-12 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* expprint.c (dump_subexp_body_standard): Handle OP_BOOL.
|
|
|
|
|
|
2021-01-11 22:14:02 +08:00
|
|
|
|
2021-01-12 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* f-exp.y (dot_ops): Rename to...
|
|
|
|
|
(fortran_operators): ...this. Add a header comment. Add symbol
|
|
|
|
|
based operators.
|
|
|
|
|
(yylex): Update to use fortran_operators not dot_ops. Remove
|
|
|
|
|
special handling for '**', this is now included in
|
|
|
|
|
fortran_operators.
|
|
|
|
|
|
2021-01-12 05:52:42 +08:00
|
|
|
|
2021-01-11 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* arch/aarch64-insn.h (aarch64_debug_printf): New.
|
|
|
|
|
* arch/aarch64-insn.c: Use aarch64_debug_printf.
|
|
|
|
|
* aarch64-tdep.c: Use aarch64_debug_printf.
|
|
|
|
|
|
2021-01-12 05:30:44 +08:00
|
|
|
|
2021-01-11 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* solib-aix.c (solib_aix_debug_printf): New, use throughout
|
|
|
|
|
file.
|
|
|
|
|
|
2021-01-12 05:18:48 +08:00
|
|
|
|
2021-01-11 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* jit.c (jit_debug): Change type to bool.
|
|
|
|
|
(_initialize_jit): Adjust.
|
|
|
|
|
|
2021-01-10 02:38:41 +08:00
|
|
|
|
2021-01-09 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
PR compile/23672
|
|
|
|
|
* compile/compile.c (compile_to_object): Avoid crash when
|
|
|
|
|
osabi_triplet_regexp returns NULL.
|
|
|
|
|
|
2021-01-10 01:06:25 +08:00
|
|
|
|
2021-01-09 Tom Tromey <tom@tromey.com>
|
|
|
|
|
|
|
|
|
|
* tracepoint.h (class collection_list) <append_exp>: Take a
|
|
|
|
|
std::string.
|
|
|
|
|
* tracepoint.c (collection_list::append_exp): Take a std::string.
|
|
|
|
|
(encode_actions_1): Update.
|
|
|
|
|
|
2021-01-09 03:20:12 +08:00
|
|
|
|
2021-01-08 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* parse.c (parse_expression): Add void_context_p parameter. Use
|
|
|
|
|
parse_exp_in_context.
|
|
|
|
|
* printcmd.c (print_command_1): Change voidprint to bool. Pass to
|
|
|
|
|
parse_expression.
|
|
|
|
|
(print_command, call_command): Update.
|
|
|
|
|
* expression.h (parse_expression): Add void_context_p parameter.
|
|
|
|
|
|
gdb: user variables with components of dynamic type
Consider this Fortran type:
type :: some_type
integer, allocatable :: array_one (:,:)
integer :: a_field
integer, allocatable :: array_two (:,:)
end type some_type
And a variable declared:
type(some_type) :: some_var
Now within GDB we try this:
(gdb) set $a = some_var
(gdb) p $a
$1 = ( array_one =
../../src/gdb/value.c:3968: internal-error: Unexpected lazy value type.
Normally, when an internalvar ($a in this case) is created, it is
non-lazy, the value is immediately copied out of the inferior into
GDB's memory.
When printing the internalvar ($a) GDB will extract each field in
turn, so in this case `array_one`. As the original internalvar is
non-lazy then the extracted field will also be non-lazy, with its
contents immediately copied from the parent internalvar.
However, when the field has a dynamic type this is not the case, in
value_primitive_field we see that any field with dynamic type is
always created lazy. Further, the content of this field will usually
not have been captured in the contents buffer of the original value, a
field with dynamic location is effectively a pointer value contained
within the parent value, with rules in the DWARF for how to
dereference the pointer.
So, we end up with a lazy lval_internalvar_component representing a
field within an lval_internalvar. This eventually ends up in
value_fetch_lazy, which currently does not support
lval_internalvar_component, and we see the error above.
My original plan for how to handle this involved extending
value_fetch_lazy to handle lval_internalvar_component. However, when
I did this I ran into another error:
(gdb) set $a = some_var
(gdb) p $a
$1 = ( array_one = ((1, 1) (1, 1) (1, 1)), a_field = 5, array_two = ((0, 0, 0) (0, 0, 0)) )
(gdb) p $a%array_one
$2 = ((1, 1) (1, 1) (1, 1))
(gdb) p $a%array_one(1,1)
../../src/gdb/value.c:1547: internal-error: void set_value_address(value*, CORE_ADDR): Assertion `value->lval == lval_memory' failed.
The problem now is inside set_value_component_location, where we
attempt to set the address for a component if the original parent
value has a dynamic location. GDB does not expect to ever set the
address on anything other than an lval_memory value (which seems
reasonable).
In order to resolve this issue I initially thought about how an
internalvar should "capture" the value of a program variable at the
moment the var is created. In an ideal world (I think) GDB would be
able to do this even for values with dynamic type. So in our above
example doing `set $a = some_var` would capture the content of
'some_var', but also the content of 'array_one', and also 'array_two',
even though these content regions are not contained within the region
of 'some_var'.
Supporting this would require GDB values to be able to carry around
multiple non-contiguous regions of memory as content in some way,
which sounds like a pretty huge change to a core part of GDB.
So, I wondered if there was some other solution that wouldn't require
such a huge change.
What if values with a dynamic location were though of like points with
automatic dereferencing? Given this C structure:
struct foo_t {
int *val;
}
struct foo_t my_foo;
Then in GDB:
(gdb) $a = my_foo
We would expect GDB to capture the pointer value in '$a', but not the
value pointed at by the pointer. So maybe it's not that unreasonable
to think that given a dynamically typed field GDB will capture the
address of the content, but not the actual content itself.
That's what this patch does.
The approach is to catch this case in set_value_component_location.
When we create a component location (of an lval_internalvar) that has
a dynamic data location, the lval_internalvar_component is changed
into an lval_memory. After this, both of the above issues are
resolved. In the first case, the lval_memory is still lazy, but
value_fetch_lazy knows how to handle that. In the second case, when
we access an element of the array we are now accessing an element of
an lval_memory, not an lval_internalvar_component, and calling
set_value_address on an lval_memory is fine.
gdb/ChangeLog:
* value.c (set_value_component_location): Adjust the VALUE_LVAL
for internalvar components that have a dynamic location.
gdb/testsuite/ChangeLog:
* gdb.fortran/intvar-dynamic-types.exp: New file.
* gdb.fortran/intvar-dynamic-types.f90: New file.
2020-10-22 18:34:52 +08:00
|
|
|
|
2021-01-08 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* value.c (set_value_component_location): Adjust the VALUE_LVAL
|
|
|
|
|
for internalvar components that have a dynamic location.
|
|
|
|
|
|
[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 18:11:16 +08:00
|
|
|
|
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 01:13:21 +08:00
|
|
|
|
2021-01-08 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* f-lang.c (fortran_value_subarray): Call value_from_component.
|
|
|
|
|
|
2015-12-30 12:52:57 +08:00
|
|
|
|
2021-01-07 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* remote-sim.c: Include memory-map.h.
|
|
|
|
|
(gdbsim_target): Define memory_map override.
|
|
|
|
|
(gdbsim_target::memory_map): Define.
|
|
|
|
|
|
2021-01-07 22:02:46 +08:00
|
|
|
|
2021-01-07 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (do_full_match): Conditionally skip "_ada_" prefix.
|
|
|
|
|
|
2021-01-07 21:58:19 +08:00
|
|
|
|
2021-01-07 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (add_component_interval): Start loop using vector's
|
|
|
|
|
updated size.
|
|
|
|
|
|
Fix fixed-point binary operation type handling
Testing showed that gdb was not correctly handling some fixed-point
binary operations correctly.
Addition and subtraction worked by casting the result to the type of
left hand operand. So, "fixed+int" had a different type -- and
different value -- from "int+fixed".
Furthermore, for multiplication and division, it does not make sense
to first cast both sides to the fixed-point type. For example, this
can prevent "f * 1" from yielding "f", if 1 is not in the domain of
"f". Instead, this patch changes gdb to use the value. (This is
somewhat different from Ada semantics, as those can yield a "universal
fixed point".)
This includes a new test case. It is only run in "minimal" mode, as
the old-style fixed point works differently, and is obsolete, so I
have no plans to change it.
gdb/ChangeLog
2021-01-06 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_evaluate_subexp) <BINOP_ADD, BINOP_SUB>:
Do not cast result.
* valarith.c (fixed_point_binop): Handle multiplication
and division specially.
* valops.c (value_to_gdb_mpq): New function.
(value_cast_to_fixed_point): Use it.
gdb/testsuite/ChangeLog
2021-01-06 Tom Tromey <tromey@adacore.com>
* gdb.ada/fixed_points/pck.ads (Delta4): New constant.
(FP4_Type): New type.
(FP4_Var): New variable.
* gdb.ada/fixed_points/fixed_points.adb: Update.
* gdb.ada/fixed_points.exp: Add tests for binary operators.
2021-01-07 04:47:48 +08:00
|
|
|
|
2021-01-06 Tom Tromey <tromey@adacore.com>
|
|
|
|
|
|
|
|
|
|
* ada-lang.c (ada_evaluate_subexp) <BINOP_ADD, BINOP_SUB>:
|
|
|
|
|
Do not cast result.
|
|
|
|
|
* valarith.c (fixed_point_binop): Handle multiplication
|
|
|
|
|
and division specially.
|
|
|
|
|
* valops.c (value_to_gdb_mpq): New function.
|
|
|
|
|
(value_cast_to_fixed_point): Use it.
|
|
|
|
|
|
2020-12-21 21:26:29 +08:00
|
|
|
|
2021-01-05 Hannes Domani <ssbssa@yahoo.de>
|
|
|
|
|
|
|
|
|
|
* tui/tui-winsource.c (tui_source_window_base::refresh_window):
|
|
|
|
|
Call wnoutrefresh instead of tui_win_info::refresh_window.
|
|
|
|
|
|
2020-12-21 20:52:03 +08:00
|
|
|
|
2021-01-05 Hannes Domani <ssbssa@yahoo.de>
|
|
|
|
|
|
|
|
|
|
* tui/tui-source.c (tui_source_window::show_line_number):
|
|
|
|
|
Redraw second space after line number.
|
|
|
|
|
|
2020-12-21 20:16:24 +08:00
|
|
|
|
2021-01-05 Hannes Domani <ssbssa@yahoo.de>
|
|
|
|
|
|
|
|
|
|
PR tui/26927
|
|
|
|
|
* tui/tui-winsource.c (tui_source_window_base::refresh_window):
|
|
|
|
|
Fix source pad size in prefresh.
|
|
|
|
|
(tui_source_window_base::show_source_content): Grow source pad
|
|
|
|
|
if necessary.
|
|
|
|
|
|
2015-06-19 16:24:13 +08:00
|
|
|
|
2021-01-04 Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
|
|
* bfin-tdep.c (bfin_push_dummy_call): Use align_up.
|
|
|
|
|
(bfin_frame_align): Use align_down.
|
|
|
|
|
|
2021-01-05 02:34:25 +08:00
|
|
|
|
2021-01-04 Tom de Vries <tdevries@suse.de>
|
|
|
|
|
|
|
|
|
|
* buildsym.c (buildsym_compunit::record_line): Filter out end-of-seq
|
|
|
|
|
terminators that do not terminate anything.
|
|
|
|
|
|
gdb: introduce scoped debug prints
I spent a lot of time reading infrun debug logs recently, and I think
they could be made much more readable by being indented, to clearly see
what operation is done as part of what other operation. In the current
format, there are no visual cues to tell where things start and end,
it's just a big flat list. It's also difficult to understand what
caused a given operation (e.g. a call to resume_1) to be done.
To help with this, I propose to add the new scoped_debug_start_end
structure, along with a bunch of macros to make it convenient to use.
The idea of scoped_debug_start_end is simply to print a start and end
message at construction and destruction. It also increments/decrements
a depth counter in order to make debug statements printed during this
range use some indentation. Some care is taken to handle the fact that
debug can be turned on or off in the middle of such a range. For
example, a "set debug foo 1" command in a breakpoint command, or a
superior GDB manually changing the debug_foo variable.
Two macros are added in gdbsupport/common-debug.h, which are helpers to
define module-specific macros:
- scoped_debug_start_end: takes a message that is printed both at
construction / destruction, with "start: " and "end: " prefixes.
- scoped_debug_enter_exit: prints hard-coded "enter" and "exit"
messages, to denote the entry and exit of a function.
I added some examples in the infrun module to give an idea of how it can
be used and what the result looks like. The macros are in capital
letters (INFRUN_SCOPED_DEBUG_START_END and
INFRUN_SCOPED_DEBUG_ENTER_EXIT) to mimic the existing SCOPE_EXIT, but
that can be changed if you prefer something else.
Here's an excerpt of the debug
statements printed when doing "continue", where a displaced step is
started:
[infrun] proceed: enter
[infrun] proceed: addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT
[infrun] global_thread_step_over_chain_enqueue: enqueueing thread Thread 0x7ffff75a5640 (LWP 2289301) in global step over chain
[infrun] start_step_over: enter
[infrun] start_step_over: stealing global queue of threads to step, length = 1
[infrun] start_step_over: resuming [Thread 0x7ffff75a5640 (LWP 2289301)] for step-over
[infrun] resume_1: step=1, signal=GDB_SIGNAL_0, trap_expected=1, current thread [Thread 0x7ffff75a5640 (LWP 2289301)] at 0x5555555551bd
[displaced] displaced_step_prepare_throw: displaced-stepping Thread 0x7ffff75a5640 (LWP 2289301) now
[displaced] prepare: selected buffer at 0x5555555550c2
[displaced] prepare: saved 0x5555555550c2: 1e fa 31 ed 49 89 d1 5e 48 89 e2 48 83 e4 f0 50
[displaced] amd64_displaced_step_copy_insn: copy 0x5555555551bd->0x5555555550c2: c7 45 fc 00 00 00 00 eb 13 8b 05 d4 2e 00 00 83
[displaced] displaced_step_prepare_throw: prepared successfully thread=Thread 0x7ffff75a5640 (LWP 2289301), original_pc=0x5555555551bd, displaced_pc=0x5555555550c2
[displaced] resume_1: run 0x5555555550c2: c7 45 fc 00
[infrun] infrun_async: enable=1
[infrun] prepare_to_wait: prepare_to_wait
[infrun] start_step_over: [Thread 0x7ffff75a5640 (LWP 2289301)] was resumed.
[infrun] operator(): step-over queue now empty
[infrun] start_step_over: exit
[infrun] proceed: start: resuming threads, all-stop-on-top-of-non-stop
[infrun] proceed: resuming Thread 0x7ffff7da7740 (LWP 2289296)
[infrun] resume_1: step=0, signal=GDB_SIGNAL_0, trap_expected=0, current thread [Thread 0x7ffff7da7740 (LWP 2289296)] at 0x7ffff7f7d9b7
[infrun] prepare_to_wait: prepare_to_wait
[infrun] proceed: resuming Thread 0x7ffff7da6640 (LWP 2289300)
[infrun] resume_1: thread Thread 0x7ffff7da6640 (LWP 2289300) has pending wait status status->kind = stopped, signal = GDB_SIGNAL_TRAP (currently_stepping=0).
[infrun] prepare_to_wait: prepare_to_wait
[infrun] proceed: [Thread 0x7ffff75a5640 (LWP 2289301)] resumed
[infrun] proceed: resuming Thread 0x7ffff6da4640 (LWP 2289302)
[infrun] resume_1: thread Thread 0x7ffff6da4640 (LWP 2289302) has pending wait status status->kind = stopped, signal = GDB_SIGNAL_TRAP (currently_stepping=0).
[infrun] prepare_to_wait: prepare_to_wait
[infrun] proceed: end: resuming threads, all-stop-on-top-of-non-stop
[infrun] proceed: exit
We can easily see where the call to `proceed` starts and end. We can
also see why there are a bunch of resume_1 calls, it's because we are
resuming threads, emulating all-stop on top of a non-stop target.
We also see that debug statements nest well with other modules that have
been migrated to use the "new" debug statement helpers (because they all
use debug_prefixed_vprintf in the end. I think this is desirable, for
example we could see the debug statements about reading the DWARF info
of a library nested under the debug statements about loading that
library.
Of course, modules that haven't been migrated to use the "new" helpers
will still print without indentations. This will be one good reason to
migrate them.
I think the runtime cost (when debug statements are disabled) of this is
reasonable, given the improvement in readability. There is the cost of
the conditionals (like standard debug statements), one more condition
(if (m_must_decrement_print_depth)) and the cost of constructing a stack
object, which means copying a fews pointers.
Adding the print in fetch_inferior_event breaks some tests that use "set
debug infrun", because it prints a debug statement after the prompt. I
adapted these tests to cope with it, by using the "-prompt" switch of
gdb_test_multiple to as if this debug statement is part of the expected
prompt. It's unfortunate that we have to do this, but I think the debug
print is useful, and I don't want a few tests to get in the way of
adding good debug output.
gdbsupport/ChangeLog:
* common-debug.h (debug_print_depth): New.
(struct scoped_debug_start_end): New.
(scoped_debug_start_end): New.
(scoped_debug_enter_exit): New.
* common-debug.cc (debug_prefixed_vprintf): Print indentation.
gdb/ChangeLog:
* debug.c (debug_print_depth): New.
* infrun.h (INFRUN_SCOPED_DEBUG_START_END): New.
(INFRUN_SCOPED_DEBUG_ENTER_EXIT): New.
* infrun.c (start_step_over): Use
INFRUN_SCOPED_DEBUG_ENTER_EXIT.
(proceed): Use INFRUN_SCOPED_DEBUG_ENTER_EXIT and
INFRUN_SCOPED_DEBUG_START_END.
(fetch_inferior_event): Use INFRUN_SCOPED_DEBUG_ENTER_EXIT.
gdbserver/ChangeLog:
* debug.cc (debug_print_depth): New.
gdb/testsuite/ChangeLog:
* gdb.base/ui-redirect.exp: Expect infrun debug print after
prompt.
* gdb.threads/ia64-sigill.exp: Likewise.
* gdb.threads/watchthreads-reorder.exp: Likewise.
Change-Id: I7c3805e6487807aa63a1bae318876a0c69dce949
2021-01-05 00:56:10 +08:00
|
|
|
|
2021-01-04 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* debug.c (debug_print_depth): New.
|
|
|
|
|
* infrun.h (INFRUN_SCOPED_DEBUG_START_END): New.
|
|
|
|
|
(INFRUN_SCOPED_DEBUG_ENTER_EXIT): New.
|
|
|
|
|
* infrun.c (start_step_over): Use
|
|
|
|
|
INFRUN_SCOPED_DEBUG_ENTER_EXIT.
|
|
|
|
|
(proceed): Use INFRUN_SCOPED_DEBUG_ENTER_EXIT and
|
|
|
|
|
INFRUN_SCOPED_DEBUG_START_END.
|
|
|
|
|
(fetch_inferior_event): Use INFRUN_SCOPED_DEBUG_ENTER_EXIT.
|
|
|
|
|
|
gdb: use infrun_debug_printf in print_target_wait_results
The code in print_target_wait_results uses a single call to debug_printf
in order to make sure a single timestamp is emitted, despite printing
multiple lines. The result is:
941502.043284 [infrun] target_wait (-1.0.0, status) =
[infrun] 649832.649832.0 [process 649832],
[infrun] status->kind = stopped, signal = GDB_SIGNAL_TRAP
I find this decision a bit counter productive, because it messes up the
alignment of the three lines. We don't care that three (slightly
different) timestamps are printed.
I suggest to change this function to use infrun_debug_printf, with this
result:
941601.425771 [infrun] print_target_wait_results: target_wait (-1.0.0 [process -1], status) =
941601.425824 [infrun] print_target_wait_results: 651481.651481.0 [process 651481],
941601.425867 [infrun] print_target_wait_results: status->kind = stopped, signal = GDB_SIGNAL_TRAP
Note that the current code only prints the waiton_ptid as a string
between square brackets if pid != -1. I don't think this complexity is
needed in a debug print. I made it so it's always printed, which I
think results in a much simpler function.
gdb/ChangeLog:
* infrun.c (print_target_wait_results): Use infrun_debug_printf.
Change-Id: I817bd10286b8e641a6c751ac3a1bd1ddf9b18ce0
2021-01-05 00:56:10 +08:00
|
|
|
|
2021-01-04 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* infrun.c (print_target_wait_results): Use infrun_debug_printf.
|
|
|
|
|
|
gdb: make "set debug timestamp" work nice with new debug printouts
New in v2:
- implement by modifying vprintf_unfiltered rather than
debug_prefixed_vprintf.
I tried enabling debug timestamps, and realized that it doesn't play
well with the revamp of the debug printouts I've been working on:
$ ./gdb -q -nx --data-directory=data-directory -ex "set debug infrun" -ex "set debug timestamp" a.out
Reading symbols from a.out...
(gdb) start
Temporary breakpoint 1 at 0x1131: file test.c, line 2.
Starting program: /home/smarchi/build/binutils-gdb-all-targets/gdb/a.out
939897.769338 [infrun] infrun_async:
939897.769383 enable=1
939897.769409
939897.915218 [infrun] proceed:
939897.915281 addr=0x7ffff7fd0100, signal=GDB_SIGNAL_0
939897.915315
939897.915417 [infrun] start_step_over:
939897.915464 stealing global queue of threads to step, length = 0
939897.915502
939897.915567 [infrun] operator():
939897.915601 step-over queue now empty
939897.915633
939897.915690 [infrun] proceed:
939897.915729 resuming process 636244
939897.915768
939897.915892 [infrun] resume_1:
939897.915954 step=0, signal=GDB_SIGNAL_0, trap_expected=0, current thread [process 636244] at 0x7ffff7fd0100
939897.915991
939897.916119 [infrun] prepare_to_wait:
939897.916153 prepare_to_wait
939897.916201
939897.916661 [infrun] target_wait (-1.0.0, status) =
[infrun] 636244.636244.0 [process 636244],
[infrun] status->kind = stopped, signal = GDB_SIGNAL_TRAP
939897.916734 [infrun] handle_inferior_event:
939897.916768 status->kind = stopped, signal = GDB_SIGNAL_TRAP
939897.916799
This is due to debug_prefixed_vprintf being implemented as three
separate calls to debug_printf / debug_vprintf. Each call gets its own
timestamp and newline, curtesy of vprintf_unfiltered.
My first idea was to add a "line_start" parameter to debug_vprintf,
allowing the caller to say whether the print is the start of the line.
A debug timestamp would only be printed if line_start was true.
However, that was much more invasive than the simple fix implemented in
this patch.
My second idea was to make debug_prefixed_vprintf use string_printf and
issue a single call to debug_printf. That would however prevent future
use of styling in the debug messages.
What is implemented in this patch is the same as is implemented in
GDBserver: the timestamp-printing code in GDB tracks whether the last
debug output ended with a newline. If so, it prints a timestamp on the
next debug output.
After the fix, it looks like this:
$ ./gdb -q -nx --data-directory=data-directory -ex "set debug infrun" -ex "set debug timestamp" a.out
Reading symbols from a.out...
(gdb) start
Temporary breakpoint 1 at 0x1131: file test.c, line 2.
Starting program: /home/smarchi/build/binutils-gdb-all-targets/gdb/a.out
941112.135662 [infrun] infrun_async: enable=1
941112.279930 [infrun] proceed: addr=0x7ffff7fd0100, signal=GDB_SIGNAL_0
941112.280064 [infrun] start_step_over: stealing global queue of threads to step, length = 0
941112.280125 [infrun] operator(): step-over queue now empty
941112.280194 [infrun] proceed: resuming process 646228
941112.280332 [infrun] resume_1: step=0, signal=GDB_SIGNAL_0, trap_expected=0, current thread [process 646228] at 0x7ffff7fd0100
941112.280480 [infrun] prepare_to_wait: prepare_to_wait
941112.281004 [infrun] target_wait (-1.0.0, status) =
[infrun] 646228.646228.0 [process 646228],
[infrun] status->kind = stopped, signal = GDB_SIGNAL_TRAP
941112.281078 [infrun] handle_inferior_event: status->kind = stopped, signal = GDB_SIGNAL_TRAP
gdb/ChangeLog:
* utils.c (vfprintf_unfiltered): Print timestamp only when
previous debug output ended with a newline.
Change-Id: Idcfe3acc7e3d0f526a5f0a43a5e0884bf93c41ae
2021-01-05 00:56:10 +08:00
|
|
|
|
2021-01-04 Simon Marchi <simon.marchi@efficios.com>
|
|
|
|
|
|
|
|
|
|
* utils.c (vfprintf_unfiltered): Print timestamp only when
|
|
|
|
|
previous debug output ended with a newline.
|
|
|
|
|
|
Refactor struct trad_frame_saved_regs
The following patch drops the overloading going on with the trad_frame_saved_reg
struct and defines a new struct with a KIND enum and a union of different
fields.
The new struct looks like this:
struct trad_frame_saved_reg
{
setters/getters
...
private:
trad_frame_saved_reg_kind m_kind;
union {
LONGEST value;
int realreg;
LONGEST addr;
const gdb_byte *value_bytes;
} m_reg;
};
And the enums look like this:
/* Describes the kind of encoding a stored register has. */
enum class trad_frame_saved_reg_kind
{
/* Register value is unknown. */
UNKNOWN = 0,
/* Register value is a constant. */
VALUE,
/* Register value is in another register. */
REALREG,
/* Register value is at an address. */
ADDR,
/* Register value is a sequence of bytes. */
VALUE_BYTES
};
The patch also adds setters/getters and updates all the users of the old
struct.
It is worth mentioning that due to the previous overloaded nature of the
fields, some tdep files like to store negative offsets and indexes in the ADDR
field, so I kept the ADDR as LONGEST instead of CORE_ADDR. Those cases may
be better supported by a new enum entry.
I have not addressed those cases in this patch to prevent unwanted breakage,
given I have no way to test some of the targets. But it would be nice to
clean those up eventually.
The change to frame-unwind.* is to constify the parameter being passed to the
unwinding functions, given we now accept a "const gdb_byte *" for value bytes.
Tested on aarch64-linux/Ubuntu 20.04/18.04 and by building GDB with
--enable-targets=all.
gdb/ChangeLog:
2021-01-04 Luis Machado <luis.machado@linaro.org>
Update all users of trad_frame_saved_reg to use the new member
functions.
Remote all struct keywords from declarations of trad_frame_saved_reg
types, except on forward declarations.
* aarch64-tdep.c: Update.
* alpha-mdebug-tdep.c: Update.
* alpha-tdep.c: Update.
* arc-tdep.c: Update.
* arm-tdep.c: Update.
* avr-tdep.c: Update.
* cris-tdep.c: Update.
* csky-tdep.c: Update.
* frv-tdep.c: Update.
* hppa-linux-tdep.c: Update.
* hppa-tdep.c: Update.
* hppa-tdep.h: Update.
* lm32-tdep.c: Update.
* m32r-linux-tdep.c: Update.
* m32r-tdep.c: Update.
* m68hc11-tdep.c: Update.
* mips-tdep.c: Update.
* moxie-tdep.c: Update.
* riscv-tdep.c: Update.
* rs6000-tdep.c: Update.
* s390-linux-tdep.c: Update.
* s390-tdep.c: Update.
* score-tdep.c: Update.
* sparc-netbsd-tdep.c: Update.
* sparc-sol2-tdep.c: Update.
* sparc64-fbsd-tdep.c: Update.
* sparc64-netbsd-tdep.c: Update.
* sparc64-obsd-tdep.c: Update.
* sparc64-sol2-tdep.c: Update.
* tilegx-tdep.c: Update.
* v850-tdep.c: Update.
* vax-tdep.c: Update.
* frame-unwind.c (frame_unwind_got_bytes): Make parameter const.
* frame-unwind.h (frame_unwind_got_bytes): Likewise.
* trad-frame.c: Update.
Remove TF_REG_* enum.
(trad_frame_alloc_saved_regs): Add a static assertion to check for
a trivially-constructible struct.
(trad_frame_reset_saved_regs): Adjust to use member function.
(trad_frame_value_p): Likewise.
(trad_frame_addr_p): Likewise.
(trad_frame_realreg_p): Likewise.
(trad_frame_value_bytes_p): Likewise.
(trad_frame_set_value): Likewise.
(trad_frame_set_realreg): Likewise.
(trad_frame_set_addr): Likewise.
(trad_frame_set_unknown): Likewise.
(trad_frame_set_value_bytes): Likewise.
(trad_frame_get_prev_register): Likewise.
* trad-frame.h: Update.
(trad_frame_saved_reg_kind): New enum.
(struct trad_frame_saved_reg) <addr, realreg, data>: Remove.
<m_kind, m_reg>: New member fields.
<set_value, set_realreg, set_addr, set_unknown, set_value_bytes>
<kind, value, realreg, addr, value_bytes, is_value, is_realreg>
<is_addr, is_unknown, is_value_bytes>: New member functions.
2020-12-23 04:45:21 +08:00
|
|
|
|
2021-01-04 Luis Machado <luis.machado@linaro.org>
|
|
|
|
|
|
|
|
|
|
Update all users of trad_frame_saved_reg to use the new member
|
|
|
|
|
functions.
|
|
|
|
|
|
|
|
|
|
Remote all struct keywords from declarations of trad_frame_saved_reg
|
|
|
|
|
types, except on forward declarations.
|
|
|
|
|
|
|
|
|
|
* aarch64-tdep.c: Update.
|
|
|
|
|
* alpha-mdebug-tdep.c: Update.
|
|
|
|
|
* alpha-tdep.c: Update.
|
|
|
|
|
* arc-tdep.c: Update.
|
|
|
|
|
* arm-tdep.c: Update.
|
|
|
|
|
* avr-tdep.c: Update.
|
|
|
|
|
* cris-tdep.c: Update.
|
|
|
|
|
* csky-tdep.c: Update.
|
|
|
|
|
* frv-tdep.c: Update.
|
|
|
|
|
* hppa-linux-tdep.c: Update.
|
|
|
|
|
* hppa-tdep.c: Update.
|
|
|
|
|
* hppa-tdep.h: Update.
|
|
|
|
|
* lm32-tdep.c: Update.
|
|
|
|
|
* m32r-linux-tdep.c: Update.
|
|
|
|
|
* m32r-tdep.c: Update.
|
|
|
|
|
* m68hc11-tdep.c: Update.
|
|
|
|
|
* mips-tdep.c: Update.
|
|
|
|
|
* moxie-tdep.c: Update.
|
|
|
|
|
* riscv-tdep.c: Update.
|
|
|
|
|
* rs6000-tdep.c: Update.
|
|
|
|
|
* s390-linux-tdep.c: Update.
|
|
|
|
|
* s390-tdep.c: Update.
|
|
|
|
|
* score-tdep.c: Update.
|
|
|
|
|
* sparc-netbsd-tdep.c: Update.
|
|
|
|
|
* sparc-sol2-tdep.c: Update.
|
|
|
|
|
* sparc64-fbsd-tdep.c: Update.
|
|
|
|
|
* sparc64-netbsd-tdep.c: Update.
|
|
|
|
|
* sparc64-obsd-tdep.c: Update.
|
|
|
|
|
* sparc64-sol2-tdep.c: Update.
|
|
|
|
|
* tilegx-tdep.c: Update.
|
|
|
|
|
* v850-tdep.c: Update.
|
|
|
|
|
* vax-tdep.c: Update.
|
|
|
|
|
|
|
|
|
|
* frame-unwind.c (frame_unwind_got_bytes): Make parameter const.
|
|
|
|
|
* frame-unwind.h (frame_unwind_got_bytes): Likewise.
|
|
|
|
|
|
|
|
|
|
* trad-frame.c: Update.
|
|
|
|
|
Remove TF_REG_* enum.
|
|
|
|
|
(trad_frame_alloc_saved_regs): Add a static assertion to check for
|
|
|
|
|
a trivially-constructible struct.
|
|
|
|
|
(trad_frame_reset_saved_regs): Adjust to use member function.
|
|
|
|
|
(trad_frame_value_p): Likewise.
|
|
|
|
|
(trad_frame_addr_p): Likewise.
|
|
|
|
|
(trad_frame_realreg_p): Likewise.
|
|
|
|
|
(trad_frame_value_bytes_p): Likewise.
|
|
|
|
|
(trad_frame_set_value): Likewise.
|
|
|
|
|
(trad_frame_set_realreg): Likewise.
|
|
|
|
|
(trad_frame_set_addr): Likewise.
|
|
|
|
|
(trad_frame_set_unknown): Likewise.
|
|
|
|
|
(trad_frame_set_value_bytes): Likewise.
|
|
|
|
|
(trad_frame_get_prev_register): Likewise.
|
|
|
|
|
* trad-frame.h: Update.
|
|
|
|
|
(trad_frame_saved_reg_kind): New enum.
|
|
|
|
|
(struct trad_frame_saved_reg) <addr, realreg, data>: Remove.
|
|
|
|
|
<m_kind, m_reg>: New member fields.
|
|
|
|
|
<set_value, set_realreg, set_addr, set_unknown, set_value_bytes>
|
|
|
|
|
<kind, value, realreg, addr, value_bytes, is_value, is_realreg>
|
|
|
|
|
<is_addr, is_unknown, is_value_bytes>: New member functions.
|
|
|
|
|
|
2021-01-03 10:32:14 +08:00
|
|
|
|
2021-01-02 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* target-float.c: Fix typos.
|
|
|
|
|
|
2021-01-03 00:35:25 +08:00
|
|
|
|
2021-01-02 Hannes Domani <ssbssa@yahoo.de>
|
|
|
|
|
|
|
|
|
|
* gdb-gdb.py.in: Fix main_type.flds_bnds.bounds pretty printer.
|
|
|
|
|
|
2021-01-01 16:08:28 +08:00
|
|
|
|
2021-01-01 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdbarch.sh: Update copyright year range.
|
|
|
|
|
|
2021-01-01 16:03:39 +08:00
|
|
|
|
2021-01-01 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
Update copyright year range in copyright header of all GDB files.
|
|
|
|
|
|
2021-01-01 15:56:12 +08:00
|
|
|
|
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 15:53:14 +08:00
|
|
|
|
2021-01-01 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* top.c (print_gdb_version): Update copyright year.
|
|
|
|
|
|
2021-04-16 00:05:00 +08:00
|
|
|
|
2021-01-01, 21 Joel Brobecker <brobecker@adacore.com>
|
2020-12-28 04:36:55 +08:00
|
|
|
|
|
2021-01-01 15:45:58 +08:00
|
|
|
|
* config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2020.
|
2020-12-28 04:36:55 +08:00
|
|
|
|
|
2021-01-01 15:45:58 +08:00
|
|
|
|
For older changes see ChangeLog-2020.
|
1999-04-16 09:35:26 +08:00
|
|
|
|
|
|
|
|
|
Local Variables:
|
|
|
|
|
mode: change-log
|
|
|
|
|
left-margin: 8
|
|
|
|
|
fill-column: 74
|
|
|
|
|
version-control: never
|
2007-08-10 06:44:38 +08:00
|
|
|
|
coding: utf-8
|
1999-04-16 09:35:26 +08:00
|
|
|
|
End:
|