aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-02-15More ecoff sanity checksAlan Modra1-20/+24
Change FIX so that unused pointers that escape the UPDATE_RAW_END sanity checks won't result in overflows. Also sanity check the local sym fdr isymBase and csym values. * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Define FIX to set pointers into swapped internal data to NULL if count is zero. Sanity check local sym fdr_ptr->isymBase and fdr_ptr->csym.
2023-02-15binutils stabs type listAlan Modra1-21/+15
Fuzzers have found that specifying a large stab type number results in lots of memory being requested, as the list is extended with a 16 element array at a time until we reach the given stab type. It also takes a long time. Of course normal sane stab types use small positive integers, but it's not hard to modify the code to handle type numbers starting anyhere. * stabs.c (struct stab_types): Add base_index. (stab_find_slot): Simplify filenum check. Delete type number check. Don't allocate entire array from 0 to type number, allocate a sparse array.
2023-02-15Automatic date update in version.inGDB Administrator1-1/+1
2023-02-14Remove a use of pagination_enabledTom Tromey1-6/+0
I noticed that the TUI temporarily sets pagination_enabled and gdb_stdout in one spot. However, I don't believe these settings are necessary here, as a ui_file is passed to gdbarch_print_registers_info. This patch removes these settings.
2023-02-14gdb/dwarf2: rename some things, index -> gdb_indexSimon Marchi1-34/+35
This renaming helps make it clearer that these entites (classes, functions) are specific to .gdb_index only, they are not shared with the .debug_names handling. Change-Id: I1a3cf3dbf450b62d1a0879d9aedd26397abdfd13 Approved-By: Tom Tromey <tom@tromey.com>
2023-02-14gdb: cast return value of std::unique_ptr::release to voidSimon Marchi1-2/+5
My editor shows warnings like: value.c:2784: warning: The value returned by this function should be used value.c:2784: note: cast the expression to void to silence this warning [bugprone-unused-return-value] These warnings come from clangd, so ultimately from one of the clang static analyzers (probably clang-tidy). Silence these warnings by casting to void. Add a comment to explain why this unusual thing is done. Change-Id: I58323959c0baf9f1b20a8d596e4c58dc77c6809a Approved-By: Tom Tromey <tom@tromey.com>
2023-02-14gdb: remove unnecessary tui directory check in configureSimon Marchi2-22/+18
I suppose this was possible in the CVS days for the tui directory to be missing, but it's not really possible nowaday. Well, a user could delete the directory from their source tree but... it doesn't make sense. Remove the check for that directory in configure. Change-Id: Iea1412f5e5482ed003015030132ec22150c7d0b3 Approved-By: Tom Tromey <tom@tromey.com>
2023-02-14Do not cast away const in agent_run_commandTom Tromey5-13/+17
While investigating something else, I noticed some weird code in agent_run_command (use of memcpy rather than strcpy). Then I noticed that 'cmd' is used as both an in and out parameter, despite being const. Casting away const like this is bad. This patch removes the const and fixes the memcpy. I also added a static assert to assure myself that the code in gdbserver is correct -- gdbserver is passing its own buffer directly to agent_run_command. Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-02-14[gdb/testsuite] Add xfail in gdb.python/py-record-btrace.expTom de Vries1-1/+42
There's a HW bug affecting Processor Trace on some Intel processors (Ice Lake to Raptor Lake microarchitectures). The bug was exposed by linux kernel commit 670638477aed ("perf/x86/intel/pt: Opportunistically use single range output mode"), added in version v5.5.0, and was worked around by commit ce0d998be927 ("perf/x86/intel/pt: Fix sampling using single range output") in version 6.1.0. The bug manifests (on a Performance-core of an i7-1250U, an Alder Lake cpu) in a single test-case: ... (gdb) python insn = r.instruction_history^M warning: Decode error (-20) at instruction 33 (offset = 0x3d6a, \ pc = 0x400501): compressed return without call.^M (gdb) FAIL: gdb.python/py-record-btrace.exp: prepare record: \ python insn = r.instruction_history ... Add a corresponding XFAIL. Note that the i7-1250U has both Performance-cores and Efficient-cores, and on an Efficient-Core the test-case runs without any problems, so if the testsuite run is not pinned to a specific cpu, the test may either PASS or XFAIL. Tested on x86_64-linux: - openSUSE Leap 15.4 with linux kernel version 5.14.21 - openSUSE Tumbleweed with linux kernel version 6.1.8 PR testsuite/30075 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30075
2023-02-14 Mention that the -plugin command line option is used to load plugins.Nick Clifton2-0/+8
2023-02-14[gdb/testsuite] Factor out proc linux_kernel_versionTom de Vries2-14/+29
Factor out new proc linux_kernel_version from test-case gdb.arch/i386-pkru.exp. Tested on x86_64-linux.
2023-02-14ASCIZ Command for output sectionUlf Samuelsson10-3/+157
Adds a new directive to the linker script syntax: ASCIZ. This inserts a zero-terminated string into the output at the place where it is used.
2023-02-14gas: correct symbol name comparison in .startof./.sizeof. handlingJan Beulich3-2/+7
In 162c6aef1f3a ("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-14x86: {LD,ST}TILECFG use an extension opcodeJan Beulich2-4/+4
It being zero and happening to work right now doesn't mean the insns shouldn't be spelled out properly.
2023-02-14gas: improve interaction between read_a_source_file() and s_linefile()Jan Beulich2-6/+10
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-14Fix build bug in ppc-linux-nat.cTom Tromey1-1/+1
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-14Automatic date update in version.inGDB Administrator1-1/+1
2023-02-13Rely on value_ref_ptr::operator->Tom Tromey6-21/+21
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-13Remove deprecated_lval_hackTom Tromey28-122/+112
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-13Introduce set_lval method on valueTom Tromey13-31/+35
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-13Make ~value privateTom Tromey1-4/+6
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-13Make struct value data members privateTom Tromey1-6/+2
This hoists the 'private' in struct value to also encompass the data members. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13Turn record_latest_value into a methodTom Tromey7-24/+21
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-13Add value::set_modifiableTom Tromey2-2/+6
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-13Turn various value copying-related functions into methodsTom Tromey16-197/+193
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-13Turn preserve_one_value into methodTom Tromey4-17/+14
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-13Turn some xmethod functions into methodsTom Tromey5-29/+29
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-13Change some code to use value methodsTom Tromey1-14/+14
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-13Turn set_value_component_location into methodTom Tromey5-24/+22
This turns set_value_component_location into a method of value. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13Turn value_non_lval and value_force_lval into methodsTom Tromey4-23/+26
This changes value_non_lval and value_force_lval to be methods of value. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13Turn many optimized-out value functions into methodsTom Tromey37-272/+237
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-13Turn value_copy into a methodTom Tromey10-49/+51
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-13Fully qualify calls to copy in value.cTom Tromey1-3/+3
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-13Turn remaining value_contents functions into methodsTom Tromey84-329/+330
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-13Turn value_incref and value_decref into methodsTom Tromey7-39/+27
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-13Move value_ref_policy methods out-of-lineTom Tromey1-9/+14
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-13Turn value_bits_synthetic_pointer into a methodTom Tromey8-31/+26
This changes value_bits_synthetic_pointer to be a method of value. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13Turn value_contents_eq into a methodTom Tromey7-93/+102
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-13Turn allocate_value_contents into a methodTom Tromey2-28/+37
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-13Turn value_fetch_lazy into a methodTom Tromey16-88/+98
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-13Turn some value_contents functions into methodsTom Tromey32-145/+142
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-13Turn value_zero into static "constructor"Tom Tromey15-77/+77
This turns value_zero into a static "constructor" of value. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13Turn allocate_optimized_out_value into static "constructor"Tom Tromey11-20/+21
This turns allocate_optimized_out_value into a static "constructor" of value. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13Turn allocate_computed_value into static "constructor"Tom Tromey7-15/+14
This turns allocate_computed_value into a static "constructor" of value. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13Turn allocate_value into a static "constructor"Tom Tromey37-128/+135
This changes allocate_value to be a static "constructor" of value. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-13Turn allocate_value_lazy into a static "constructor"Tom Tromey6-21/+29
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-13Turn more deprecated_* functions into methodsTom Tromey2-18/+16
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-13Turn value_address and set_value_address functions into methodsTom Tromey45-167/+166
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-13Turn value_initialized and set_value_initialized functions into methodsTom Tromey4-24/+11
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-13Convert value_lval_const and deprecated_lval_hack to methodsTom Tromey5-24/+14
This converts the value_lval_const and deprecated_lval_hack functions to be methods on value. Approved-By: Simon Marchi <simon.marchi@efficios.com>