~ubuntu-support-team/binutils/+git/binutils-gdb:users/gwen/try-frame-unwind-c++-ification-fixed

Last commit made on 2024-02-21
Get this branch:
git clone -b users/gwen/try-frame-unwind-c++-ification-fixed https://git.launchpad.net/~ubuntu-support-team/binutils/+git/binutils-gdb

Branch merges

Branch information

Name:
users/gwen/try-frame-unwind-c++-ification-fixed
Repository:
lp:~ubuntu-support-team/binutils/+git/binutils-gdb

Recent commits

d2b4f49... by Guinevere Larsen <email address hidden>

gdb: Migrate frame unwinders to use C++ classes

Frame unwinders have historically been a structure populated with
callback pointers, so that architectures (or other specific unwinders)
could install their own way to handle the inferior. However, since
moving to c++, we could use polymorphism to get the same functionality
in a more readable way. Polymorphism also makes it simpler to add new
functionality to all frame unwinders, since all that's required is
adding it to the base class.

As part of the changes to add support to disabling frame unwinders,
this commit makes the first baby step in using polymorphism for the
frame unwinders, by making frame_unwind a virtual class, and adds 3 new
classes. The main class added is frame_unwind_legacy, which works the
same as the previous structs, using function pointers as callbacks. This
class was added to allow the transition to happen piecemeal. New
unwinders should instead follow the lead of the other 2 classes
implemented.

The other 2, frame_unwind_python and frame_unwind_trampoline, were added
because it seemed simpler at the moment to do that instead of reworking
the dynamic allocation to work with the legacy class, and can be used as
an example to future implementations.

c5497c1... by Guinevere Larsen <email address hidden>

gdb: add "unwinder class" to frame unwinders

A future patch will add a way to disable certain unwinders based on
different characteristics. This patch aims to make it more convenient
to disable related unwinders in bulk, such as architecture specific
ones, by indentifying all unwinders by which part of the code adds it.
The classes, and explanations, are as follows:

* GDB: An internal unwinder, added by GDB core, such as the unwinder
  for dummy frames;
* EXTENSION: Unwinders added by extension languages;
* DEBUGINFO: Unwinders installed by the debug info reader;
* ARCH: Unwinders installed by the architecture specific code.

fb054b5... by Fedora GDB patches <email address hidden>

gdb/testsuite: Test for a backtrace through object without debuginfo

Fedora has been carrying this test since back in the Project Archer
days. A change back then caused GDB to stop being able to backtrace when
only some of the object files had debug information. Even though the
changed code never seems to have made its way into the main GDB project,
I think it makes sense to bring the test along to ensure something like
this doesn't pass unnoticed.

e961aad... by Guinevere Larsen <email address hidden>

gdb: make gdbarch store a vector of frame unwinders

Before this commit, all frame unwinders would be stored in the obstack
of a gdbarch and accessed by using the registry system. This made for
unwieldy code, and unnecessarily complex logic in the frame_unwinder
implementation, along with making frame_unwind structs be unable to have
non-trivial constructors.

Seeing as a future patch of this series wants to refactor the
frame_unwind struct to use inheritance, obstack storage would no longer
be viable. In preparation for that change, this commit adds an
std::vector to gdbarch to store the unwinders in.

There should be no user-visible changes.

b235e90... by Tom de Vries <email address hidden>

[gdb/testsuite] Fix another fail and tcl error in gdb.dap/sources.exp

With gdb.dap/sources.exp on aarch64-linux, I'm running into:
...
{"request_seq": 3, "type": "response", "command": "loadedSources", \
  "success": false, "message": "notStopped", "seq": 7}Content-Length: 92^M
^M
{"type": "event", "event": "thread", \
  "body": {"reason": "started", "threadId": 1}, \
  "seq": 8}FAIL: gdb.dap/sources.exp: loadedSources success
ERROR: tcl error sourcing gdb.dap/sources.exp.
ERROR: tcl error code TCL LOOKUP DICT body
ERROR: key "body" not known in dictionary
    while executing
"dict get [lindex $obj 0] body sources"
...

These are the same type of tcl error and FAIL I just fixed for a later
request in the same test-case.

Fix this by:
- moving the wait-for-stop to before the loadedSources request to fix the
  FAIL, and
- checking for $obj == "" to fix the tcl error.

Also make the code a bit less indented and more readable by wrapping the tests
in a proc, allowing the use of return to bail out, while still running
dap_shutdown afterwards.

Approved-By: Tom Tromey <email address hidden>

Tested on aarch64-linux.

363baa1... by GDB Administrator <email address hidden>

Automatic date update in version.in

fd07bcb... by Yuriy Kolerov <email address hidden>

arc: Don't use multiline in arc-disassembler-options.exp test

Breaking a TCL string to several lines leads to adding of extra
symbols to the resulting expect string. In turn, this leads to
failing of all test cases in gdb.arch/arc-disassembler-options.exp
testsuite. It's necessary to use multi_line function in such
cases.

Approved-By: Tom Tromey <email address hidden>

a16034b... by Tom de Vries <email address hidden>

[gdb/testsuite] Fix fail in gdb.dap/sources.exp

With test-case gdb.dap/sources.exp, I run into:
...
{"request_seq": 4, "type": "response", "command": "source", \
  "success": false, "message": "notStopped", \
  "seq": 11}FAIL: gdb.dap/sources.exp: get source success
...

The fail happens because the request races with the stopping at main as
requested by:
...
if {[dap_launch $testfile stop_at_main 1] == ""} {
...

Fix this by waiting for the stop, in the same way that is done in other
test-cases that use stop_at_main.

Tested on x86_64-linux.

Approved-By: Tom Tromey <email address hidden>

PR testsuite/31374
https://sourceware.org/bugzilla/show_bug.cgi?id=31374

3224e32... by Jaydeep Patil <email address hidden>

sim: riscv: Add support for compressed integer instructions

Added support for simulation of compressed integer instruction set ("c").
Added test file sim/testsuite/riscv/c-ext.s to test compressed instructions.
The compressed instructions are available for models implementing C extension.
Such as RV32IC, RV64IC, RV32GC, RV64GC etc.

Approved-By: Andrew Burgess <email address hidden>

4dad3c1... by Tom de Vries <email address hidden>

[gdb/testsuite] Fix tcl error in gdb.dap/sources.exp

With test-case gdb.dap/sources.exp, I run into:
...
{"request_seq": 4, "type": "response", "command": "source", \
  "success": false, "message": "notStopped", \
  "seq": 11}FAIL: gdb.dap/sources.exp: get source success
ERROR: tcl error sourcing gdb.dap/sources.exp.
ERROR: key "body" not known in dictionary
...

The FAIL has been filed as PR dap/31374.

The ERROR happens because after the FAIL, dap_check_request_and_response
returns "", and the test-case doesn't check for that.

Fix this by checking for $obj != "" in the test-case.

Tested on x86_64-linux.