summaryrefslogtreecommitdiffstats
path: root/usr.bin/gcore
Commit message (Collapse)AuthorAgeFilesLines
* MFC 313407,313449: Copy ELF machine/flags from binaries to core dumps.jhb2017-05-111-8/+15
| | | | | | | | | | | | | | | | | 313407: Copy the e_machine and e_flags fields from the binary into an ELF core dump. 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). 313449: Trim trailing whitespace (mostly introduced in r313407). Sponsored by: DARPA / AFRL
* MFC 303002: Include process IDs in core dumps.jhb2016-10-281-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.
* MFC 302859: Include command line arguments in core dump process info.jhb2016-10-061-1/+15
| | | | | Fill in pr_psargs in the NT_PRSINFO ELF core dump note with command line arguments.
* gcore: Forward pending signals when detaching from the target.markj2016-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
* Fix buffer overrun in gcore(1) NT_PRPSINFOcem2016-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
* Add META_MODE support.sjg2015-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
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge sync of headsjg2015-05-273-21/+70
| |\ | |/ |/|
| * Merge from head@274682sjg2014-11-191-1/+1
| |\
| * \ Merge head from 7/28sjg2014-08-193-15/+123
| |\ \
| * | | Updated dependenciessjg2014-05-161-1/+0
| | | |
| * | | Updated dependenciessjg2014-05-101-0/+2
| | | |
| * | | Updated dependenciessjg2013-10-131-0/+1
| | | |
| * | | Merge from headsjg2013-09-052-204/+374
| |\ \ \
| * | | | Updated dependenciessjg2013-03-111-0/+1
| | | | |
| * | | | Updated dependenciessjg2013-02-161-2/+0
| | | | |
| * | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+20
| | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | Move the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h>jhb2015-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
* | | | | Include OBJT_PHYS VM objects in ELF core dumps. In particular thisjhb2015-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
* | | | | Make use of the new Altivec ptrace support, to save the Altivec registers injhibbits2015-01-141-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcore. MFC after: 2 weeks Relnotes: yes
* | | | | Convert to usr.bin/ to LIBADDbapt2014-11-251-2/+1
| | | | | | | | | | | | | | | | | | | | Reduce overlinking
* | | | | Improve support for XSAVE with debuggers.jhb2014-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
* | | | Remove an unsed variable.kevlo2014-07-311-1/+1
| |_|/ |/| |
* | | Create 32-bit core files for 32-bit processes on 64-bit machines.marcel2014-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.
* | Add some missing DPADD.antoine2013-05-111-1/+1
| |
* | Wrong cast.trociny2013-04-201-2/+1
| | | | | | | | MFC after: 1 month
* | Sync gcore(1) with the recent changes in kernel code aimed at addingtrociny2013-04-202-203/+374
|/ | | | | | | procstat notes to a process core file. Suggested by: jhb MFC after: 1 month
* Match size_t and ssize_t by using %zu and %zd instead of %d.delphij2011-07-111-1/+1
| | | | MFC after: 1 month
* Start sentences on a new line to ease life for translators. Tweak thejhb2010-12-281-7/+8
| | | | | | wording in a few places. MFC after: 1 week
* Remove the advertising clause from UCB copyrighted files in usr.bin. Thisjoel2010-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
* Add the ability for GDB to printout the thread name along with otherattilio2010-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
* Fix spelling.attilio2010-07-141-5/+5
| | | | | | | Sponsored by: Sandvine Incorporated Submitted by: b.f. <bf1783 at googlemail dot com> MFC after: 2 weeks X-MFC: 210063
* Fix the way the segments are included in the gcore outputs (with theattilio2010-07-144-11/+30
| | | | | | | | | | | | | | | | | | | default invokation): - Right now if segments are not writable are not included. Remove this. - Right now if a segment is mapped with NOCORE the check is not honoured. Change this by checking the newly added flag, from libutil, KVME_FLAG_NOCOREDUMP. Besides that, add a new flag (-f) that forces a 'full' dump of all the segments excluding just the malformed ones. This might be used very carefully as, among the reported segments, there could be memory mapped areas that could be vital to program execution. Sponsored by: Sandvine Incorporated Discussed with: kib Reviewed by: emaste Tested by: Sandvine Incorporated MFC after: 2 weeks
* Fixed dependencies (make checkdpadd).ru2010-02-251-1/+2
|
* Fix gcore so that it can have the '-s' flag without hanging.mjacob2010-02-052-27/+19
|
* Build usr.bin/ with WARNS=6 by default.ed2010-01-021-0/+2
| | | | Also add some missing $FreeBSD$ to keep svn happy.
* Revert most part of 200420 as requested, as more review and polish isdelphij2009-12-131-0/+1
| | | | needed.
* Remove unneeded header includes from usr.bin/ except contributed code.delphij2009-12-111-1/+0
| | | | Tested with: make universe
* Change gcore in order to get rid of the procfs accesses and use FreeBSD'sattilio2009-11-254-198/+185
| | | | | | | | | | | | | | | | | | | | | specific sysctls and ptrace interfaces. This change switches a bit gcore POLA that is summarized here: - now gcore can recognize threads within the process and handle dumps on thread-scope - the process to be analyzed will be stopped during its gcore run - gcore may not work with processes which are actively being analyzed by gdb or truss - the ptrace interface may cause syscalls to return EINTR, thus interferring with signals handling within the process Side note: <janitor task> the interface can be further lifted in order to get rid of the very last procfs interfaces remnants and made more suitable for copying with sysctl/ptrace interface </janitor task>. Obtained from: Sandvine Incorporated Reviewed by: emaste, rwatson Sponsored by: Sandvine Incorporated MFC: 1 month
* Use %zu for size_t, not %zd.emaste2009-09-231-3/+3
| | | | | Submitted by: ru MFC after: 1 week
* Use %zd for size_t. With this gcore(1) is WARNS=6 clean.delphij2008-07-181-3/+3
|
* Eliminate memory leak from an accidental malloc().emaste2007-04-101-1/+0
|
* Make gcore(1) 64 bit safe. It was trying to parse the /proc/*/map filepeter2006-03-251-3/+3
| | | | | | | | | using sscanf and truncating the start/end entries by writing them with a 32 bit int descriptor (%x). The upper bytes of the 64 bit vm_offset_t variables (for little endian machines) were uninitialized. For big endian machines, things would have been worse because it was storing the 32 bit value in the upper half of the 64 bit variable. I've changed it to use %lx and long types. That should work on all our platforms.
* Remove a.out support from gcore(1).das2004-11-272-249/+0
|
* gcore(1) apparently still cares about a.out core dumps, so it stilldas2004-11-201-0/+2
| | | | | | needs to know that a 1-page U area is part of the dump format. Reviewed by: arch@
* Teach gcore about the pathname field of '/proc/*/map' so that it doesn'trwatson2004-07-121-3/+3
| | | | | | | spin when its parser gets confused by a lack of end-of-line. Submitted by: Dan Nelson <dan@dan.emsphone.com> PR: 68839
* Deal with double whitespace.ru2004-07-031-1/+1
|
* Mechanically kill hard sentence breaks.ru2004-07-021-2/+4
|
* Fix some WARNS:dwmalone2004-02-153-8/+7
| | | | | | 1) Remove some unused variables. 2) Mark some things aas static or __unused. 3) Cast to make sure we're comparing the same types.
* Add #include <sys/queue.h> for sparc64's benefit. The MD includes therepeter2002-09-131-0/+1
| | | | have less polution.
OpenPOWER on IntegriCloud