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
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
(20) |
2
(19) |
3
(7) |
|
4
(13) |
5
(24) |
6
(9) |
7
(12) |
8
(8) |
9
(34) |
10
(28) |
|
11
(20) |
12
(23) |
13
(12) |
14
(10) |
15
(15) |
16
(24) |
17
(26) |
|
18
(17) |
19
(14) |
20
(14) |
21
(8) |
22
(12) |
23
(22) |
24
(10) |
|
25
(21) |
26
(21) |
27
(18) |
28
(8) |
29
(13) |
30
(15) |
|
|
From: Jeroen N. W. [Bahco] <jn...@xs...> - 2007-11-24 05:29:03
|
On Fri, 23 Nov 2007, Nicholas Nethercote wrote: > > On Fri, 23 Nov 2007, Gregor Jasny wrote: > >> I've got an idea for a MMX checker tool. First some background: >> When you use MMX/SSE instructions on the x86 platform you have to reset >> the FPU stack with the 'emms' instruction after calculations finished. >> Otherwise the following floating point instructions will fail. >> >> I have a large C++ project here and somewhere in an static initializer >> such an reset is omitted. Spotting the missing place is quite hard. >> I've tried to use GDB to watch the $ftag register, but GDBs single >> instruction stepping takes ages. >> >> So the valgrind tool should do the following: If an FPU instruction is >> executed with a corrupt FPU stack, print the position of the last >> MMX/SSE instruction. >> >> I've skimmed the lackey source code, but have still no idea where to >> start. It would be nice if you could provide me some assistance or even >> some source code. >> >> What do you think? > > It might be possible. If it is possible, it probably wouldn't be all that > hard, i.e. the source code needn't be that long, but understanding > Valgrind > enough to write it requires some effort. > > The key factor is that Valgrind translates x86 (or PPC) code into an > intermediate representation (IR). The question is whether the IR > preserves > the 'emms' instruction in such a way that you can recognise it. Judging > from VEX/priv/guest-x86/toIR.c:do_EMMS_preamble() (around line 5090), it's > not represented explicitly, but rather all the FP regs get zeroed, as does > the FP stack top. You might be able to detect that manually; it's > conceivable that an optimisation pass might remove some of the zeroings if > it knew they weren't necessary, but I don't know how likely that is. > > To understand the IR, look at VEX/pub/libvex_ir.h. Make sure you use the > SVN version, it has much better comments in it than the 3.2.3 version. > Then, Memcheck might be a better example tool than Lackey, to see how a > wider range of instructions are handled. Maybe I'm wrong, but does this tool have to deal with actual IR at all? As this tool seems to be x86-specific, wouldn't an inspection of the IMarks yield all the information this tool needs? (IIRC, IMark has been renamed in valgrind trunk.) Just my two cents ... Jeroen. |
|
From: Tom H. <th...@cy...> - 2007-11-24 03:55:36
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2007-11-24 03:15:02 GMT 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 == 318 tests, 60 stderr failures, 3 stdout failures, 27 post failures == memcheck/tests/addressable (stderr) memcheck/tests/badjump (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-pool-0 (stderr) memcheck/tests/leak-pool-1 (stderr) memcheck/tests/leak-pool-2 (stderr) memcheck/tests/leak-pool-3 (stderr) memcheck/tests/leak-pool-4 (stderr) memcheck/tests/leak-pool-5 (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/long_namespace_xml (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/noisy_child (stderr) memcheck/tests/partial_load_dflt (stderr) memcheck/tests/partial_load_ok (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/x86/bug152022 (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/xor-undef-x86 (stderr) memcheck/tests/xml1 (stderr) massif/tests/alloc-fns-A (post) massif/tests/alloc-fns-B (post) massif/tests/basic (post) massif/tests/big-alloc (post) massif/tests/culling1 (stderr) massif/tests/culling2 (stderr) massif/tests/custom_alloc (post) massif/tests/deep-A (post) massif/tests/deep-B (stderr) massif/tests/deep-B (post) massif/tests/deep-C (stderr) massif/tests/deep-C (post) massif/tests/deep-D (post) massif/tests/ignoring (post) massif/tests/insig (post) massif/tests/long-time (post) massif/tests/new-cpp (post) massif/tests/null (post) massif/tests/one (post) massif/tests/overloaded-new (post) massif/tests/peak (post) massif/tests/peak2 (stderr) massif/tests/peak2 (post) massif/tests/realloc (stderr) massif/tests/realloc (post) massif/tests/thresholds_0_0 (post) massif/tests/thresholds_0_10 (post) massif/tests/thresholds_10_0 (post) massif/tests/thresholds_10_10 (post) massif/tests/thresholds_5_0 (post) massif/tests/thresholds_5_10 (post) massif/tests/zero1 (post) massif/tests/zero2 (post) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/hg01_all_ok (stderr) helgrind/tests/hg02_deadlock (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/hg06_readshared (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc02_simple_tls (stderr) helgrind/tests/tc03_re_excl (stderr) helgrind/tests/tc05_simple_race (stderr) helgrind/tests/tc06_two_races (stderr) helgrind/tests/tc07_hbl1 (stderr) helgrind/tests/tc08_hbl2 (stderr) helgrind/tests/tc09_bad_unlock (stderr) helgrind/tests/tc11_XCHG (stderr) helgrind/tests/tc12_rwl_trivial (stderr) helgrind/tests/tc14_laog_dinphils (stderr) helgrind/tests/tc16_byterace (stderr) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) |
|
From: Tom H. <th...@cy...> - 2007-11-24 03:31:07
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2007-11-24 03:05:06 GMT 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 == 352 tests, 6 stderr failures, 4 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) |
|
From: Tom H. <th...@cy...> - 2007-11-24 03:26:05
|
Nightly build on dellow ( x86_64, Fedora 8 ) started at 2007-11-24 03:10:03 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 352 tests, 9 stderr failures, 6 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/pth_cvsimple (stdout) none/tests/pth_detached (stdout) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 352 tests, 9 stderr failures, 5 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/pth_detached (stdout) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Sat Nov 24 03:18:13 2007 --- new.short Sat Nov 24 03:26:08 2007 *************** *** 8,10 **** ! == 352 tests, 9 stderr failures, 5 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) --- 8,10 ---- ! == 352 tests, 9 stderr failures, 6 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) *************** *** 17,18 **** --- 17,19 ---- none/tests/mremap2 (stdout) + none/tests/pth_cvsimple (stdout) none/tests/pth_detached (stdout) |
|
From: Tom H. <th...@cy...> - 2007-11-24 03:13:21
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2007-11-24 03:00:02 GMT 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 == 354 tests, 24 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/hg01_all_ok (stderr) helgrind/tests/hg02_deadlock (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc05_simple_race (stderr) helgrind/tests/tc06_two_races (stderr) helgrind/tests/tc09_bad_unlock (stderr) helgrind/tests/tc14_laog_dinphils (stderr) helgrind/tests/tc16_byterace (stderr) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) |
|
From: <js...@ac...> - 2007-11-24 01:22:24
|
Nightly build on g5 ( SuSE 10.1, ppc970 ) started at 2007-11-24 02:00:01 CET Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 285 tests, 25 stderr failures, 5 stdout failures, 0 post failures == memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/hg02_deadlock (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc05_simple_race (stderr) helgrind/tests/tc06_two_races (stderr) helgrind/tests/tc07_hbl1 (stderr) helgrind/tests/tc08_hbl2 (stdout) helgrind/tests/tc08_hbl2 (stderr) helgrind/tests/tc09_bad_unlock (stderr) helgrind/tests/tc11_XCHG (stderr) helgrind/tests/tc14_laog_dinphils (stderr) helgrind/tests/tc16_byterace (stderr) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 285 tests, 25 stderr failures, 5 stdout failures, 0 post failures == memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/res_search (stdout) helgrind/tests/hg02_deadlock (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc05_simple_race (stderr) helgrind/tests/tc06_two_races (stderr) helgrind/tests/tc07_hbl1 (stderr) helgrind/tests/tc08_hbl2 (stderr) helgrind/tests/tc09_bad_unlock (stderr) helgrind/tests/tc11_XCHG (stderr) helgrind/tests/tc14_laog_dinphils (stderr) helgrind/tests/tc16_byterace (stderr) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Sat Nov 24 02:11:39 2007 --- new.short Sat Nov 24 02:22:24 2007 *************** *** 19,21 **** none/tests/mremap2 (stdout) - none/tests/res_search (stdout) helgrind/tests/hg02_deadlock (stderr) --- 19,20 ---- *************** *** 28,29 **** --- 27,29 ---- helgrind/tests/tc07_hbl1 (stderr) + helgrind/tests/tc08_hbl2 (stdout) helgrind/tests/tc08_hbl2 (stderr) |
|
From: Nicholas N. <nj...@cs...> - 2007-11-23 22:38:09
|
On Fri, 23 Nov 2007, Josef Weidendorfer wrote:
> VG_(expand_file_name) looks almost good to me.
>
> In callgrind, I allow to set an absolute output name with eg. "--base=/tmp/clgout".
> If the format starts with a slash, we could skip prefixing the output with
> the base_dir.
Done.
> Very minor points:
> playing a little bit with %q, I got misleading errors.
>
> weidendo@linux:~> valgrind --log-file=foo%q ls
> ==17529== --log-file: expected 'p' or 'q' or '%' after '%'
> valgrind: Bad option '--log-file=foo%q'; aborting.
> valgrind: Use --help for more information.
>
> weidendo@linux:~> valgrind --log-file=foo%q{x}%q{y} ls
> ==17625== --log-file: environment variable x is not set
> valgrind: Bad option '--log-file=foo%q{x'; aborting.
> valgrind: Use --help for more information.
Fixed and fixed.
Thanks for the feedback!
N
|
|
From: <sv...@va...> - 2007-11-23 22:37:34
|
Author: njn
Date: 2007-11-23 22:37:35 +0000 (Fri, 23 Nov 2007)
New Revision: 7204
Log:
Tweak VG_(expand_file_name), as per Josef's suggestions.
Modified:
trunk/coregrind/m_options.c
trunk/include/pub_tool_options.h
Modified: trunk/coregrind/m_options.c
===================================================================
--- trunk/coregrind/m_options.c 2007-11-23 01:42:10 UTC (rev 7203)
+++ trunk/coregrind/m_options.c 2007-11-23 22:37:35 UTC (rev 7204)
@@ -144,11 +144,18 @@
goto bad;
}
+ // If 'format' starts with a '/', do not prefix with startup dir.
+ if (format[0] != '/') {
+ j += VG_(strlen)(base_dir);
+ }
+
// The 10 is slop, it should be enough in most cases.
- j = VG_(strlen)(base_dir);
len = j + VG_(strlen)(format) + 10;
out = VG_(malloc)( len );
- VG_(strcpy)(out, base_dir);
+ if (format[0] != '/') {
+ VG_(strcpy)(out, base_dir);
+ out[j++] = '/';
+ }
#define ENSURE_THIS_MUCH_SPACE(x) \
if (j + x >= len) { \
@@ -156,7 +163,6 @@
out = VG_(realloc)(out, len); \
}
- out[j++] = '/';
while (format[i]) {
if (format[i] != '%') {
ENSURE_THIS_MUCH_SPACE(1);
@@ -178,35 +184,44 @@
j += VG_(sprintf)(&out[j], "%d", pid);
i++;
}
- else if ('q' == format[i] && '{' == format[i+1]) {
- // Get the env var name, print its contents.
- Char* qualname;
- Char* qual;
- i += 2;
- qualname = &format[i];
- while (True) {
- if (0 == format[i]) {
- VG_(message)(Vg_UserMsg, "%s: malformed %%q specifier",
- option_name);
- goto bad;
- } else if ('}' == format[i]) {
- // Temporarily replace the '}' with NUL to extract var name.
- format[i] = 0;
- qual = VG_(getenv)(qualname);
- if (NULL == qual) {
- VG_(message)(Vg_UserMsg,
- "%s: environment variable %s is not set",
- option_name, qualname);
+ else if ('q' == format[i]) {
+ i++;
+ if ('{' == format[i]) {
+ // Get the env var name, print its contents.
+ Char* qualname;
+ Char* qual;
+ i++;
+ qualname = &format[i];
+ while (True) {
+ if (0 == format[i]) {
+ VG_(message)(Vg_UserMsg, "%s: malformed %%q specifier",
+ option_name);
goto bad;
+ } else if ('}' == format[i]) {
+ // Temporarily replace the '}' with NUL to extract var
+ // name.
+ format[i] = 0;
+ qual = VG_(getenv)(qualname);
+ if (NULL == qual) {
+ VG_(message)(Vg_UserMsg,
+ "%s: environment variable %s is not set",
+ option_name, qualname);
+ format[i] = '}'; // Put the '}' back.
+ goto bad;
+ }
+ format[i] = '}'; // Put the '}' back.
+ i++;
+ break;
}
- format[i] = '}'; // Put the '}' back.
i++;
- break;
}
- i++;
+ ENSURE_THIS_MUCH_SPACE(VG_(strlen)(qual));
+ j += VG_(sprintf)(&out[j], "%s", qual);
+ } else {
+ VG_(message)(Vg_UserMsg,
+ "%s: expected '{' after '%%q'", option_name);
+ goto bad;
}
- ENSURE_THIS_MUCH_SPACE(VG_(strlen)(qual));
- j += VG_(sprintf)(&out[j], "%s", qual);
}
else {
// Something else, abort.
Modified: trunk/include/pub_tool_options.h
===================================================================
--- trunk/include/pub_tool_options.h 2007-11-23 01:42:10 UTC (rev 7203)
+++ trunk/include/pub_tool_options.h 2007-11-23 22:37:35 UTC (rev 7204)
@@ -130,6 +130,9 @@
isn't set, we abort. If the "{QUAL}" part is malformed, we abort.
- "%%" is replaced with "%".
Anything else after '%' causes an abort.
+ If the format specifies a relative file name, it's put in the program's
+ initial working directory. If it specifies an absolute file name (ie.
+ starts with '/') then it is put there.
*/
extern Char* VG_(expand_file_name)(Char* option_name, Char* format);
|
|
From: Nicholas N. <nj...@cs...> - 2007-11-23 22:24:48
|
On Fri, 23 Nov 2007, Gregor Jasny wrote: > I've got an idea for a MMX checker tool. First some background: > When you use MMX/SSE instructions on the x86 platform you have to reset > the FPU stack with the 'emms' instruction after calculations finished. > Otherwise the following floating point instructions will fail. > > I have a large C++ project here and somewhere in an static initializer > such an reset is omitted. Spotting the missing place is quite hard. > I've tried to use GDB to watch the $ftag register, but GDBs single > instruction stepping takes ages. > > So the valgrind tool should do the following: If an FPU instruction is > executed with a corrupt FPU stack, print the position of the last > MMX/SSE instruction. > > I've skimmed the lackey source code, but have still no idea where to > start. It would be nice if you could provide me some assistance or even > some source code. > > What do you think? It might be possible. If it is possible, it probably wouldn't be all that hard, i.e. the source code needn't be that long, but understanding Valgrind enough to write it requires some effort. The key factor is that Valgrind translates x86 (or PPC) code into an intermediate representation (IR). The question is whether the IR preserves the 'emms' instruction in such a way that you can recognise it. Judging from VEX/priv/guest-x86/toIR.c:do_EMMS_preamble() (around line 5090), it's not represented explicitly, but rather all the FP regs get zeroed, as does the FP stack top. You might be able to detect that manually; it's conceivable that an optimisation pass might remove some of the zeroings if it knew they weren't necessary, but I don't know how likely that is. To understand the IR, look at VEX/pub/libvex_ir.h. Make sure you use the SVN version, it has much better comments in it than the 3.2.3 version. Then, Memcheck might be a better example tool than Lackey, to see how a wider range of instructions are handled. Hope this helps, feel free to ask more questions if you have trouble. Nick |
|
From: Julian S. <js...@ac...> - 2007-11-23 15:49:22
|
Hi. In fact Helgrind will be available in the soon to happen 3.3.0 release. You can get it immediately by checking out the svn trunk as described at http://valgrind.org/downloads/repository.html. Compared to the 2.2.0 Helgrind there are already some extensions which are documented in Valgrind's user manual. J On Friday 23 November 2007 16:29, Ali Jannesari wrote: > Hi, > > I am a PhD student at university of Karlsruhe-Germany and working on > Debugging and race detection of parallel programs. As a part of my resear= ch > I want to extend some features in Helgrind. > > > > Just want to know please if there is a possibility of getting Helgrind ba= ck > to work in the future release? Is there any support for Helgrind? > > > > Thank you very much. > > > > Regards > > Ali Jannesari > > > > --- > > M. Sc. Ali Jannesari > > Universit=E4t Karlsruhe > > Institut f=FCr Programmstrukturen > > und Datenorganisation (IPD) > > Am Fasanengarten 5, Geb. 50.34, Raum 346 > > 76131 Karlsruhe > > Tel. 0721 / 608 =96 4064 > > Jan...@ip... > > http://www.ipd.uka.de/~jannesari |
|
From: Ali J. <jan...@ip...> - 2007-11-23 15:29:10
|
Hi, I am a PhD student at university of Karlsruhe-Germany and working on Debugging and race detection of parallel programs. As a part of my = research I want to extend some features in Helgrind.=20 =20 Just want to know please if there is a possibility of getting Helgrind = back to work in the future release? Is there any support for Helgrind?=20 =20 Thank you very much. =20 Regards Ali Jannesari =20 --- M. Sc. Ali Jannesari Universit=E4t Karlsruhe Institut f=FCr Programmstrukturen=20 und Datenorganisation (IPD)=20 Am Fasanengarten 5, Geb. 50.34, Raum 346 76131 Karlsruhe Tel. 0721 / 608 =96 4064 Jan...@ip... http://www.ipd.uka.de/~jannesari =20 =20 |
|
From: Konstantin S. <kon...@gm...> - 2007-11-23 14:49:38
|
I don't have access to openSUSE (neither 10.1 nor 10.2). Could you please send me index.fo produced ob both systems as well as version strings for xsltproc and pdfxmltex? --kcc On Nov 23, 2007 5:30 PM, Julian Seward <js...@ac...> wrote: > On Friday 23 November 2007 14:27, Konstantin Serebryany wrote: > > >> If anybody can figure out why the PDF doc build fails on > > >> openSUSE 10.2 and later, that would be great. > > > > Who is guilty, xsltproc or pdfxmltex? > > Does xsltproc produce the same index.fo on these two systems? > > If you have the time to chase this around, that would be great :-) > > J > |
|
From: Julian S. <js...@ac...> - 2007-11-23 14:30:38
|
On Friday 23 November 2007 14:27, Konstantin Serebryany wrote: > >> If anybody can figure out why the PDF doc build fails on > >> openSUSE 10.2 and later, that would be great. > > Who is guilty, xsltproc or pdfxmltex? > Does xsltproc produce the same index.fo on these two systems? If you have the time to chase this around, that would be great :-) J |
|
From: Konstantin S. <kon...@gm...> - 2007-11-23 13:27:22
|
>> If anybody can figure out why the PDF doc build fails on >> openSUSE 10.2 and later, that would be great. Who is guilty, xsltproc or pdfxmltex? Does xsltproc produce the same index.fo on these two systems? On Nov 23, 2007 2:43 PM, Julian Seward <js...@ac...> wrote: > On Friday 23 November 2007 08:19, Konstantin Serebryany wrote: > > > I've tried building printable valgrind docs from the svn trunc. [...] > > ! ==> Fatal error occurred, the output PDF file is not finished! > > Yes. The PDF build chain is very fragile. I keep a SuSE 10.1 machine > available purely so I can build the PDF -- it will not build on > openSUSE 10.2 or later, for unknown reasons. Even then it requires > the following hack to succeed (see docs/README): > > pdfxmltex still bombs when building the print docs. On SuSE 10.1 I > edited /etc/texmf/web2c/texmf.cnf and changed > pool_size.pdfxmltex = 500000 > to > pool_size.pdfxmltex = 1500000 > and that fixes it. > > For these kinds of reasons, in the distribution tarball, the PDF > docs and HTML docs are pre-built. > > If anybody can figure out why the PDF doc build fails on > openSUSE 10.2 and later, that would be great. > > I can send PDF of current docs if you want. > > J > |
|
From: Julian S. <js...@ac...> - 2007-11-23 11:43:49
|
On Friday 23 November 2007 08:19, Konstantin Serebryany wrote:
> I've tried building printable valgrind docs from the svn trunc. [...]
> ! ==> Fatal error occurred, the output PDF file is not finished!
Yes. The PDF build chain is very fragile. I keep a SuSE 10.1 machine
available purely so I can build the PDF -- it will not build on
openSUSE 10.2 or later, for unknown reasons. Even then it requires
the following hack to succeed (see docs/README):
pdfxmltex still bombs when building the print docs. On SuSE 10.1 I
edited /etc/texmf/web2c/texmf.cnf and changed
pool_size.pdfxmltex = 500000
to
pool_size.pdfxmltex = 1500000
and that fixes it.
For these kinds of reasons, in the distribution tarball, the PDF
docs and HTML docs are pre-built.
If anybody can figure out why the PDF doc build fails on
openSUSE 10.2 and later, that would be great.
I can send PDF of current docs if you want.
J
|
|
From: Josef W. <Jos...@gm...> - 2007-11-23 11:09:52
|
On Friday 23 November 2007, sv...@va... wrote:
> Author: njn
> Date: 2007-11-23 01:41:32 +0000 (Fri, 23 Nov 2007)
> New Revision: 7202
>
> Log:
> Fixed up the log file mess throughout, including the docs. This killed
> --log-file-qualifier and --log-file-exactly.
Thanks!
> +// - Get Josef to update the Callgrind --callgrind-out-file option.
I'll do.
VG_(expand_file_name) looks almost good to me.
In callgrind, I allow to set an absolute output name with eg. "--base=/tmp/clgout".
If the format starts with a slash, we could skip prefixing the output with
the base_dir.
So what about
===================================================================
--- m_options.c (Revision 7203)
+++ m_options.c (Arbeitskopie)
@@ -144,11 +144,17 @@
goto bad;
}
+ // if format starts with a '/', do not prefix with startup dir
+ if (format[0] != '/')
+ j += VG_(strlen)(base_dir);
+
// The 10 is slop, it should be enough in most cases.
- j = VG_(strlen)(base_dir);
len = j + VG_(strlen)(format) + 10;
out = VG_(malloc)( len );
- VG_(strcpy)(out, base_dir);
+ if (format[0] != '/') {
+ VG_(strcpy)(out, base_dir);
+ out[j++] = '/';
+ }
#define ENSURE_THIS_MUCH_SPACE(x) \
if (j + x >= len) { \
@@ -156,7 +162,6 @@
out = VG_(realloc)(out, len); \
}
- out[j++] = '/';
while (format[i]) {
if (format[i] != '%') {
ENSURE_THIS_MUCH_SPACE(1);
===================================================================
Very minor points:
playing a little bit with %q, I got misleading errors.
weidendo@linux:~> valgrind --log-file=foo%q ls
==17529== --log-file: expected 'p' or 'q' or '%' after '%'
valgrind: Bad option '--log-file=foo%q'; aborting.
valgrind: Use --help for more information.
weidendo@linux:~> valgrind --log-file=foo%q{x}%q{y} ls
==17625== --log-file: environment variable x is not set
valgrind: Bad option '--log-file=foo%q{x'; aborting.
valgrind: Use --help for more information.
Thanks again for doing this,
Josef
|
|
From: Gregor J. <ja...@vi...> - 2007-11-23 10:25:34
|
Hi, I've got an idea for a MMX checker tool. First some background: When you use MMX/SSE instructions on the x86 platform you have to reset the FPU stack with the 'emms' instruction after calculations finished. Otherwise the following floating point instructions will fail. I have a large C++ project here and somewhere in an static initializer such an reset is omitted. Spotting the missing place is quite hard. I've tried to use GDB to watch the $ftag register, but GDBs single instruction stepping takes ages. So the valgrind tool should do the following: If an FPU instruction is executed with a corrupt FPU stack, print the position of the last MMX/SSE instruction. I've skimmed the lackey source code, but have still no idea where to start. It would be nice if you could provide me some assistance or even some source code. What do you think? Thanks, Gregor |
|
From: Nicholas N. <nj...@cs...> - 2007-11-23 08:52:02
|
On Thu, 22 Nov 2007, Florian Krohm wrote: > Do you have plans to morph branches/ORIGIN_TRACKING into an > experimental tool? I read the pldi paper and understand it has > limitations but it could still make a quite a difference if a > bug is of the kind where it can track its origin. > I've checked out the branch to play with it a bit, but > unfortunately it does not compile, due to changes in VEX IR. No... the cost/benefit trade-off wasn't very good -- it added quite a bit of complication to Memcheck and the core. N |
|
From: Konstantin S. <kon...@gm...> - 2007-11-23 07:19:27
|
Hi,
I've tried building printable valgrind docs from the svn trunc.
If I type 'cd docs && make print-docs' I get
make print-docs
Generating PDF file: ../docs/print/index.pdf (please be patient)...
export XML_CATALOG_FILES=/etc/xml/catalog && \
mkdir -p ../docs/print && \
mkdir -p ../docs/print/images && \
cp ../docs/images/massif-graph-sm.png ../docs/print/images && \
xsltproc --xinclude -o ../docs/print/index.fo
../docs/lib/vg-fo.xsl../docs/xml/index.xml && \
(cd ../docs/print && \
( pdfxmltex index.fo && \
pdfxmltex index.fo && \
pdfxmltex index.fo ) &> print.log < /dev/null && \
echo "Generating PS file: ../docs/print/index.ps ..." && \
pdftops index.pdf && \
rm -f *.log *.aux *.fo *.out)
Making portrait pages on USletter paper (8.5inx11in)
pre encountered in chapter, but no template matches.
make: *** [print-docs] Error 1
docs/print/print.log contains
! Emergency stop.
<inserted text>
\par
l.797 ...)</fo:inline>-related Options</fo:marker>
<fo:block font-size="
17.28...
! ==> Fatal error occurred, the output PDF file is not finished!
Transcript written on index.log.
If I run 'pdfxmltex index.fo' manually, I get slightly further, but then I
get tons of complains like
! pdfTeX warning (dest): name{tech-docs} has been referenced but does
not exist
and the resulting pdf is truncated.
What did I do wrong?
May be I have old versions of tools?
pdfxmltex
This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
xsltproc --version
Using libxml 20624, libxslt 10115 and libexslt 812
xsltproc was compiled against libxml 20622, libxslt 10115 and libexslt
812
libxslt 10115 was compiled against libxml 20622
libexslt 812 was compiled against libxml 20622
Thanks,
--kcc
|
|
From: Florian K. <br...@ac...> - 2007-11-23 05:22:11
|
On Thursday 22 November 2007 1:53 pm, Julian Seward wrote: > Greetings all. > > I'm trying to wrap up the long overdue 3.3.0 release. It's been > nearly 18 months since 3.2.0 shipped. The 3.2.X line has done well, > but it's a bit old now. Plus we've accumulated a bunch of cool new > stuff to ship over the past 18 months: > > * revised Massif (almost a complete rewrite) > * Helgrind works again (a complete rewrite) > * Cachegrind does branch-misprediction profiling > * experimental tools section (Omega, DRD) Do you have plans to morph branches/ORIGIN_TRACKING into an experimental tool? I read the pldi paper and understand it has limitations but it could still make a quite a difference if a bug is of the kind where it can track its origin. I've checked out the branch to play with it a bit, but unfortunately it does not compile, due to changes in VEX IR. Florian |
|
From: Tom H. <th...@cy...> - 2007-11-23 03:55:31
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2007-11-23 03:15:02 GMT 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 == 318 tests, 60 stderr failures, 3 stdout failures, 27 post failures == memcheck/tests/addressable (stderr) memcheck/tests/badjump (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-pool-0 (stderr) memcheck/tests/leak-pool-1 (stderr) memcheck/tests/leak-pool-2 (stderr) memcheck/tests/leak-pool-3 (stderr) memcheck/tests/leak-pool-4 (stderr) memcheck/tests/leak-pool-5 (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/long_namespace_xml (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/noisy_child (stderr) memcheck/tests/partial_load_dflt (stderr) memcheck/tests/partial_load_ok (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/x86/bug152022 (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/xor-undef-x86 (stderr) memcheck/tests/xml1 (stderr) massif/tests/alloc-fns-A (post) massif/tests/alloc-fns-B (post) massif/tests/basic (post) massif/tests/big-alloc (post) massif/tests/culling1 (stderr) massif/tests/culling2 (stderr) massif/tests/custom_alloc (post) massif/tests/deep-A (post) massif/tests/deep-B (stderr) massif/tests/deep-B (post) massif/tests/deep-C (stderr) massif/tests/deep-C (post) massif/tests/deep-D (post) massif/tests/ignoring (post) massif/tests/insig (post) massif/tests/long-time (post) massif/tests/new-cpp (post) massif/tests/null (post) massif/tests/one (post) massif/tests/overloaded-new (post) massif/tests/peak (post) massif/tests/peak2 (stderr) massif/tests/peak2 (post) massif/tests/realloc (stderr) massif/tests/realloc (post) massif/tests/thresholds_0_0 (post) massif/tests/thresholds_0_10 (post) massif/tests/thresholds_10_0 (post) massif/tests/thresholds_10_10 (post) massif/tests/thresholds_5_0 (post) massif/tests/thresholds_5_10 (post) massif/tests/zero1 (post) massif/tests/zero2 (post) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/hg01_all_ok (stderr) helgrind/tests/hg02_deadlock (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/hg06_readshared (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc02_simple_tls (stderr) helgrind/tests/tc03_re_excl (stderr) helgrind/tests/tc05_simple_race (stderr) helgrind/tests/tc06_two_races (stderr) helgrind/tests/tc07_hbl1 (stderr) helgrind/tests/tc08_hbl2 (stderr) helgrind/tests/tc09_bad_unlock (stderr) helgrind/tests/tc11_XCHG (stderr) helgrind/tests/tc12_rwl_trivial (stderr) helgrind/tests/tc14_laog_dinphils (stderr) helgrind/tests/tc16_byterace (stderr) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) |
|
From: Tom H. <th...@cy...> - 2007-11-23 03:30:55
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2007-11-23 03:05:05 GMT 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 == 352 tests, 6 stderr failures, 4 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) |
|
From: Tom H. <th...@cy...> - 2007-11-23 03:26:12
|
Nightly build on dellow ( x86_64, Fedora 8 ) started at 2007-11-23 03:10:05 GMT 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 == 352 tests, 9 stderr failures, 5 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/pth_detached (stdout) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) |
|
From: Tom H. <th...@cy...> - 2007-11-23 03:13:26
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2007-11-23 03:00:03 GMT 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 == 354 tests, 24 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/hg01_all_ok (stderr) helgrind/tests/hg02_deadlock (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc05_simple_race (stderr) helgrind/tests/tc06_two_races (stderr) helgrind/tests/tc09_bad_unlock (stderr) helgrind/tests/tc14_laog_dinphils (stderr) helgrind/tests/tc16_byterace (stderr) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) |
|
From: <sv...@va...> - 2007-11-23 02:46:28
|
Author: sewardj
Date: 2007-11-23 02:46:29 +0000 (Fri, 23 Nov 2007)
New Revision: 1800
Log:
Implement DAA/DAS/AAA/AAS. Really stupid and ugly instructions which
might have made sense in 1973, but not now. Fixes #152501.
Modified:
trunk/priv/guest-x86/gdefs.h
trunk/priv/guest-x86/ghelpers.c
trunk/priv/guest-x86/toIR.c
Modified: trunk/priv/guest-x86/gdefs.h
===================================================================
--- trunk/priv/guest-x86/gdefs.h 2007-11-20 17:29:08 UTC (rev 1799)
+++ trunk/priv/guest-x86/gdefs.h 2007-11-23 02:46:29 UTC (rev 1800)
@@ -114,6 +114,8 @@
UInt arg, UInt rot_amt, UInt eflags_in, UInt sz
);
+extern UInt x86g_calculate_daa_das_aaa_aas ( UInt AX_and_flags, UInt opcode );
+
extern ULong x86g_check_fldcw ( UInt fpucw );
extern UInt x86g_create_fpucw ( UInt fpround );
Modified: trunk/priv/guest-x86/ghelpers.c
===================================================================
--- trunk/priv/guest-x86/ghelpers.c 2007-11-20 17:29:08 UTC (rev 1799)
+++ trunk/priv/guest-x86/ghelpers.c 2007-11-23 02:46:29 UTC (rev 1800)
@@ -1875,6 +1875,135 @@
}
+/* CALLED FROM GENERATED CODE: CLEAN HELPER */
+/* Calculate both flags and value result for DAA/DAS/AAA/AAS.
+ AX value in low half of arg, OSZACP in upper half.
+ See guest-x86/toIR.c usage point for details.
+*/
+static UInt calc_parity_8bit ( UInt w32 ) {
+ UInt i;
+ UInt p = 1;
+ for (i = 0; i < 8; i++)
+ p ^= (1 & (w32 >> i));
+ return p;
+}
+UInt x86g_calculate_daa_das_aaa_aas ( UInt flags_and_AX, UInt opcode )
+{
+ UInt r_AL = (flags_and_AX >> 0) & 0xFF;
+ UInt r_AH = (flags_and_AX >> 8) & 0xFF;
+ UInt r_O = (flags_and_AX >> (16 + X86G_CC_SHIFT_O)) & 1;
+ UInt r_S = (flags_and_AX >> (16 + X86G_CC_SHIFT_S)) & 1;
+ UInt r_Z = (flags_and_AX >> (16 + X86G_CC_SHIFT_Z)) & 1;
+ UInt r_A = (flags_and_AX >> (16 + X86G_CC_SHIFT_A)) & 1;
+ UInt r_C = (flags_and_AX >> (16 + X86G_CC_SHIFT_C)) & 1;
+ UInt r_P = (flags_and_AX >> (16 + X86G_CC_SHIFT_P)) & 1;
+ UInt result = 0;
+
+ switch (opcode) {
+ case 0x27: { /* DAA */
+ UInt old_AL = r_AL;
+ UInt old_C = r_C;
+ r_C = 0;
+ if ((r_AL & 0xF) > 9 || r_A == 1) {
+ r_AL = r_AL + 6;
+ r_C = old_C;
+ if (r_AL >= 0x100) r_C = 1;
+ r_A = 1;
+ } else {
+ r_A = 0;
+ }
+ if (old_AL > 0x99 || old_C == 1) {
+ r_AL = r_AL + 0x60;
+ r_C = 1;
+ } else {
+ r_C = 0;
+ }
+ /* O is undefined. S Z and P are set according to the
+ result. */
+ r_AL &= 0xFF;
+ r_O = 0; /* let's say */
+ r_S = (r_AL & 0x80) ? 1 : 0;
+ r_Z = (r_AL == 0) ? 1 : 0;
+ r_P = calc_parity_8bit( r_AL );
+ break;
+ }
+ case 0x2F: { /* DAS */
+ UInt old_AL = r_AL;
+ UInt old_C = r_C;
+ r_C = 0;
+ if ((r_AL & 0xF) > 9 || r_A == 1) {
+ Bool borrow = r_AL < 6;
+ r_AL = r_AL - 6;
+ r_C = old_C;
+ if (borrow) r_C = 1;
+ r_A = 1;
+ } else {
+ r_A = 0;
+ }
+ if (old_AL > 0x99 || old_C == 1) {
+ r_AL = r_AL - 0x60;
+ r_C = 1;
+ } else {
+ /* Intel docs are wrong: r_C = 0; */
+ }
+ /* O is undefined. S Z and P are set according to the
+ result. */
+ r_AL &= 0xFF;
+ r_O = 0; /* let's say */
+ r_S = (r_AL & 0x80) ? 1 : 0;
+ r_Z = (r_AL == 0) ? 1 : 0;
+ r_P = calc_parity_8bit( r_AL );
+ break;
+ }
+ case 0x37: { /* AAA */
+ Bool nudge = r_AL > 0xF9;
+ if ((r_AL & 0xF) > 9 || r_A == 1) {
+ r_AL = r_AL + 6;
+ r_AH = r_AH + 1 + (nudge ? 1 : 0);
+ r_A = 1;
+ r_C = 1;
+ r_AL = r_AL & 0xF;
+ } else {
+ r_A = 0;
+ r_C = 0;
+ r_AL = r_AL & 0xF;
+ }
+ /* O S Z and P are undefined. */
+ r_O = r_S = r_Z = r_P = 0; /* let's say */
+ break;
+ }
+ case 0x3F: { /* AAS */
+ Bool nudge = r_AL < 0x06;
+ if ((r_AL & 0xF) > 9 || r_A == 1) {
+ r_AL = r_AL - 6;
+ r_AH = r_AH - 1 - (nudge ? 1 : 0);
+ r_A = 1;
+ r_C = 1;
+ r_AL = r_AL & 0xF;
+ } else {
+ r_A = 0;
+ r_C = 0;
+ r_AL = r_AL & 0xF;
+ }
+ /* O S Z and P are undefined. */
+ r_O = r_S = r_Z = r_P = 0; /* let's say */
+ break;
+ }
+ default:
+ vassert(0);
+ }
+ result = ( (r_O & 1) << (16 + X86G_CC_SHIFT_O) )
+ | ( (r_S & 1) << (16 + X86G_CC_SHIFT_S) )
+ | ( (r_Z & 1) << (16 + X86G_CC_SHIFT_Z) )
+ | ( (r_A & 1) << (16 + X86G_CC_SHIFT_A) )
+ | ( (r_C & 1) << (16 + X86G_CC_SHIFT_C) )
+ | ( (r_P & 1) << (16 + X86G_CC_SHIFT_P) )
+ | ( (r_AH & 0xFF) << 8 )
+ | ( (r_AL & 0xFF) << 0 );
+ return result;
+}
+
+
/* CALLED FROM GENERATED CODE */
/* DIRTY HELPER (non-referentially-transparent) */
/* Horrible hack. On non-x86 platforms, return 1. */
Modified: trunk/priv/guest-x86/toIR.c
===================================================================
--- trunk/priv/guest-x86/toIR.c 2007-11-20 17:29:08 UTC (rev 1799)
+++ trunk/priv/guest-x86/toIR.c 2007-11-23 02:46:29 UTC (rev 1800)
@@ -11196,44 +11196,62 @@
DIP("leave\n");
break;
-//-- /* ---------------- Misc weird-ass insns --------------- */
-//--
-//-- case 0x27: /* DAA */
-//-- case 0x2F: /* DAS */
-//-- t1 = newTemp(cb);
-//-- uInstr2(cb, GET, 1, ArchReg, R_AL, TempReg, t1);
-//-- /* Widen %AL to 32 bits, so it's all defined when we push it. */
-//-- uInstr1(cb, WIDEN, 4, TempReg, t1);
-//-- uWiden(cb, 1, False);
-//-- uInstr0(cb, CALLM_S, 0);
-//-- uInstr1(cb, PUSH, 4, TempReg, t1);
-//-- uInstr1(cb, CALLM, 0, Lit16,
-//-- opc == 0x27 ? VGOFF_(helper_DAA) : VGOFF_(helper_DAS) );
-//-- uFlagsRWU(cb, FlagsAC, FlagsSZACP, FlagO);
-//-- uInstr1(cb, POP, 4, TempReg, t1);
-//-- uInstr0(cb, CALLM_E, 0);
-//-- uInstr2(cb, PUT, 1, TempReg, t1, ArchReg, R_AL);
-//-- DIP(opc == 0x27 ? "daa\n" : "das\n");
-//-- break;
-//--
-//-- case 0x37: /* AAA */
-//-- case 0x3F: /* AAS */
-//-- t1 = newTemp(cb);
-//-- uInstr2(cb, GET, 2, ArchReg, R_EAX, TempReg, t1);
-//-- /* Widen %AL to 32 bits, so it's all defined when we push it. */
-//-- uInstr1(cb, WIDEN, 4, TempReg, t1);
-//-- uWiden(cb, 2, False);
-//-- uInstr0(cb, CALLM_S, 0);
-//-- uInstr1(cb, PUSH, 4, TempReg, t1);
-//-- uInstr1(cb, CALLM, 0, Lit16,
-//-- opc == 0x37 ? VGOFF_(helper_AAA) : VGOFF_(helper_AAS) );
-//-- uFlagsRWU(cb, FlagA, FlagsAC, FlagsEmpty);
-//-- uInstr1(cb, POP, 4, TempReg, t1);
-//-- uInstr0(cb, CALLM_E, 0);
-//-- uInstr2(cb, PUT, 2, TempReg, t1, ArchReg, R_EAX);
-//-- DIP(opc == 0x37 ? "aaa\n" : "aas\n");
-//-- break;
-//--
+ /* ---------------- Misc weird-ass insns --------------- */
+
+ case 0x27: /* DAA */
+ case 0x2F: /* DAS */
+ case 0x37: /* AAA */
+ case 0x3F: /* AAS */
+ /* An ugly implementation for some ugly instructions. Oh
+ well. */
+ if (sz != 4) goto decode_failure;
+ t1 = newTemp(Ity_I32);
+ t2 = newTemp(Ity_I32);
+ /* Make up a 32-bit value (t1), with the old value of AX in the
+ bottom 16 bits, and the old OSZACP bitmask in the upper 16
+ bits. */
+ assign(t1,
+ binop(Iop_16HLto32,
+ unop(Iop_32to16,
+ mk_x86g_calculate_eflags_all()),
+ getIReg(2, R_EAX)
+ ));
+ /* Call the helper fn, to get a new AX and OSZACP value, and
+ poke both back into the guest state. Also pass the helper
+ the actual opcode so it knows which of the 4 instructions it
+ is doing the computation for. */
+ vassert(opc == 0x27 || opc == 0x2F || opc == 0x37 || opc == 0x3F);
+ assign(t2,
+ mkIRExprCCall(
+ Ity_I32, 0/*regparm*/, "x86g_calculate_daa_das_aaa_aas",
+ &x86g_calculate_daa_das_aaa_aas,
+ mkIRExprVec_2( mkexpr(t1), mkU32( opc & 0xFF) )
+ ));
+ putIReg(2, R_EAX, unop(Iop_32to16, mkexpr(t2) ));
+
+ stmt( IRStmt_Put( OFFB_CC_OP, mkU32(X86G_CC_OP_COPY) ));
+ stmt( IRStmt_Put( OFFB_CC_DEP2, mkU32(0) ));
+ stmt( IRStmt_Put( OFFB_CC_DEP1,
+ binop(Iop_And32,
+ binop(Iop_Shr32, mkexpr(t2), mkU8(16)),
+ mkU32( X86G_CC_MASK_C | X86G_CC_MASK_P
+ | X86G_CC_MASK_A | X86G_CC_MASK_Z
+ | X86G_CC_MASK_S| X86G_CC_MASK_O )
+ )
+ )
+ );
+ /* Set NDEP even though it isn't used. This makes redundant-PUT
+ elimination of previous stores to this field work better. */
+ stmt( IRStmt_Put( OFFB_CC_NDEP, mkU32(0) ));
+ switch (opc) {
+ case 0x27: DIP("daa\n"); break;
+ case 0x2F: DIP("das\n"); break;
+ case 0x37: DIP("aaa\n"); break;
+ case 0x3F: DIP("aas\n"); break;
+ default: vassert(0);
+ }
+ break;
+
//-- case 0xD4: /* AAM */
//-- case 0xD5: /* AAD */
//-- d32 = getIByte(delta); delta++;
|