Created attachment 170147 [details] The patch that create the new port Creating the new port bstack: bstack is the port of the Linux gstack, a utility to print the backtrace of a running process using GDB. It's a simple shell script retrieving information of the running process using procstat and then invoking gdb to show the backtrace of all threads. I choose the sysutils as category for the port, because similar tools like pstack and pstacku are in the same category.
Can you provide a shar file in place of a patch (Using patch < didn't create directory). Thanks.
Created attachment 171567 [details] The shar version of the port The submitted shar create the new port directory, but it doesn't modify the sysutil's Makefile. I've also added the NO_ARCH = yes, as suggested by Q/A, because it's olny a couple of scripts.
A commit references this bug: Author: olivier Date: Mon Jun 20 08:18:30 UTC 2016 New revision: 417144 URL: https://svnweb.freebsd.org/changeset/ports/417144 Log: New port: sysutils/bstack bstack - gstack for FreeBSD This is a port of gstack, a script build around gdb on RedHat and other Linux distros, to FreeBSD. bstack take a PID as only parameter and print out the back trace of that running process. If the process is multithread, the backtrace of all threads is printed. It works with the last version of GDB WWW: https://github.com/pizzamig/bstack PR: 209398 Submitted by: luca.pizzamiglio@gmail.com Approved by: jadawin (mentor) Differential Revision: https://reviews.freebsd.org/D6899 Changes: head/sysutils/Makefile head/sysutils/bstack/ head/sysutils/bstack/Makefile head/sysutils/bstack/distinfo head/sysutils/bstack/pkg-descr
Thanks for your new port!
luca, olivier: There is a minor problem with this port, specifically this line: RUN_DEPENDS= gdb:devel/gdb From the description of the tool I can infer this is supposed to be used with gdb from ports. However, the RUN_DEPENDS is never registered? Why is that, you say? because every single release of FreeBSD (and DragonFly) has gdb in base and in the standard path. The ports framework (or pkg, not sure which) sees gdb in the path and doesn't register devel/gdb as a dependency. The fix is to change the line to: RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb I will probably make this change without waiting for confirmation (after I test build it) but if you guys see this post, a confirmation that you agree would be nice.
(In reply to John Marino from comment #5) Hi John, you are totally right. I've seen poudriere build devel/gdb, because it's a dependency. But during the build phase, no gdb is installed. Another solution would be: RUN_DEPENDS= gdb>=7:devel/gdb But LOCALBASE solution seems more solid to me. thanks for the fix!
right, using a version specifier is in effect the same thing (maybe not as clear but that's subjective). FYI I caught this using synth. For a healthy port (we'll use bstack as an example), if you do this: "synth just-build sysutils/bstack" followed by the same command: "synth just-build sysutils/bstack" The result of the second command should be nothing; synth should say it's already built. In bstack's case, it built it again because the port makefile said gdb was supposed to be a dependency but synth didn't detect gdb registered in the package (it uses pkg to probe existing packages). So bstack built over and over and over again. Anyway, that's a little trick for the future. Matt Dillon found 40 of these after we built the whole tree with synth and ran synth on the tree again without changing anything.