Commit Graph

94 Commits

Author SHA1 Message Date
Simon J. Gerraty
ccfb965433 Add META_MODE support.
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
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
John Baldwin
dbee5c671a Move the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h>
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
2015-04-08 16:30:45 +00:00
John Baldwin
bc411bc2d0 Include OBJT_PHYS VM objects in ELF core dumps. In particular this
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
2015-02-14 17:12:31 +00:00
Justin Hibbits
b5d4909ec3 Make use of the new Altivec ptrace support, to save the Altivec registers in
gcore.

MFC after:	2 weeks
Relnotes:	yes
2015-01-14 07:02:21 +00:00
Baptiste Daroussin
3e11bd9e2a Convert to usr.bin/ to LIBADD
Reduce overlinking
2014-11-25 14:29:10 +00:00
John Baldwin
180e57e5c7 Improve support for XSAVE with debuggers.
- 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
2014-11-21 20:53:17 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Kevin Lo
798d238f9c Remove an unsed variable. 2014-07-31 03:36:03 +00:00
Marcel Moolenaar
31d743df76 Create 32-bit core files for 32-bit processes on 64-bit machines.
The 64-bit machine supported right now is amd64, but it's not too
hard to add powerpc64.

Obtained from:	Juniper Networks, Inc.
2014-07-26 16:45:11 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
34b33809b7 Updated dependencies 2013-10-13 00:24:00 +00:00
Simon J. Gerraty
d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Antoine Brodin
290b7b224a Add some missing DPADD. 2013-05-11 13:46:05 +00:00
Mikolaj Golub
e344fb0222 Wrong cast.
MFC after:	1 month
2013-04-20 15:37:33 +00:00
Mikolaj Golub
7fe6d16ef9 Sync gcore(1) with the recent changes in kernel code aimed at adding
procstat notes to a process core file.

Suggested by:	jhb
MFC after:	1 month
2013-04-20 08:23:19 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Xin LI
d1d6559b08 Match size_t and ssize_t by using %zu and %zd instead of %d.
MFC after:	1 month
2011-07-11 05:46:15 +00:00
John Baldwin
581499c3bf Start sentences on a new line to ease life for translators. Tweak the
wording in a few places.

MFC after:	1 week
2010-12-28 18:58:15 +00:00
Joel Dahl
da52b4caaf Remove the advertising clause from UCB copyrighted files in usr.bin. This
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
2010-12-11 08:32:16 +00:00
Attilio Rao
7f08176ee8 Add the ability for GDB to printout the thread name along with other
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
2010-11-22 14:42:13 +00:00
Attilio Rao
837ada2240 Fix spelling.
Sponsored by:	Sandvine Incorporated
Submitted by:	b.f. <bf1783 at googlemail dot com>
MFC after:	2 weeks
X-MFC:		210063
2010-07-14 17:46:44 +00:00
Attilio Rao
1d73ef9790 Fix the way the segments are included in the gcore outputs (with the
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
2010-07-14 17:16:25 +00:00
Ruslan Ermilov
bee10047c0 Fixed dependencies (make checkdpadd). 2010-02-25 20:24:19 +00:00
Matt Jacob
adaa8f14dd Fix gcore so that it can have the '-s' flag without hanging. 2010-02-05 18:28:43 +00:00
Ed Schouten
b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Xin LI
821df508e8 Revert most part of 200420 as requested, as more review and polish is
needed.
2009-12-13 03:14:06 +00:00
Xin LI
6f2d322192 Remove unneeded header includes from usr.bin/ except contributed code.
Tested with:	make universe
2009-12-11 23:35:38 +00:00
Attilio Rao
2e7ecbfbc8 Change gcore in order to get rid of the procfs accesses and use FreeBSD's
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
2009-11-25 15:23:14 +00:00
Ed Maste
7149ebf446 Use %zu for size_t, not %zd.
Submitted by:	ru
MFC after:	1 week
2009-09-23 15:32:59 +00:00
Xin LI
fffc0a1e59 Use %zd for size_t. With this gcore(1) is WARNS=6 clean. 2008-07-18 23:37:05 +00:00
Ed Maste
affde8a968 Eliminate memory leak from an accidental malloc(). 2007-04-10 17:37:53 +00:00
Peter Wemm
045b6fdaf6 Make gcore(1) 64 bit safe. It was trying to parse the /proc/*/map file
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.
2006-03-25 01:14:20 +00:00
David Schultz
c5ac569a4b Remove a.out support from gcore(1). 2004-11-27 06:46:48 +00:00
David Schultz
6661339b82 gcore(1) apparently still cares about a.out core dumps, so it still
needs to know that a 1-page U area is part of the dump format.

Reviewed by:	arch@
2004-11-20 02:30:02 +00:00
Robert Watson
22c1471434 Teach gcore about the pathname field of '/proc/*/map' so that it doesn't
spin when its parser gets confused by a lack of end-of-line.

Submitted by:	Dan Nelson <dan@dan.emsphone.com>
PR:		68839
2004-07-12 20:19:40 +00:00
Ruslan Ermilov
557b7fa148 Deal with double whitespace. 2004-07-03 00:24:45 +00:00
Ruslan Ermilov
6a3e8b0adc Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
David Malone
c4dd6db19b Fix some WARNS:
1) Remove some unused variables.
2) Mark some things aas static or __unused.
3) Cast to make sure we're comparing the same types.
2004-02-15 22:48:25 +00:00
Peter Wemm
9e0a9e9833 Add #include <sys/queue.h> for sparc64's benefit. The MD includes there
have less polution.
2002-09-13 18:24:59 +00:00
Peter Wemm
e0491636b5 Use a crowbar to move the a.out code out of gcore.c and into its own
file so that we have a chance of using gcore on non-i386 platforms.  Use
linker sets to reduce the registration glue.  Remove md-sparc.c, we do not
have an a.out sparc32 port.  aoutcore.c was repocopied from gcore.c.
2002-09-13 16:33:35 +00:00
Ian Dowse
56d037c684 Include stdint.h to make this compile.
Submitted by:	Garance A Drosihn <drosih@rpi.edu>
2002-09-05 07:43:34 +00:00
David Malone
f4ac32def2 ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by:	md5
2002-09-04 23:29:10 +00:00
David E. O'Brien
64567a4162 Consistently wrap CSRG SCM ID.
Requested by:	bde
2002-06-30 09:24:25 +00:00
David E. O'Brien
e026a48c34 Consistently use FBSDID 2002-06-30 05:25:07 +00:00