Commit Graph

113435 Commits

Author SHA1 Message Date
Jan Beulich
12ef683055 gas: correct symbol name comparison in .startof./.sizeof. handling
In 162c6aef1f ("gas: fold symbol table entries generated for
.startof.() / .sizeof.()") I screwed up quite badly, inverting the case
sensitive and case insensitive comparison functions.
2023-02-14 08:35:02 +01:00
Jan Beulich
676dcbb0a0 x86: {LD,ST}TILECFG use an extension opcode
It being zero and happening to work right now doesn't mean the insns
shouldn't be spelled out properly.
2023-02-14 08:34:42 +01:00
Jan Beulich
7545aa2dd2 gas: improve interaction between read_a_source_file() and s_linefile()
read_a_source_file() would bump line numbers only when seeing a newline,
whereas is_end_of_line[] indicates further end-of-line characters, in
particular the nul character. s_linefile() attempts to compensate for
the bump, but was too aggressive with this so far: It should only adjust
when a newline ends the line. To facilitate such a check, the check for
nothing else on the line needs to move ahead, which luckily is easily
possible: The relevant two conditions match, and the function can
simply return from the body of that earlier instance of the conditional.

The more strict treatment in s_linefile() then requires an adjustment
to buffer_and_nest()'s invocation of the function: The line terminator
now needs to be a newline, not nul.
2023-02-14 08:34:03 +01:00
Tom Tromey
f54cd6441d Fix build bug in ppc-linux-nat.c
The buildbot pointed out that my value refactoring series introduced a
bug in ppc-linux-nat.c:

../../binutils-gdb/gdb/ppc-linux-nat.c: In member function ‘int ppc_linux_nat_target::num_memory_accesses(const std::vector<gdb::ref_ptr<value, value_ref_policy> >&)’:
../../binutils-gdb/gdb/ppc-linux-nat.c:2458:44: error: expected unqualified-id before ‘->’ token
 2458 |       if (VALUE_LVAL (v) == not_lval || v->->deprecated_modifiable () == 0)

I don't know how that happened, but I am checking in this patch which
I think should fix it.  It just removes the second "->".

I can't readily test this, so perhaps there's another bug lurking
after this one.
2023-02-14 00:31:04 -07:00
GDB Administrator
978042640c Automatic date update in version.in 2023-02-14 00:00:22 +00:00
Tom Tromey
f28085dfb4 Rely on value_ref_ptr::operator->
Simon pointed out some spots were doing val.get()->mumble, where val
is a value_ref_ptr.  These were introduced by the function-to-method
script, replacing older code that passed the result of .get() to a
function.

Now that value.h is using methods, we can instead rely on operator->.
This patch replaces all the newly-introduced instances of this.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:24:27 -07:00
Tom Tromey
736355f2e1 Remove deprecated_lval_hack
This removes deprecated_lval_hack and the VALUE_LVAL macro, replacing
all uses with a call to value::lval.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:20 -07:00
Tom Tromey
6f9c9d71c2 Introduce set_lval method on value
This introduces the set_lval method on value, one step toward removing
deprecated_lval_hack.  Ultimately I think the goal should be for some
of these set_* methods to be replaced with constructors; but I haven't
done this, as the series is already too long.  Other 'deprecated'
methods can probably be handled the same way.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:20 -07:00
Tom Tromey
43b5fba223 Make ~value private
At the end of this series, I belatedly realized that values should
only be destroyed by value_decref.  This patch marks the the
destructor private to enforce this.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:20 -07:00
Tom Tromey
8f4135314a Make struct value data members private
This hoists the 'private' in struct value to also encompass the data
members.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:20 -07:00
Tom Tromey
0d0f488e1d Turn record_latest_value into a method
record_latest_value now access some internals of struct value, so turn
it into a method.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:17 -07:00
Tom Tromey
e6cf1e1b42 Add value::set_modifiable
This introduces a value::set_modifiable and changes a couple of spots
to use it.

I'm not completely sure the comments by deprecated_modifiable are
correct any more.  Perhaps they should be removed and the method
renamed.  Like so many before me, though, I've deferred investigation
of the issue.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:17 -07:00
Tom Tromey
6c49729e59 Turn various value copying-related functions into methods
This patch turns a grab bag of value functions to methods of value.
These are done together because their implementations are
interrelated.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:17 -07:00
Tom Tromey
e3fb3c4772 Turn preserve_one_value into method
This changes preserve_one_value to be a method of value.  Much of this
patch was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:17 -07:00
Tom Tromey
6bd5c75435 Turn some xmethod functions into methods
This turns value_from_xmethod, result_type_of_xmethod, and
call_xmethod to be methods of value.  value_from_xmethod is a static
"constructor" now.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:17 -07:00
Tom Tromey
fcf86fe597 Change some code to use value methods
A few functions in value.c were accessing the internal fields of
struct value.  However, in these cases it seemed simpler to change
them to use the public API rather than convert them to be methods.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:17 -07:00
Tom Tromey
8181b7b657 Turn set_value_component_location into method
This turns set_value_component_location into a method of value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:17 -07:00
Tom Tromey
aa9f4538cc Turn value_non_lval and value_force_lval into methods
This changes value_non_lval and value_force_lval to be methods of
value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:17 -07:00
Tom Tromey
d00664dbba Turn many optimized-out value functions into methods
This turns many functions that are related to optimized-out or
availability-checking to be methods of value.  The static function
value_entirely_covered_by_range_vector is also converted to be a
private method.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:17 -07:00
Tom Tromey
cda0334434 Turn value_copy into a method
This turns value_copy into a method of value.  Much of this was
written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:16 -07:00
Tom Tromey
e18312bb59 Fully qualify calls to copy in value.c
A coming patch will add value::copy, so this namespace-qualifies
existing calls to 'copy' in value.c, to ensure it will still compile
after that change is done.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:16 -07:00
Tom Tromey
efaf1ae025 Turn remaining value_contents functions into methods
This turns the remaining value_contents functions -- value_contents,
value_contents_all, value_contents_for_printing, and
value_contents_for_printing_const -- into methods of value.  It also
converts the static functions require_not_optimized_out and
require_available to be private methods.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:16 -07:00
Tom Tromey
cdf3de175d Turn value_incref and value_decref into methods
This changes value_incref and value_decref to be methods of value.
Much of this patch was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:16 -07:00
Tom Tromey
d3824ae14a Move value_ref_policy methods out-of-line
This moves the value_ref_policy methods to be defined out-of-line.
This is a necessary step to change value_incref and value_decref to be
methods of value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:16 -07:00
Tom Tromey
e989e63761 Turn value_bits_synthetic_pointer into a method
This changes value_bits_synthetic_pointer to be a method of value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:16 -07:00
Tom Tromey
02744ba9a2 Turn value_contents_eq into a method
This changes value_contents_eq to be a method of value.  It also
converts the static function value_contents_bits_eq into a private
method.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:16 -07:00
Tom Tromey
82ca8f7201 Turn allocate_value_contents into a method
This turns the static function allocate_value_contents into a method
on value.  It is temporarily public, until some users are converted.
set_limited_array_length is converted as well.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:12 -07:00
Tom Tromey
78259c365f Turn value_fetch_lazy into a method
This changes value_fetch_lazy to be a method of value.  A few helper
functions are converted as well, to avoid problems in later patches
when the data members are all made private.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:22:04 -07:00
Tom Tromey
bbe912ba88 Turn some value_contents functions into methods
This turns value_contents_raw, value_contents_writeable, and
value_contents_all_raw into methods on value.  The remaining functions
will be changed later in the series; they were a bit trickier and so I
didn't include them in this patch.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:08 -07:00
Tom Tromey
ee7bb2944b Turn value_zero into static "constructor"
This turns value_zero into a static "constructor" of value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:08 -07:00
Tom Tromey
b27556e3c1 Turn allocate_optimized_out_value into static "constructor"
This turns allocate_optimized_out_value into a static "constructor" of
value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:08 -07:00
Tom Tromey
b64e260290 Turn allocate_computed_value into static "constructor"
This turns allocate_computed_value into a static "constructor" of
value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
317c3ed9fc Turn allocate_value into a static "constructor"
This changes allocate_value to be a static "constructor" of value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
cbe793af88 Turn allocate_value_lazy into a static "constructor"
This changes allocate_value_lazy to be a static "constructor" of
struct value.

I considered trying to change value to use ordinary new/delete, but it
seems to me that due to reference counting, we may someday want to
change these static constructors to return value_ref_ptr instead.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
f29de66504 Turn more deprecated_* functions into methods
This changes deprecated_value_internalvar_hack,
deprecated_value_internalvar_hack, and deprecated_value_regnum_hack
into methods on value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
9feb2d07de Turn value_address and set_value_address functions into methods
This changes the value_address and set_value_address functions to be
methods of value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
8e5b19ad99 Turn value_initialized and set_value_initialized functions into methods
This changes the value_initialized and set_value_initialized functions
to be methods of value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
970441058c Convert value_lval_const and deprecated_lval_hack to methods
This converts the value_lval_const and deprecated_lval_hack functions
to be methods on value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
b9f74d5432 Turn value_computed_closure and value_computed_funcs functions into methods
This changes the value_computed_funcs and value_computed_closure
functions to be methods of value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
c8580184bb Turn value_stack and set_value_stack functions into methods
This changes the value_stack and set_value_stack functions to be
methods of value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
3ee3b2700d Turn value_lazy and set_value_lazy functions into methods
This changes the value_lazy and set_value_lazy functions to be methods
of value.  Much of this patch was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
391f86284f Turn some value offset functions into method
This changes various offset-related functions to be methods of value.
Much of this patch was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
463b870d01 Turn value_enclosing_type into method
This changes value_enclosing_type to be a method of value.  Much of
this patch was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
4b53ca8883 Turn deprecated_value_modifiable into method
This changes deprecated_value_modifiable to be a method of value.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
76675c4d0b Turn value_offset into method
This changes value_offset to be a method of value.  Much of this patch
was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
fac7bdaaab Turn value_parent into method
This changes value_parent to be a method of value.  Much of this patch
was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
5011c493fb Turn value_bitpos into method
This changes value_bitpos to be a method of value.  Much of this patch
was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
f49d5fa263 Turn value_bitsize into method
This changes value_bitsize to be a method of value.  Much of this patch
was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
f9ee742cd7 Turn value_arch into method
This changes value_arch to be a method of value.  Much of this patch
was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00
Tom Tromey
81ae560ca4 Turn deprecated_set_value_type into a method
This changes deprecated_set_value_type to be a method of value.  Much
of this patch was written by script.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13 15:21:07 -07:00