Page MenuHomeFreeBSD

devel/gdb: Update to 10.1
ClosedPublic

Authored by jhb on Nov 1 2020, 4:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 7:11 PM
Unknown Object (File)
Wed, Apr 17, 12:29 PM
Unknown Object (File)
Wed, Apr 17, 12:29 PM
Unknown Object (File)
Wed, Apr 17, 12:29 PM
Unknown Object (File)
Wed, Apr 17, 12:28 PM
Unknown Object (File)
Wed, Apr 17, 11:18 AM
Unknown Object (File)
Feb 28 2024, 11:37 AM
Unknown Object (File)
Jan 28 2024, 9:48 PM
Subscribers

Details

Summary

This patch aims to update the gdb port to 10.1
Currently, kgdb doesn't build because of internal API changes
An input from jhb@ is needed to fix kgdb.

Test Plan

Successfully build with a mix of options enabled/disabled
Runtime test using the usual set of scenarios.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I've pushed a kgdb-10 branch here:

https://github.com/bsdjhb/gdb/tree/kgdb-10

For the new files in files/kgdb, you can just copy them from that branch.

For extrapatch-kgdb, I use git diff --no-prefix --diff-filter=M gdb-10-branch...kgdb-10.

jhb edited reviewers, added: pizzamig; removed: jhb.

Grabbing this so I can update it with kgdb bits.

  • Adding updated kgdb bits.

KGDB changes that are new relative to 9.2 include:

  • Updated for changed PCB layout in RISC-V kernels in FreeBSD 13.
  • target vmcore will now tab-complete filenames.
  • Kernel modules are autoloaded correctly when using a sysroot (this was a regression in kgdb in GDB 9).
devel/gdb/files/kgdb/fbsd-kvm.c
194 ↗(On Diff #80277)

This also means that kgdb works on RISC-V kernels. It didn't fully work before.

@pizzamig you can comandeer this back now.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 4 2020, 11:19 PM
Closed by commit rP557028: devel/gdb: Update to 10.1 (authored by pizzamig). · Explain Why
This revision was automatically updated to reflect the committed changes.

Unfortunately, this fails on armv7 and on aarch64.

 CXX    fork-child.o
/usr/ports/devel/gdb/work-py37/gdb-10.1/gdb/fbsd-kvm.c:342:10: error: typedef 'section_offsets' cannot be referenced with a struct specifier
                struct section_offsets *new_offsets;
                       ^
/usr/ports/devel/gdb/work-py37/gdb-10.1/gdb/symtab.h:1351:32: note: declared here
typedef std::vector<CORE_ADDR> section_offsets;
                               ^
/usr/ports/devel/gdb/work-py37/gdb-10.1/gdb/fbsd-kvm.c:349:22: error: no member named 'num_sections' in 'objfile'; did you mean 'sections'?
                                symfile_objfile->num_sections);
                                                 ^~~~~~~~~~~~
                                                 sections
/usr/ports/devel/gdb/work-py37/gdb-10.1/gdb/../include/libiberty.h:365:55: note: expanded from macro 'XALLOCAVEC'
#define XALLOCAVEC(T, N)        ((T *) alloca (sizeof (T) * (N)))
                                                             ^
/usr/ports/devel/gdb/work-py37/gdb-10.1/gdb/../include/libiberty.h:738:37: note: expanded from macro 'alloca'
# define alloca(x) __builtin_alloca(x)
                                    ^
/usr/ports/devel/gdb/work-py37/gdb-10.1/gdb/objfiles.h:653:23: note: 'sections' declared here
  struct obj_section *sections = nullptr;
                      ^
/usr/ports/devel/gdb/work-py37/gdb-10.1/gdb/fbsd-kvm.c:351:37: error: no member named 'num_sections' in 'objfile'
                        for (i = 0; i < symfile_objfile->num_sections; i++)
                                        ~~~~~~~~~~~~~~~  ^
3 errors generated.
gmake[4]: *** [Makefile:1625: fbsd-kvm.o] Error 1

it fails on current, independently by the architecture.

https://reviews.freebsd.org/D27499 is the WIP fix