You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(32) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(32) |
2
(22) |
3
(47) |
4
(29) |
5
(18) |
6
(16) |
|
7
(21) |
8
(29) |
9
(23) |
10
(68) |
11
(20) |
12
(17) |
13
(17) |
|
14
(27) |
15
(26) |
16
(21) |
17
(13) |
18
(19) |
19
(29) |
20
(13) |
|
21
(9) |
22
(8) |
23
(29) |
24
(56) |
25
(21) |
26
(46) |
27
(33) |
|
28
(25) |
29
(41) |
30
(35) |
31
(28) |
|
|
|
|
From: Tom H. <th...@cy...> - 2005-08-29 02:12:21
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-08-29 03:00:03 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 164 tests, 7 stderr failures, 0 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_fcntl (stderr) |
|
From: <sv...@va...> - 2005-08-29 01:27:53
|
Author: njn
Date: 2005-08-29 02:27:50 +0100 (Mon, 29 Aug 2005)
New Revision: 4558
Log:
Add a newline to the failure message.
Modified:
branches/ASPACEM/coregrind/m_launcher.c
Modified: branches/ASPACEM/coregrind/m_launcher.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_launcher.c 2005-08-29 01:22:54 UTC (rev =
4557)
+++ branches/ASPACEM/coregrind/m_launcher.c 2005-08-29 01:27:50 UTC (rev =
4558)
@@ -103,7 +103,8 @@
=20
execve(toolfile, argv, envp);
=20
- fprintf(stderr, "valgrind: failed to start %s: %s", toolname, strerro=
r(errno));
+ fprintf(stderr, "valgrind: failed to start %s: %s\n",
+ toolname, strerror(errno));
=20
exit(1);
}
|
|
From: <sv...@va...> - 2005-08-29 01:22:56
|
Author: njn Date: 2005-08-29 02:22:54 +0100 (Mon, 29 Aug 2005) New Revision: 4557 Log: Fixed the hacky method of building libcoregrind.so. Also, we don't need to play --whole-archive games with libreplacemalloc_core.a now. Modified: branches/ASPACEM/Makefile.tool.am branches/ASPACEM/cachegrind/Makefile.am branches/ASPACEM/coregrind/Makefile.am branches/ASPACEM/lackey/Makefile.am branches/ASPACEM/massif/Makefile.am branches/ASPACEM/memcheck/Makefile.am branches/ASPACEM/none/Makefile.am Modified: branches/ASPACEM/Makefile.tool.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/ASPACEM/Makefile.tool.am 2005-08-29 01:15:13 UTC (rev 4556) +++ branches/ASPACEM/Makefile.tool.am 2005-08-29 01:22:54 UTC (rev 4557) @@ -7,3 +7,26 @@ =20 LIBREPLACEMALLOC =3D $(top_builddir)/coregrind/m_replacemalloc/libreplac= emalloc_toolpreload.a =20 +## Nb: libscheduler.a must precede libdispatch.a in this list. +COREGRIND_LIBS =3D \ + $(top_builddir)/coregrind/libcoregrind_singles.a \ + $(top_builddir)/coregrind/m_aspacemgr/libaspacemgr.a \ + $(top_builddir)/coregrind/m_debuginfo/libdebuginfo.a \ + $(top_builddir)/coregrind/m_demangle/libdemangle.a \ + $(top_builddir)/coregrind/m_scheduler/libscheduler.a \ + $(top_builddir)/coregrind/m_dispatch/libdispatch.a \ + $(top_builddir)/coregrind/m_replacemalloc/libreplacemalloc_core.a \ + $(top_builddir)/coregrind/m_sigframe/libsigframe.a \ + $(top_builddir)/coregrind/m_syswrap/libsyswrap.a \ + @VEX_DIR@/libvex.a + + +## Nb: do not call this variables "TOOL_LINKADD" and "TOOL_LDFLAGS" -- t= hat +## makes automake think we are building something called "TOOLS". +TOOL_LINKADD =3D $(COREGRIND_LIBS) -lgcc +TOOL_LINKFLAGS =3D \ + -static \ + -Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \ + -Wl,-T,$(top_srcdir)/valt_load_address.lds \ + -nodefaultlibs -nostartfiles + Modified: branches/ASPACEM/cachegrind/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/ASPACEM/cachegrind/Makefile.am 2005-08-29 01:15:13 UTC (rev = 4556) +++ branches/ASPACEM/cachegrind/Makefile.am 2005-08-29 01:22:54 UTC (rev = 4557) @@ -11,13 +11,7 @@ =20 val_PROGRAMS =3D cachegrind =20 -cachegrind_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a -cachegrind_SOURCES =3D \ - cg_main.c \ - cg-@VG_ARCH@.c -cachegrind_LDFLAGS =3D \ - -static \ - $(top_srcdir)/coregrind/libcoregrind.a \ - -Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \ - -Wl,-T,$(top_srcdir)/valt_load_address.lds \ - -nodefaultlibs -lgcc -nostartfiles +cachegrind_SOURCES =3D cg_main.c cg-@VG_ARCH@.c +cachegrind_DEPENDENCIES =3D $(COREGRIND_LIBS) +cachegrind_LDADD =3D $(TOOL_LINKADD) +cachegrind_LDFLAGS =3D $(TOOL_LINKFLAGS) Modified: branches/ASPACEM/coregrind/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/ASPACEM/coregrind/Makefile.am 2005-08-29 01:15:13 UTC (rev 4= 556) +++ branches/ASPACEM/coregrind/Makefile.am 2005-08-29 01:22:54 UTC (rev 4= 557) @@ -23,15 +23,7 @@ =20 default.supp: $(SUPP_FILES) =20 -## XXXXXXXXXXXXX JRS 8 Aug 05: the next three lines constitute an -## appalling hack. Although we purportedly create a .a file, in fact -## it is really a .o (relocatable ELF object) file. The root reason -## is that some of the inputs to libcoregrind.a are themselves .a files, -## and I don't know how to get /usr/bin/ar to accept .a files as inputs. -noinst_LIBRARIES =3D libcoregrind.a -libcoregrind_a_AR =3D $(LD) --whole-archive -r -o -RANLIB =3D echo "Not really ranlib-ing" -## end of hack +noinst_LIBRARIES =3D libcoregrind_singles.a =20 bin_PROGRAMS =3D \ valgrind @@ -98,7 +90,7 @@ m_commandline.c \ m_debuglog.c =20 -libcoregrind_a_SOURCES =3D \ +libcoregrind_singles_a_SOURCES =3D \ m_commandline.c \ m_cpuid.S \ m_debugger.c \ @@ -133,39 +125,6 @@ m_transtab.c \ m_ume.c =20 -## Nb: libscheduler.a must precede libdispatch.a in this list. -libcoregrind_a_extra=3D \ - m_debuginfo/libdebuginfo.a \ - m_demangle/libdemangle.a \ - m_scheduler/libscheduler.a \ - m_dispatch/libdispatch.a \ - m_aspacemgr/libaspacemgr.a \ - m_sigframe/libsigframe.a \ - m_syswrap/libsyswrap.a \ - @VEX_DIR@/libvex.a - -## These ones must be linked in with the --whole-archive flag, because -## they wouldn't get pulled into libcoregrind otherwise (because they -## contain symbols only referred to by tool shared objects). -libcoregrind_a_extra2 =3D \ - m_replacemalloc/libreplacemalloc_core.a - -## Nb: older versions of automake don't seem to like having +=3D within = an -## if-then-else, so we have to use these variables for the common parts. -libcoregrind_a_DEPS_common =3D \ - $(libcoregrind_a_extra) \ - $(libcoregrind_a_extra2) - -st2_LDFLAGS_common =3D \ - -Wl,--export-dynamic -g \ - -Wl,--whole-archive $(libcoregrind_a_extra2) -Wl,--no-whole-archive - -libcoregrind_a_DEPENDENCIES =3D $(libcoregrind_a_DEPS_common) -libcoregrind_a_LIBFLAGS =3D \ - $(st2_LDFLAGS_common) - -libcoregrind_a_LIBADD=3D $(libcoregrind_a_extra) $(libcoregrind_a_extra2= ) - vg_preload_core_so_SOURCES =3D vg_preloaded.c vg_preload_core_so_CFLAGS =3D $(AM_CFLAGS) -fpic vg_preload_core_so_LDADD =3D -ldl Modified: branches/ASPACEM/lackey/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/ASPACEM/lackey/Makefile.am 2005-08-29 01:15:13 UTC (rev 4556= ) +++ branches/ASPACEM/lackey/Makefile.am 2005-08-29 01:22:54 UTC (rev 4557= ) @@ -2,12 +2,7 @@ =20 val_PROGRAMS =3D lackey =20 -lackey_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a -lackey_SOURCES =3D \ - lk_main.c -lackey_LDFLAGS =3D \ - -static \ - $(top_srcdir)/coregrind/libcoregrind.a \ - -Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \ - -Wl,-T,$(top_srcdir)/valt_load_address.lds \ - -nodefaultlibs -lgcc -nostartfiles +lackey_SOURCES =3D lk_main.c +lackey_DEPENDENCIES =3D $(COREGRIND_LIBS) +lackey_LDADD =3D $(TOOL_LINKADD) +lackey_LDFLAGS =3D $(TOOL_LINKFLAGS) Modified: branches/ASPACEM/massif/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/ASPACEM/massif/Makefile.am 2005-08-29 01:15:13 UTC (rev 4556= ) +++ branches/ASPACEM/massif/Makefile.am 2005-08-29 01:22:54 UTC (rev 4557= ) @@ -4,20 +4,15 @@ =20 val_PROGRAMS =3D massif vgpreload_massif.so =20 -vgpreload_massif_so_SOURCES =3D=20 -vgpreload_massif_so_DEPENDENCIES =3D \ - $(LIBREPLACEMALLOC) -vgpreload_massif_so_LDFLAGS =3D -shared -Wl,-z,interpose,-z,initfirst \ +vgpreload_massif_so_SOURCES =3D=20 +vgpreload_massif_so_DEPENDENCIES =3D $(LIBREPLACEMALLOC) +vgpreload_massif_so_LDFLAGS =3D \ + -shared -Wl,-z,interpose,-z,initfirst \ -Wl,--whole-archive \ $(LIBREPLACEMALLOC) \ -Wl,--no-whole-archive =20 -massif_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a -massif_SOURCES =3D \ - ms_main.c -massif_LDFLAGS =3D \ - -static \ - $(top_srcdir)/coregrind/libcoregrind.a \ - -Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \ - -Wl,-T,$(top_srcdir)/valt_load_address.lds \ - -nodefaultlibs -lgcc -nostartfiles +massif_SOURCES =3D ms_main.c +massif_DEPENDENCIES =3D $(COREGRIND_LIBS) +massif_LDADD =3D $(TOOL_LINKADD) +massif_LDFLAGS =3D $(TOOL_LINKFLAGS) Modified: branches/ASPACEM/memcheck/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/ASPACEM/memcheck/Makefile.am 2005-08-29 01:15:13 UTC (rev 45= 56) +++ branches/ASPACEM/memcheck/Makefile.am 2005-08-29 01:22:54 UTC (rev 45= 57) @@ -5,28 +5,23 @@ =20 val_PROGRAMS =3D memcheck vgpreload_memcheck.so =20 -vgpreload_memcheck_so_SOURCES =3D \ - mac_replace_strmem.c -vgpreload_memcheck_so_DEPENDENCIES =3D \ - $(LIBREPLACEMALLOC) -vgpreload_memcheck_so_LDFLAGS =3D -shared -Wl,-z,interpose,-z,initfirst = \ +vgpreload_memcheck_so_SOURCES =3D mac_replace_strmem.c +vgpreload_memcheck_so_DEPENDENCIES =3D $(LIBREPLACEMALLOC) +vgpreload_memcheck_so_LDFLAGS =3D \ + -shared -Wl,-z,interpose,-z,initfirst \ -Wl,--whole-archive \ $(LIBREPLACEMALLOC) \ -Wl,--no-whole-archive =20 -memcheck_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a memcheck_SOURCES =3D \ mac_leakcheck.c \ mac_malloc_wrappers.c \ mc_main.c \ mac_shared.c \ mc_translate.c -memcheck_LDFLAGS =3D \ - -static \ - $(top_srcdir)/coregrind/libcoregrind.a \ - -Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \ - -Wl,-T,$(top_srcdir)/valt_load_address.lds \ - -nodefaultlibs -lgcc -nostartfiles +memcheck_DEPENDENCIES =3D $(COREGRIND_LIBS) +memcheck_LDADD =3D $(TOOL_LINKADD) +memcheck_LDFLAGS =3D $(TOOL_LINKFLAGS) =20 mcincludedir =3D $(includedir)/valgrind =20 Modified: branches/ASPACEM/none/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/ASPACEM/none/Makefile.am 2005-08-29 01:15:13 UTC (rev 4556) +++ branches/ASPACEM/none/Makefile.am 2005-08-29 01:22:54 UTC (rev 4557) @@ -2,12 +2,7 @@ =20 val_PROGRAMS =3D none =20 -none_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a -none_SOURCES =3D \ - nl_main.c -none_LDFLAGS =3D \ - -static \ - $(top_srcdir)/coregrind/libcoregrind.a \ - -Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \ - -Wl,-T,$(top_srcdir)/valt_load_address.lds \ - -nodefaultlibs -lgcc -nostartfiles +none_SOURCES =3D nl_main.c +none_DEPENDENCIES =3D $(COREGRIND_LIBS) +none_LDADD =3D $(TOOL_LINKADD) +none_LDFLAGS =3D $(TOOL_LINKFLAGS) |
|
From: <sv...@va...> - 2005-08-29 01:15:16
|
Author: njn
Date: 2005-08-29 02:15:13 +0100 (Mon, 29 Aug 2005)
New Revision: 4556
Log:
Mashed around and simplified main() a bit now that we don't need to
load the tool.
Modified:
branches/ASPACEM/coregrind/m_main.c
branches/ASPACEM/include/pub_tool_tooliface.h
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-08-28 19:34:39 UTC (rev 4555=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-08-29 01:15:13 UTC (rev 4556=
)
@@ -109,7 +109,7 @@
=20
// HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK A
// temporary bootstrapping allocator, for use until such time as we
-// can get rid of the circularites in allocator dependencies at
+// can get rid of the circularities in allocator dependencies at
// startup. There is also a copy of this in m_ume.c.
#define N_HACK_BYTES 10000
static Int hack_bytes_used =3D 0;
@@ -353,38 +353,50 @@
If this needs to handle any more variables it should be hacked
into something table driven.
*/
-static HChar **fix_environment(HChar **origenv, const HChar *preload)
+static HChar **fix_environment(HChar **origenv, const HChar *toolname)
{
- static const HChar preload_core_so[] =3D "vg_preload_core.so";
- static const HChar ld_preload[] =3D "LD_PRELOAD=3D";
- static const HChar valgrind_clo[] =3D VALGRINDCLO "=3D";
- static const int ld_preload_len =3D sizeof(ld_preload)-1;
- static const int valgrind_clo_len =3D sizeof(valgrind_clo)-1;
- int ld_preload_done =3D 0;
- HChar *preload_core_path;
- int preload_core_path_len;
- int vgliblen =3D VG_(strlen)(VG_(libdir));
- HChar **cpp;
- HChar **ret;
- int envc;
- const int preloadlen =3D (preload =3D=3D NULL) ? 0 : VG_(strlen)(prel=
oad);
+ static const HChar preload_core_so[] =3D "vg_preload_core.so";
+ static const HChar ld_preload[] =3D "LD_PRELOAD=3D";
+ static const HChar valgrind_clo[] =3D VALGRINDCLO "=3D";
+ static const Int ld_preload_len =3D sizeof(ld_preload)-1;
+ static const Int valgrind_clo_len =3D sizeof(valgrind_clo)-1;
+ Bool ld_preload_done =3D False;
+ Int vgliblen =3D VG_(strlen)(VG_(libdir));
+ HChar** cpp;
+ HChar** ret;
+ HChar* preload_tool_path;;
+ Int envc;
=20
- /* Find the vg_preload_core.so; also make room for the tool preload
- library */
- preload_core_path_len =3D sizeof(preload_core_so) + vgliblen + preloa=
dlen + 16;
+ /* Alloc space for the vgpreload_core.so path and vgpreload_<tool>.so
+ paths. We might not need the space for vgpreload_<tool>.so, but i=
t
+ doesn't hurt to over-allocate briefly. The 16s are just cautious
+ slop. */
+ Int preload_core_path_len =3D vgliblen + sizeof(preload_core_so) + 16=
;
+ Int preload_tool_path_len =3D vgliblen + VG_(strlen)(toolname) + 16=
;
+ Int preload_string_len =3D preload_core_path_len + preload_tool_pa=
th_len;
/* FIXME */
- preload_core_path =3D /*VG_(malloc)*/ hack_malloc(preload_core_path_l=
en);
- vg_assert(preload_core_path);
-
- if (preload)
- VG_(snprintf)(preload_core_path, preload_core_path_len, "%s/%s:%s"=
,=20
- VG_(libdir), preload_core_so, preload);
- else
- VG_(snprintf)(preload_core_path, preload_core_path_len, "%s/%s",=20
- VG_(libdir), preload_core_so);
+ HChar* preload_string =3D /*VG_(malloc)*/ hack_malloc(preload_str=
ing_len);
+ vg_assert(preload_string);
=20
+ /* Determine if there's a vgpreload_<tool>.so file, and setup
+ preload_string. */
+ preload_tool_path =3D /*VG_(malloc)*/ hack_malloc(preload_tool_path_l=
en);
+ vg_assert(preload_tool_path);
+ VG_(snprintf)(preload_tool_path, preload_tool_path_len,
+ "%s/vgpreload_%s.so", VG_(libdir), toolname);
+ if (VG_(access)(preload_tool_path, True/*r*/, False/*w*/, False/*x*/)=
=3D=3D 0) {
+ VG_(snprintf)(preload_string, preload_string_len, "%s/%s:%s",=20
+ VG_(libdir), preload_core_so, preload_tool_path);
+ } else {
+ VG_(snprintf)(preload_string, preload_string_len, "%s/%s",=20
+ VG_(libdir), preload_core_so);
+ }
+ //FIXME VG_(free)(preload_tool);
+
+ VG_(debugLog)(1, "main", "preload_string =3D %s\n", preload_string);
+
/* Count the original size of the env */
- envc =3D 0; /* trailing NULL */
+ envc =3D 0; /* trailing NULL */
for (cpp =3D origenv; cpp && *cpp; cpp++)
envc++;
=20
@@ -402,39 +414,39 @@
/* Walk over the new environment, mashing as we go */
for (cpp =3D ret; cpp && *cpp; cpp++) {
if (VG_(memcmp)(*cpp, ld_preload, ld_preload_len) =3D=3D 0) {
- int len =3D VG_(strlen)(*cpp) + preload_core_path_len;
- HChar *cp =3D /*FIXME VG_(malloc)*/ hack_malloc(len);
+ Int len =3D VG_(strlen)(*cpp) + preload_string_len;
+ HChar *cp =3D /*FIXME VG_(malloc)*/ hack_malloc(len);
vg_assert(cp);
=20
- VG_(snprintf)(cp, len, "%s%s:%s",
- ld_preload, preload_core_path, (*cpp)+ld_preload_=
len);
+ VG_(snprintf)(cp, len, "%s%s:%s",
+ ld_preload, preload_string, (*cpp)+ld_preload_len=
);
=20
- *cpp =3D cp;
- =20
- ld_preload_done =3D 1;
+ *cpp =3D cp;
+
+ ld_preload_done =3D True;
} else if (VG_(memcmp)(*cpp, valgrind_clo, valgrind_clo_len) =3D=3D=
0) {
- *cpp =3D "";
+ *cpp =3D "";
}
}
=20
/* Add the missing bits */
if (!ld_preload_done) {
- int len =3D ld_preload_len + preload_core_path_len;
+ Int len =3D ld_preload_len + preload_string_len;
HChar *cp =3D /*FIXME VG_(malloc)*/ hack_malloc (len);
vg_assert(cp);
- =20
- VG_(snprintf)(cp, len, "%s%s", ld_preload, preload_core_path);
- =20
+
+ VG_(snprintf)(cp, len, "%s%s", ld_preload, preload_string);
+
ret[envc++] =3D cp;
}
=20
- //FIXME VG_(free)(preload_core_path);
+ //FIXME VG_(free)(preload_string);
ret[envc] =3D NULL;
=20
return ret;
}
=20
-extern char **environ; /* our environment */
+extern char **environ; /* our environment */
=20
/* Add a string onto the string table, and return its address */
static char *copy_str(char **tab, const char *str)
@@ -767,39 +779,6 @@
=20
=20
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-/*=3D=3D=3D Loading tools =
=3D=3D=3D*/
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-
-/* Return a pointer to the tool_info struct. Also looks to see if
- there's a matching vgpreload_*.so file, and returns its name in
- *preloadpath. */
-
-/* HACK required because we can't use VG_(strdup) yet -- dynamic
- memory allocation is not running. */
-static HChar load_tool__preloadpath[VKI_PATH_MAX];
-
-static void load_tool( const char *toolname,
- ToolInfo** toolinfo_out, char **preloadpath_out )
-{
- extern ToolInfo VG_(tool_info);
- *toolinfo_out =3D &VG_(tool_info);
-
- Int len =3D VG_(strlen)(VG_(libdir)) + VG_(strlen)(toolname) + 16;
- HChar buf[len];
-
- VG_(snprintf)(buf, len, "%s/vgpreload_%s.so", VG_(libdir), toolname);
- if (VG_(access)(buf, True/*r*/, False/*w*/, False/*x*/) =3D=3D 0=20
- && len < VKI_PATH_MAX-1) {
- VG_(strncpy)( load_tool__preloadpath, buf, VKI_PATH_MAX-1 );
- load_tool__preloadpath[VKI_PATH_MAX-1] =3D 0;
- *preloadpath_out =3D load_tool__preloadpath;
- } else {
- *preloadpath_out =3D NULL;
- }
-}
-
-
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
/*=3D=3D=3D Command line errors =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
=20
@@ -1012,7 +991,7 @@
}
=20
static void pre_process_cmd_line_options
- ( Int* need_help, const char** tool, const char** exec )
+ ( Int* need_help, HChar** tool, HChar** exec )
{
UInt i;
=20
@@ -2052,11 +2031,9 @@
HChar** cl_argv;
HChar* tool =3D "memcheck"; // default to Memcheck
HChar* exec =3D NULL;
- HChar* preload =3D NULL; /* tool-specific LD_PRELOAD .so */
HChar** env;
Int need_help =3D 0; // 0 =3D no, 1 =3D --help, 2 =3D --help=
-debug
struct exeinfo info;
- ToolInfo* toolinfo =3D NULL;
Addr client_eip;
Addr sp_at_startup; /* client's SP at the point we
gained control. */
@@ -2133,7 +2110,7 @@
// Look for alternative libdir =20
// p: none
//--------------------------------------------------------------
- if (1) {
+ {
HChar *cp =3D VG_(getenv)(VALGRINDLIB);
if (cp !=3D NULL)
VG_(libdir) =3D cp;
@@ -2165,29 +2142,16 @@
}
=20
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
- // Nb: once a tool is specified, the tool.so must be loaded even if=20
- // they specified --help or didn't specify a client program.
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
-
- //--------------------------------------------------------------
- // With client padded out, map in tool
- // p: set-libdir [for VG_(libdir)]
- // p: pre_process_cmd_line_options() [for 'tool']
- //--------------------------------------------------------------
- VG_(debugLog)(1, "main", "Loading tool '%s'\n", tool);
- load_tool(tool, &toolinfo, &preload);
-
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
// Can use VG_(malloc)() and VG_(arena_malloc)() only after load_tool=
()
// -- redzone size is now set. This is checked by vg_malloc2.c.
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
//--------------------------------------------------------------
// Finalise address space layout
- // p: load_tool() [for 'toolinfo']
+ // p: load_tool() [probably?]
//--------------------------------------------------------------
VG_(debugLog)(1, "main", "Laying out remaining space\n");
- layout_remaining_space( (Addr) & argc, toolinfo->shadow_ratio );
+ layout_remaining_space( (Addr) & argc, VG_(tool_info).shadow_ratio );
=20
//--------------------------------------------------------------
// Load client executable, finding in $PATH if necessary
@@ -2207,11 +2171,11 @@
=20
//--------------------------------------------------------------
// Set up client's environment
- // p: set-libdir [for VG_(libdir)]
- // p: load_tool() [for 'preload']
+ // p: set-libdir [for VG_(libdir)]
+ // p: pre_process_cmd_line_options [for tool]
//--------------------------------------------------------------
VG_(debugLog)(1, "main", "Setup client env\n");
- env =3D fix_environment(envp, preload);
+ env =3D fix_environment(envp, tool);
=20
//--------------------------------------------------------------
// Setup client stack, eip, and VG_(client_arg[cv])
@@ -2259,7 +2223,6 @@
//--------------------------------------------------------------
// Init tool: pre_clo_init, process cmd line, post_clo_init
// p: setup_client_stack() [for 'VG_(client_arg[cv]']
- // p: load_tool() [for 'toolinfo']
// p: setup_file_descriptors() [for 'VG_(fd_xxx_limit)']
// p: parse_procselfmaps [so VG segments are setup so tool c=
an
// call VG_(malloc)]
@@ -2268,7 +2231,7 @@
Char* s;
Bool ok;
VG_(debugLog)(1, "main", "Initialise the tool\n");
- (*toolinfo->tl_pre_clo_init)();
+ (VG_(tool_info).tl_pre_clo_init)();
ok =3D VG_(sanity_check_needs)( VG_(shadow_base) !=3D VG_(shadow_e=
nd), &s );
if (!ok) {
VG_(tool_panic)(s);
Modified: branches/ASPACEM/include/pub_tool_tooliface.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/include/pub_tool_tooliface.h 2005-08-28 19:34:39 UTC=
(rev 4555)
+++ branches/ASPACEM/include/pub_tool_tooliface.h 2005-08-29 01:15:13 UTC=
(rev 4556)
@@ -64,6 +64,8 @@
float shadow_ratio;
} ToolInfo;
=20
+extern const ToolInfo VG_(tool_info);
+
/* Every tool must include this macro somewhere, exactly once. */
#define VG_DETERMINE_INTERFACE_VERSION(pre_clo_init, shadow) \
const ToolInfo VG_(tool_info) =3D { \
|
|
From: <sv...@va...> - 2005-08-28 19:34:45
|
Author: njn
Date: 2005-08-28 20:34:39 +0100 (Sun, 28 Aug 2005)
New Revision: 4555
Log:
Now that --tool=3D is working via the wrapper again, revert to the previo=
us
method of finding the toolname. This is required for the loading of
vgpreload_<tool>.so. Memcheck's malloc replacements now work again,
and so the regtests are almost working fully again.
Modified:
branches/ASPACEM/coregrind/m_main.c
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-08-28 19:08:09 UTC (rev 4554=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-08-28 19:34:39 UTC (rev 4555=
)
@@ -1032,9 +1032,9 @@
} else if (VG_CLO_STREQ(vg_argv[i], "--help-debug")) {
*need_help =3D 2;
=20
+ // The tool has already been determined, but we need to know it he=
re.
} else if (VG_CLO_STREQN(7, vg_argv[i], "--tool=3D")) {
- /* *tool =3D &vg_argv[i][7]; */
- /* ignore this, since by now it is way too late to change */
+ *tool =3D &vg_argv[i][7];
=20
} else if (VG_CLO_STREQN(7, vg_argv[i], "--exec=3D")) {
*exec =3D &vg_argv[i][7];
@@ -2050,7 +2050,7 @@
Int main(Int argc, HChar **argv, HChar **envp)
{
HChar** cl_argv;
- HChar* tool =3D NULL; // will acquire tool name later
+ HChar* tool =3D "memcheck"; // default to Memcheck
HChar* exec =3D NULL;
HChar* preload =3D NULL; /* tool-specific LD_PRELOAD .so */
HChar** env;
@@ -2170,33 +2170,11 @@
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
//--------------------------------------------------------------
- // Figure out the tool name by looking at the executable name
- // eg /path/to/valgrind_memcheck --> memcheck
- // p: none, except the ability to bomb out if nothing
- // sensible can be determined
- //--------------------------------------------------------------
- VG_(debugLog)(1, "main", "Deducing tool name from argv[0]\n");
- {=20
- HChar *p0, *p1;
- tool =3D "CANNOT_DETERMINE_TOOL_NAME";
- /* scan to the end the the exe name */
- p0 =3D argv[0];
- for (p1 =3D p0; *p1; p1++)
- ;
- /* scan bwds to find '_' */
- for (; p1 > p0 && *p1 !=3D '_'; p1--)
- ;
- if (p1 > p0 && *p1 =3D=3D '_')
- tool =3D p1 + 1;
- }
- VG_(debugLog)(1, "main", "Deduced tool name =3D '%s'\n", tool);
-
- //--------------------------------------------------------------
// With client padded out, map in tool
// p: set-libdir [for VG_(libdir)]
// p: pre_process_cmd_line_options() [for 'tool']
//--------------------------------------------------------------
- VG_(debugLog)(1, "main", "Loading tool\n");
+ VG_(debugLog)(1, "main", "Loading tool '%s'\n", tool);
load_tool(tool, &toolinfo, &preload);
=20
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
|
|
From: <sv...@va...> - 2005-08-28 19:08:11
|
Author: njn Date: 2005-08-28 20:08:09 +0100 (Sun, 28 Aug 2005) New Revision: 4554 Log: Disable vgtest_ume so the regtests build. This shows that Memcheck is not being built properly -- the malloc replacements aren't getting hooked in correctly. Modified: branches/ASPACEM/memcheck/tests/Makefile.am Modified: branches/ASPACEM/memcheck/tests/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/ASPACEM/memcheck/tests/Makefile.am 2005-08-28 18:54:17 UTC (= rev 4553) +++ branches/ASPACEM/memcheck/tests/Makefile.am 2005-08-28 19:08:09 UTC (= rev 4554) @@ -89,6 +89,7 @@ zeropage.stderr.exp zeropage.stderr.exp2 zeropage.stdout.exp \ zeropage.vgtest =20 +# vgtest_ume is not working check_PROGRAMS =3D \ addressable \ badaddrvalue badfree badjump badjump2 \ @@ -111,7 +112,7 @@ stack_changes strchr str_tester supp1 supp2 suppfree \ trivialleak weirdioctl \ mismatches new_override metadata \ - vgtest_ume xml1 \ + xml1 \ writev zeropage =20 =20 |
|
From: <sv...@va...> - 2005-08-28 18:54:24
|
Author: tom
Date: 2005-08-28 19:54:17 +0100 (Sun, 28 Aug 2005)
New Revision: 4553
Log:
Abstract out the command line handling from m_main.c and make the launche=
r
use it to process the command line when looking for the tool to use.
Added:
branches/ASPACEM/coregrind/m_commandline.c
branches/ASPACEM/coregrind/pub_core_commandline.h
Modified:
branches/ASPACEM/coregrind/Makefile.am
branches/ASPACEM/coregrind/m_launcher.c
branches/ASPACEM/coregrind/m_main.c
Modified: branches/ASPACEM/coregrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/Makefile.am 2005-08-28 16:29:25 UTC (rev 4=
552)
+++ branches/ASPACEM/coregrind/Makefile.am 2005-08-28 18:54:17 UTC (rev 4=
553)
@@ -43,6 +43,7 @@
coregrind.h \
pub_core_aspacemgr.h \
pub_core_basics.h \
+ pub_core_commandline.h \
pub_core_cpuid.h \
pub_core_debuginfo.h \
pub_core_debugger.h \
@@ -94,9 +95,11 @@
=20
valgrind_SOURCES =3D \
m_launcher.c \
+ m_commandline.c \
m_debuglog.c
=20
libcoregrind_a_SOURCES =3D \
+ m_commandline.c \
m_cpuid.S \
m_debugger.c \
m_debuglog.c \
Added: branches/ASPACEM/coregrind/m_commandline.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_commandline.c 2005-08-28 16:29:25 UTC (r=
ev 4552)
+++ branches/ASPACEM/coregrind/m_commandline.c 2005-08-28 18:54:17 UTC (r=
ev 4553)
@@ -0,0 +1,253 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Command line handling. m_commandline.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward=20
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "pub_core_basics.h"
+#include "pub_core_commandline.h"
+#include "pub_core_libcassert.h"
+#include "pub_core_libcbase.h"
+#include "pub_core_libcfile.h"
+#include "pub_core_libcprint.h"
+#include "pub_core_libcproc.h"
+#include "pub_core_mallocfree.h"
+#include "pub_core_options.h"
+
+// Note that we deliberately don't free the malloc'd memory. See commen=
t
+// at call site.
+static char* get_file_clo(char* dir)
+{
+ Int n;
+ SysRes fd;
+ struct vki_stat s1;
+ Char* f_clo =3D NULL;
+ Char filename[VKI_PATH_MAX];
+
+ VG_(snprintf)(filename, VKI_PATH_MAX, "%s/.valgrindrc",=20
+ ( NULL =3D=3D dir ? "" : dir ) );
+ fd =3D VG_(open)(filename, 0, VKI_S_IRUSR);
+ if ( !fd.isError ) {
+ if ( 0 =3D=3D VG_(fstat)(fd.val, &s1) ) {
+ f_clo =3D VG_(malloc)(s1.st_size+1);
+ vg_assert(f_clo);
+ n =3D VG_(read)(fd.val, f_clo, s1.st_size);
+ if (n =3D=3D -1) n =3D 0;
+ f_clo[n] =3D '\0';
+ }
+ VG_(close)(fd.val);
+ }
+ return f_clo;
+}
+
+static Int count_args(char* s)
+{
+ Int n =3D 0;
+ if (s) {
+ char* cp =3D s;
+ while (True) {
+ // We have alternating sequences: blanks, non-blanks, blanks...
+ // count the non-blanks sequences.
+ while ( VG_(isspace)(*cp) ) cp++;
+ if ( !*cp ) break;
+ n++;
+ while ( !VG_(isspace)(*cp) && *cp ) cp++;
+ }
+ }
+ return n;
+}
+
+// Add args out of environment, skipping multiple spaces and "--" args.
+// We split 's' into multiple strings by replacing whitespace with nuls,
+// eg. "--aa --bb --cc" --> "--aa\0--bb\0--cc". And for each new string
+// carved out of 's', we put a pointer to it in 'to'.
+static char** copy_args( char* s, char** to )
+{
+ if (s) {
+ char* cp =3D s;
+ while (True) {
+ // We have alternating sequences: blanks, non-blanks, blanks...
+ // copy the non-blanks sequences, and add terminating '\0'
+ while ( VG_(isspace)(*cp) ) cp++;
+ if ( !*cp ) break;
+ *to++ =3D cp;
+ while ( !VG_(isspace)(*cp) && *cp ) cp++;
+ if ( *cp ) *cp++ =3D '\0'; // terminate if not the l=
ast
+ if (VG_STREQ(to[-1], "--")) to--; // undo any '--' arg
+ }
+ }
+ return to;
+}
+
+// Augment command line with arguments from environment and .valgrindrc
+// files.
+static void augment_command_line(Int* vg_argc_inout, char*** vg_argv_ino=
ut)
+{
+ int vg_argc0 =3D *vg_argc_inout;
+ char** vg_argv0 =3D *vg_argv_inout;
+
+ // get_file_clo() allocates the return value with malloc(). We do no=
t
+ // free f1_clo and f2_clo as they get put into vg_argv[] which must p=
ersist.
+ char* env_clo =3D VG_(getenv)(VALGRINDOPTS);
+ char* f1_clo =3D get_file_clo( VG_(getenv)("HOME") );
+ char* f2_clo =3D get_file_clo(".");
+
+ /* copy any extra args from file or environment, if present */
+ if ( (env_clo && *env_clo) || (f1_clo && *f1_clo) || (f2_clo && *f2_c=
lo) ) {
+ /* ' ' separated extra options */
+ char **from;
+ char **to;
+ int orig_arg_count, env_arg_count, f1_arg_count, f2_arg_count;
+
+ for ( orig_arg_count =3D 0; vg_argv0[orig_arg_count]; orig_arg_cou=
nt++ );
+
+ env_arg_count =3D count_args(env_clo);
+ f1_arg_count =3D count_args(f1_clo);
+ f2_arg_count =3D count_args(f2_clo);
+
+ if (0)
+ VG_(printf)("extra-argc=3D%d %d %d\n",
+ env_arg_count, f1_arg_count, f2_arg_count);
+
+ /* +2: +1 for null-termination, +1 for added '--' */
+ from =3D vg_argv0;
+ vg_argv0 =3D VG_(malloc)( (orig_arg_count + env_arg_count + f1_arg=
_count=20
+ + f2_arg_count + 2) * sizeof(char **));
+ vg_assert(vg_argv0);
+ to =3D vg_argv0;
+
+ /* copy argv[0] */
+ *to++ =3D *from++;
+
+ /* Copy extra args from env var and file, in the order: ~/.valgrin=
drc,
+ * $VALGRIND_OPTS, ./.valgrindrc -- more local options are put lat=
er
+ * to override less local ones. */
+ to =3D copy_args(f1_clo, to);
+ to =3D copy_args(env_clo, to);
+ to =3D copy_args(f2_clo, to);
+ =20
+ /* copy original arguments, stopping at command or -- */
+ while (*from) {
+ if (**from !=3D '-')
+ break;
+ if (VG_STREQ(*from, "--")) {
+ from++; /* skip -- */
+ break;
+ }
+ *to++ =3D *from++;
+ }
+
+ /* add -- */
+ *to++ =3D "--";
+
+ vg_argc0 =3D to - vg_argv0;
+
+ /* copy rest of original command line, then NULL */
+ while (*from) *to++ =3D *from++;
+ *to =3D NULL;
+ }
+
+ *vg_argc_inout =3D vg_argc0;
+ *vg_argv_inout =3D vg_argv0;
+}
+
+void VG_(get_command_line)( int argc, char** argv,
+ Int* vg_argc_out, Char*** vg_argv_out,=20
+ char*** cl_argv_out )
+{
+ int vg_argc0;
+ char** vg_argv0;
+ char** cl_argv;
+ char* env_clo =3D VG_(getenv)(VALGRINDCLO);
+
+ if (env_clo !=3D NULL && *env_clo !=3D '\0') {
+ char *cp;
+ char **cpp;
+
+ /* OK, VALGRINDCLO is set, which means we must be a child of anoth=
er
+ Valgrind process using --trace-children, so we're getting all o=
ur
+ arguments from VALGRINDCLO, and the entire command line belongs=
to
+ the client (including argv[0]) */
+ vg_argc0 =3D 1; /* argv[0] */
+ for (cp =3D env_clo; *cp; cp++)
+ if (*cp =3D=3D VG_CLO_SEP)
+ vg_argc0++;
+
+ vg_argv0 =3D VG_(malloc)(sizeof(char **) * (vg_argc0 + 1));
+ vg_assert(vg_argv0);
+
+ cpp =3D vg_argv0;
+
+ *cpp++ =3D "valgrind"; /* nominal argv[0] */
+ *cpp++ =3D env_clo;
+
+ // Replace the VG_CLO_SEP args separator with '\0'
+ for (cp =3D env_clo; *cp; cp++) {
+ if (*cp =3D=3D VG_CLO_SEP) {
+ *cp++ =3D '\0'; /* chop it up in place */
+ *cpp++ =3D cp;
+ }
+ }
+ *cpp =3D NULL;
+ cl_argv =3D argv;
+
+ } else {
+ Bool noaugment =3D False;
+
+ /* Count the arguments on the command line. */
+ vg_argv0 =3D argv;
+
+ for (vg_argc0 =3D 1; vg_argc0 < argc; vg_argc0++) {
+ Char* arg =3D argv[vg_argc0];
+ if (arg[0] !=3D '-') /* exe name */
+ break;
+ if (VG_STREQ(arg, "--")) { /* dummy arg */
+ vg_argc0++;
+ break;
+ }
+ VG_BOOL_CLO(arg, "--command-line-only", noaugment)
+ }
+ cl_argv =3D &argv[vg_argc0];
+
+ /* Get extra args from VALGRIND_OPTS and .valgrindrc files.
+ Note we don't do this if getting args from VALGRINDCLO, as=20
+ those extra args will already be present in VALGRINDCLO.
+ (We also don't do it when --command-line-only=3Dyes.) */
+ if (!noaugment)
+ augment_command_line(&vg_argc0, &vg_argv0);
+ }
+
+ if (0) {
+ Int i;
+ for (i =3D 0; i < vg_argc0; i++)
+ VG_(printf)("vg_argv0[%d]=3D\"%s\"\n", i, vg_argv0[i]);
+ }
+
+ *vg_argc_out =3D vg_argc0;
+ *vg_argv_out =3D (Char**)vg_argv0;
+ *cl_argv_out =3D cl_argv;
+}
Modified: branches/ASPACEM/coregrind/m_launcher.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_launcher.c 2005-08-28 16:29:25 UTC (rev =
4552)
+++ branches/ASPACEM/coregrind/m_launcher.c 2005-08-28 18:54:17 UTC (rev =
4553)
@@ -28,6 +28,7 @@
The GNU General Public License is contained in the file COPYING.
*/
=20
+#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -35,17 +36,26 @@
#include <unistd.h>
=20
#include "pub_core_basics.h"
+#include "pub_core_commandline.h"
#include "pub_core_debuglog.h"
+#include "pub_core_libcassert.h"
+#include "pub_core_libcbase.h"
+#include "pub_core_libcfile.h"
+#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h" // For VALGRINDLIB
+#include "pub_core_mallocfree.h"
=20
/* Where we expect to find all our aux files */
static const char *valgrind_lib =3D VG_LIBDIR;
=20
int main(int argc, char** argv, char** envp)
{
+ int i, loglevel;
+ Int vg_argc;
+ Char **vg_argv;
+ char **cl_argv;
const char *toolname =3D NULL;
const char *cp;
- int i, loglevel;
char *toolfile;
=20
/* Start the debugging-log system ASAP. First find out how many=20
@@ -58,14 +68,22 @@
break;
if (0 =3D=3D strcmp(argv[i], "-d"))=20
loglevel++;
- if (0 =3D=3D strncmp(argv[i], "--tool=3D", 7))=20
- toolname =3D argv[i] + 7;
}
=20
/* ... and start the debug logger. Now we can safely emit logging
messages all through startup. */
VG_(debugLog_startup)(loglevel, "Stage 1");
=20
+ /* Get the full command line */
+ VG_(get_command_line)(argc, argv, &vg_argc, &vg_argv, &cl_argv);
+
+ /* Look for a --tool switch */
+ for (i =3D 1; i < vg_argc; i++) {
+ if (0 =3D=3D strncmp(vg_argv[i], "--tool=3D", 7))=20
+ toolname =3D vg_argv[i] + 7;
+ }
+
+ /* Make sure we know which tool we're using */
if (toolname) {
VG_(debugLog)(1, "stage1", "tool %s requested\n", toolname);
} else {
@@ -89,3 +107,102 @@
=20
exit(1);
}
+
+void* VG_(malloc) ( SizeT nbytes )
+{
+ return malloc(nbytes);
+}
+
+Bool VG_(isspace) ( Char c )
+{
+ return isspace(c);
+}
+
+Int VG_(strcmp) ( const Char* s1, const Char* s2 )
+{
+ return strcmp(s1, s2);
+}
+
+Char *VG_(getenv)(Char *varname)
+{
+ return getenv(varname);
+}
+
+SysRes VG_(open) ( const Char* pathname, Int flags, Int mode )
+{
+ SysRes res;
+ Int fd;
+ if ((fd =3D open(pathname, flags, mode)) < 0) {
+ res.isError =3D True;
+ res.val =3D errno;
+ } else {
+ res.isError =3D False;
+ res.val =3D fd;
+ }
+ return res;
+}
+
+void VG_(close) ( Int fd )
+{
+ close(fd);
+ return;
+}
+
+Int VG_(read) ( Int fd, void* buf, Int count)
+{
+ return read(fd, buf, count);
+}
+
+Int VG_(fstat) ( Int fd, struct vki_stat* buf )
+{
+ return fstat(fd, buf);
+}
+
+UInt VG_(snprintf) ( Char* buf, Int size, const HChar *format, ... )
+{
+ va_list vargs;
+ UInt n;
+
+ va_start(vargs, format);
+ n =3D vsnprintf(buf, size, format, vargs);
+ va_end(vargs);
+
+ return n;
+}
+
+void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char* file,=
=20
+ Int line, const Char* fn, const HChar* format, .=
.. )
+{
+ va_list vargs;
+ Char buf[256];
+
+ va_start(vargs, format);
+ vsprintf(buf, format, vargs);
+ va_end(vargs);
+
+ fprintf(stderr, "\nvalgrind: %s:%d (%s): Assertion '%s' failed.\n",
+ file, line, fn, expr );
+ if (!strcmp(buf, ""))
+ fprintf(stderr, "valgrind: %s\n", buf);
+
+ exit(1);
+}
+
+static Bool isterm ( Char c )
+{
+ return ( VG_(isspace)(c) || 0 =3D=3D c );
+}
+
+Int VG_(strcmp_ws) ( const Char* s1, const Char* s2 )
+{
+ while (True) {
+ if (isterm(*s1) && isterm(*s2)) return 0;
+ if (isterm(*s1)) return -1;
+ if (isterm(*s2)) return 1;
+
+ if (*(UChar*)s1 < *(UChar*)s2) return -1;
+ if (*(UChar*)s1 > *(UChar*)s2) return 1;
+
+ s1++; s2++;
+ }
+}
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-08-28 16:29:25 UTC (rev 4552=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-08-28 18:54:17 UTC (rev 4553=
)
@@ -34,6 +34,7 @@
#include "pub_core_threadstate.h"
#include "pub_core_debuginfo.h" // Needed for pub_core_aspacemgr :(
#include "pub_core_aspacemgr.h"
+#include "pub_core_commandline.h"
#include "pub_core_debuglog.h"
#include "pub_core_errormgr.h"
#include "pub_core_execontext.h"
@@ -299,227 +300,6 @@
}
=20
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-/*=3D=3D=3D Command line setup =
=3D=3D=3D*/
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
-
-// Note that we deliberately don't free the malloc'd memory. See commen=
t
-// at call site.
-static char* get_file_clo(char* dir)
-{
- Int n;
- SysRes fd;
- struct vki_stat s1;
- Char* f_clo =3D NULL;
- Char filename[VKI_PATH_MAX];
-
- VG_(snprintf)(filename, VKI_PATH_MAX, "%s/.valgrindrc",=20
- ( NULL =3D=3D dir ? "" : dir ) );
- fd =3D VG_(open)(filename, 0, VKI_S_IRUSR);
- if ( !fd.isError ) {
- if ( 0 =3D=3D VG_(fstat)(fd.val, &s1) ) {
- f_clo =3D VG_(malloc)(s1.st_size+1);
- vg_assert(f_clo);
- n =3D VG_(read)(fd.val, f_clo, s1.st_size);
- if (n =3D=3D -1) n =3D 0;
- f_clo[n] =3D '\0';
- }
- VG_(close)(fd.val);
- }
- return f_clo;
-}
-
-static Int count_args(char* s)
-{
- Int n =3D 0;
- if (s) {
- char* cp =3D s;
- while (True) {
- // We have alternating sequences: blanks, non-blanks, blanks...
- // count the non-blanks sequences.
- while ( VG_(isspace)(*cp) ) cp++;
- if ( !*cp ) break;
- n++;
- while ( !VG_(isspace)(*cp) && *cp ) cp++;
- }
- }
- return n;
-}
-
-// Add args out of environment, skipping multiple spaces and "--" args.
-// We split 's' into multiple strings by replacing whitespace with nuls,
-// eg. "--aa --bb --cc" --> "--aa\0--bb\0--cc". And for each new string
-// carved out of 's', we put a pointer to it in 'to'.
-static char** copy_args( char* s, char** to )
-{
- if (s) {
- char* cp =3D s;
- while (True) {
- // We have alternating sequences: blanks, non-blanks, blanks...
- // copy the non-blanks sequences, and add terminating '\0'
- while ( VG_(isspace)(*cp) ) cp++;
- if ( !*cp ) break;
- *to++ =3D cp;
- while ( !VG_(isspace)(*cp) && *cp ) cp++;
- if ( *cp ) *cp++ =3D '\0'; // terminate if not the l=
ast
- if (VG_STREQ(to[-1], "--")) to--; // undo any '--' arg
- }
- }
- return to;
-}
-
-// Augment command line with arguments from environment and .valgrindrc
-// files.
-static void augment_command_line(Int* vg_argc_inout, char*** vg_argv_ino=
ut)
-{
- int vg_argc0 =3D *vg_argc_inout;
- char** vg_argv0 =3D *vg_argv_inout;
-
- // get_file_clo() allocates the return value with malloc(). We do no=
t
- // free f1_clo and f2_clo as they get put into vg_argv[] which must p=
ersist.
- char* env_clo =3D VG_(getenv)(VALGRINDOPTS);
- char* f1_clo =3D get_file_clo( VG_(getenv)("HOME") );
- char* f2_clo =3D get_file_clo(".");
-
- /* copy any extra args from file or environment, if present */
- if ( (env_clo && *env_clo) || (f1_clo && *f1_clo) || (f2_clo && *f2_c=
lo) ) {
- /* ' ' separated extra options */
- char **from;
- char **to;
- int orig_arg_count, env_arg_count, f1_arg_count, f2_arg_count;
-
- for ( orig_arg_count =3D 0; vg_argv0[orig_arg_count]; orig_arg_cou=
nt++ );
-
- env_arg_count =3D count_args(env_clo);
- f1_arg_count =3D count_args(f1_clo);
- f2_arg_count =3D count_args(f2_clo);
-
- if (0)
- VG_(printf)("extra-argc=3D%d %d %d\n",
- env_arg_count, f1_arg_count, f2_arg_count);
-
- /* +2: +1 for null-termination, +1 for added '--' */
- from =3D vg_argv0;
- vg_argv0 =3D VG_(malloc)( (orig_arg_count + env_arg_count + f1_arg=
_count=20
- + f2_arg_count + 2) * sizeof(char **));
- vg_assert(vg_argv0);
- to =3D vg_argv0;
-
- /* copy argv[0] */
- *to++ =3D *from++;
-
- /* Copy extra args from env var and file, in the order: ~/.valgrin=
drc,
- * $VALGRIND_OPTS, ./.valgrindrc -- more local options are put lat=
er
- * to override less local ones. */
- to =3D copy_args(f1_clo, to);
- to =3D copy_args(env_clo, to);
- to =3D copy_args(f2_clo, to);
- =20
- /* copy original arguments, stopping at command or -- */
- while (*from) {
- if (**from !=3D '-')
- break;
- if (VG_STREQ(*from, "--")) {
- from++; /* skip -- */
- break;
- }
- *to++ =3D *from++;
- }
-
- /* add -- */
- *to++ =3D "--";
-
- vg_argc0 =3D to - vg_argv0;
-
- /* copy rest of original command line, then NULL */
- while (*from) *to++ =3D *from++;
- *to =3D NULL;
- }
-
- *vg_argc_inout =3D vg_argc0;
- *vg_argv_inout =3D vg_argv0;
-}
-
-#define VG_CLO_SEP '\01'
-
-static void get_command_line( int argc, char** argv,
- Int* vg_argc_out, Char*** vg_argv_out,=20
- char*** cl_argv_out )
-{
- int vg_argc0;
- char** vg_argv0;
- char** cl_argv;
- char* env_clo =3D VG_(getenv)(VALGRINDCLO);
-
- if (env_clo !=3D NULL && *env_clo !=3D '\0') {
- char *cp;
- char **cpp;
-
- /* OK, VALGRINDCLO is set, which means we must be a child of anoth=
er
- Valgrind process using --trace-children, so we're getting all o=
ur
- arguments from VALGRINDCLO, and the entire command line belongs=
to
- the client (including argv[0]) */
- vg_argc0 =3D 1; /* argv[0] */
- for (cp =3D env_clo; *cp; cp++)
- if (*cp =3D=3D VG_CLO_SEP)
- vg_argc0++;
-
- vg_argv0 =3D VG_(malloc)(sizeof(char **) * (vg_argc0 + 1));
- vg_assert(vg_argv0);
-
- cpp =3D vg_argv0;
-
- *cpp++ =3D "valgrind"; /* nominal argv[0] */
- *cpp++ =3D env_clo;
-
- // Replace the VG_CLO_SEP args separator with '\0'
- for (cp =3D env_clo; *cp; cp++) {
- if (*cp =3D=3D VG_CLO_SEP) {
- *cp++ =3D '\0'; /* chop it up in place */
- *cpp++ =3D cp;
- }
- }
- *cpp =3D NULL;
- cl_argv =3D argv;
-
- } else {
- Bool noaugment =3D False;
-
- /* Count the arguments on the command line. */
- vg_argv0 =3D argv;
-
- for (vg_argc0 =3D 1; vg_argc0 < argc; vg_argc0++) {
- Char* arg =3D argv[vg_argc0];
- if (arg[0] !=3D '-') /* exe name */
- break;
- if (VG_STREQ(arg, "--")) { /* dummy arg */
- vg_argc0++;
- break;
- }
- VG_BOOL_CLO(arg, "--command-line-only", noaugment)
- }
- cl_argv =3D &argv[vg_argc0];
-
- /* Get extra args from VALGRIND_OPTS and .valgrindrc files.
- Note we don't do this if getting args from VALGRINDCLO, as=20
- those extra args will already be present in VALGRINDCLO.
- (We also don't do it when --command-line-only=3Dyes.) */
- if (!noaugment)
- augment_command_line(&vg_argc0, &vg_argv0);
- }
-
- if (0) {
- Int i;
- for (i =3D 0; i < vg_argc0; i++)
- VG_(printf)("vg_argv0[%d]=3D\"%s\"\n", i, vg_argv0[i]);
- }
-
- *vg_argc_out =3D vg_argc0;
- *vg_argv_out =3D (Char**)vg_argv0;
- *cl_argv_out =3D cl_argv;
-}
-
-
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
/*=3D=3D=3D Environment and stack setup =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
=20
@@ -2365,7 +2145,7 @@
// p: none
//--------------------------------------------------------------
VG_(debugLog)(1, "main", "Preprocess command line opts\n");
- get_command_line(argc, argv, &vg_argc, &vg_argv, &cl_argv);
+ VG_(get_command_line)(argc, argv, &vg_argc, &vg_argv, &cl_argv);
pre_process_cmd_line_options(&need_help, &tool, &exec);
=20
/* If this process was created by exec done by another Valgrind
Added: branches/ASPACEM/coregrind/pub_core_commandline.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_commandline.h 2005-08-28 16:29:25=
UTC (rev 4552)
+++ branches/ASPACEM/coregrind/pub_core_commandline.h 2005-08-28 18:54:17=
UTC (rev 4553)
@@ -0,0 +1,44 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Command line handling. pub_core_commandline.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward=20
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_COMMANDLINE_H
+#define __PUB_CORE_COMMANDLINE_H
+
+#define VG_CLO_SEP '\01'
+
+extern void VG_(get_command_line)( int argc, char** argv,
+ Int* vg_argc_out, Char*** vg_argv_out=
,=20
+ char*** cl_argv_out=
);
+
+#endif // __PUB_CORE_COMMANDLINE_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2005-08-28 16:29:33
|
Author: njn
Date: 2005-08-28 17:29:25 +0100 (Sun, 28 Aug 2005)
New Revision: 4552
Log:
Reenable VALGRIND_LIBS so that in-place builds work.
Modified:
branches/ASPACEM/coregrind/m_main.c
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-08-28 11:01:13 UTC (rev 4551=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-08-28 16:29:25 UTC (rev 4552=
)
@@ -2353,7 +2353,7 @@
// Look for alternative libdir =20
// p: none
//--------------------------------------------------------------
- if (0) {
+ if (1) {
HChar *cp =3D VG_(getenv)(VALGRINDLIB);
if (cp !=3D NULL)
VG_(libdir) =3D cp;
|
|
From: Tom H. <to...@co...> - 2005-08-28 15:52:45
|
In message <Pin...@ch...>
Nicholas Nethercote <nj...@cs...> wrote:
> On Sun, 28 Aug 2005, Tom Hughes wrote:
>
> > What I'm thinking is to create x86-linux and amd64-linux subdirectories
> > under the normal valgrind library directory, move all the static tool
> > executables and the preload libraries there so we have two copies and
> > then get the launcher to choose the right ones.
>
> Is the normal approach to have lib/ and lib64/ directories? And maybe
> bin/ and bin64/ directories? If that's the standard approach we should
> follow it.
Well it is (although not universal - at least one linux distro has
not gone that way for amd64). This is actually a bit different though...
What we're specifying here is not the architecture that valgrind is
complied to run on (ie lib vs lib64) but the architecture of the binaries
a given tool is designed to run. There is (in principle) nothing to
prevent have a /usr/lib64/valgrind/solaris-sparc/memcheck tool on an
amd64 linux box if we ever got to the point of being able to do cross
platform/os emulation.
In other words it is more like the directories under /usr/lib/gcc
which correspond to the targets you can build code for if you have
cross compilers installed.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Nicholas N. <nj...@cs...> - 2005-08-28 15:45:59
|
On Sun, 28 Aug 2005, Tom Hughes wrote: > That is my plan, yes. It's a bit more complicated than that because > if it is a script you have to parse the #! line to get the interpreter > and then probe the ELF header of the interpreter. Yes. This trivial wrapper is quickly looking like the old stage1.c :) > What I'm thinking is to create x86-linux and amd64-linux subdirectories > under the normal valgrind library directory, move all the static tool > executables and the preload libraries there so we have two copies and > then get the launcher to choose the right ones. Is the normal approach to have lib/ and lib64/ directories? And maybe bin/ and bin64/ directories? If that's the standard approach we should follow it. N |
|
From: Nicholas N. <nj...@cs...> - 2005-08-28 15:43:52
|
On Sun, 28 Aug 2005, Tom Hughes wrote: > The problem is that the command line handling uses various functions > from valgrind's internal libc and in order to avoid linking that into > the launcher (which quickly got out of control, especially malloc) I had > to give the launcher versions of about a dozen VG_ libc routines which > are implemented using the real libc. > > The real pains were assert_fail and strcmp_ws which don't exist as > such in the normal C library. You could do it more concisely with pre-processor hackery. See memcheck/tests/oset_test.c for an example. It's a bit nasty, though. For assert_fail, I'd do a simpler version. For example, you don't have to distinguish between core vs tool errors. Also, I wouldn't worry about the call to report_and_quit(), ie. all the stack tracing stuff. (More or less) duplicating strcmp_ws seems fine to me. Nick |
|
From: Tom H. <to...@co...> - 2005-08-28 15:42:39
|
In message <Pin...@ch...>
Nicholas Nethercote <nj...@cs...> wrote:
> How will this relate to getting transparent handling of 32- and 64-bit
> programs working on AMD64? It seems like this launcher would be the right
> place to detect which stage2 (stage2_32 or stage2_64) is needed. That
> would require parsing the command line a bit more to find the file being
> executed, and then inspecting the ELF header. Is that the right way to do
> it?
That is my plan, yes. It's a bit more complicated than that because
if it is a script you have to parse the #! line to get the interpreter
and then probe the ELF header of the interpreter.
What I'm thinking is to create x86-linux and amd64-linux subdirectories
under the normal valgrind library directory, move all the static tool
executables and the preload libraries there so we have two copies and
then get the launcher to choose the right ones.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Nicholas N. <nj...@cs...> - 2005-08-28 15:36:43
|
On Sun, 28 Aug 2005, sv...@va... wrote: > Log: > Move the tool specific executables to the valgrind library directory > and implement a trivial launcher program that decides which tool to use > and exec's the relevant executable. Nice work, Tom. How will this relate to getting transparent handling of 32- and 64-bit programs working on AMD64? It seems like this launcher would be the right place to detect which stage2 (stage2_32 or stage2_64) is needed. That would require parsing the command line a bit more to find the file being executed, and then inspecting the ELF header. Is that the right way to do it? N |
|
From: Tom H. <to...@co...> - 2005-08-28 11:59:12
|
In message <200...@ja...>
sv...@va... wrote:
> Author: tom
> Date: 2005-08-28 12:01:13 +0100 (Sun, 28 Aug 2005)
> New Revision: 4551
>
> Log:
> Move the tool specific executables to the valgrind library directory
> and implement a trivial launcher program that decides which tool to use
> and exec's the relevant executable.
One problem with this at the moment is that it only looks for --tool in
the arguments to valgrind and not in VALGRIND_OPTS or .valgrindrc.
I have abstracted out the command line processing from m_main.c into a
new file which can then be linked into the launcher program so that it
can easily process all the options, and it seems to work.
The problem is that the command line handling uses various functions
from valgrind's internal libc and in order to avoid linking that into
the launcher (which quickly got out of control, especially malloc) I had
to give the launcher versions of about a dozen VG_ libc routines which
are implemented using the real libc.
The real pains were assert_fail and strcmp_ws which don't exist as
such in the normal C library.
Does all this sound like a reasonable approach? or does anybody have
a better suggestion how to handle this?
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: <sv...@va...> - 2005-08-28 11:01:16
|
Author: tom
Date: 2005-08-28 12:01:13 +0100 (Sun, 28 Aug 2005)
New Revision: 4551
Log:
Move the tool specific executables to the valgrind library directory
and implement a trivial launcher program that decides which tool to use
and exec's the relevant executable.
Added:
branches/ASPACEM/coregrind/m_launcher.c
Modified:
branches/ASPACEM/cachegrind/Makefile.am
branches/ASPACEM/coregrind/Makefile.am
branches/ASPACEM/lackey/Makefile.am
branches/ASPACEM/massif/Makefile.am
branches/ASPACEM/memcheck/Makefile.am
branches/ASPACEM/none/Makefile.am
Modified: branches/ASPACEM/cachegrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/cachegrind/Makefile.am 2005-08-28 10:17:00 UTC (rev =
4550)
+++ branches/ASPACEM/cachegrind/Makefile.am 2005-08-28 11:01:13 UTC (rev =
4551)
@@ -9,13 +9,13 @@
=20
noinst_HEADERS =3D cg_arch.h
=20
-bin_PROGRAMS =3D valgrind_cachegrind
+val_PROGRAMS =3D cachegrind
=20
-valgrind_cachegrind_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrin=
d.a
-valgrind_cachegrind_SOURCES =3D \
+cachegrind_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a
+cachegrind_SOURCES =3D \
cg_main.c \
cg-@VG_ARCH@.c
-valgrind_cachegrind_LDFLAGS =3D \
+cachegrind_LDFLAGS =3D \
-static \
$(top_srcdir)/coregrind/libcoregrind.a \
-Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \
Modified: branches/ASPACEM/coregrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/Makefile.am 2005-08-28 10:17:00 UTC (rev 4=
550)
+++ branches/ASPACEM/coregrind/Makefile.am 2005-08-28 11:01:13 UTC (rev 4=
551)
@@ -33,6 +33,9 @@
RANLIB =3D echo "Not really ranlib-ing"
## end of hack
=20
+bin_PROGRAMS =3D \
+ valgrind
+
val_PROGRAMS =3D \
vg_preload_core.so
=20
@@ -89,6 +92,10 @@
BUILT_SOURCES =3D=20
CLEANFILES =3D=20
=20
+valgrind_SOURCES =3D \
+ m_launcher.c \
+ m_debuglog.c
+
libcoregrind_a_SOURCES =3D \
m_cpuid.S \
m_debugger.c \
Added: branches/ASPACEM/coregrind/m_launcher.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_launcher.c 2005-08-28 10:17:00 UTC (rev =
4550)
+++ branches/ASPACEM/coregrind/m_launcher.c 2005-08-28 11:01:13 UTC (rev =
4551)
@@ -0,0 +1,91 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Launching valgrind m_launcher.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward=20
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "pub_core_basics.h"
+#include "pub_core_debuglog.h"
+#include "pub_core_libcproc.h" // For VALGRINDLIB
+
+/* Where we expect to find all our aux files */
+static const char *valgrind_lib =3D VG_LIBDIR;
+
+int main(int argc, char** argv, char** envp)
+{
+ const char *toolname =3D NULL;
+ const char *cp;
+ int i, loglevel;
+ char *toolfile;
+
+ /* Start the debugging-log system ASAP. First find out how many=20
+ "-d"s were specified. This is a pre-scan of the command line. */
+ loglevel =3D 0;
+ for (i =3D 1; i < argc; i++) {
+ if (argv[i][0] !=3D '-')
+ break;
+ if (0 =3D=3D strcmp(argv[i], "--"))=20
+ break;
+ if (0 =3D=3D strcmp(argv[i], "-d"))=20
+ loglevel++;
+ if (0 =3D=3D strncmp(argv[i], "--tool=3D", 7))=20
+ toolname =3D argv[i] + 7;
+ }
+
+ /* ... and start the debug logger. Now we can safely emit logging
+ messages all through startup. */
+ VG_(debugLog_startup)(loglevel, "Stage 1");
+
+ if (toolname) {
+ VG_(debugLog)(1, "stage1", "tool %s requested\n", toolname);
+ } else {
+ VG_(debugLog)(1, "stage1", "no tool requested, defaulting to memch=
eck\n");
+ toolname =3D "memcheck";
+ }
+
+ cp =3D getenv(VALGRINDLIB);
+
+ if (cp !=3D NULL)
+ valgrind_lib =3D cp;
+
+ toolfile =3D malloc(strlen(valgrind_lib) + strlen(toolname) + 2);
+ sprintf(toolfile, "%s/%s", valgrind_lib, toolname);
+
+ VG_(debugLog)(1, "stage1", "launching %s\n", toolfile);
+
+ execve(toolfile, argv, envp);
+
+ fprintf(stderr, "valgrind: failed to start %s: %s", toolname, strerro=
r(errno));
+
+ exit(1);
+}
Modified: branches/ASPACEM/lackey/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/lackey/Makefile.am 2005-08-28 10:17:00 UTC (rev 4550=
)
+++ branches/ASPACEM/lackey/Makefile.am 2005-08-28 11:01:13 UTC (rev 4551=
)
@@ -1,11 +1,11 @@
include $(top_srcdir)/Makefile.tool.am
=20
-bin_PROGRAMS =3D valgrind_lackey
+val_PROGRAMS =3D lackey
=20
-valgrind_lackey_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a
-valgrind_lackey_SOURCES =3D \
+lackey_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a
+lackey_SOURCES =3D \
lk_main.c
-valgrind_lackey_LDFLAGS =3D \
+lackey_LDFLAGS =3D \
-static \
$(top_srcdir)/coregrind/libcoregrind.a \
-Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \
Modified: branches/ASPACEM/massif/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/massif/Makefile.am 2005-08-28 10:17:00 UTC (rev 4550=
)
+++ branches/ASPACEM/massif/Makefile.am 2005-08-28 11:01:13 UTC (rev 4551=
)
@@ -2,8 +2,7 @@
=20
SUBDIRS +=3D hp2ps
=20
-val_PROGRAMS =3D vgpreload_massif.so
-bin_PROGRAMS =3D valgrind_massif
+val_PROGRAMS =3D massif vgpreload_massif.so
=20
vgpreload_massif_so_SOURCES =3D=20
vgpreload_massif_so_DEPENDENCIES =3D \
@@ -13,10 +12,10 @@
$(LIBREPLACEMALLOC) \
-Wl,--no-whole-archive
=20
-valgrind_massif_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a
-valgrind_massif_SOURCES =3D \
+massif_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a
+massif_SOURCES =3D \
ms_main.c
-valgrind_massif_LDFLAGS =3D \
+massif_LDFLAGS =3D \
-static \
$(top_srcdir)/coregrind/libcoregrind.a \
-Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \
Modified: branches/ASPACEM/memcheck/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/memcheck/Makefile.am 2005-08-28 10:17:00 UTC (rev 45=
50)
+++ branches/ASPACEM/memcheck/Makefile.am 2005-08-28 11:01:13 UTC (rev 45=
51)
@@ -3,8 +3,7 @@
## Build Memcheck at a higher optimisation level
AM_CFLAGS +=3D -O2
=20
-val_PROGRAMS =3D vgpreload_memcheck.so
-bin_PROGRAMS =3D valgrind_memcheck
+val_PROGRAMS =3D memcheck vgpreload_memcheck.so
=20
vgpreload_memcheck_so_SOURCES =3D \
mac_replace_strmem.c
@@ -15,14 +14,14 @@
$(LIBREPLACEMALLOC) \
-Wl,--no-whole-archive
=20
-valgrind_memcheck_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.=
a
-valgrind_memcheck_SOURCES =3D \
+memcheck_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a
+memcheck_SOURCES =3D \
mac_leakcheck.c \
mac_malloc_wrappers.c \
mc_main.c \
mac_shared.c \
mc_translate.c
-valgrind_memcheck_LDFLAGS =3D \
+memcheck_LDFLAGS =3D \
-static \
$(top_srcdir)/coregrind/libcoregrind.a \
-Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \
Modified: branches/ASPACEM/none/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/none/Makefile.am 2005-08-28 10:17:00 UTC (rev 4550)
+++ branches/ASPACEM/none/Makefile.am 2005-08-28 11:01:13 UTC (rev 4551)
@@ -1,11 +1,11 @@
include $(top_srcdir)/Makefile.tool.am
=20
-bin_PROGRAMS =3D valgrind_none
+val_PROGRAMS =3D none
=20
-valgrind_none_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a
-valgrind_none_SOURCES =3D \
+none_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a
+none_SOURCES =3D \
nl_main.c
-valgrind_none_LDFLAGS =3D \
+none_LDFLAGS =3D \
-static \
$(top_srcdir)/coregrind/libcoregrind.a \
-Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \
|
|
From: <sv...@va...> - 2005-08-28 10:17:11
|
Author: tom
Date: 2005-08-28 11:17:00 +0100 (Sun, 28 Aug 2005)
New Revision: 4550
Log:
Update bug statuses.
Modified:
trunk/docs/internals/3_0_BUGSTATUS.txt
Modified: trunk/docs/internals/3_0_BUGSTATUS.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/docs/internals/3_0_BUGSTATUS.txt 2005-08-28 10:16:29 UTC (rev 4=
549)
+++ trunk/docs/internals/3_0_BUGSTATUS.txt 2005-08-28 10:17:00 UTC (rev 4=
550)
@@ -326,6 +326,13 @@
=20
----------------------------------------------------------------
=20
+110770 VEX: Generated files not always updated when making valgrind
+
+FIXED-TRUNK: partial(4473)
+FIXED-30BRANCH: TODO
+
+----------------------------------------------------------------
+
110830 configuring with --host fails to build 32 bit on 64 bit target
=20
FIXED-TRUNK: 4442
@@ -392,7 +399,7 @@
111231 sctp_getladdrs() and sctp_getpaddrs() returns uninitialized
memory
=20
-FIXED-TRUNK: TODO
+FIXED-TRUNK: 4549
FIXED-30BRANCH: TODO
=20
----------------------------------------------------------------
|
|
From: <sv...@va...> - 2005-08-28 10:16:39
|
Author: tom
Date: 2005-08-28 11:16:29 +0100 (Sun, 28 Aug 2005)
New Revision: 4549
Log:
Handle the SCTP_GET_LOCAL_ADDRS and SCTP_GET_PEER_ADDRS getsockopt
calls correctly. Fix to bug #111231.
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/include/vki-amd64-linux.h
trunk/include/vki-linux.h
trunk/include/vki-ppc32-linux.h
trunk/include/vki-x86-linux.h
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2005-08-28 05:21:17 UTC (=
rev 4548)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2005-08-28 10:16:29 UTC (=
rev 4549)
@@ -1146,10 +1146,17 @@
Addr optval_p =3D arg3;
Addr optlen_p =3D arg4;
/* vg_assert(sizeof(socklen_t) =3D=3D sizeof(UInt)); */
- if (optval_p !=3D (Addr)NULL)=20
+ if (optval_p !=3D (Addr)NULL) {
buf_and_len_pre_check ( tid, optval_p, optlen_p,
"socketcall.getsockopt(optval)",
"socketcall.getsockopt(optlen)" );
+ if (arg1 =3D=3D VKI_SOL_SCTP &&
+ (arg2 =3D=3D VKI_SCTP_GET_PEER_ADDRS || arg2 =3D=3D VKI_SCTP_G=
ET_LOCAL_ADDRS)) {
+ struct vki_sctp_getaddrs *ga =3D (struct vki_sctp_getaddrs*)arg=
3;
+ int address_bytes =3D sizeof(struct vki_sockaddr_in6) * ga->add=
r_num;
+ PRE_MEM_WRITE( "socketcall.getsockopt(optval.addrs)", (Addr)ga-=
>addrs, address_bytes );
+ }
+ }
}
=20
void=20
@@ -1161,9 +1168,28 @@
Addr optval_p =3D arg3;
Addr optlen_p =3D arg4;
vg_assert(!res.isError); /* guaranteed by caller */
- if (optval_p !=3D (Addr)NULL)=20
+ if (optval_p !=3D (Addr)NULL) {
buf_and_len_post_check ( tid, res, optval_p, optlen_p,
"socketcall.getsockopt(optlen_out)" );
+ if (arg1 =3D=3D VKI_SOL_SCTP &&
+ (arg2 =3D=3D VKI_SCTP_GET_PEER_ADDRS || arg2 =3D=3D VKI_SCTP_G=
ET_LOCAL_ADDRS)) {
+ struct vki_sctp_getaddrs *ga =3D (struct vki_sctp_getaddrs*)arg=
3;
+ struct vki_sockaddr *a =3D ga->addrs;
+ int i;
+ for (i =3D 0; i < ga->addr_num; i++) {
+ int sl =3D 0;
+ if (a->sa_family =3D=3D VKI_AF_INET)
+ sl =3D sizeof(struct vki_sockaddr_in);
+ else if (a->sa_family =3D=3D VKI_AF_INET6)
+ sl =3D sizeof(struct vki_sockaddr_in6);
+ else {
+ VG_(message)(Vg_UserMsg, "Warning: getsockopt: unhandled =
address type %d", a->sa_family);
+ }
+ a =3D (struct vki_sockaddr*)((char*)a + sl);
+ }
+ POST_MEM_WRITE( (Addr)ga->addrs, (char*)a - (char*)ga->addrs );
+ }
+ }
}
=20
/* ------ */
Modified: trunk/include/vki-amd64-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/vki-amd64-linux.h 2005-08-28 05:21:17 UTC (rev 4548)
+++ trunk/include/vki-amd64-linux.h 2005-08-28 10:16:29 UTC (rev 4549)
@@ -44,6 +44,7 @@
typedef __signed__ short __vki_s16;
typedef unsigned short __vki_u16;
=20
+typedef __signed__ int __vki_s32;
typedef unsigned int __vki_u32;
=20
typedef __signed__ long long __vki_s64;
Modified: trunk/include/vki-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/vki-linux.h 2005-08-28 05:21:17 UTC (rev 4548)
+++ trunk/include/vki-linux.h 2005-08-28 10:16:29 UTC (rev 4549)
@@ -587,6 +587,8 @@
=20
#define VKI_MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */
=20
+#define VKI_SOL_SCTP 132
+
//----------------------------------------------------------------------
// From linux-2.6.8.1/include/linux/in.h
//----------------------------------------------------------------------
@@ -772,6 +774,73 @@
};
=20
//----------------------------------------------------------------------
+// From linux-2.6.13-rc5/include/net/sctp/user.h
+//----------------------------------------------------------------------
+
+typedef __vki_s32 vki_sctp_assoc_t;
+
+enum vki_sctp_optname {
+ VKI_SCTP_RTOINFO,
+#define VKI_SCTP_RTOINFO VKI_SCTP_RTOINFO
+ VKI_SCTP_ASSOCINFO,
+#define VKI_SCTP_ASSOCINFO VKI_SCTP_ASSOCINFO
+ VKI_SCTP_INITMSG,
+#define VKI_SCTP_INITMSG VKI_SCTP_INITMSG
+ VKI_SCTP_NODELAY, /* Get/set nodelay option. */
+#define VKI_SCTP_NODELAY VKI_SCTP_NODELAY
+ VKI_SCTP_AUTOCLOSE,
+#define VKI_SCTP_AUTOCLOSE VKI_SCTP_AUTOCLOSE
+ VKI_SCTP_SET_PEER_PRIMARY_ADDR,=20
+#define VKI_SCTP_SET_PEER_PRIMARY_ADDR VKI_SCTP_SET_PEER_PRIMARY_ADDR
+ VKI_SCTP_PRIMARY_ADDR,
+#define VKI_SCTP_PRIMARY_ADDR VKI_SCTP_PRIMARY_ADDR
+ VKI_SCTP_ADAPTION_LAYER, =20
+#define VKI_SCTP_ADAPTION_LAYER VKI_SCTP_ADAPTION_LAYER
+ VKI_SCTP_DISABLE_FRAGMENTS,
+#define VKI_SCTP_DISABLE_FRAGMENTS VKI_SCTP_DISABLE_FRAGMENTS
+ VKI_SCTP_PEER_ADDR_PARAMS,
+#define VKI_SCTP_PEER_ADDR_PARAMS VKI_SCTP_PEER_ADDR_PARAMS
+ VKI_SCTP_DEFAULT_SEND_PARAM,
+#define VKI_SCTP_DEFAULT_SEND_PARAM VKI_SCTP_DEFAULT_SEND_PARAM
+ VKI_SCTP_EVENTS,
+#define VKI_SCTP_EVENTS VKI_SCTP_EVENTS
+ VKI_SCTP_I_WANT_MAPPED_V4_ADDR, /* Turn on/off mapped v4 addresses */
+#define VKI_SCTP_I_WANT_MAPPED_V4_ADDR VKI_SCTP_I_WANT_MAPPED_V4_ADDR
+ VKI_SCTP_MAXSEG, /* Get/set maximum fragment. */
+#define VKI_SCTP_MAXSEG VKI_SCTP_MAXSEG
+ VKI_SCTP_STATUS,
+#define VKI_SCTP_STATUS VKI_SCTP_STATUS
+ VKI_SCTP_GET_PEER_ADDR_INFO,
+#define VKI_SCTP_GET_PEER_ADDR_INFO VKI_SCTP_GET_PEER_ADDR_INFO
+
+ /* Internal Socket Options. Some of the sctp library functions are=20
+ * implemented using these socket options.
+ */
+ VKI_SCTP_SOCKOPT_BINDX_ADD =3D 100,/* BINDX requests for adding address=
es. */
+#define VKI_SCTP_SOCKOPT_BINDX_ADD VKI_SCTP_SOCKOPT_BINDX_ADD
+ VKI_SCTP_SOCKOPT_BINDX_REM, /* BINDX requests for removing addresses. *=
/
+#define VKI_SCTP_SOCKOPT_BINDX_REM VKI_SCTP_SOCKOPT_BINDX_REM
+ VKI_SCTP_SOCKOPT_PEELOFF, /* peel off association. */
+#define VKI_SCTP_SOCKOPT_PEELOFF VKI_SCTP_SOCKOPT_PEELOFF
+ VKI_SCTP_GET_PEER_ADDRS_NUM, /* Get number of peer addresss. */
+#define VKI_SCTP_GET_PEER_ADDRS_NUM VKI_SCTP_GET_PEER_ADDRS_NUM
+ VKI_SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */
+#define VKI_SCTP_GET_PEER_ADDRS VKI_SCTP_GET_PEER_ADDRS
+ VKI_SCTP_GET_LOCAL_ADDRS_NUM, /* Get number of local addresss. */
+#define VKI_SCTP_GET_LOCAL_ADDRS_NUM VKI_SCTP_GET_LOCAL_ADDRS_NUM
+ VKI_SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */
+#define VKI_SCTP_GET_LOCAL_ADDRS VKI_SCTP_GET_LOCAL_ADDRS
+ VKI_SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */
+#define VKI_SCTP_SOCKOPT_CONNECTX VKI_SCTP_SOCKOPT_CONNECTX
+};
+
+struct vki_sctp_getaddrs {
+ vki_sctp_assoc_t assoc_id;
+ int addr_num;
+ struct vki_sockaddr *addrs;
+};
+
+//----------------------------------------------------------------------
// From linux-2.6.8.1/include/linux/resource.h
//----------------------------------------------------------------------
=20
Modified: trunk/include/vki-ppc32-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/vki-ppc32-linux.h 2005-08-28 05:21:17 UTC (rev 4548)
+++ trunk/include/vki-ppc32-linux.h 2005-08-28 10:16:29 UTC (rev 4549)
@@ -44,6 +44,7 @@
typedef __signed__ short __vki_s16;
typedef unsigned short __vki_u16;
=20
+typedef __signed__ int __vki_s32;
typedef unsigned int __vki_u32;
=20
typedef __signed__ long long __vki_s64;
Modified: trunk/include/vki-x86-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/vki-x86-linux.h 2005-08-28 05:21:17 UTC (rev 4548)
+++ trunk/include/vki-x86-linux.h 2005-08-28 10:16:29 UTC (rev 4549)
@@ -43,6 +43,7 @@
typedef __signed__ short __vki_s16;
typedef unsigned short __vki_u16;
=20
+typedef __signed__ int __vki_s32;
typedef unsigned int __vki_u32;
=20
typedef __signed__ long long __vki_s64;
|
|
From: <sv...@va...> - 2005-08-28 05:21:19
|
Author: njn
Date: 2005-08-28 06:21:17 +0100 (Sun, 28 Aug 2005)
New Revision: 4548
Log:
Add some comments.
Modified:
trunk/addrcheck/ac_main.c
Modified: trunk/addrcheck/ac_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/addrcheck/ac_main.c 2005-08-28 05:10:48 UTC (rev 4547)
+++ trunk/addrcheck/ac_main.c 2005-08-28 05:21:17 UTC (rev 4548)
@@ -707,6 +707,7 @@
abits >>=3D (a & 4);
abits &=3D 15;
PROF_EVENT(66, "");
+ // XXX: Should this be "if (!is_distinguished_sm(sm) && abits =3D=3D =
VGM_NIBBLE_VALID)"?
if (abits =3D=3D VGM_NIBBLE_VALID) {
/* Handle common case quickly: a is suitably aligned, is mapped,
and is addressible. So just return. */
@@ -727,6 +728,7 @@
AcSecMap* sm =3D primary_map[sec_no];
UInt a_off =3D (SM_OFF(a)) >> 3;
PROF_EVENT(67, "");
+ // XXX: Should this be "if (!is_distinguished_sm(sm) && sm->abits[a_o=
ff] =3D=3D VGM_BYTE_VALID)"?
if (sm->abits[a_off] =3D=3D VGM_BYTE_VALID) {
/* Handle common case quickly. */
return;
@@ -746,6 +748,7 @@
AcSecMap* sm =3D primary_map[sec_no];
UInt a_off =3D (SM_OFF(a)) >> 3;
PROF_EVENT(68, "");
+ // XXX: Should this be "if (!is_distinguished_sm(sm) && sm->abits[a_o=
ff] =3D=3D VGM_BYTE_VALID)"?
if (sm->abits[a_off] =3D=3D VGM_BYTE_VALID) {
/* Handle common case quickly. */
return;
|
|
From: <sv...@va...> - 2005-08-28 05:10:55
|
Author: njn
Date: 2005-08-28 06:10:48 +0100 (Sun, 28 Aug 2005)
New Revision: 4547
Log:
Save some informative emails about Darwin from Greg Parker.
Added:
trunk/docs/internals/darwin-notes.txt
trunk/docs/internals/darwin-syscalls.txt
Modified:
trunk/docs/internals/Makefile.am
Modified: trunk/docs/internals/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/docs/internals/Makefile.am 2005-08-28 04:48:12 UTC (rev 4546)
+++ trunk/docs/internals/Makefile.am 2005-08-28 05:10:48 UTC (rev 4547)
@@ -1,5 +1,7 @@
EXTRA_DIST =3D \
- 3_0_BUGSTATUS 64-bit-cleanness.txt directory-structure.txt \
+ 3_0_BUGSTATUS 64-bit-cleanness.txt \
+ darwin-notes.txt darwin-syscalls.txt \
+ directory-structure.txt \
m_replacemalloc.txt \
m_syswrap.txt module-structure.txt notes.txt porting-HOWTO.txt \
porting-to-ARM.txt \
Added: trunk/docs/internals/darwin-notes.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/docs/internals/darwin-notes.txt 2005-08-28 04:48:12 UTC (rev 45=
46)
+++ trunk/docs/internals/darwin-notes.txt 2005-08-28 05:10:48 UTC (rev 45=
47)
@@ -0,0 +1,78 @@
+[Julian replying to Greg Parker's notes about darwin/ppc32]
+
+
+> Some notes about porting Valgrind 3.x to Mac OS X / PowerPC:
+>
+> * Darwin always uses a 64-bit off_t, even on 32-bit architectures.
+> (FreeBSD may also do this.) Valgrind currently allows off_t to
+> be pointer sized only, but it doesn't look like there is any
+> strong dependence on this anywhere.
+
+Ok. This sounds fairly harmless.
+
+> * dispatch.S should be platform-specific instead of arch-specific.
+> In particular, Darwin's assembler is not GNU as, so the file's
+> syntax would be wrong even if everything else were the same.
+> It should be reasonable to change dispatch-$VG_ARCH.S to
+> dispatch-$VG_OS-$VG_ARCH.S .
+
+True.
+
+> * Some Darwin syscalls take 7 arguments (in particular, mmap()
+> with 64-bit off_t offset). Valgrind currently provides
+> arg1..arg6. I don't see any obvious 8-argument syscalls.
+> Do other architectures define a 7th syscall argument and
+> just never use it, or do they have a 6 argument max?
+
+6 args is as many as Linux uses, it seems, and that's why the
+m_syswrap abstractions stop at 6. But clearly that could be
+extended to 7 with minimal effort.
+
+> * Darwin syscalls return a full 64-bit result, even on 32-bit
+> architectures. In particular, the lseek() syscall returns
+> a 64-bit off_t in registers r3 and r4. For syscalls that
+> return a 32-bit int, the kernel sets the other return
+> register to zero (or the appropriate sign extension for
+> signed return types). I don't know how much of an effect
+> changing this would have.
+
+I think the m_syswrap abstractions should be able to hide that OK.
+
+> * Darwin/PPC syscalls indicate success and failure in an unusual
+> way: successful calls and failed calls return to different
+> points. A syscall call usually looks like this:
+>
+> // ...set up parameters here...
+> sc // make the syscall
+> b BAD // failed calls return here
+> GOOD:
+> nop // successful calls return here
+> // ...handle success case here...
+> blr
+> BAD:
+> // ...handle failure case here...
+> blr
+
+So you're saying that after sc, execution continues either at
+CIA+4 or CIA+8 depending on outcome. Right?
+
+> Handling this in VG_(do_syscall_for_client) isn't too bad.
+> One option is to store the PC of the last simulated `sc`
+> in the thread state, updating it before each call. Another
+> is to store a "sc failed" bit in each thread state, updating
+> it after each call. In either case, the simulated PC after
+> completion of the simulated `sc` would be adjusted based on
+> the result of the real `sc` or the syscall wrapper. The
+> syscall restarter would use the extra thread state to decide
+> whether to back up on instruction or two.
+>
+> Handling this in VEX might be more difficult, because VEX
+> might need to know that `sc` looks like a conditional branch
+> in basic block analysis.
+
+Probably pretty harmless. There's all sorts of tricks that can
+be played. I think it's a non-problem.
+
+> (Of course, Mach traps use `sc` but don't use the PC-modifying
+> calling convention. However, Mach traps are an entirely different
+> ball of wax, and much will be said about them later.)
Added: trunk/docs/internals/darwin-syscalls.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/docs/internals/darwin-syscalls.txt 2005-08-28 04:48:12 UTC (rev=
4546)
+++ trunk/docs/internals/darwin-syscalls.txt 2005-08-28 05:10:48 UTC (rev=
4547)
@@ -0,0 +1,479 @@
+[Master list of Darwin syscalls, courtesy of Greg Parker]
+
+
+xnu-792.2.4:bsd/kern/syscalls.master
+
+; derived from: FreeBSD @(#)syscalls.master 8.2 (Berkeley) 1/13/94
+;
+; System call name/number master file.
+; This is file processed by .../xnu/bsd/kern/makesyscalls.sh and creates=
:
+; .../xnu/bsd/kern/init_sysent.c=20
+; .../xnu/bsd/kern/syscalls.c=20
+; .../xnu/bsd/sys/syscall.h=20
+; .../xnu/bsd/sys/sysproto.h=20
+;
+; Columns -> | Number | Cancel | Funnel | Files | { Name and Args } | { =
Comments }
+; Number: system call number, must be in order
+; Cancel: type of thread cancel - "PRE", "POST" or "NONE"
+; Funnel: type of funnel - "KERN" or "NONE"
+; Files: with files to generate - "ALL" or any combo of:
+; "T" for syscall table (in init_sysent.c)
+; "N" for syscall names (in syscalls.c)
+; "H" for syscall headers (in syscall.h)
+; "P" for syscall prototypes (in sysproto.h)
+; Comments: additional comments about the sys call copied to output fil=
es
+;
+; #ifdef's, #include's, #if's etc. are copied to all output files.
+
+#include <sys/appleapiopts.h>
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/types.h>
+#include <sys/sysent.h>
+#include <sys/sysproto.h>
+
+e NONE NONE ALL { int nosys(void); } { indirect syscal=
l }
+1 NONE KERN ALL { void exit(int rval); }=20
+2 NONE KERN ALL { int fork(void); }=20
+3 PRE NONE ALL { user_ssize_t read(int fd, user_addr_t =
cbuf, user_size_t nbyte); }=20
+4 PRE NONE ALL { user_ssize_t write(int fd, user_addr_t=
cbuf, user_size_t nbyte); }=20
+5 PRE NONE ALL { int open(user_addr_t path, int flags, =
int mode); }=20
+6 PRE NONE ALL { int close(int fd); }=20
+7 PRE KERN ALL { int wait4(int pid, user_addr_t status,=
int options, user_addr_t rusage); }=20
+8 NONE NONE ALL { int nosys(void); } { old creat }
+9 NONE NONE ALL { int link(user_addr_t path, user_addr_t=
link); }=20
+10 NONE NONE ALL { int unlink(user_addr_t path); }=20
+11 NONE NONE ALL { int nosys(void); } { old execv }
+12 NONE NONE ALL { int chdir(user_addr_t path); }=20
+13 NONE NONE ALL { int fchdir(int fd); }=20
+14 NONE NONE ALL { int mknod(user_addr_t path, int mode, =
int dev); }=20
+15 NONE NONE ALL { int chmod(user_addr_t path, int mode);=
}=20
+16 NONE NONE ALL { int chown(user_addr_t path, int uid, i=
nt gid); }=20
+17 NONE NONE UALL { int obreak(char *nsize); } { old bre=
ak }
+
+#if COMPAT_GETFSSTAT
+18 NONE NONE ALL { int ogetfsstat(user_addr_t buf, int bu=
fsize, int flags); }=20
+#else
+18 NONE NONE ALL { int getfsstat(user_addr_t buf, int buf=
size, int flags); }=20
+#endif
+
+19 NONE NONE ALL { int nosys(void); } { old lseek }
+20 NONE NONE ALL { int getpid(void); }=20
+21 NONE NONE ALL { int nosys(void); } { old mount }
+22 NONE NONE ALL { int nosys(void); } { old umount }
+23 NONE KERN ALL { int setuid(uid_t uid); }=20
+24 NONE KERN ALL { int getuid(void); }=20
+25 NONE KERN ALL { int geteuid(void); }=20
+26 NONE KERN ALL { int ptrace(int req, pid_t pid, caddr_t=
addr, int data); }=20
+27 PRE NONE ALL { int recvmsg(int s, struct msghdr *msg,=
int flags); }=20
+28 PRE NONE ALL { int sendmsg(int s, caddr_t msg, int fl=
ags); }=20
+29 PRE NONE ALL { int recvfrom(int s, void *buf, size_t =
len, int flags, struct sockaddr *from, int *fromlenaddr); }=20
+30 PRE NONE ALL { int accept(int s, caddr_t name, sockle=
n_t *anamelen); }=20
+31 NONE NONE ALL { int getpeername(int fdes, caddr_t asa,=
socklen_t *alen); }=20
+32 NONE NONE ALL { int getsockname(int fdes, caddr_t asa,=
socklen_t *alen); }=20
+33 NONE NONE ALL { int access(user_addr_t path, int flags=
); }=20
+34 NONE NONE ALL { int chflags(char *path, int flags); }=20
+35 NONE NONE ALL { int fchflags(int fd, int flags); }=20
+36 NONE NONE ALL { int sync(void); }=20
+37 NONE KERN ALL { int kill(int pid, int signum); }=20
+38 NONE NONE ALL { int nosys(void); } { old stat }
+39 NONE KERN ALL { int getppid(void); }=20
+40 NONE NONE ALL { int nosys(void); } { old lstat }
+41 NONE NONE ALL { int dup(u_int fd); }=20
+42 NONE NONE ALL { int pipe(void); }=20
+43 NONE KERN ALL { int getegid(void); }=20
+44 NONE KERN ALL { int profil(short *bufbase, size_t bufs=
ize, u_long pcoffset, u_int pcscale); }=20
+45 NONE KERN ALL { int ktrace(const char *fname, int ops,=
int facs, int pid); }=20
+46 NONE KERN ALL { int sigaction(int signum, struct __sig=
action *nsa, struct sigaction *osa); }=20
+47 NONE KERN ALL { int getgid(void); }=20
+48 NONE KERN ALL { int sigprocmask(int how, user_addr_t m=
ask, user_addr_t omask); }=20
+49 NONE KERN ALL { int getlogin(char *namebuf, u_int name=
len); }=20
+50 NONE KERN ALL { int setlogin(char *namebuf); }=20
+51 NONE KERN ALL { int acct(char *path); }=20
+52 NONE KERN ALL { int sigpending(struct sigvec *osv); }=20
+53 NONE KERN ALL { int sigaltstack(struct sigaltstack *ns=
s, struct sigaltstack *oss); }=20
+54 NONE NONE ALL { int ioctl(int fd, u_long com, caddr_t =
data); }=20
+55 NONE KERN ALL { int reboot(int opt, char *command); }=20
+56 NONE NONE ALL { int revoke(char *path); }=20
+57 NONE NONE ALL { int symlink(char *path, char *link); }=
=20
+58 NONE NONE ALL { int readlink(char *path, char *buf, in=
t count); }=20
+59 NONE KERN ALL { int execve(char *fname, char **argp, c=
har **envp); }=20
+60 NONE KERN ALL { int umask(int newmask); }=20
+61 NONE KERN ALL { int chroot(user_addr_t path); }=20
+62 NONE NONE ALL { int nosys(void); } { old fstat }
+63 NONE NONE ALL { int nosys(void); } { used internally=
, reserved }
+64 NONE NONE ALL { int nosys(void); } { old getpagesize=
}
+65 PRE NONE ALL { int msync(caddr_t addr, size_t len, in=
t flags); }=20
+66 NONE KERN ALL { int vfork(void); }=20
+67 NONE NONE ALL { int nosys(void); } { old vread }
+68 NONE NONE ALL { int nosys(void); } { old vwrite }
+69 NONE NONE ALL { int sbrk(int incr); }=20
+70 NONE NONE ALL { int sstk(int incr); }=20
+71 NONE NONE ALL { int nosys(void); } { old mmap }
+72 NONE NONE ALL { int ovadvise(void); } { old vadvise =
}
+73 NONE NONE ALL { int munmap(caddr_t addr, size_t len); =
}=20
+74 NONE NONE ALL { int mprotect(caddr_t addr, size_t len,=
int prot); }=20
+75 NONE NONE ALL { int madvise(caddr_t addr, size_t len, =
int behav); }=20
+76 NONE NONE ALL { int nosys(void); } { old vhangup }
+77 NONE NONE ALL { int nosys(void); } { old vlimit }
+78 NONE NONE ALL { int mincore(user_addr_t addr, user_siz=
e_t len, user_addr_t vec); }=20
+79 NONE KERN ALL { int getgroups(u_int gidsetsize, gid_t =
*gidset); }=20
+80 NONE KERN ALL { int setgroups(u_int gidsetsize, gid_t =
*gidset); }=20
+81 NONE KERN ALL { int getpgrp(void); }=20
+82 NONE KERN ALL { int setpgid(int pid, int pgid); }=20
+83 NONE KERN ALL { int setitimer(u_int which, struct itim=
erval *itv, struct itimerval *oitv); }=20
+84 NONE NONE ALL { int nosys(void); } { old wait }
+85 NONE NONE ALL { int swapon(void); }=20
+86 NONE KERN ALL { int getitimer(u_int which, struct itim=
erval *itv); }=20
+87 NONE NONE ALL { int nosys(void); } { old gethostname=
}
+88 NONE NONE ALL { int nosys(void); } { old sethostname=
}
+89 NONE NONE ALL { int getdtablesize(void); }=20
+90 NONE NONE ALL { int dup2(u_int from, u_int to); }=20
+91 NONE NONE ALL { int nosys(void); } { old getdopt }
+92 PRE NONE ALL { int fcntl(int fd, int cmd, long arg); =
}=20
+93 PRE KERN ALL { int select(int nd, u_int32_t *in, u_in=
t32_t *ou, u_int32_t *ex, struct timeval *tv); }=20
+94 NONE NONE ALL { int nosys(void); } { old setdopt }
+95 PRE NONE ALL { int fsync(int fd); }=20
+96 NONE KERN ALL { int setpriority(int which, int who, in=
t prio); }=20
+97 NONE NONE ALL { int socket(int domain, int type, int p=
rotocol); }=20
+98 PRE NONE ALL { int connect(int s, caddr_t name, sockl=
en_t namelen); }=20
+99 NONE NONE ALL { int nosys(void); } { old accept }
+100 NONE KERN ALL { int getpriority(int which, int who); }=
=20
+101 NONE NONE ALL { int nosys(void); } { old send }
+102 NONE NONE ALL { int nosys(void); } { old recv }
+
+#ifdef __ppc__
+103 NONE NONE ALL { int nosys(void); } { old sigreturn }
+#else
+103 NONE KERN UALL { int sigreturn(struct sigcontext *sigcn=
txp); }=20
+#endif
+
+104 NONE NONE ALL { int bind(int s, caddr_t name, socklen_=
t namelen); }=20
+105 NONE NONE ALL { int setsockopt(int s, int level, int n=
ame, caddr_t val, socklen_t valsize); }=20
+106 NONE NONE ALL { int listen(int s, int backlog); }=20
+107 NONE NONE ALL { int nosys(void); } { old vtimes }
+108 NONE NONE ALL { int nosys(void); } { old sigvec }
+109 NONE NONE ALL { int nosys(void); } { old sigblock }
+110 NONE NONE ALL { int nosys(void); } { old sigsetmask =
}
+111 PRE KERN ALL { int sigsuspend(sigset_t mask); }=20
+112 NONE NONE ALL { int nosys(void); } { old sigstack }
+113 NONE NONE ALL { int nosys(void); } { old recvmsg }
+114 NONE NONE ALL { int nosys(void); } { old sendmsg } =20
+115 NONE NONE ALL { int nosys(void); } { old vtrace }
+
+#ifdef __ppc__
+116 NONE NONE ALL { int ppc_gettimeofday(struct timeval *t=
p, struct timezone *tzp); }=20
+#else
+116 NONE NONE ALL { int gettimeofday(struct timeval *tp, s=
truct timezone *tzp); }=20
+#endif
+
+117 NONE KERN ALL { int getrusage(int who, struct rusage *=
rusage); }=20
+118 NONE NONE ALL { int getsockopt(int s, int level, int n=
ame, caddr_t val, socklen_t *avalsize); }=20
+119 NONE NONE ALL { int nosys(void); } { old resuba }
+120 PRE NONE ALL { user_ssize_t readv(int fd, struct iove=
c *iovp, u_int iovcnt); }=20
+121 PRE NONE ALL { user_ssize_t writev(int fd, struct iov=
ec *iovp, u_int iovcnt); }=20
+122 NONE KERN ALL { int settimeofday(struct timeval *tv, s=
truct timezone *tzp); }=20
+123 NONE NONE ALL { int fchown(int fd, int uid, int gid); =
}=20
+124 NONE NONE ALL { int fchmod(int fd, int mode); }=20
+125 NONE NONE ALL { int nosys(void); } { old recvfrom }
+126 NONE NONE ALL { int nosys(void); } { old setreuid }
+127 NONE NONE ALL { int nosys(void); } { old setregid }
+128 NONE NONE ALL { int rename(char *from, char *to); }=20
+129 NONE NONE ALL { int nosys(void); } { old truncate }
+130 NONE NONE ALL { int nosys(void); } { old ftruncate }
+131 NONE NONE ALL { int flock(int fd, int how); }=20
+132 NONE NONE ALL { int mkfifo(user_addr_t path, int mode)=
; }=20
+133 PRE NONE ALL { int sendto(int s, caddr_t buf, size_t =
len, int flags, caddr_t to, socklen_t tolen); }=20
+134 NONE NONE ALL { int shutdown(int s, int how); }=20
+135 NONE NONE ALL { int socketpair(int domain, int type, i=
nt protocol, int *rsv); }=20
+136 NONE NONE ALL { int mkdir(user_addr_t path, int mode);=
}=20
+137 NONE NONE ALL { int rmdir(char *path); }=20
+138 NONE NONE ALL { int utimes(char *path, struct timeval =
*tptr); }=20
+139 NONE NONE ALL { int futimes(int fd, struct timeval *tp=
tr); }=20
+140 NONE KERN ALL { int adjtime(struct timeval *delta, str=
uct timeval *olddelta); }=20
+141 NONE NONE ALL { int nosys(void); } { old getpeername=
}
+142 NONE NONE ALL { int nosys(void); } { old gethostid }
+143 NONE NONE ALL { int nosys(void); } { old sethostid =
}
+144 NONE NONE ALL { int nosys(void); } { old getrlimit }
+145 NONE NONE ALL { int nosys(void); } { old setrlimit }
+146 NONE NONE ALL { int nosys(void); } { old killpg }
+147 NONE KERN ALL { int setsid(void); }=20
+148 NONE NONE ALL { int nosys(void); } { old setquota }
+149 NONE NONE ALL { int nosys(void); } { old qquota }
+150 NONE NONE ALL { int nosys(void); } { old getsockname=
}
+151 NONE KERN ALL { int getpgid(pid_t pid); }=20
+152 NONE KERN ALL { int setprivexec(int flag); }=20
+153 PRE NONE ALL { user_ssize_t pread(int fd, user_addr_t=
buf, user_size_t nbyte, off_t offset); }=20
+154 PRE NONE ALL { user_ssize_t pwrite(int fd, user_addr_=
t buf, user_size_t nbyte, off_t offset); }=20
+
+#if NFSSERVER
+155 NONE KERN ALL { int nfssvc(int flag, caddr_t argp); }=20
+#else
+155 NONE NONE ALL { int nosys(void); }=20
+#endif
+
+156 NONE NONE ALL { int nosys(void); } { old getdirentri=
es }
+157 NONE NONE ALL { int statfs(char *path, struct statfs *=
buf); }=20
+158 NONE NONE ALL { int fstatfs(int fd, struct statfs *buf=
); }=20
+159 NONE NONE ALL { int unmount(user_addr_t path, int flag=
s); }=20
+160 NONE NONE ALL { int nosys(void); } { old async_daemo=
n }
+
+#if NFSCLIENT
+161 NONE KERN ALL { int getfh(char *fname, fhandle_t *fhp)=
; }=20
+#else
+161 NONE NONE ALL { int nosys(void); }=20
+#endif
+
+162 NONE NONE ALL { int nosys(void); } { old getdomainna=
me }
+163 NONE NONE ALL { int nosys(void); } { old setdomainna=
me }
+164 NONE NONE ALL { int nosys(void); }=20
+165 NONE KERN ALL { int quotactl(char *path, int cmd, int =
uid, caddr_t arg); }=20
+166 NONE NONE ALL { int nosys(void); } { old exportfs }
+167 NONE NONE ALL { int mount(char *type, char *path, int =
flags, caddr_t data); }=20
+168 NONE NONE ALL { int nosys(void); } { old ustat }
+169 NONE NONE ALL { int nosys(void); }=20
+170 NONE NONE HN { int table(void); } { old table }
+171 NONE NONE ALL { int nosys(void); } { old wait3 }
+172 NONE NONE ALL { int nosys(void); } { old rpause =
} =20
+173 PRE KERN ALL { int waitid(idtype_t idtype, id_t id, s=
iginfo_t *infop, int options); }=20
+174 NONE NONE ALL { int nosys(void); } { old getdents }
+175 NONE NONE ALL { int nosys(void); } { old gc_control =
}
+176 NONE KERN ALL { int add_profil(short *bufbase, size_t =
bufsize, u_long pcoffset, u_int pcscale); }=20
+177 NONE NONE ALL { int nosys(void); }=20
+178 NONE NONE ALL { int nosys(void); }=20
+179 NONE NONE ALL { int nosys(void); }=20
+180 NONE NONE UALL { int kdebug_trace(int code, int arg1, int =
arg2, int arg3, int arg4, int arg5); }=20
+181 NONE KERN ALL { int setgid(gid_t gid); }=20
+182 NONE KERN ALL { int setegid(gid_t egid); }=20
+183 NONE KERN ALL { int seteuid(uid_t euid); }=20
+
+#ifdef __ppc__
+184 NONE KERN ALL { int sigreturn(struct ucontext *uctx, i=
nt infostyle); }=20
+#else
+184 NONE NONE ALL { int nosys(void); }=20
+#endif
+
+185 NONE NONE ALL { int nosys(void); }=20
+186 NONE NONE ALL { int nosys(void); }=20
+187 NONE NONE ALL { int nosys(void); }=20
+188 NONE NONE ALL { int stat(user_addr_t path, user_addr_t=
ub); }=20
+189 NONE NONE ALL { int fstat(int fd, user_addr_t ub); }=20
+190 NONE NONE ALL { int lstat(user_addr_t path, user_addr_=
t ub); }=20
+191 NONE NONE ALL { int pathconf(char *path, int name); }=20
+192 NONE NONE ALL { int fpathconf(int fd, int name); }=20
+
+#if COMPAT_GETFSSTAT
+193 NONE NONE ALL { int getfsstat(user_addr_t buf, user_lo=
ng_t bufsize, int flags); }=20
+#else
+193 NONE NONE ALL { int nosys(void); }=20
+#endif
+
+194 NONE KERN ALL { int getrlimit(u_int which, struct rlim=
it *rlp); }=20
+195 NONE KERN ALL { int setrlimit(u_int which, struct rlim=
it *rlp); }=20
+196 NONE NONE ALL { int getdirentries(int fd, char *buf, u=
_int count, long *basep); }=20
+197 NONE NONE ALL { user_addr_t mmap(caddr_t addr, size_t =
len, int prot, int flags, int fd, off_t pos); }=20
+198 NONE NONE ALL { int nosys(void); } { __syscall }
+199 NONE NONE ALL { off_t lseek(int fd, off_t offset, int =
whence); }=20
+200 NONE NONE ALL { int truncate(char *path, off_t length)=
; }=20
+201 NONE NONE ALL { int ftruncate(int fd, off_t length); }=
=20
+202 NONE KERN ALL { int __sysctl(int *name, u_int namelen, voi=
d *old, size_t *oldlenp, void *new, size_t newlen); }=20
+203 NONE NONE ALL { int mlock(caddr_t addr, size_t len); }=20
+204 NONE NONE ALL { int munlock(caddr_t addr, size_t len); }=20
+205 NONE NONE ALL { int undelete(user_addr_t path); }=20
+
+#ifdef __ppc__
+206 NONE NONE ALL { int ATsocket(int proto); }=20
+207 NONE NONE UALL { int ATgetmsg(int fd, void *ctlptr, voi=
d *datptr, int *flags); }=20
+208 NONE NONE UALL { int ATputmsg(int fd, void *ctlptr, voi=
d *datptr, int flags); }=20
+209 NONE NONE UALL { int ATPsndreq(int fd, unsigned char *b=
uf, int len, int nowait); }=20
+210 NONE NONE UALL { int ATPsndrsp(int fd, unsigned char *r=
espbuff, int resplen, int datalen); }=20
+211 NONE NONE UALL { int ATPgetreq(int fd, unsigned char *b=
uf, int buflen); }=20
+212 NONE NONE UALL { int ATPgetrsp(int fd, unsigned char *b=
dsp); }=20
+213 NONE NONE ALL { int nosys(void); } { Reserved for A=
ppleTalk }
+#else
+206 NONE NONE HN { int ATsocket(int proto); }=20
+207 NONE NONE UHN { int ATgetmsg(int fd, void *ctlptr, voi=
d *datptr, int *flags); }=20
+208 NONE NONE UHN { int ATputmsg(int fd, void *ctlptr, voi=
d *datptr, int flags); }=20
+209 NONE NONE UHN { int ATPsndreq(int fd, unsigned char *b=
uf, int len, int nowait); }=20
+210 NONE NONE UHN { int ATPsndrsp(int fd, unsigned char *r=
espbuff, int resplen, int datalen); }=20
+211 NONE NONE UHN { int ATPgetreq(int fd, unsigned char *b=
uf, int buflen); }=20
+212 NONE NONE UHN { int ATPgetrsp(int fd, unsigned char *b=
dsp); }=20
+213 NONE NONE ALL { int nosys(void); } { Reserved for A=
ppleTalk }
+#endif /* __ppc__ */
+
+214 NONE KERN ALL { int kqueue_from_portset_np(int portset=
); }=20
+215 NONE KERN ALL { int kqueue_portset_np(int fd); }=20
+
+; System Calls 216 - 230 are reserved for calls to support HFS/HFS Plus
+; file system semantics. Currently, we only use 215-227. The rest is=20
+; for future expansion in anticipation of new MacOS APIs for HFS Plus.
+; These calls are not conditionalized becuase while they are specific
+; to HFS semantics, they are not specific to the HFS filesystem.
+; We expect all filesystems to recognize the call and report that it is
+; not supported or to actually implement it.
+216 NONE NONE UHN { int mkcomplex(const char *path, mode_t =
mode, u_long type); } { soon to be obsolete }
+217 NONE NONE UHN { int statv(const char *path, struct vsta=
t *vsb); } { soon to be obsolete }
+218 NONE NONE UHN { int lstatv(const char *path, struct vst=
at *vsb); } { soon to be obsolete }
+219 NONE NONE UHN { int fstatv(int fd, struct vstat *vsb); =
} { soon to be obsolete }
+220 NONE NONE ALL { int getattrlist(const char *path, struc=
t attrlist *alist, void *attributeBuffer, size_t bufferSize, u_long optio=
ns); }=20
+221 NONE NONE ALL { int setattrlist(const char *path, struc=
t attrlist *alist, void *attributeBuffer, size_t bufferSize, u_long optio=
ns); }=20
+222 NONE NONE ALL { int getdirentriesattr(int fd, struct at=
trlist *alist, void *buffer, size_t buffersize, u_long *count, u_long *ba=
sep, u_long *newstate, u_long options); }=20
+223 NONE NONE ALL { int exchangedata(const char *path1, con=
st char *path2, u_long options); }=20
+
+#ifdef __APPLE_API_OBSOLETE
+224 NONE NONE UALL { int checkuseraccess(const char *path, =
uid_t userid, gid_t *groups, int ngroups, int accessrequired, u_long opti=
ons); }=20
+#else
+224 NONE NONE ALL { int nosys(void); } { HFS checkusera=
ccess check access to a file }
+#endif /* __APPLE_API_OBSOLETE */
+225 NONE KERN ALL { int searchfs(const cha=
r *path, struct fssearchblock *searchblock, u_long *nummatches, u_long sc=
riptcode, u_long options, struct searchstate *state); }=20
+226 NONE NONE ALL { int delete(user_addr_t=
path); } { private delete (Carbon semantics) }
+227 NONE NONE ALL { int copyfile(char *fro=
m, char *to, int mode, int flags); }=20
+228 NONE NONE ALL { int nosys(void); }=20
+229 NONE NONE ALL { int nosys(void); }=20
+230 PRE NONE ALL { int poll(struct pollfd=
*fds, u_int nfds, int timeout); }=20
+231 NONE NONE UALL { int watchevent(struct =
eventreq *u_req, int u_eventmask); }=20
+232 NONE NONE UALL { int waitevent(struct e=
ventreq *u_req, struct timeval *tv); }=20
+233 NONE NONE UALL { int modwatch(struct ev=
entreq *u_req, int u_eventmask); }=20
+234 NONE NONE ALL { user_ssize_t getxattr(=
user_addr_t path, user_addr_t attrname, user_addr_t value, size_t size, u=
int32_t position, int options); }=20
+235 NONE NONE ALL { user_ssize_t fgetxattr=
(int fd, user_addr_t attrname, user_addr_t value, size_t size, uint32_t p=
osition, int options); }=20
+236 NONE NONE ALL { int setxattr(user_addr=
_t path, user_addr_t attrname, user_addr_t value, size_t size, uint32_t p=
osition, int options); }=20
+237 NONE NONE ALL { int fsetxattr(int fd, =
user_addr_t attrname, user_addr_t value, size_t size, uint32_t position, =
int options); }=20
+238 NONE NONE ALL { int removexattr(user_a=
ddr_t path, user_addr_t attrname, int options); }=20
+239 NONE NONE ALL { int fremovexattr(int f=
d, user_addr_t attrname, int options); }=20
+240 NONE NONE ALL { user_ssize_t listxattr=
(user_addr_t path, user_addr_t namebuf, size_t bufsize, int options); }=20
+241 NONE NONE ALL { user_ssize_t flistxatt=
r(int fd, user_addr_t namebuf, size_t bufsize, int options); }=20
+242 NONE KERN ALL { int fsctl(const char *=
path, u_long cmd, caddr_t data, u_long options); }=20
+243 NONE KERN ALL { int initgroups(u_int g=
idsetsize, gid_t *gidset, int gmuid); }=20
+244 NONE NONE ALL { int nosys(void); }=20
+245 NONE NONE ALL { int nosys(void); }=20
+246 NONE NONE ALL { int nosys(void); }=20
+
+#if NFSCLIENT
+247 NONE KERN ALL { int nfsclnt(int flag, caddr_t argp); }=
=20
+248 NONE KERN ALL { int fhopen(const struct fhandle *u_fhp=
, int flags); }=20
+#else
+247 NONE NONE ALL { int nosys(void); }=20
+248 NONE NONE ALL { int nosys(void); }=20
+#endif
+
+249 NONE NONE ALL { int nosys(void); }=20
+250 NONE NONE ALL { int minherit(void *addr, size_t len, i=
nt inherit); }=20
+251 NONE NONE ALL { int semsys(u_int which, int a2, int a3=
, int a4, int a5); }=20
+252 NONE NONE ALL { int msgsys(u_int which, int a2, int a3=
, int a4, int a5); }
+253 NONE NONE ALL { int shmsys(u_int which, int a2, int a3=
, int a4); }=20
+254 NONE NONE ALL { int semctl(int semid, int semnum, int =
cmd, semun_t arg); }=20
+255 NONE NONE ALL { int semget(key_t key, int nsems, int s=
emflg); }=20
+256 NONE NONE ALL { int semop(int semid, struct sembuf *so=
ps, int nsops); }=20
+257 NONE NONE ALL { int semconfig(semconfig_ctl_t fla=
g); }=20
+258 NONE NONE ALL { int msgctl(int msqid, int cmd, struct =
msqid_ds *buf); }=20
+259 NONE NONE ALL { int msgget(key_t key, int msgflg); }=20
+260 PRE NONE ALL { int msgsnd(int msqid, void *msgp, size=
_t msgsz, int msgflg); }=20
+261 PRE NONE ALL { user_ssize_t msgrcv(int msqid, void *m=
sgp, size_t msgsz, long msgtyp, int msgflg); }=20
+262 NONE NONE ALL { int shmat(int shmid, void *shmaddr, in=
t shmflg); }=20
+263 NONE NONE ALL { int shmctl(int shmid, int cmd, struct =
shmid_ds *buf); }=20
+264 NONE NONE ALL { int shmdt(void *shmaddr); }=20
+265 NONE NONE ALL { int shmget(key_t key, size_t size, int=
shmflg); }=20
+266 NONE NONE ALL { int shm_open(const char *name, int ofl=
ag, int mode); }=20
+267 NONE NONE ALL { int shm_unlink(const char *name); }=20
+268 NONE NONE ALL { user_addr_t sem_open(const char *name,=
int oflag, int mode, int value); }=20
+269 NONE NONE ALL { int sem_close(sem_t *sem); }=20
+270 NONE NONE ALL { int sem_unlink(const char *name); }=20
+271 PRE NONE ALL { int sem_wait(sem_t *sem); }=20
+272 NONE NONE ALL { int sem_trywait(sem_t *sem); }=20
+273 NONE NONE ALL { int sem_post(sem_t *sem); }=20
+274 NONE NONE ALL { int sem_getvalue(sem_t *sem, int *sval=
); }=20
+275 NONE NONE ALL { int sem_init(sem_t *sem, int phsared, =
u_int value); }=20
+276 NONE NONE ALL { int sem_destroy(sem_t *sem); }=20
+277 NONE NONE ALL { int open_extended(user_addr_t path, in=
t flags, uid_t uid, gid_t gid, int mode, user_addr_t xsecurity); }=20
+278 NONE KERN ALL { int umask_extended(int newmask, user_a=
ddr_t xsecurity); }=20
+279 NONE NONE ALL { int stat_extended(user_addr_t path, us=
er_addr_t ub, user_addr_t xsecurity, user_addr_t xsecurity_size); }=20
+280 NONE NONE ALL { int lstat_extended(user_addr_t path, u=
ser_addr_t ub, user_addr_t xsecurity, user_addr_t xsecurity_size); }=20
+281 NONE NONE ALL { int fstat_extended(int fd, user_addr_t=
ub, user_addr_t xsecurity, user_addr_t xsecurity_size); }=20
+282 NONE NONE ALL { int chmod_extended(user_addr_t path, u=
id_t uid, gid_t gid, int mode, user_addr_t xsecurity); }=20
+283 NONE NONE ALL { int fchmod_extended(int fd, uid_t uid,=
gid_t gid, int mode, user_addr_t xsecurity); }=20
+284 NONE NONE ALL { int access_extended(user_addr_t entrie=
s, size_t size, user_addr_t results, uid_t uid); }=20
+285 NONE NONE ALL { int settid(uid_t uid, gid_t gid); }=20
+286 NONE NONE ALL { int gettid(uid_t *uidp, gid_t *gidp); =
}=20
+287 NONE NONE ALL { int setsgroups(int setlen, user_addr_t=
guidset); }=20
+288 NONE NONE ALL { int getsgroups(user_addr_t setlen, use=
r_addr_t guidset); }=20
+289 NONE NONE ALL { int setwgroups(int setlen, user_addr_t=
guidset); }=20
+290 NONE NONE ALL { int getwgroups(user_addr_t setlen, use=
r_addr_t guidset); }
+291 NONE NONE ALL { int mkfifo_extended(user_addr_t path, =
uid_t uid, gid_t gid, int mode, user_addr_t xsecurity); }=20
+292 NONE NONE ALL { int mkdir_extended(user_addr_t path, u=
id_t uid, gid_t gid, int mode, user_addr_t xsecurity); }=20
+293 NONE NONE ALL { int identitysvc(int opcode, user_addr_=
t message); }=20
+294 NONE NONE ALL { int nosys(void); }=20
+295 NONE NONE ALL { int nosys(void); }=20
+296 NONE KERN UALL { int load_shared_file(char *filename, c=
addr_t mfa, u_long mfs, caddr_t *ba, int map_cnt, sf_mapping_t *mappings,=
int *flags); }=20
+297 NONE KERN UALL { int reset_shared_file(caddr_t *ba, int=
map_cnt, sf_mapping_t *mappings); }=20
+298 NONE KERN ALL { int new_system_shared_regions(void); }=
=20
+299 NONE KERN UALL { int shared_region_map_file_np(int fd, =
uint32_t mappingCount, user_addr_t mappings, user_addr_t slide_p); }=20
+300 NONE KERN UALL { int shared_region_make_private_np(uint=
32_t rangeCount, user_addr_t ranges); }=20
+301 NONE NONE ALL { int nosys(void); }=20
+302 NONE NONE ALL { int nosys(void); }=20
+303 NONE NONE ALL { int nosys(void); }=20
+304 NONE NONE ALL { int nosys(void); }=20
+305 NONE NONE ALL { int nosys(void); }=20
+306 NONE NONE ALL { int nosys(void); }=20
+307 NONE NONE ALL { int nosys(void); }=20
+308 NONE NONE ALL { int nosys(void); }=20
+309 NONE NONE ALL { int nosys(void); }=20
+310 NONE KERN ALL { int getsid(pid_t pid); }=20
+311 NONE NONE ALL { int settid_with_pid(pid_t pid, int ass=
ume); }=20
+312 NONE NONE ALL { int nosys(void); }=20
+313 NONE NONE ALL { int aio_fsync(int op, user_addr_t aioc=
bp); }=20
+314 NONE NONE ALL { user_ssize_t aio_return(user_addr_t ai=
ocbp); }=20
+315 PRE NONE ALL { int aio_suspend(user_addr_t aiocblist,=
int nent, user_addr_t timeoutp); }=20
+316 NONE NONE ALL { int aio_cancel(int fd, user_addr_t aio=
cbp); }=20
+317 NONE NONE ALL { int aio_error(user_addr_t aiocbp); }=20
+318 NONE NONE ALL { int aio_read(user_addr_t aiocbp); }=20
+319 NONE NONE ALL { int aio_write(user_addr_t aiocbp); }=20
+320 NONE NONE ALL { int lio_listio(int mode, user_addr_t a=
iocblist, int nent, user_addr_t sigp); }=20
+321 NONE NONE ALL { int nosys(void); }=20
+322 NONE NONE ALL { int nosys(void); }=20
+323 NONE NONE ALL { int nosys(void); }=20
+324 NONE NONE ALL { int mlockall(int how); }=20
+325 NONE NONE ALL { int munlockall(int how); }=20
+326 NONE NONE ALL { int nosys(void); }=20
+327 NONE KERN ALL { int issetugid(void); }=20
+328 NONE KERN ALL { int __pthread_kill(int thread_port, in=
t sig); }=20
+329 NONE KERN ALL { int pthread_sigmask(int how, user_addr=
_t set, user_addr_t oset); }=20
+330 PRE KERN ALL { int sigwait(user_addr_t set, user_addr=
_t sig); }=20
+331 NONE KERN ALL { int __disable_threadsignal(int value);=
}=20
+332 NONE NONE ALL { int __pthread_markcancel(int thread_po=
rt); }=20
+333 NONE NONE ALL { int __pthread_canceled(int action); }=
=20
+334 POST NONE ALL { int __semwait_signal(int cond_sem, int=
mutex_sem, int timeout, int relative, time_t tv_sec, int32_t tv_nsec); }=
=20
+335 NONE KERN ALL { int utrace(const void *addr, size_t le=
n); }=20
+336 NONE NONE ALL { int nosys(void); }=20
+337 NONE NONE ALL { int nosys(void); }=20
+338 NONE NONE ALL { int nosys(void); }=20
+339 NONE NONE ALL { int nosys(void); }=20
+340 NONE NONE ALL { int nosys(void); }=20
+341 NONE NONE ALL { int nosys(void); }=20
+342 NONE NONE ALL { int nosys(void); }=20
+343 NONE NONE ALL { int nosys(void); }=20
+344 NONE NONE ALL { int nosys(void); }=20
+345 NONE NONE ALL { int nosys(void); }=20
+346 NONE NONE ALL { int nosys(void); }=20
+347 NONE NONE ALL { int nosys(void); }=20
+348 NONE NONE ALL { int nosys(void); }=20
+349 NONE NONE ALL { int nosys(void); }=20
+350 NONE KERN ALL { int audit(void *record, int length); }=
=20
+351 NONE KERN ALL { int auditon(int cmd, void *data, int l=
ength); }=20
+352 NONE KERN ALL { int nosys(void); }=20
+353 NONE KERN ALL { int getauid(au_id_t *auid); }=20
+354 NONE KERN ALL { int setauid(au_id_t *auid); }=20
+355 NONE KERN ALL { int getaudit(struct auditinfo *auditin=
fo); }=20
+356 NONE KERN ALL { int setaudit(struct auditinfo *auditin=
fo); }=20
+357 NONE KERN ALL { int getaudit_addr(struct auditinfo_add=
r *auditinfo_addr, int length); }=20
+358 NONE KERN ALL { int setaudit_addr(struct auditinfo_add=
r *auditinfo_addr, int length); }=20
+359 NONE KERN ALL { int auditctl(char *path); }=20
+360 NONE NONE ALL { int nosys(void); }=20
+361 NONE NONE ALL { int nosys(void); }=20
+362 NONE NONE ALL { int kqueue(void); }=20
+363 NONE NONE ALL { int kevent(int fd, const struct kevent=
*changelist, int nchanges, struct kevent *eventlist, int nevents, const =
struct timespec *timeout); }=20
+364 NONE NONE ALL { int lchown(user_addr_t path, uid_t own=
er, gid_t group); }
+365 NONE NONE ALL { int nosys(void); }=20
+366 NONE NONE ALL { int nosys(void); }=20
+367 NONE NONE ALL { int nosys(void); }=20
+368 NONE NONE ALL { int nosys(void); }=20
+369 NONE NONE ALL { int nosys(void); }=20
|
Author: njn Date: 2005-08-28 05:48:12 +0100 (Sun, 28 Aug 2005) New Revision: 4546 Log: Give file a better name. Added: trunk/Makefile.core.am Removed: trunk/Makefile.core-AM_CPPFLAGS.am Modified: trunk/Makefile.am trunk/auxprogs/Makefile.am trunk/coregrind/Makefile.am trunk/coregrind/m_aspacemgr/Makefile.am trunk/coregrind/m_debuginfo/Makefile.am trunk/coregrind/m_demangle/Makefile.am trunk/coregrind/m_dispatch/Makefile.am trunk/coregrind/m_replacemalloc/Makefile.am trunk/coregrind/m_scheduler/Makefile.am trunk/coregrind/m_sigframe/Makefile.am trunk/coregrind/m_syswrap/Makefile.am Modified: trunk/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/Makefile.am 2005-08-28 04:38:12 UTC (rev 4545) +++ trunk/Makefile.am 2005-08-28 04:48:12 UTC (rev 4546) @@ -47,7 +47,7 @@ README_PACKAGERS \ README_MISSING_SYSCALL_OR_IOCTL \ valgrind.spec.in valgrind.pc.in \ - Makefile.all.am Makefile.tool.am Makefile.core-AM_CPPFLAGS.am \ + Makefile.all.am Makefile.tool.am Makefile.core.am \ Makefile.tool-inplace.am \ $(VEX_PRIMARY_SOURCES) =20 Deleted: trunk/Makefile.core-AM_CPPFLAGS.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/Makefile.core-AM_CPPFLAGS.am 2005-08-28 04:38:12 UTC (rev 4545) +++ trunk/Makefile.core-AM_CPPFLAGS.am 2005-08-28 04:48:12 UTC (rev 4546) @@ -1,19 +0,0 @@ -add_includes =3D -I$(top_srcdir)/coregrind \ - -I$(top_srcdir) \ - -I$(top_srcdir)/coregrind/$(VG_ARCH) \ - -I$(top_srcdir)/coregrind/$(VG_OS) \ - -I$(top_srcdir)/coregrind/$(VG_PLATFORM) \ - -I$(top_srcdir)/include \ - -I@VEX_DIR@/pub \ - -DVGA_$(VG_ARCH)=3D1 \ - -DVGO_$(VG_OS)=3D1 \ - -DVGP_$(VG_ARCH)_$(VG_OS)=3D1 - -BASE_AM_CFLAGS =3D @ARCH_CORE_AM_CFLAGS@ -Wmissing-prototypes -Winline -= Wall -Wshadow -O -g - -PIC_AM_CFLAGS =3D $(BASE_AM_CFLAGS) -fpic -fno-omit-frame-pointer - -AM_CPPFLAGS =3D $(add_includes) -AM_CFLAGS =3D $(WERROR) @PIE_AM_CFLAGS@ $(BASE_AM_CFLAGS) -AM_CCASFLAGS =3D $(add_includes) @ARCH_CORE_AM_CCASFLAGS@ -Wa,-gstabs - Copied: trunk/Makefile.core.am (from rev 4528, trunk/Makefile.core-AM_CPP= FLAGS.am) Modified: trunk/auxprogs/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/auxprogs/Makefile.am 2005-08-28 04:38:12 UTC (rev 4545) +++ trunk/auxprogs/Makefile.am 2005-08-28 04:48:12 UTC (rev 4546) @@ -1,5 +1,5 @@ include $(top_srcdir)/Makefile.all.am -include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am +include $(top_srcdir)/Makefile.core.am =20 bin_PROGRAMS =3D valgrind-listener =20 Modified: trunk/coregrind/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/Makefile.am 2005-08-28 04:38:12 UTC (rev 4545) +++ trunk/coregrind/Makefile.am 2005-08-28 04:48:12 UTC (rev 4546) @@ -1,5 +1,5 @@ include $(top_srcdir)/Makefile.all.am -include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am +include $(top_srcdir)/Makefile.core.am =20 .PHONY: @VEX_DIR@/libvex.a =20 Modified: trunk/coregrind/m_aspacemgr/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_aspacemgr/Makefile.am 2005-08-28 04:38:12 UTC (rev = 4545) +++ trunk/coregrind/m_aspacemgr/Makefile.am 2005-08-28 04:48:12 UTC (rev = 4546) @@ -1,5 +1,5 @@ include $(top_srcdir)/Makefile.all.am -include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am +include $(top_srcdir)/Makefile.core.am =20 noinst_LIBRARIES =3D libaspacemgr.a =20 Modified: trunk/coregrind/m_debuginfo/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_debuginfo/Makefile.am 2005-08-28 04:38:12 UTC (rev = 4545) +++ trunk/coregrind/m_debuginfo/Makefile.am 2005-08-28 04:48:12 UTC (rev = 4546) @@ -1,5 +1,5 @@ include $(top_srcdir)/Makefile.all.am -include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am +include $(top_srcdir)/Makefile.core.am =20 noinst_HEADERS =3D \ priv_symtab.h \ Modified: trunk/coregrind/m_demangle/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_demangle/Makefile.am 2005-08-28 04:38:12 UTC (rev 4= 545) +++ trunk/coregrind/m_demangle/Makefile.am 2005-08-28 04:48:12 UTC (rev 4= 546) @@ -1,5 +1,5 @@ include $(top_srcdir)/Makefile.all.am -include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am +include $(top_srcdir)/Makefile.core.am =20 noinst_HEADERS =3D \ ansidecl.h \ Modified: trunk/coregrind/m_dispatch/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_dispatch/Makefile.am 2005-08-28 04:38:12 UTC (rev 4= 545) +++ trunk/coregrind/m_dispatch/Makefile.am 2005-08-28 04:48:12 UTC (rev 4= 546) @@ -1,5 +1,5 @@ include $(top_srcdir)/Makefile.all.am -include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am +include $(top_srcdir)/Makefile.core.am =20 noinst_LIBRARIES =3D libdispatch.a =20 Modified: trunk/coregrind/m_replacemalloc/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_replacemalloc/Makefile.am 2005-08-28 04:38:12 UTC (= rev 4545) +++ trunk/coregrind/m_replacemalloc/Makefile.am 2005-08-28 04:48:12 UTC (= rev 4546) @@ -1,5 +1,5 @@ include $(top_srcdir)/Makefile.all.am -include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am +include $(top_srcdir)/Makefile.core.am =20 noinst_LIBRARIES =3D \ libreplacemalloc_core.a \ Modified: trunk/coregrind/m_scheduler/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_scheduler/Makefile.am 2005-08-28 04:38:12 UTC (rev = 4545) +++ trunk/coregrind/m_scheduler/Makefile.am 2005-08-28 04:48:12 UTC (rev = 4546) @@ -1,5 +1,5 @@ include $(top_srcdir)/Makefile.all.am -include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am +include $(top_srcdir)/Makefile.core.am =20 noinst_HEADERS =3D \ priv_sema.h Modified: trunk/coregrind/m_sigframe/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_sigframe/Makefile.am 2005-08-28 04:38:12 UTC (rev 4= 545) +++ trunk/coregrind/m_sigframe/Makefile.am 2005-08-28 04:48:12 UTC (rev 4= 546) @@ -1,5 +1,5 @@ include $(top_srcdir)/Makefile.all.am -include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am +include $(top_srcdir)/Makefile.core.am =20 # Remember to include all the platform-specific files in the distributio= n. EXTRA_DIST =3D \ Modified: trunk/coregrind/m_syswrap/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/m_syswrap/Makefile.am 2005-08-28 04:38:12 UTC (rev 45= 45) +++ trunk/coregrind/m_syswrap/Makefile.am 2005-08-28 04:48:12 UTC (rev 45= 46) @@ -1,5 +1,5 @@ include $(top_srcdir)/Makefile.all.am -include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am +include $(top_srcdir)/Makefile.core.am =20 # Remember to include all the OS/platform-specific files in the distribu= tion. EXTRA_DIST =3D \ |
|
From: <sv...@va...> - 2005-08-28 04:38:20
|
Author: njn
Date: 2005-08-28 05:38:12 +0100 (Sun, 28 Aug 2005)
New Revision: 4545
Log:
Move the core dumping code out of m_signals to a new module,
m_coredump. The code is still commented out, though.
Added:
trunk/coregrind/m_coredump.c
trunk/coregrind/pub_core_coredump.h
Modified:
trunk/coregrind/Makefile.am
trunk/coregrind/m_signals.c
Modified: trunk/coregrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/Makefile.am 2005-08-27 19:35:42 UTC (rev 4544)
+++ trunk/coregrind/Makefile.am 2005-08-28 04:38:12 UTC (rev 4545)
@@ -36,6 +36,7 @@
coregrind.h \
pub_core_aspacemgr.h \
pub_core_basics.h \
+ pub_core_coredump.h \
pub_core_cpuid.h \
pub_core_debuginfo.h \
pub_core_debugger.h \
@@ -95,6 +96,7 @@
valgrind_LDADD=3D
=20
stage2_SOURCES =3D \
+ m_coredump.c \
m_cpuid.S \
m_debugger.c \
m_debuglog.c \
Added: trunk/coregrind/m_coredump.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_coredump.c 2005-08-27 19:35:42 UTC (rev 4544)
+++ trunk/coregrind/m_coredump.c 2005-08-28 04:38:12 UTC (rev 4545)
@@ -0,0 +1,376 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Dumping core. m_coredump.c ---*/
+/*--------------------------------------------------------------------*/
+=20
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward=20
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "pub_core_basics.h"
+#include "pub_core_coredump.h"
+#include "pub_core_libcassert.h"
+
+// Core dumping is disabled until someone can work out how to abstract o=
ut
+// the arch-specific and word-size-specific parts neatly.
+//
+// Note that the code below is not 64-bit clean!
+//
+#if 0
+/*
+ Dump core
+ =20
+ Generate a standard ELF core file corresponding to the client state
+ at the time of a crash.
+ */
+#include <elf.h>
+#ifndef NT_PRXFPREG
+#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/el=
f/common.h */
+#endif /* NT_PRXFPREG */
+
+/* If true, then this Segment may be mentioned in the core */
+static Bool may_dump(const Segment *seg)
+{
+ return (seg->flags & (SF_DEVICE|SF_VALGRIND)) =3D=3D 0 && VG_(is_clie=
nt_addr)(seg->addr);
+}
+
+/* If true, then this Segment's contents will be in the core */
+static Bool should_dump(const Segment *seg)
+{
+ return may_dump(seg); // && (seg->prot & VKI_PROT_WRITE);
+}
+
+static void fill_ehdr(Elf32_Ehdr *ehdr, Int num_phdrs)
+{
+ VG_(memset)(ehdr, 0, sizeof(*ehdr));
+
+ VG_(memcpy)(ehdr->e_ident, ELFMAG, SELFMAG);
+ ehdr->e_ident[EI_CLASS] =3D VG_ELF_CLASS;
+ ehdr->e_ident[EI_DATA] =3D VG_ELF_ENDIANNESS;
+ ehdr->e_ident[EI_VERSION] =3D EV_CURRENT;
+
+ ehdr->e_type =3D ET_CORE;
+ ehdr->e_machine =3D VG_ELF_MACHINE;
+ ehdr->e_version =3D EV_CURRENT;
+ ehdr->e_entry =3D 0;
+ ehdr->e_phoff =3D sizeof(Elf32_Ehdr);
+ ehdr->e_shoff =3D 0;
+ ehdr->e_flags =3D 0;
+ ehdr->e_ehsize =3D sizeof(Elf32_Ehdr);
+ ehdr->e_phentsize =3D sizeof(Elf32_Phdr);
+ ehdr->e_phnum =3D num_phdrs;
+ ehdr->e_shentsize =3D 0;
+ ehdr->e_shnum =3D 0;
+ ehdr->e_shstrndx =3D 0;
+
+}
+
+static void fill_phdr(Elf32_Phdr *phdr, const Segment *seg, UInt off, Bo=
ol write)
+{
+ write =3D write && should_dump(seg);
+
+ VG_(memset)(phdr, 0, sizeof(*phdr));
+
+ phdr->p_type =3D PT_LOAD;
+ phdr->p_offset =3D off;
+ phdr->p_vaddr =3D seg->addr;
+ phdr->p_paddr =3D 0;
+ phdr->p_filesz =3D write ? seg->len : 0;
+ phdr->p_memsz =3D seg->len;
+ phdr->p_flags =3D 0;
+
+ if (seg->prot & VKI_PROT_READ)
+ phdr->p_flags |=3D PF_R;
+ if (seg->prot & VKI_PROT_WRITE)
+ phdr->p_flags |=3D PF_W;
+ if (seg->prot & VKI_PROT_EXEC)
+ phdr->p_flags |=3D PF_X;
+
+ phdr->p_align =3D VKI_PAGE_SIZE;
+}
+
+struct note {
+ struct note *next;
+ Elf32_Nhdr note;
+ Char name[0];
+};
+
+static UInt note_size(const struct note *n)
+{
+ return sizeof(Elf32_Nhdr) + VG_ROUNDUP(VG_(strlen)(n->name)+1, 4) + V=
G_ROUNDUP(n->note.n_descsz, 4);
+}
+
+static void add_note(struct note **list, const Char *name, UInt type, co=
nst void *data, UInt datasz)
+{
+ Int namelen =3D VG_(strlen)(name)+1;
+ Int notelen =3D sizeof(struct note) +=20
+ VG_ROUNDUP(namelen, 4) +=20
+ VG_ROUNDUP(datasz, 4);
+ struct note *n =3D VG_(arena_malloc)(VG_AR_CORE, notelen);
+
+ VG_(memset)(n, 0, notelen);
+
+ n->next =3D *list;
+ *list =3D n;
+
+ n->note.n_type =3D type;
+ n->note.n_namesz =3D namelen;
+ n->note.n_descsz =3D datasz;
+
+ VG_(memcpy)(n->name, name, namelen);
+ VG_(memcpy)(n->name+VG_ROUNDUP(namelen,4), data, datasz);
+}
+
+static void write_note(Int fd, const struct note *n)
+{
+ VG_(write)(fd, &n->note, note_size(n));
+}
+
+static void fill_prpsinfo(const ThreadState *tst, struct vki_elf_prpsinf=
o *prpsinfo)
+{
+ static Char name[VKI_PATH_MAX];
+ Bool res;
+
+ VG_(memset)(prpsinfo, 0, sizeof(*prpsinfo));
+
+ switch(tst->status) {
+ case VgTs_Runnable:
+ case VgTs_Yielding:
+ prpsinfo->pr_sname =3D 'R';
+ break;
+
+ case VgTs_WaitSys:
+ prpsinfo->pr_sname =3D 'S';
+ break;
+
+ case VgTs_Zombie:
+ prpsinfo->pr_sname =3D 'Z';
+ break;
+
+ case VgTs_Empty:
+ case VgTs_Init:
+ prpsinfo->pr_sname =3D '?';
+ break;
+ }
+
+ prpsinfo->pr_uid =3D 0;
+ prpsinfo->pr_gid =3D 0;
+ =20
+ if (VG_(resolve_filename)(VG_(clexecfd), name, VKI_PATH_MAX)) {
+ Char *n =3D name+VG_(strlen)(name)-1;
+
+ while (n > name && *n !=3D '/')
+ n--;
+ if (n !=3D name)
+ n++;
+
+ VG_(strncpy)(prpsinfo->pr_fname, n, sizeof(prpsinfo->pr_fname));
+ }
+}
+
+static void fill_prstatus(const ThreadState *tst,=20
+ struct vki_elf_prstatus *prs,=20
+ const vki_siginfo_t *si)
+{
+ struct vki_user_regs_struct *regs;
+
+ VG_(memset)(prs, 0, sizeof(*prs));
+
+ prs->pr_info.si_signo =3D si->si_signo;
+ prs->pr_info.si_code =3D si->si_code;
+ prs->pr_info.si_errno =3D 0;
+
+ prs->pr_cursig =3D si->si_signo;
+
+ prs->pr_pid =3D tst->os_state.lwpid;
+ prs->pr_ppid =3D 0;
+ prs->pr_pgrp =3D VG_(getpgrp)();
+ prs->pr_sid =3D VG_(getpgrp)();
+ =20
+ regs =3D (struct vki_user_regs_struct *)prs->pr_reg;
+
+ vg_assert(sizeof(*regs) =3D=3D sizeof(prs->pr_reg));
+
+ VG_(fill_elfregs_from_tst)(regs, &tst->arch);
+}
+
+static void fill_fpu(const ThreadState *tst, vki_elf_fpregset_t *fpu)
+{
+ VG_(fill_elffpregs_from_tst)(fpu, &tst->arch);
+}
+
+static void fill_xfpu(const ThreadState *tst, vki_elf_fpxregset_t *xfpu)
+{
+ VG_(fill_elffpxregs_from_tst)(xfpu, &tst->arch);
+}
+
+void VG_(make_coredump)(ThreadId tid, const vki_siginfo_t *si, UInt max_=
size)
+{
+ Char buf[1000];
+ Char *basename =3D "vgcore";
+ Char *coreext =3D "";
+ Int seq =3D 0;
+ Int core_fd;
+ Segment *seg;
+ Elf32_Ehdr ehdr;
+ Elf32_Phdr *phdrs;
+ Int num_phdrs;
+ Int i, idx;
+ UInt off;
+ struct note *notelist, *note;
+ UInt notesz;
+ struct vki_elf_prpsinfo prpsinfo;
+ struct vki_elf_prstatus prstatus;
+
+ if (VG_(clo_log_name) !=3D NULL) {
+ coreext =3D ".core";
+ basename =3D VG_(clo_log_name);
+ }
+
+ for(;;) {
+ if (seq =3D=3D 0)
+ VG_(sprintf)(buf, "%s%s.pid%d",
+ basename, coreext, VG_(getpid)());
+ else
+ VG_(sprintf)(buf, "%s%s.pid%d.%d",
+ basename, coreext, VG_(getpid)(), seq);
+ seq++;
+
+ core_fd =3D VG_(open)(buf, =20
+ VKI_O_CREAT|VKI_O_WRONLY|VKI_O_EXCL|VKI_O_TRUNC,=20
+ VKI_S_IRUSR|VKI_S_IWUSR);
+ if (core_fd >=3D 0)
+ break;
+
+ if (core_fd !=3D -VKI_EEXIST)
+ return; /* can't create file */
+ }
+
+ /* First, count how many memory segments to dump */
+ num_phdrs =3D 1; /* start with notes */
+ for(seg =3D VG_(first_segment)();
+ seg !=3D NULL;
+ seg =3D VG_(next_segment)(seg)) {
+ if (!may_dump(seg))
+ continue;
+
+ num_phdrs++;
+ }
+
+ fill_ehdr(&ehdr, num_phdrs);
+
+ notelist =3D NULL;
+
+ /* Second, work out their layout */
+ phdrs =3D VG_(arena_malloc)(VG_AR_CORE, sizeof(*phdrs) * num_phdrs);
+
+ for(i =3D 1; i < VG_N_THREADS; i++) {
+ vki_elf_fpregset_t fpu;
+ vki_elf_fpxregset_t xfpu;
+
+ if (VG_(threads)[i].status =3D=3D VgTs_Empty)
+ continue;
+
+ fill_xfpu(&VG_(threads)[i], &xfpu);
+ add_note(¬elist, "LINUX", NT_PRXFPREG, &xfpu, sizeof(xfpu));
+
+ fill_fpu(&VG_(threads)[i], &fpu);
+ add_note(¬elist, "CORE", NT_FPREGSET, &fpu, sizeof(fpu));
+
+ fill_prstatus(&VG_(threads)[i], &prstatus, si);
+ add_note(¬elist, "CORE", NT_PRSTATUS, &prstatus, sizeof(prstatu=
s));
+ }
+
+ fill_prpsinfo(&VG_(threads)[tid], &prpsinfo);
+ add_note(¬elist, "CORE", NT_PRPSINFO, &prpsinfo, sizeof(prpsinfo))=
;
+
+ for(note =3D notelist, notesz =3D 0; note !=3D NULL; note =3D note->n=
ext)
+ notesz +=3D note_size(note);
+
+ off =3D sizeof(ehdr) + sizeof(*phdrs) * num_phdrs;
+
+ phdrs[0].p_type =3D PT_NOTE;
+ phdrs[0].p_offset =3D off;
+ phdrs[0].p_vaddr =3D 0;
+ phdrs[0].p_paddr =3D 0;
+ phdrs[0].p_filesz =3D notesz;
+ phdrs[0].p_memsz =3D 0;
+ phdrs[0].p_flags =3D 0;
+ phdrs[0].p_align =3D 0;
+
+ off +=3D notesz;
+
+ off =3D VG_PGROUNDUP(off);
+
+ for(seg =3D VG_(first_segment)(), idx =3D 1;
+ seg !=3D NULL;
+ seg =3D VG_(next_segment)(seg)) {
+ if (!may_dump(seg))
+ continue;
+
+ fill_phdr(&phdrs[idx], seg, off, (seg->len + off) < max_size);
+ =20
+ off +=3D phdrs[idx].p_filesz;
+
+ idx++;
+ }
+
+ /* write everything out */
+ VG_(write)(core_fd, &ehdr, sizeof(ehdr));
+ VG_(write)(core_fd, phdrs, sizeof(*phdrs) * num_phdrs);
+
+ for(note =3D notelist; note !=3D NULL; note =3D note->next)
+ write_note(core_fd, note);
+ =20
+ VG_(lseek)(core_fd, phdrs[1].p_offset, VKI_SEEK_SET);
+
+ for(seg =3D VG_(first_segment)(), idx =3D 1;
+ seg !=3D NULL;
+ seg =3D VG_(next_segment)(seg)) {
+ if (!should_dump(seg))
+ continue;
+
+ if (phdrs[idx].p_filesz > 0) {
+ Int ret;
+
+ vg_assert(VG_(lseek)(core_fd, phdrs[idx].p_offset, VKI_SEEK_SET) =3D=3D=
phdrs[idx].p_offset);
+ vg_assert(seg->len >=3D phdrs[idx].p_filesz);
+
+ ret =3D VG_(write)(core_fd, (void *)seg->addr, phdrs[idx].p_filesz);
+ }
+ idx++;
+ }
+
+ VG_(close)(core_fd);
+}
+#endif
+
+void VG_(make_coredump)(ThreadId tid, const vki_siginfo_t *si, UInt max_=
size)
+{
+ I_die_here;
+}
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_signals.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_signals.c 2005-08-27 19:35:42 UTC (rev 4544)
+++ trunk/coregrind/m_signals.c 2005-08-28 04:38:12 UTC (rev 4545)
@@ -81,6 +81,7 @@
=20
#include "pub_core_basics.h"
#include "pub_core_threadstate.h"
+#include "pub_core_coredump.h"
#include "pub_core_debuginfo.h" // Needed for pub_core_aspacemgr :(
#include "pub_core_aspacemgr.h"
#include "pub_core_debugger.h" // For VG_(start_debugger)
@@ -908,340 +909,6 @@
VG_(sigprocmask)(VKI_SIG_SETMASK, &origmask, NULL);
}
=20
-// Core dumping is disabled until someone can work out how to abstract o=
ut
-// the arch-specific and word-size-specific parts neatly.
-//
-// Note that the code below is not 64-bit clean!
-//
-#if 0
-/*
- Dump core
- =20
- Generate a standard ELF core file corresponding to the client state
- at the time of a crash.
- */
-#include <elf.h>
-#ifndef NT_PRXFPREG
-#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/el=
f/common.h */
-#endif /* NT_PRXFPREG */
-
-/* If true, then this Segment may be mentioned in the core */
-static Bool may_dump(const Segment *seg)
-{
- return (seg->flags & (SF_DEVICE|SF_VALGRIND)) =3D=3D 0 && VG_(is_clie=
nt_addr)(seg->addr);
-}
-
-/* If true, then this Segment's contents will be in the core */
-static Bool should_dump(const Segment *seg)
-{
- return may_dump(seg); // && (seg->prot & VKI_PROT_WRITE);
-}
-
-static void fill_ehdr(Elf32_Ehdr *ehdr, Int num_phdrs)
-{
- VG_(memset)(ehdr, 0, sizeof(*ehdr));
-
- VG_(memcpy)(ehdr->e_ident, ELFMAG, SELFMAG);
- ehdr->e_ident[EI_CLASS] =3D VG_ELF_CLASS;
- ehdr->e_ident[EI_DATA] =3D VG_ELF_ENDIANNESS;
- ehdr->e_ident[EI_VERSION] =3D EV_CURRENT;
-
- ehdr->e_type =3D ET_CORE;
- ehdr->e_machine =3D VG_ELF_MACHINE;
- ehdr->e_version =3D EV_CURRENT;
- ehdr->e_entry =3D 0;
- ehdr->e_phoff =3D sizeof(Elf32_Ehdr);
- ehdr->e_shoff =3D 0;
- ehdr->e_flags =3D 0;
- ehdr->e_ehsize =3D sizeof(Elf32_Ehdr);
- ehdr->e_phentsize =3D sizeof(Elf32_Phdr);
- ehdr->e_phnum =3D num_phdrs;
- ehdr->e_shentsize =3D 0;
- ehdr->e_shnum =3D 0;
- ehdr->e_shstrndx =3D 0;
-
-}
-
-static void fill_phdr(Elf32_Phdr *phdr, const Segment *seg, UInt off, Bo=
ol write)
-{
- write =3D write && should_dump(seg);
-
- VG_(memset)(phdr, 0, sizeof(*phdr));
-
- phdr->p_type =3D PT_LOAD;
- phdr->p_offset =3D off;
- phdr->p_vaddr =3D seg->addr;
- phdr->p_paddr =3D 0;
- phdr->p_filesz =3D write ? seg->len : 0;
- phdr->p_memsz =3D seg->len;
- phdr->p_flags =3D 0;
-
- if (seg->prot & VKI_PROT_READ)
- phdr->p_flags |=3D PF_R;
- if (seg->prot & VKI_PROT_WRITE)
- phdr->p_flags |=3D PF_W;
- if (seg->prot & VKI_PROT_EXEC)
- phdr->p_flags |=3D PF_X;
-
- phdr->p_align =3D VKI_PAGE_SIZE;
-}
-
-struct note {
- struct note *next;
- Elf32_Nhdr note;
- Char name[0];
-};
-
-static UInt note_size(const struct note *n)
-{
- return sizeof(Elf32_Nhdr) + VG_ROUNDUP(VG_(strlen)(n->name)+1, 4) + V=
G_ROUNDUP(n->note.n_descsz, 4);
-}
-
-static void add_note(struct note **list, const Char *name, UInt type, co=
nst void *data, UInt datasz)
-{
- Int namelen =3D VG_(strlen)(name)+1;
- Int notelen =3D sizeof(struct note) +=20
- VG_ROUNDUP(namelen, 4) +=20
- VG_ROUNDUP(datasz, 4);
- struct note *n =3D VG_(arena_malloc)(VG_AR_CORE, notelen);
-
- VG_(memset)(n, 0, notelen);
-
- n->next =3D *list;
- *list =3D n;
-
- n->note.n_type =3D type;
- n->note.n_namesz =3D namelen;
- n->note.n_descsz =3D datasz;
-
- VG_(memcpy)(n->name, name, namelen);
- VG_(memcpy)(n->name+VG_ROUNDUP(namelen,4), data, datasz);
-}
-
-static void write_note(Int fd, const struct note *n)
-{
- VG_(write)(fd, &n->note, note_size(n));
-}
-
-static void fill_prpsinfo(const ThreadState *tst, struct vki_elf_prpsinf=
o *prpsinfo)
-{
- static Char name[VKI_PATH_MAX];
- Bool res;
-
- VG_(memset)(prpsinfo, 0, sizeof(*prpsinfo));
-
- switch(tst->status) {
- case VgTs_Runnable:
- case VgTs_Yielding:
- prpsinfo->pr_sname =3D 'R';
- break;
-
- case VgTs_WaitSys:
- prpsinfo->pr_sname =3D 'S';
- break;
-
- case VgTs_Zombie:
- prpsinfo->pr_sname =3D 'Z';
- break;
-
- case VgTs_Empty:
- case VgTs_Init:
- prpsinfo->pr_sname =3D '?';
- break;
- }
-
- prpsinfo->pr_uid =3D 0;
- prpsinfo->pr_gid =3D 0;
- =20
- if (VG_(resolve_filename)(VG_(clexecfd), name, VKI_PATH_MAX)) {
- Char *n =3D name+VG_(strlen)(name)-1;
-
- while (n > name && *n !=3D '/')
- n--;
- if (n !=3D name)
- n++;
-
- VG_(strncpy)(prpsinfo->pr_fname, n, sizeof(prpsinfo->pr_fname));
- }
-}
-
-static void fill_prstatus(const ThreadState *tst,=20
- struct vki_elf_prstatus *prs,=20
- const vki_siginfo_t *si)
-{
- struct vki_user_regs_struct *regs;
-
- VG_(memset)(prs, 0, sizeof(*prs));
-
- prs->pr_info.si_signo =3D si->si_signo;
- prs->pr_info.si_code =3D si->si_code;
- prs->pr_info.si_errno =3D 0;
-
- prs->pr_cursig =3D si->si_signo;
-
- prs->pr_pid =3D tst->os_state.lwpid;
- prs->pr_ppid =3D 0;
- prs->pr_pgrp =3D VG_(getpgrp)();
- prs->pr_sid =3D VG_(getpgrp)();
- =20
- regs =3D (struct vki_user_regs_struct *)prs->pr_reg;
-
- vg_assert(sizeof(*regs) =3D=3D sizeof(prs->pr_reg));
-
- VG_(fill_elfregs_from_tst)(regs, &tst->arch);
-}
-
-static void fill_fpu(const ThreadState *tst, vki_elf_fpregset_t *fpu)
-{
- VG_(fill_elffpregs_from_tst)(fpu, &tst->arch);
-}
-
-static void fill_xfpu(const ThreadState *tst, vki_elf_fpxregset_t *xfpu)
-{
- VG_(fill_elffpxregs_from_tst)(xfpu, &tst->arch);
-}
-
-static void make_coredump(ThreadId tid, const vki_siginfo_t *si, UInt ma=
x_size)
-{
- Char buf[1000];
- Char *basename =3D "vgcore";
- Char *coreext =3D "";
- Int seq =3D 0;
- Int core_fd;
- Segment *seg;
- Elf32_Ehdr ehdr;
- Elf32_Phdr *phdrs;
- Int num_phdrs;
- Int i, idx;
- UInt off;
- struct note *notelist, *note;
- UInt notesz;
- struct vki_elf_prpsinfo prpsinfo;
- struct vki_elf_prstatus prstatus;
-
- if (VG_(clo_log_name) !=3D NULL) {
- coreext =3D ".core";
- basename =3D VG_(clo_log_name);
- }
-
- for(;;) {
- if (seq =3D=3D 0)
- VG_(sprintf)(buf, "%s%s.pid%d",
- basename, coreext, VG_(getpid)());
- else
- VG_(sprintf)(buf, "%s%s.pid%d.%d",
- basename, coreext, VG_(getpid)(), seq);
- seq++;
-
- core_fd =3D VG_(open)(buf, =20
- VKI_O_CREAT|VKI_O_WRONLY|VKI_O_EXCL|VKI_O_TRUNC,=20
- VKI_S_IRUSR|VKI_S_IWUSR);
- if (core_fd >=3D 0)
- break;
-
- if (core_fd !=3D -VKI_EEXIST)
- return; /* can't create file */
- }
-
- /* First, count how many memory segments to dump */
- num_phdrs =3D 1; /* start with notes */
- for(seg =3D VG_(first_segment)();
- seg !=3D NULL;
- seg =3D VG_(next_segment)(seg)) {
- if (!may_dump(seg))
- continue;
-
- num_phdrs++;
- }
-
- fill_ehdr(&ehdr, num_phdrs);
-
- notelist =3D NULL;
-
- /* Second, work out their layout */
- phdrs =3D VG_(arena_malloc)(VG_AR_CORE, sizeof(*phdrs) * num_phdrs);
-
- for(i =3D 1; i < VG_N_THREADS; i++) {
- vki_elf_fpregset_t fpu;
- vki_elf_fpxregset_t xfpu;
-
- if (VG_(threads)[i].status =3D=3D VgTs_Empty)
- continue;
-
- fill_xfpu(&VG_(threads)[i], &xfpu);
- add_note(¬elist, "LINUX", NT_PRXFPREG, &xfpu, sizeof(xfpu));
-
- fill_fpu(&VG_(threads)[i], &fpu);
- add_note(¬elist, "CORE", NT_FPREGSET, &fpu, sizeof(fpu));
-
- fill_prstatus(&VG_(threads)[i], &prstatus, si);
- add_note(¬elist, "CORE", NT_PRSTATUS, &prstatus, sizeof(prstatu=
s));
- }
-
- fill_prpsinfo(&VG_(threads)[tid], &prpsinfo);
- add_note(¬elist, "CORE", NT_PRPSINFO, &prpsinfo, sizeof(prpsinfo))=
;
-
- for(note =3D notelist, notesz =3D 0; note !=3D NULL; note =3D note->n=
ext)
- notesz +=3D note_size(note);
-
- off =3D sizeof(ehdr) + sizeof(*phdrs) * num_phdrs;
-
- phdrs[0].p_type =3D PT_NOTE;
- phdrs[0].p_offset =3D off;
- phdrs[0].p_vaddr =3D 0;
- phdrs[0].p_paddr =3D 0;
- phdrs[0].p_filesz =3D notesz;
- phdrs[0].p_memsz =3D 0;
- phdrs[0].p_flags =3D 0;
- phdrs[0].p_align =3D 0;
-
- off +=3D notesz;
-
- off =3D VG_PGROUNDUP(off);
-
- for(seg =3D VG_(first_segment)(), idx =3D 1;
- seg !=3D NULL;
- seg =3D VG_(next_segment)(seg)) {
- if (!may_dump(seg))
- continue;
-
- fill_phdr(&phdrs[idx], seg, off, (seg->len + off) < max_size);
- =20
- off +=3D phdrs[idx].p_filesz;
-
- idx++;
- }
-
- /* write everything out */
- VG_(write)(core_fd, &ehdr, sizeof(ehdr));
- VG_(write)(core_fd, phdrs, sizeof(*phdrs) * num_phdrs);
-
- for(note =3D notelist; note !=3D NULL; note =3D note->next)
- write_note(core_fd, note);
- =20
- VG_(lseek)(core_fd, phdrs[1].p_offset, VKI_SEEK_SET);
-
- for(seg =3D VG_(first_segment)(), idx =3D 1;
- seg !=3D NULL;
- seg =3D VG_(next_segment)(seg)) {
- if (!should_dump(seg))
- continue;
-
- if (phdrs[idx].p_filesz > 0) {
- Int ret;
-
- vg_assert(VG_(lseek)(core_fd, phdrs[idx].p_offset, VKI_SEEK_SET) =3D=3D=
phdrs[idx].p_offset);
- vg_assert(seg->len >=3D phdrs[idx].p_filesz);
-
- ret =3D VG_(write)(core_fd, (void *)seg->addr, phdrs[idx].p_filesz);
- }
- idx++;
- }
-
- VG_(close)(core_fd);
-}
-#endif
-
/*=20
Perform the default action of a signal. If the signal is fatal, it
marks all threads as needing to exit, but it doesn't actually kill
@@ -1401,7 +1068,7 @@
if (core) {
const static struct vki_rlimit zero =3D { 0, 0 };
=20
- make_coredump(tid, info, corelim.rlim_cur);
+ VG_(make_coredump)(tid, info, corelim.rlim_cur);
=20
/* Make sure we don't get a confusing kernel-generated
coredump when we finally exit */
Added: trunk/coregrind/pub_core_coredump.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_coredump.h 2005-08-27 19:35:42 UTC (rev 4544=
)
+++ trunk/coregrind/pub_core_coredump.h 2005-08-28 04:38:12 UTC (rev 4545=
)
@@ -0,0 +1,45 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Dumping core. pub_core_coredump.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_COREDUMP_H
+#define __PUB_CORE_COREDUMP_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module produces a core dump when asked.
+//--------------------------------------------------------------------
+
+extern void VG_(make_coredump) ( ThreadId tid, const vki_siginfo_t *si,
+ UInt max_size );
+
+#endif // __PUB_CORE_COREDUMP_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
|
|
From: <js...@ac...> - 2005-08-28 02:56:46
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-08-28 03:30:00 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 185 tests, 2 stderr failures, 0 stdout failures ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: <js...@ac...> - 2005-08-28 02:45:01
|
Nightly build on g5 ( YDL 4.0, ppc970 ) started at 2005-08-28 04:40:00 CEST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 158 tests, 17 stderr failures, 1 stdout failure ================= memcheck/tests/badjump (stderr) memcheck/tests/badjump2 (stderr) memcheck/tests/fprw (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/supp1 (stderr) memcheck/tests/supp_unknown (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) cachegrind/tests/chdir (stderr) cachegrind/tests/dlclose (stdout) cachegrind/tests/dlclose (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/fdleak_ipv4 (stderr) |
|
From: Tom H. <to...@co...> - 2005-08-28 02:41:00
|
Nightly build on dunsmere ( athlon, Fedora Core 4 ) started at 2005-08-28 03:30:03 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 187 tests, 5 stderr failures, 0 stdout failures ================= memcheck/tests/leak-tree (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-08-28 02:28:17
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-08-28 03:15:03 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 186 tests, 14 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |