summaryrefslogtreecommitdiff
path: root/usr.bin/gcore
Commit message (Collapse)AuthorAgeFilesLines
* Use MACHINE_CPUARCH when checking for arm64Andrew Turner2020-09-141-1/+1
| | | | | | | | | | | | | | | Use MACHINE_CPUARCH with arm64 (aarch64) when we build code that could run on any 64-bit Arm instruction set. This will simplify checks in downstream consumers targeting prototype instruction sets. The only place we check for MACHINE_ARCH == aarch64 is when building the device tree blobs. As these are targeting current generation ISAs. Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D26370 Notes: svn path=/head/; revision=365726
* gcore: Avoid using vm_map_entry_t.Mark Johnston2019-12-071-20/+27
| | | | | | | | | | Use an internally defined structure instead, to avoid relying on kernel structure details. No functional change intended. MFC after: 1 week Notes: svn path=/head/; revision=355506
* gcore: Don't add VSX notes on powerpcspeJustin Hibbits2019-11-161-0/+2
| | | | | | | | powerpcspe does not support VSX at all, but gets the 'VMX' notes for free, providing the SPE registers. Notes: svn path=/head/; revision=354778
* gcore: Add powerpc64 32-bit gcore supportJustin Hibbits2019-10-112-1/+15
| | | | | | | | | | Summary: Add the necessary bits for taking 32-bit gcore coredumps on powerpc64. Reviewed by: luporl Differential Revision: https://reviews.freebsd.org/D21954 Notes: svn path=/head/; revision=353437
* gcore: Add aarch64 32-bit core supportJustin Hibbits2019-10-112-2/+12
| | | | | | | | | | | | Summary: Add trivial 32-bit arm cores on aarch64 support for gcore. This doesn't handle fpregs. Reviewed by: #arm, andrew Sponsored by: Juniper Networks, Inc Differential Revision: https://reviews.freebsd.org/D21947 Notes: svn path=/head/; revision=353436
* Included VSX registers in powerpc core dumpsJustin Hibbits2018-06-021-0/+26
| | | | | | | | | | Summary: Included VSX registers in powerpc core dumps (both kernel and gcore) Submitted by: Luis Pires Differential Revision: https://reviews.freebsd.org/D15512 Notes: svn path=/head/; revision=334538
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-202-0/+4
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Add a NT_ARM_VFP ELF core note to hold VFP registers for each thread.John Baldwin2017-09-141-0/+31
| | | | | | | | | | | | | The core note matches the format and layout of NT_ARM_VFP on Linux. Debuggers use the AT_HWCAP flags to determine how many VFP registers are actually used and their format. Reviewed by: mmel (earlier version w/o gcore) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D12293 Notes: svn path=/head/; revision=323584
* Store a 32-bit PT_LWPINFO struct for 32-bit process core dumps.John Baldwin2017-06-292-4/+52
| | | | | | | | | | | | Process core notes for a 32-bit process running on a 64-bit host need to use 32-bit structures so that the note layout matches the layout of notes of a core dump of a 32-bit process under a 32-bit kernel. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D11407 Notes: svn path=/head/; revision=320481
* Add support for capturing 'struct ptrace_lwpinfo' for signalsTycho Nightingale2017-03-301-0/+21
| | | | | | | | | | | | resulting in a process dumping core in the corefile. Also extend procstat to view select members of 'struct ptrace_lwpinfo' from the contents of the note. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316286
* Renumber copyright clause 4Warner Losh2017-02-283-3/+3
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Trim trailing whitespace (mostly introduced in r313407).John Baldwin2017-02-081-1/+1
| | | | | | | Sponsored by: DARPA / AFRL Notes: svn path=/head/; revision=313449
* Copy the e_machine and e_flags fields from the binary into an ELF core dump.John Baldwin2017-02-071-9/+16
| | | | | | | | | | | | | | | | In the kernel, cache the machine and flags fields from ELF header to use in the ELF header of a core dump. For gcore, the copy these fields over from the ELF header in the binary. This matters for platforms which encode ABI information in the flags field (such as o32 vs n32 on MIPS). Reviewed by: kib Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D9392 Notes: svn path=/head/; revision=313407
* Cleanup some leftovers from '-s' removal in r302792.Bryan Drewery2016-11-171-16/+1
| | | | | | | | MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=308788
* Mirror r303120 to gcoreConrad Meyer2016-07-211-6/+6
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303122
* Add extended segment support to gcoreConrad Meyer2016-07-201-3/+31
| | | | | | | | | | | | | | A follow-up to r303099, D7255. Basically, apply the exact same change, with the exact same rationale, to gcore. gcore's elfcore.c is largely a clone of the kernel imgact_elf coredump facility. Reviewed by: emaste (earlier version, not substantially different) Requested by: jhb Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7265 Notes: svn path=/head/; revision=303114
* Include process IDs in core dumps.John Baldwin2016-07-181-0/+1
| | | | | | | | | | | | | | | | When threads were added to the kernel, the pr_pid member of the NT_PRSTATUS note was repurposed to store LWP IDs instead of process IDs. However, the process ID was no longer recorded in core dumps. This change adds a pr_pid field to prpsinfo (NT_PRSINFO). Rather than bumping the prpsinfo version number, note parsers can use the note's payload size to determine if pr_pid is present. Reviewed by: kib, emaste (older version) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D7117 Notes: svn path=/head/; revision=303002
* Include command line arguments in core dump process info.John Baldwin2016-07-141-1/+15
| | | | | | | | | | | Fill in pr_psargs in the NT_PRSINFO ELF core dump note with command line arguments. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D7116 Notes: svn path=/head/; revision=302859
* Remove gcore's -s option.Mark Johnston2016-07-143-16/+2
| | | | | | | | It has no effect and is always implicitly set since ptrace(2) stops the target process. Notes: svn path=/head/; revision=302792
* gcore: Forward pending signals when detaching from the target.Mark Johnston2016-06-241-3/+13
| | | | | | | | | | | | | | Otherwise gcore's ptrace attach operation can race with delivery of a signal and cause it to be lost. In collaboration with: Suraj Raju <sraju@isilon.com> Reviewed by: bdrewery Approved by: re (gjb, kib) MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=302179
* Fix buffer overrun in gcore(1) NT_PRPSINFOConrad Meyer2016-05-111-2/+2
| | | | | | | | | | | | | | | | Use size of destination buffer, rather than a constant that may or may not correspond to the source buffer, to restrict the length of copied strings. In particular, pr_fname has 16+1 characters but MAXCOMLEN is 18+1. Use strlcpy instead of strncpy to ensure the result is nul-terminated. This seems to be what is expected of these fields. Reported by: Coverity CIDs: 1011302, 1011378 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299458
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-273-21/+70
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-191-1/+1
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * \ Merge head from 7/28Simon J. Gerraty2014-08-193-15/+123
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | | Updated dependenciesSimon J. Gerraty2013-10-131-0/+1
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=256419
| * | | Merge from headSimon J. Gerraty2013-09-052-204/+374
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | Move the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h>John Baldwin2015-04-081-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and export them to userland. - Define __HAVE_REG32 on platforms that define a reg32 structure and check for this in <sys/procfs.h> to control when to export prstatus32, etc. - Add prstatus32_t and prpsinfo32_t typedefs for the 32-bit structures. libbfd looks for these types, and having them fixes 'gcore' in gdb of a 32-bit process on a 64-bit platform. - Use the structure definitions from <sys/procfs.h> in gcore's elf32 core dump code instead of duplicating the definitions. Differential Revision: https://reviews.freebsd.org/D2142 Reviewed by: kib, nathanw (powerpc bits) MFC after: 1 week Notes: svn path=/head/; revision=281266
* | | | | Include OBJT_PHYS VM objects in ELF core dumps. In particular thisJohn Baldwin2015-02-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | includes the shared page allowing debuggers to use the signal trampoline code to identify signal frames in core dumps. Differential Revision: https://reviews.freebsd.org/D1828 Reviewed by: alc, kib MFC after: 1 week Notes: svn path=/head/; revision=278761
* | | | | Make use of the new Altivec ptrace support, to save the Altivec registers inJustin Hibbits2015-01-141-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcore. MFC after: 2 weeks Relnotes: yes Notes: svn path=/head/; revision=277167
* | | | | Convert to usr.bin/ to LIBADDBaptiste Daroussin2014-11-251-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275042
* | | | | Improve support for XSAVE with debuggers.John Baldwin2014-11-211-0/+35
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Dump an NT_X86_XSTATE note if XSAVE is in use. This note is designed to match what Linux does in that 1) it dumps the entire XSAVE area including the fxsave state, and 2) it stashes a copy of the current xsave mask in the unused padding between the fxsave state and the xstate header at the same location used by Linux. - Teach readelf() to recognize NT_X86_XSTATE notes. - Change PT_GET/SETXSTATE to take the entire XSAVE state instead of only the extra portion. This avoids having to always make two ptrace() calls to get or set the full XSAVE state. - Add a PT_GET_XSTATE_INFO which returns the length of the current XSTATE save area (so the size of the buffer needed for PT_GETXSTATE) and the current XSAVE mask (%xcr0). Differential Revision: https://reviews.freebsd.org/D1193 Reviewed by: kib MFC after: 2 weeks Notes: svn path=/head/; revision=274817
* | | | Remove an unsed variable.Kevin Lo2014-07-311-1/+1
| |_|/ |/| | | | | | | | Notes: svn path=/head/; revision=269320
* | | Create 32-bit core files for 32-bit processes on 64-bit machines.Marcel Moolenaar2014-07-263-15/+123
| |/ |/| | | | | | | | | | | | | | | | | The 64-bit machine supported right now is amd64, but it's not too hard to add powerpc64. Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=269128
* | Add some missing DPADD.Antoine Brodin2013-05-111-1/+1
| | | | | | | | Notes: svn path=/head/; revision=250511
* | Wrong cast.Mikolaj Golub2013-04-201-2/+1
| | | | | | | | | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=249704
* | Sync gcore(1) with the recent changes in kernel code aimed at addingMikolaj Golub2013-04-202-203/+374
|/ | | | | | | | | | procstat notes to a process core file. Suggested by: jhb MFC after: 1 month Notes: svn path=/head/; revision=249687
* Match size_t and ssize_t by using %zu and %zd instead of %d.Xin LI2011-07-111-1/+1
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=223924
* Start sentences on a new line to ease life for translators. Tweak theJohn Baldwin2010-12-281-7/+8
| | | | | | | | | wording in a few places. MFC after: 1 week Notes: svn path=/head/; revision=216769
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-113-12/+0
| | | | | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson Notes: svn path=/head/; revision=216370
* Add the ability for GDB to printout the thread name along with otherAttilio Rao2010-11-221-0/+11
| | | | | | | | | | | | | | | | | | | | | | | thread specific informations. In order to do that, and in order to avoid KBI breakage with existing infrastructure the following semantic is implemented: - For live programs, a new member to the PT_LWPINFO is added (pl_tdname) - For cores, a new ELF note is added (NT_THRMISC) that can be used for storing thread specific, miscellaneous, informations. Right now it is just popluated with a thread name. GDB, then, retrieves the correct informations from the corefile via the BFD interface, as it groks the ELF notes and create appropriate pseudo-sections. Sponsored by: Sandvine Incorporated Tested by: gianni Discussed with: dim, kan, kib MFC after: 2 weeks Notes: svn path=/head/; revision=215679
* Fix spelling.Attilio Rao2010-07-141-5/+5
| | | | | | | | | | Sponsored by: Sandvine Incorporated Submitted by: b.f. <bf1783 at googlemail dot com> MFC after: 2 weeks X-MFC: 210063 Notes: svn path=/head/; revision=210065