Commit Graph

116418 Commits

Author SHA1 Message Date
Tom Tromey
2bcbfaeadc Remove stray trailing "," from DAP breakpoint.py
The buildbot pointed out that the last DAP series I checked in had an
issue.  Looking into it, it seems there is a stray trailing "," in
breakpoint.py.  This patch removes it.

This seems to point out a test suite deficiency.  I will look into
fixing that.
2023-09-20 17:09:13 -06:00
Tom Tromey
ef0f16ccf8 Remove explanatory comments from includes
I noticed a comment by an include and remembered that I think these
don't really provide much value -- sometimes they are just editorial,
and sometimes they are obsolete.  I think it's better to just remove
them.  Tested by rebuilding.

Approved-By: Andrew Burgess <aburgess@redhat.com>
2023-09-20 11:45:16 -06:00
Gregory Anders
0b7de6d3ee gdb/dap: only include sourceReference if file path does not exist
According to the DAP specification if the "sourceReference" field is
included in a Source object, then the DAP client _must_ make a "source"
request to the debugger to retrieve file contents, even if the Source
object also includes path information.

If the Source's path field is a valid path that the DAP client is able
to read from the filesystem, having to make another request to the
debugger to get the file contents is wasteful and leads to incorrect
results (DAP clients will try to get the contents from the server and
display those contents as a file with the name in "source.path", but
this will conflict with the _acutal_ existing file at "source.path").

Instead, only set "sourceReference" if the source file path does not
exist.

Approved-By: Tom Tromey <tom@tromey.com>
2023-09-20 10:59:47 -06:00
Gregory Anders
61830fcb31 gdb/dap: use breakpoint fullname to resolve source
If the breakpoint has a fullname, use that as the source path when
resolving the breakpoint source information. This is consistent with
other callers of make_source which also use "fullname" if it exists (see
e.g. DAPFrameDecorator which returns the symtab's fullname).

Approved-By: Tom Tromey <tom@tromey.com>
2023-09-20 10:59:43 -06:00
Gregory Anders
d2266b2305 gdb/dap: ignore unused keyword args in step_out
Some DAP clients may send additional parameters in the stepOut command
(e.g. "granularity") which are not used by GDB, but should nonetheless
be accepted without error.

Approved-By: Tom Tromey <tom@tromey.com>
2023-09-20 10:59:38 -06:00
Gregory Anders
155f5df517 gdb/dap: check for breakpoint source before unpacking
Not all breakpoints have a source location. For example, a breakpoint
set on a raw address will have only the "address" field populated, but
"source" will be None, which leads to a RuntimeError when attempting to
unpack the filename and line number.

Before attempting to unpack the filename and line number from the
breakpoint, ensure that the source information is not None. Also
populate the source and line information separately from the
"instructionReference" field, so that breakpoints that include only an
address are still included.

Approved-By: Tom Tromey <tom@tromey.com>
2023-09-20 10:59:32 -06:00
Tom Tromey
4abf53c991 Run 'black' on printing.py
The buildbot pointed out that I neglected to re-run 'black' after
making some changes.  This patch fixes the oversight.
2023-09-20 10:43:04 -06:00
Matthew "strager" Glazar
0f6a699478 gdb/tui: add 'set tui mouse-events off' to restore mouse selection
Rationale:
I use the mouse with my terminal to select and copy text. In gdb, I use
the mouse to select a function name to set a breakpoint, or a variable
name to print, for example.

When gdb is compiled with ncurses mouse support, gdb's TUI mode
intercepts mouse events. Left-clicking and dragging, which would
normally select text, seems to do nothing. This means I cannot select
text using my mouse anymore. This makes it harder to set breakpoints,
print variables, etc.

Solution:
I tried to fix this issue by editing the 'mousemask' call to only enable
buttons 4 and 5. However, this still caused my terminal (gnome-terminal)
to not allow text to be selected. The only way I could make it work is
by calling 'mousemask (0, NULL);'. But doing so disables the mouse code
entirely, which other people might want.

I therefore decided to make a setting in gdb called 'tui mouse-events'.
If enabled (the default), the behavior is as it is now: terminal mouse
events are given to gdb, disabling the terminal's default behavior.
If disabled (opt-in), the behavior is as it was before the year 2020:
terminal mouse events are not given to gdb, therefore the mouse can be
used to select and copy text.

Notes:
I am not attached to the setting name or its description. Feel free to
suggest better wording.

Testing:
I tested this change in gnome-terminal by performing the following steps
manually:

1. Run: gdb --args ./myprogram
2. Enable TUI: press ctrl-x ctrl-a
3. Click and drag text with the mouse. Observe no selection.
4. Input: set tui mouse-events off
5. Click and drag text with the mouse. Observe that selection works now.
6. Input: set tui mouse-events on.
7. Click and drag text with the mouse. Observe no selection.
2023-09-20 16:35:36 +01:00
Tom de Vries
973db6fae3 [gdb/symtab] Error out for .debug_types section in dwz file
There are two methods to factor out type information in a dwarf4 executable:
- use -fdebug-info-types to generate type units in a .debug_types section, and
- use dwz to create partial units.

The dwz method has an extra benefit: it also allows to factor out information
between executables into a newly created .dwz file, pointed to by a
.gnu_debugaltlink section.

There is nothing prohibiting a .gnu_debugaltlink file to contain a
.debug_types section.

It's just not generated by dwz or any other tool atm, and consequently gdb has
no support for it.  Enhancement PR symtab/30838 is open about the lack of
support.

Make the current situation explicit by emitting a dwarf error:
...
(gdb) file struct-with-sig-2^M
Reading symbols from struct-with-sig-2...^M
Dwarf Error: .debug_types section not supported in dwz file^M
...
and add an assert in write_gdbindex:
...
+      /* See enhancement PR symtab/30838.  */
+      gdb_assert (!(per_cu->is_dwz && per_cu->is_debug_types));
...
to clarify why we can use:
...
      data_buf &cu_list = (per_cu->is_debug_types
                           ? types_cu_list
                           : per_cu->is_dwz ? dwz_cu_list : objfile_cu_list);
...

The test-case is a modified copy from gdb.dwarf2/struct-with-sig.exp, so it
keeps the copyright years range.

Tested on x86_64-linux.

Tested-By: Guinevere Larsen <blarsen@redhat.com>

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30838
2023-09-20 16:05:55 +02:00
Song Mengzhi
fbf4b3c9bb PR30870, VMS_DEBUG compilation error
Introduced by 8169954446.

	PR 30870
	* vms-alpha.c (image_write): Remove extraneous parenthesis.
2023-09-20 09:35:53 +09:30
GDB Administrator
39d12f2159 Automatic date update in version.in 2023-09-20 00:00:48 +00:00
Alan Modra
765a0c0a86 readelf.c 'ext' may be used uninitialized
* readelf.c (display_lto_symtab): Init ext.
2023-09-20 08:23:48 +09:30
Alan Modra
a1d1634d00 elf-attrs.c memory allocation fail
Report errors rather than segfaulting.

bfd/
	* elf-attrs.c (elf_new_obj_attr): Return NULL on bfd_alloc fail.
	(bfd_elf_add_obj_attr_int): Handle NULL return from the above,
	and propagate return to callers.
	(elf_add_obj_attr_string, elf_add_obj_attr_int_string): Likewise.
	(bfd_elf_add_obj_attr_string): Similarly.
	(_bfd_elf_copy_obj_attributes): Report error on alloc fails.
	(_bfd_elf_parse_attributes): Likewise.
	* elf-bfd.h (bfd_elf_add_obj_attr_int): Update prototype.
	(bfd_elf_add_obj_attr_string): Likewise.
	(bfd_elf_add_obj_attr_int_string): Likewise.
gas/
	* config/obj-elf.c (obj_elf_vendor_attribute): Report fatal
	error on out of memory from bfd attribute functions.
	* config/tc-arc.c (arc_set_attribute_int): Likewise.
	(arc_set_attribute_string, arc_set_public_attributes): Likewise.
	* config/tc-arm.c (aeabi_set_attribute_int): Likewise.
	(aeabi_set_attribute_string): Likewise.
	* config/tc-mips.c (mips_md_finish): Likewise.
	* config/tc-msp430.c (msp430_md_finish): Likewise.
	* config/tc-riscv.c (riscv_write_out_attrs): Likewise.
	* config/tc-sparc.c (sparc_md_finish): Likewise.
	* config/tc-tic6x.c (tic6x_set_attribute_int): Likewise.
	* config/tc-csky.c (md_begin): Likewise.
	(set_csky_attribute): Return ok status.
2023-09-20 08:23:47 +09:30
Tom Tromey
a56e5dce69 Handle pointers and references correctly in DAP
A user pointed out that the current DAP variable code does not let the
client deference a pointer.  Oops!

Fixing this oversight is simple enough -- adding a new no-op
pretty-printer for pointers and references is quite simple.

However, doing this naive caused a regession in scopes.exp, which
expected there to be no children of a 'const char *' variable.  This
problem was fixed by the preceding patches in the series, which ensure
that a C type of this kind is recognized as a string.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30821
2023-09-19 13:28:42 -06:00
Tom Tromey
76fc0f6213 Give a language to a type
This changes main_type to hold a language, and updates the debug
readers to set this field.  This is done by adding the language to the
type-allocator object.

Note that the non-DWARF readers are changed on a "best effort" basis.

This patch also reimplements type::is_array_like to use the type's
language, and it adds a new type::is_string_like as well.  This in
turn lets us change the Python implementation of these methods to
simply defer to the type.
2023-09-19 13:28:42 -06:00
Tom Tromey
26733fc747 Add is_array_like and to_array to language_defn
This adds new is_array_like and to_array methods to language_defn.
This will be used in a subsequent patch that generalizes the new
Python array- and string-handling code.
2023-09-19 13:28:42 -06:00
Tom Tromey
d948c67c5d Regularize some DWARF type initialization
In one spot, it will be convenient for a subsequent patch if the CU is
passed to a type-creation helper function.  In another spot, remove
the redundant 'objfile' parameter to another such function.
2023-09-19 13:28:42 -06:00
Tom Tromey
d559227272 Pass a type allocator to init_fixed_point_type
init_fixed_point_type currently takes an objfile and creates its own
type allocator.  However, for a later patch it is more convenient if
this function accepts a type allocator.  This patch makes this change.
2023-09-19 13:28:42 -06:00
Tom Tromey
8e032233a0 Use gdb::checked_static_cast for catchpoints
This replaces some casts to various kinds of catchpoint with
checked_static_cast.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-09-19 08:14:01 -06:00
Tom Tromey
6a9196a65f Use gdb::checked_static_cast for code_breakpoint
This replaces some casts to 'code_breakpoint *' with
checked_static_cast.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-09-19 08:14:01 -06:00
Tom Tromey
01bccc56af Use gdb::checked_static_cast for tracepoints
This replaces some casts to 'tracepoint *' with checked_static_cast.
Some functions are changed to accept a 'tracepoint *' now, for better
type safety.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-09-19 08:14:00 -06:00
Tom Tromey
bcafd1c19e Use gdb::checked_static_cast for watchpoints
This replaces some casts to 'watchpoint *' with checked_static_cast.
In one spot, an unnecessary block is also removed.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-09-19 08:14:00 -06:00
Mohamed Bouhaouel
093da43d2a gdb, breakpoint: add a destructor to the watchpoint struct
Make sure to unlink the related breakpoint when the watchpoint instance
is deleted.  This prevents having a wp-related breakpoint that is
linked to a NULL watchpoint (e.g.  the watchpoint instance is being
deleted when the 'watch' command fails).  With the below scenario,
having such a left out breakpoint will lead to a GDB hang, and this
is due to an infinite loop when deleting all inferior breakpoints.

Scenario:
	(gdb) set can-use-hw-watchpoints 0
	(gdb) awatch <SCOPE VAR>
	Can't set read/access watchpoint when hardware watchpoints are disabled.
	(gdb) rwatch <SCOPE VAR>
	Can't set read/access watchpoint when hardware watchpoints are disabled.
	(gdb) <continue the program until the end>
	>> HANG <<

Signed-off-by: Mohamed Bouhaouel <mohamed.bouhaouel@intel.com>
Reviewed-by: Bruno Larsen <blarsen@redhat.com>
2023-09-19 06:56:53 -06:00
Guinevere Larsen
12f567bcb6 gdb/cli: fixes to newly added "list ." command
After the series that added this command was pushed, Pedro mentioned
that the news description could easily be misinterpreted, as well as
some code and test improvements that should be made.

While fixing the test, I realized that code repetition wasn't
happening as it should, so I took care of that too.

Approved-By: Andrew Burgess <aburgess@redhat.com>
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2023-09-19 14:06:49 +02:00
GDB Administrator
5d69d9edc4 Automatic date update in version.in 2023-09-19 00:00:41 +00:00
Tom Tromey
e8aafb7d7a More type safety for symbol_search
This patch changes class symbol_search to store a block_enum rather
than an int.

Regression tested on x86-64 Fedora 38.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-09-18 12:34:33 -06:00
Tom Tromey
4eaa39a22d Move val_prettyformat to valprint.h
I stumbled across an ancient FIXME comment that was easy to fix --
val_prettyformat does not need to be in defs.h, and is easily moved to
valprint.h, where (despite what the comment says) it belongs.

Tested by rebuilding.
2023-09-18 12:21:07 -06:00
Jacob Navia
cf2ab5ef0b Fix: Use of uninitialized memory
* config/tc-riscv.c (riscv_ip_hardcode): Fully initialise the allocated riscv_opcode structure.
2023-09-18 12:03:58 +01:00
Simon Marchi
cb27750702 gdb: remove unused free_actions declaration
This appears to be a leftover from a past change.

Change-Id: I8e747edbf291400e4f417f5c6875049479a1669a
2023-09-17 20:49:22 -04:00
GDB Administrator
8b8050d46d Automatic date update in version.in 2023-09-18 00:00:37 +00:00
GDB Administrator
518eb2b451 Automatic date update in version.in 2023-09-17 00:00:26 +00:00
Tom de Vries
93203eebe2 [gdb/symtab] Fix overly large gdb-index file check for 32-bit
Add a unit test which checks that write_gdb_index_1 will throw
an error when the size of the file would exceed the maximum value
capable of being represented by 'offset_type'.

The unit test fails on 32-bit systems due to wrapping overflow.  Fix this by
changing the type of total_len in write_gdbindex_1 from size_t to uint64_t.

Tested on x86_64-linux.

Co-Authored-By: Kevin Buettner <kevinb@redhat.com>
Approved-by: Kevin Buettner <kevinb@redhat.com>
2023-09-16 04:10:53 +02:00
GDB Administrator
cbabd45022 Automatic date update in version.in 2023-09-16 00:00:27 +00:00
Simon Marchi
7057275297 gdb: remove -Werror annotations from MAINTAINERS file
I don't think these are useful nowadays, since we now expect all code to
be -Werror clean (it's the default in development branches).

Change-Id: I8c3b86c70d683bd41344d27add0ac2627a474d20
Approved-By: Tom Tromey <tom@tromey.com>
2023-09-15 16:20:58 -04:00
Simon Marchi
607c90c738 gdb/amdgpu: add precise-memory support
The amd-dbgapi library exposes a setting called "memory precision" for
AMD GPUs [1].  Here's a copy of the description of the setting:

    The AMD GPU can overlap the execution of memory instructions with other
    instructions.  This can result in a wave stopping due to a memory violation
    or hardware data watchpoint hit with a program counter beyond the
    instruction that caused the wave to stop.

    Some architectures allow the hardware to be configured to always wait for
    memory operations to complete before continuing.  This will result in the
    wave stopping at the instruction immediately after the one that caused the
    stop event.  Enabling this mode can make execution of waves significantly
    slower.

Expose this option through a new "amdgpu precise-memory" setting.

The precise memory setting is per inferior.  The setting is transferred
from one inferior to another when using the clone-inferior command, or
when a new inferior is created following an exec or a fork.

It can be set before starting the inferior, in which case GDB will
attempt to apply what the user wants when attaching amd-dbgapi.  If the
user has requested to enable precise memory, but it can't be enabled
(not all hardware supports it), GDB prints a warning.

If precise memory is disabled, GDB prints a warning when hitting a
memory exception (translated into GDB_SIGNAL_SEGV or GDB_SIGNAL_BUS),
saying that the stop location may not be precise.

Note that the precise memory setting also affects memory watchpoint
reporting, but the watchpoint support for AMD GPUs hasn't been
upstreamed to GDB yet.  When we do upstream watchpoint support, GDB will
produce a similar warning message when stopping due to a watchpoint if
precise memory is disabled.

Add a handful of tests.  Add a util proc
"hip_devices_support_precise_memory", which indicates if all devices
used for testing support that feature.

[1] 687374258a/include/amd-dbgapi.h.in (L6300-L6317)

Change-Id: Ife1a99c0e960513da375ced8f8afaf8e47a61b3f
Approved-By: Lancelot Six <lancelot.six@amd.com>
2023-09-15 16:19:22 -04:00
Simon Marchi
947e047fac gdb/testsuite: add linux target check in allow_hipcc_tests
ROCm / HIP tests should only run on Linux for now, existing gdb.rocm
tests miss such a check.  Add an "istarget linux" check in
allow_hipcc_tests.

Change-Id: I71f69e510a754f2fdadc32de53b923ebb9835ab5
Approved-By: Lancelot Six <lancelot.six@amd.com>
2023-09-15 16:17:59 -04:00
Simon Marchi
c6ae604573 gdb: add inferior_cloned observable
The following patch makes the amdgpu port transfer a property from the
original inferior to the new inferior when using the clone-inferior
command.  Add the inferior_cloned observable to help with this.

Change-Id: Id845a799813ec49b1b7b2fcb97b07d0a1e5e2631
Approved-By: Tom Tromey <tom@tromey.com>
2023-09-15 16:16:26 -04:00
Tom Tromey
0e0edacca5 Fix build failure with GCC 4.8
A user pointed out that the build failed with GCC 4.8.  The problem
was that the form used by the std::hash specialization of ptid_t was
not accepted.  This patch rewrites this code into a form that is
acceptable to the older compiler.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-09-15 10:36:15 -06:00
Laurent Morichetti
5490b88bfb gdb/amdgpu: Silence wave termination messages
After commit 9d7d58e726, the amdgpu target started printing
"thread exited" messages when pruning waves that had terminated.

  ...
  [AMDGPU Wave ?:?:?:2045 (?,?,?)/? exited]
  [AMDGPU Wave ?:?:?:2046 (?,?,?)/? exited]
  [AMDGPU Wave ?:?:?:2047 (?,?,?)/? exited]
  [AMDGPU Wave ?:?:?:2048 (?,?,?)/? exited]
  ...

The issue was that before commit 9d7d58e726, delete_thread was silent
by default due to a bug that the commit fixed.

Replaced the amdgpu target call to delete_thread with a call to
delete_thread_silent.

Change-Id: Ie5d5a4c5be851f092d2315b2afa6a36a30a05245
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-09-15 16:12:30 +00:00
Simon Marchi
d27f3b2fde gdb: add Lancelot Six as maintainer of the AMD GPU port
Lancelot has accepted to take the role of maintainer for the AMD GPU
port.  The AMD GPU port (amdgpu as I've written in the MAINTAINERS file)
is an umbrella term for everything needed to make this work: the amdgcn
arch, the amd-dbgapi target, solib-rocm, etc.

Thanks for accepting the role, and congratulations!

Change-Id: I4c898042fda49b45dcb0d54ca94731bb57287f71
2023-09-15 12:11:52 -04:00
Tom Tromey
fe26aa9533 Rename split_style::DOT
This renames split_style::DOT, to avoid name clashes when building gdb
with an old version of Bison (2.3, the version available on macOS).

In particular the error looks like:

./split-name.h:34:3: error: expected identifier
  DOT,
  ^
m2-exp.c:163:13: note: expanded from macro 'DOT'

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30286
2023-09-15 07:39:47 -06:00
Claudiu Zissulescu
0a43fbaa23 arc: Fix alignment of the TLS Translation Control Block
The R_ARC_TLS_LE_32 is defined as S + A + TLS_TBSS - TLS_REL, where

  -  S is the base address of the symbol in the memory
  -  A is the symbol addendum
  -  TLS_TBSS is the TLS Translation Control Block size (aligned)
  -  TLS_REL is the base of the TLS section

Given the next code snip:

__thread int data_var = 12;
__attribute__((__aligned__(128))) __thread int data_var_128 = 128;
__thread int bss_var;
__attribute__((__aligned__(256))) __thread int bss_var_256;

int __start(void)
{
	return data_var + data_var_128 + bss_var + bss_var_256;
}

The current code returns different TLS_TBSS values for .tdata and
.tbss. This patch fixes this by using the linker provided tls_sec.

bfd/

	* elf32-arc.c (TLS_REL): Clean up.
	(TLS_TBSS): Use tls_sec alignment.
	(arc_do_relocation): Check if we have valid tls_sec.

Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
2023-09-15 12:57:22 +03:00
Andrew Burgess
5a6dafd5f1 gdb: small cleanup in symbol_file_add_with_addrs
While looking at how gdb::observers::new_objfile was used, I found
some code in symbol_file_add_with_addrs that I thought could be
improved.

Instead of:

  if (condition)
   {
     ...
     return;
   }

  ...
  return;

Where some parts of '...' identical between the two branches.  I think
it would be nicer if the duplication is removed, and we just use:

  if (!condition)
    ...

to guard the one statement that should only happen when the condition
is not true.

There is one change in this commit though that is (possibly)
significant, there is a call to bfd_cache_close_all() that was only
present in the second block.  After this commit we now call that
function for both paths.

The call to bfd_cache_close_all was added in commit:

  commit ce7d45220e
  Date:   Fri Jul 30 12:05:45 2004 +0000

with the purpose of ensuring that GDB doesn't hold the BFDs open
unnecessarily, thus preventing the files from being updated on some
hosts (e.g. Win32).

In the early exit case we previously didn't call bfd_cache_close_all,
with the result that GDB would continue to hold open some BFD objects
longer than needed.

After this commit, but calling bfd_cache_close_all for both paths this
problem is solved.

I'm not sure how this change could be tested, I don't believe there's
any GDB (maintenance) command that displays the BFD cache contents, so
we can't check the cache contents easily.  Ideas are welcome though.

Approved-By: Tom Tromey <tom@tromey.com>
2023-09-15 10:16:52 +01:00
Andrew Burgess
7d9931cc31 gdb: add some missing filename styling
Spotted a few places where we can add filename styling.

Approved-By: Tom Tromey <tom@tromey.com>
2023-09-15 10:13:50 +01:00
Jinyang He
7c93730fe5 LoongArch: Enable gas sort relocs
The md_pre_output_hook creating fixup is asynchronous, causing relocs
may be out of order in .eh_frame. Define GAS_SORT_RELOCS so that reorder
relocs when write_relocs.

Reported-by: Rui Ueyama <rui314@gmail.com>
2023-09-15 17:01:44 +08:00
Jan Beulich
da5f9eb43f x86: fold CpuLM and Cpu64
Now that CpuLM is used solely in cpu_arch_flags and cpu_arch[] while
Cpu64 is solely used in insn templates, they no longer need to be
treated different from other "ordinary" flags; the only "unusual" one
left if CpuNo64. Fold both, leaving just Cpu64.
2023-09-15 09:57:05 +02:00
Jan Beulich
c0260ac619 x86: don't play with cpu_arch_flags.cpu{,no}64
A total four places exists where we set the two bits from flag_code, but
these values are never used. The two bits are evaluated only when coming
from insn templates.

Drop these assignments. Also make obvious that cpu_flags_check_cpu64()
is only ever used against insn templates.
2023-09-15 09:56:33 +02:00
Jan Beulich
1d07cfb440 x86: make code size vs CPU arch checking consistent
While update_code_flag() checks for LM / i386, set_cpu_arch() so far
didn't, allowing e.g. 64-bit code to be emitted after ".arch generic32".

Oddly enough a few of our testcases actually exhibit bad behavior (and
hence need minor adjustments).
2023-09-15 09:56:02 +02:00
Jan Beulich
b44fef84a9 x86: re-order update_code_flag()
Do checks before updating state, and bail upon failure of either of the
checks. While moving the code, eliminate some redundancy.
2023-09-15 09:55:34 +02:00
Guinevere Larsen
f8bf778c81 gdb/testsuite: explicitly test for stderr in gdb.mi/mi-dprintf.exp
As mentioned in commit 3f5bbc3e20, some
compilers such as clang don't add debug information about stderr by
default, leaving it to external debug packages.

This commit adds a way to check if GDB has access to stderr information
when in MI mode, and uses this new mechanism to skip the related section
of the test gdb.mi/mi-dprintf.exp. It also fixes an incorrect name for a
test in that file.

Co-Authored-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Kevin Buettner <kevinb@redhat.com>
2023-09-15 09:33:42 +02:00