Bug 219028

Summary: devel/gdb: Fix annoying "eh_frame" kgdb bug
Product: Ports & Packages Reporter: John Baldwin <jhb>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Many People CC: luca.pizzamiglio, np, rene
Priority: --- Flags: luca.pizzamiglio: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
kgdb.patch
none
Newer version of the patch, fixing the plist issue luca.pizzamiglio: maintainer-approval+

Description John Baldwin freebsd_committer freebsd_triage 2017-05-03 01:22:06 UTC
Created attachment 182259 [details]
kgdb.patch

The kld parsing code in kgdb was using basename() and dirname() which ended up being broken by the recent changes to make dirname() modify its input buffer.  The patch to fbsd-kld.c modifies it to use the lbasename() and ldirname() wrappers in gdb.  While here, it adds the kgdb.1 manpage from base which is helpful since stock HEAD no longer ships a kgdb manpage.  I also fixed an issue where the mips binaries weren't pulling in -lkvm which is needed for the kgdb binary to link.
Comment 1 luca.pizzamiglio 2017-05-08 09:13:19 UTC
During the test, I've found a small issue in the pkg-plist.
I'll recreate the patch after my series of tests.
Comment 2 luca.pizzamiglio 2017-05-08 11:17:55 UTC
Created attachment 182402 [details]
Newer version of the patch, fixing the plist issue

This patch substitute the previous one, fixing the pkg-plist issue caused by the added kgdb man page.
Comment 3 John Baldwin freebsd_committer freebsd_triage 2017-05-08 18:17:42 UTC
Oh, yes, I completely forgot to fix the manpage thing.  Thanks!  I'll get a ports committer to approve this and then commit.
Comment 4 Rene Ladan freebsd_committer freebsd_triage 2017-05-08 18:35:56 UTC
Approved, assuming it passes poudriere testport.
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-05-08 19:02:51 UTC
A commit references this bug:

Author: jhb
Date: Mon May  8 19:02:26 UTC 2017
New revision: 440447
URL: https://svnweb.freebsd.org/changeset/ports/440447

Log:
  Fix several issues with kgdb:

  - The kld parsing code in kgdb was using basename() and dirname() which
    ended up being broken by the recent changes to make dirname() modify its
    input buffer.  Modify fbsd-kld.c to use the lbasename() and ldirname()
    wrappers in gdb.
  - Add the kgdb.1 manpage from base and install it as 'kgdbNNN.1' which is
    helpful since stock HEAD no longer ships a kgdb manpage.
  - Link libkvm into mips binaries so that the vmcore target links.
  - Bump PORTREVISION.

  PR:		219028
  Reviewed by:	luca.pizzamiglio@gmail.com (maintainer)
  Approved by:	rene

Changes:
  head/devel/gdb/Makefile
  head/devel/gdb/files/extrapatch-kgdb
  head/devel/gdb/files/kgdb/fbsd-kld.c
  head/devel/gdb/files/kgdb/kgdb.1
  head/devel/gdb/pkg-plist