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
(14) |
2
(16) |
3
(7) |
|
4
(7) |
5
(9) |
6
(8) |
7
(10) |
8
(16) |
9
(15) |
10
(9) |
|
11
(11) |
12
(13) |
13
(8) |
14
(8) |
15
(10) |
16
(25) |
17
(7) |
|
18
(7) |
19
(13) |
20
(10) |
21
(14) |
22
(11) |
23
(12) |
24
(8) |
|
25
(19) |
26
(10) |
27
(16) |
28
(13) |
|
|
|
|
From: <sv...@va...> - 2007-02-16 21:57:29
|
Author: weidendo
Date: 2007-02-16 21:57:27 +0000 (Fri, 16 Feb 2007)
New Revision: 6602
Log:
Update
Modified:
trunk/docs/internals/3_2_BUGSTATUS.txt
Modified: trunk/docs/internals/3_2_BUGSTATUS.txt
===================================================================
--- trunk/docs/internals/3_2_BUGSTATUS.txt 2007-02-16 21:55:25 UTC (rev 6601)
+++ trunk/docs/internals/3_2_BUGSTATUS.txt 2007-02-16 21:57:27 UTC (rev 6602)
@@ -107,6 +107,9 @@
r6593 pending 139363 callgrind: fix --collect-systime=yes
with "no instrumentation" mode
+r6601 pending n-i-bz callgrind: Fix threads display
+ of "callgrind_control -s"
+
------- Bugs reported and fixed in 3.2.2 ------
TRUNK 32BRANCH PRI BUG# WHAT
|
|
From: <sv...@va...> - 2007-02-16 21:55:27
|
Author: weidendo
Date: 2007-02-16 21:55:25 +0000 (Fri, 16 Feb 2007)
New Revision: 6601
Log:
Callgrind: Fix threads display of "callgrind_control -s"
Modified:
trunk/callgrind/callgrind_control.in
Modified: trunk/callgrind/callgrind_control.in
===================================================================
--- trunk/callgrind/callgrind_control.in 2007-02-16 20:11:27 UTC (rev 6600)
+++ trunk/callgrind/callgrind_control.in 2007-02-16 21:55:25 UTC (rev 6601)
@@ -370,6 +370,7 @@
%calls = ();
%events = ();
@events = ();
+ @threads = ();
%totals = ();
$exec_bbs = 0;
@@ -378,7 +379,7 @@
$dist_calls = 0;
$dist_ctxs = 0;
$dist_funcs = 0;
- $threads = 0;
+ $threads = "";
$events = "";
while(<RESULT>) {
@@ -410,7 +411,7 @@
elsif (/distinct-functions: (\d+)/) { $dist_funcs = $1; }
elsif (/distinct-contexts: (\d+)/) { $dist_ctxs = $1; }
elsif (/events: (.+)$/) { $events = $1; prepareEvents; }
- elsif (/threads: (\d+)$/) { $threads = $1; }
+ elsif (/threads: (.+)$/) { $threads = $1; @threads = split " ", $threads; }
elsif (/instrumentation: (\w+)$/) { $instrumentation = $1; }
}
@@ -423,7 +424,7 @@
if ($printStatus) {
if ($requestEvents <1) {
- print " Number of threads: $threads\n";
+ print " Number of running threads: " .($#threads+1). ", thread IDs: $threads\n";
print " Events collected: $events\n";
}
|
|
From: <sv...@va...> - 2007-02-16 20:11:35
|
Author: sewardj
Date: 2007-02-16 20:11:27 +0000 (Fri, 16 Feb 2007)
New Revision: 6600
Log:
Improve --debug-dump=frames output.
Modified:
trunk/coregrind/m_debuginfo/readdwarf.c
Modified: trunk/coregrind/m_debuginfo/readdwarf.c
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf.c 2007-02-16 19:20:28 UTC (rev 6599)
+++ trunk/coregrind/m_debuginfo/readdwarf.c 2007-02-16 20:11:27 UTC (rev 6600)
@@ -2211,7 +2211,7 @@
return 0; /* fail */
ctx->reg[reg] = restore_ctx->reg[reg];
if (si->ddump_frames)
- VG_(printf)(" rci:DW_CFA_restore\n");
+ VG_(printf)(" DW_CFA_restore: r%d\n", (Int)reg);
return i;
}
@@ -2235,19 +2235,22 @@
delta = (UInt)read_UChar(&instr[i]); i+= sizeof(UChar);
ctx->loc += delta;
if (si->ddump_frames)
- VG_(printf)(" rci:DW_CFA_advance_loc1\n");
+ VG_(printf)(" DW_CFA_advance_loc1: %d to %08lx\n",
+ (Int)delta, (Addr)ctx->loc + printing_bias);
break;
case DW_CFA_advance_loc2:
delta = (UInt)read_UShort(&instr[i]); i+= sizeof(UShort);
ctx->loc += delta;
if (si->ddump_frames)
- VG_(printf)(" rci:DW_CFA_advance_loc2\n");
+ VG_(printf)(" DW_CFA_advance_loc2: %d to %08lx\n",
+ (Int)delta, (Addr)ctx->loc + printing_bias);
break;
case DW_CFA_advance_loc4:
delta = (UInt)read_UInt(&instr[i]); i+= sizeof(UInt);
ctx->loc += delta;
if (si->ddump_frames)
- VG_(printf)(" rci:DW_CFA_advance_loc4\n");
+ VG_(printf)(" DW_CFA_advance_loc4: %d to %08lx\n",
+ (Int)delta, (Addr)ctx->loc + printing_bias);
break;
case DW_CFA_def_cfa:
@@ -2391,7 +2394,7 @@
i += nleb;
ctx->cfa_offset = off * ctx->data_a_f;
if (si->ddump_frames)
- VG_(printf)(" rci:DW_CFA_def_cfa_offset_sf\n");
+ VG_(printf)(" DW_CFA_def_cfa_offset_sf: %d\n", ctx->cfa_offset);
break;
case DW_CFA_undefined:
@@ -2448,7 +2451,8 @@
return 0; /* fail */
ctx->reg[reg].tag = RR_ValExpr;
if (si->ddump_frames)
- VG_(printf)(" rci:DW_CFA_val_expression (ignored)\n");
+ VG_(printf)(" DW_CFA_val_expression: r%d (ignored)\n",
+ (Int)reg);
break;
case DW_CFA_def_cfa_expression:
@@ -3057,9 +3061,9 @@
cie_augmentation++;
if (si->ddump_frames) {
UInt i;
- VG_(printf)(" Augmentation data: ");
+ VG_(printf)(" Augmentation data: ");
for (i = 0; i < length; i++)
- VG_(printf)("%02x", (UInt)data[i]);
+ VG_(printf)(" %02x", (UInt)data[i]);
VG_(printf)("\n");
}
} else {
@@ -3197,8 +3201,16 @@
((Addr)fde_initloc) - si->text_start_avma + fde_arange);
if (the_CIEs[cie].saw_z_augmentation) {
- data += read_leb128( data, &nbytes, 0);
+ UInt length = read_leb128( data, &nbytes, 0);
data += nbytes;
+ if (si->ddump_frames && (length > 0)) {
+ UInt i;
+ VG_(printf)(" Augmentation data: ");
+ for (i = 0; i < length; i++)
+ VG_(printf)(" %02x", (UInt)data[i]);
+ VG_(printf)("\n\n");
+ }
+ data += length;
}
fde_instrs = data;
|
|
From: <sv...@va...> - 2007-02-16 19:20:36
|
Author: sewardj
Date: 2007-02-16 19:20:28 +0000 (Fri, 16 Feb 2007)
New Revision: 6599
Log:
Correctly handle DW_CFA_def_cfa_sf (existing code fails to scale
offset by data_a_f).
Modified:
trunk/coregrind/m_debuginfo/readdwarf.c
Modified: trunk/coregrind/m_debuginfo/readdwarf.c
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf.c 2007-02-16 15:39:24 UTC (rev 6598)
+++ trunk/coregrind/m_debuginfo/readdwarf.c 2007-02-16 19:20:28 UTC (rev 6599)
@@ -2271,7 +2271,7 @@
if (reg < 0 || reg >= N_CFI_REGS)
return 0; /* fail */
ctx->cfa_reg = reg;
- ctx->cfa_offset = off;
+ ctx->cfa_offset = off * ctx->data_a_f;
if (si->ddump_frames)
VG_(printf)(" rci:DW_CFA_def_cfa_sf\n");
break;
@@ -2566,7 +2566,8 @@
i += nleb;
off = read_leb128( &instr[i], &nleb, 1 );
i += nleb;
- VG_(printf)(" DW_CFA_def_cfa_sf: r%d ofs %d\n", (Int)reg, (Int)off);
+ VG_(printf)(" DW_CFA_def_cfa_sf: r%d ofs %d\n",
+ (Int)reg, (Int)(off * data_a_f));
break;
case DW_CFA_register:
|
|
From: Ashley P. <as...@qu...> - 2007-02-16 16:35:29
|
On Fri, 2007-02-16 at 15:44 +0000, Julian Seward wrote:
> Hi Ashley
>
> > I've still got a couple of shared libraries where valgrind isn't
> > reporting functions/line numbers correctly for errors, what are the
> > instructions for using this new feature and I'll try it here, I remember
> > something about being able to enable it on a per so basis?
>
> Well, it's still in development. I just stopped for lunch and
> intend to chase some discrepancies it found now.
>
> Nevertheless: decide which so's you want to dump info for.
>
> Then do
>
> "--trace-symtab-patt=<pattern that matches the soname>"
> --debug-dump=frames
>
> and compare the results against
>
> readelf --debug-dump=frames
>
> for the .so in question. It's not pretty.
> I presume you are talking about amd64-linux here.
What do I put for --trace-symtab-patt? I get debug output without it
but if I add it then I get nothing. I've tried the library name "mpi",
the filename and the full path of the filename but none of them seem to
work. Yes it's amd64-linux.
$ ldd /usr/bin/mping
libmpi.so.1.0 => /usr/lib/mpi/default/lib/libmpi.so.1.0
(0x0000002a9566c000)
libmpio.so.1.0 => /usr/lib/mpi/default/lib/libmpio.so.1.0
(0x0000002a957d0000)
libelan.so.1 => /usr/lib64/libelan.so.1 (0x0000002a95908000)
libpthread.so.0 => /lib64/tls/libpthread.so.0
(0x0000002a95a86000)
librt.so.1 => /lib64/tls/librt.so.1 (0x0000002a95b9b000)
libg2c.so.0 => /usr/lib64/libg2c.so.0 (0x0000002a95cb6000)
libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a95dd7000)
librmscall.so.1 => /usr/lib64/librmscall.so.1
(0x0000002a9600b000)
libelanctrl.so.2 => /usr/lib64/libelanctrl.so.2
(0x0000002a96111000)
libelan4.so.1 => /usr/lib64/libelan4.so.1 (0x0000002a96218000)
/lib64/ld-linux-x86-64.so.2 (0x0000002a95556000)
libm.so.6 => /lib64/tls/libm.so.6 (0x0000002a96341000)
$ /opt/valgrind-3.3.0.SVN-quadrics-20070215/bin/valgrind
--debug-dump=line
--trace-symtab-patt=/usr/lib/mpi/default/lib/libmpi.so.1.0 /usr/bin/mping
==3018== Memcheck, a memory error detector.
==3018== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==3018== Using LibVEX rev 1594, a library for dynamic binary
translation.
==3018== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==3018== Using valgrind-3.3.0.SVN, a dynamic binary instrumentation
framework.
==3018== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==3018== For more details, rerun with: -v
==3018==
ELAN_EXCEPTION @ --: 6 (Initialisation error)
elan_init: Can't get capability from environment
==3018==
==3018== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 9 from 4)
==3018== malloc/free: in use at exit: 3,632 bytes in 3 blocks.
==3018== malloc/free: 3 allocs, 0 frees, 3,632 bytes allocated.
==3018== For counts of detected errors, rerun with: -v
==3018== searching for pointers to 3 not-freed blocks.
==3018== checked 522,504 bytes.
==3018==
==3018== LEAK SUMMARY:
==3018== definitely lost: 0 bytes in 0 blocks.
==3018== possibly lost: 0 bytes in 0 blocks.
==3018== still reachable: 3,632 bytes in 3 blocks.
==3018== suppressed: 0 bytes in 0 blocks.
==3018== Rerun with --leak-check=full to see details of leaked memory.
Aborted
|
|
From: Julian S. <js...@ac...> - 2007-02-16 15:47:02
|
Hi Ashley > I've still got a couple of shared libraries where valgrind isn't > reporting functions/line numbers correctly for errors, what are the > instructions for using this new feature and I'll try it here, I remember > something about being able to enable it on a per so basis? Well, it's still in development. I just stopped for lunch and intend to chase some discrepancies it found now. Nevertheless: decide which so's you want to dump info for. Then do "--trace-symtab-patt=<pattern that matches the soname>" --debug-dump=frames and compare the results against readelf --debug-dump=frames for the .so in question. It's not pretty. I presume you are talking about amd64-linux here. --debug-dump=line works much better right now. If you can find any object where the readelf and valgrind outputs differ, I'd be interested to see it. > Incidentally --debug-dump=lines is giving a error although > --debug-dump=frames seems to work. Yes, I mistyped: it's --debug-dump=line. J |
|
From: <sv...@va...> - 2007-02-16 15:39:41
|
Author: sewardj
Date: 2007-02-16 15:39:24 +0000 (Fri, 16 Feb 2007)
New Revision: 6598
Log:
Update
Modified:
trunk/docs/internals/3_2_BUGSTATUS.txt
Modified: trunk/docs/internals/3_2_BUGSTATUS.txt
===================================================================
--- trunk/docs/internals/3_2_BUGSTATUS.txt 2007-02-16 14:17:10 UTC (rev 6597)
+++ trunk/docs/internals/3_2_BUGSTATUS.txt 2007-02-16 15:39:24 UTC (rev 6598)
@@ -28,6 +28,8 @@
and MPI_STATUSES_IGNORE not supported and makes
a valid MPI program crash.
+Ashley logfile qualifiers in coredumps patch
+
------- Bugs reported and fixed in 3.2.3 ------
TRUNK 32BRANCH PRI BUG# WHAT
|
|
From: Ashley P. <as...@qu...> - 2007-02-16 14:49:52
|
On Fri, 2007-02-16 at 14:17 +0000, sv...@va... wrote: > Author: sewardj > Date: 2007-02-16 14:17:10 +0000 (Fri, 16 Feb 2007) > New Revision: 6597 > > Log: > Non-functional (debug printing only) change: > > Implement GNU binutils 'readelf' style output for --debug-dump=lines > (fully) and --debug-dump=frames (partially). > > Initial testing with --debug-dump=lines shows our DWARF2 line number > reader behaves identically to readelf for all examples I tried so far. Hi, I've still got a couple of shared libraries where valgrind isn't reporting functions/line numbers correctly for errors, what are the instructions for using this new feature and I'll try it here, I remember something about being able to enable it on a per so basis? Incidentally --debug-dump=lines is giving a error although --debug-dump=frames seems to work. Ashley, |
|
From: <sv...@va...> - 2007-02-16 14:17:23
|
Author: sewardj
Date: 2007-02-16 14:17:10 +0000 (Fri, 16 Feb 2007)
New Revision: 6597
Log:
Non-functional (debug printing only) change:
Implement GNU binutils 'readelf' style output for --debug-dump=lines
(fully) and --debug-dump=frames (partially).
Initial testing with --debug-dump=lines shows our DWARF2 line number
reader behaves identically to readelf for all examples I tried so far.
Modified:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/readdwarf.c
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c 2007-02-16 14:10:24 UTC (rev 6596)
+++ trunk/coregrind/m_debuginfo/debuginfo.c 2007-02-16 14:17:10 UTC (rev 6597)
@@ -136,11 +136,9 @@
if (traceme) {
si->trace_symtab = VG_(clo_trace_symtab);
si->trace_cfi = VG_(clo_trace_cfi);
-#if 0
- si->ddump_syms = VG_(clo_ddump_syms);
- si->ddump_line = VG_(clo_ddump_line);
- si->ddump_frames = VG_(clo_ddump_frames);
-#endif
+ si->ddump_syms = VG_(clo_debug_dump_syms);
+ si->ddump_line = VG_(clo_debug_dump_line);
+ si->ddump_frames = VG_(clo_debug_dump_frames);
}
Modified: trunk/coregrind/m_debuginfo/readdwarf.c
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf.c 2007-02-16 14:10:24 UTC (rev 6596)
+++ trunk/coregrind/m_debuginfo/readdwarf.c 2007-02-16 14:17:10 UTC (rev 6597)
@@ -178,7 +178,7 @@
DW_LNE_define_file = 3
};
-typedef struct State_Machine_Registers
+typedef struct
{
/* Information for the last statement boundary.
* Needed to calculate statement lengths. */
@@ -193,7 +193,7 @@
Int is_stmt;
Int basic_block;
Int end_sequence;
-} SMR;
+} LineSMR;
static
@@ -266,7 +266,7 @@
}
-static SMR state_machine_regs;
+static LineSMR state_machine_regs;
static
void reset_state_machine ( Int is_stmt )
@@ -349,12 +349,17 @@
);
}
reset_state_machine (is_stmt);
+ if (si->ddump_line)
+ VG_(printf)(" Extended opcode %d: End of Sequence\n\n",
+ (Int)op_code);
break;
case DW_LNE_set_address:
adr = *((Addr *)data);
- if (0) VG_(printf)("smr.a := %p\n", adr );
state_machine_regs.address = adr;
+ if (si->ddump_line)
+ VG_(printf)(" Extended opcode %d: set Address to 0x%lx\n",
+ (Int)op_code, (Addr)adr);
break;
case DW_LNE_define_file:
@@ -366,9 +371,13 @@
read_leb128 (data, & bytes_read, 0);
data += bytes_read;
read_leb128 (data, & bytes_read, 0);
+ if (si->ddump_line)
+ VG_(printf)(" DWARF2-line: set_address\n");
break;
default:
+ if (si->ddump_line)
+ VG_(printf)("process_extended_line_op:default\n");
break;
}
@@ -393,6 +402,7 @@
UChar* theBlock, /* IMAGE */
Int noLargerThan )
{
+ Int i;
DebugLineInfo info;
UChar* standard_opcodes;
UChar* end_of_sequence;
@@ -448,6 +458,10 @@
info.li_length = read_initial_length_field( external, &is64 );
external += is64 ? 12 : 4;
+ if (si->ddump_line)
+ VG_(printf)(" Length: %llu\n",
+ info.li_length);
+
/* Check the length of the block. */
if (info.li_length > noLargerThan) {
ML_(symerr)("DWARF line info appears to be corrupt "
@@ -458,6 +472,10 @@
/* Check its version number. */
info.li_version = * ((UShort *)external);
external += 2;
+ if (si->ddump_line)
+ VG_(printf)(" DWARF Version: %d\n",
+ (Int)info.li_version);
+
if (info.li_version != 2) {
ML_(symerr)("Only DWARF version 2 line info "
"is currently supported.");
@@ -467,13 +485,22 @@
info.li_header_length = ui->dw64 ? *((ULong*)external)
: (ULong)(*((UInt*)external));
external += ui->dw64 ? 8 : 4;
+ if (si->ddump_line)
+ VG_(printf)(" Prologue Length: %llu\n",
+ info.li_header_length);
info.li_min_insn_length = * ((UChar *)external);
external += 1;
+ if (si->ddump_line)
+ VG_(printf)(" Minimum Instruction Length: %d\n",
+ (Int)info.li_min_insn_length);
- info.li_default_is_stmt = True;
- /* WAS: = * ((UChar *)(external->li_default_is_stmt)); */
+ info.li_default_is_stmt = * ((UChar *)external);
external += 1;
+ if (si->ddump_line)
+ VG_(printf)(" Initial value of 'is_stmt': %d\n",
+ (Int)info.li_default_is_stmt);
+
/* Josef Weidendorfer (20021021) writes:
It seems to me that the Intel Fortran compiler generates bad
@@ -489,18 +516,29 @@
I just had a look at the GDB DWARF2 reader... They completely
ignore "is_stmt" when recording line info ;-) That's the reason
"objdump -S" works on files from the the intel fortran compiler.
- */
+ Therefore: */
+ info.li_default_is_stmt = True;
+
/* JRS: changed (UInt*) to (UChar*) */
info.li_line_base = * ((UChar *)external);
info.li_line_base = (Int)(signed char)info.li_line_base;
external += 1;
+ if (si->ddump_line)
+ VG_(printf)(" Line Base: %d\n",
+ info.li_line_base);
info.li_line_range = * ((UChar *)external);
external += 1;
+ if (si->ddump_line)
+ VG_(printf)(" Line Range: %d\n",
+ (Int)info.li_line_range);
info.li_opcode_base = * ((UChar *)external);
external += 1;
+ if (si->ddump_line)
+ VG_(printf)(" Opcode Base: %d\n\n",
+ info.li_opcode_base);
if (0) VG_(printf)("dwarf2: line base: %d, range %d, opc base: %d\n",
(Int)info.li_line_base,
@@ -514,15 +552,30 @@
/* Read the contents of the Opcodes table. */
standard_opcodes = external;
+ if (si->ddump_line) {
+ VG_(printf)(" Opcodes:\n");
+ for (i = 1; i < (Int)info.li_opcode_base; i++) {
+ VG_(printf)(" Opcode %d has %d args\n",
+ i, (Int)standard_opcodes[i-1]);
+ }
+ VG_(printf)("\n");
+ }
/* Read the contents of the Directory table. */
data = standard_opcodes + info.li_opcode_base - 1;
+ if (si->ddump_line)
+ VG_(printf)(" The Directory Table%s\n",
+ *data == 0 ? " is empty." : ":" );
+
while (* data != 0) {
# define NBUF 4096
static Char buf[NBUF];
+ if (si->ddump_line)
+ VG_(printf)(" %s\n", data);
+
/* If data[0] is '/', then 'data' is an absolute path and we
don't mess with it. Otherwise, if we can, construct the
'path ui->compdir' ++ "/" ++ 'data'. */
@@ -551,6 +604,10 @@
# undef NBUF
}
+
+ if (si->ddump_line)
+ VG_(printf)("\n");
+
if (*data != 0) {
ML_(symerr)("can't find NUL at end of DWARF2 directory table");
goto out;
@@ -559,30 +616,48 @@
/* Read the contents of the File Name table. This produces a bunch
of file names, and for each, an index to the corresponding
- direcory name entry. */
+ directory name entry. */
+ if (si->ddump_line) {
+ VG_(printf)(" The File Name Table:\n");
+ VG_(printf)(" Entry Dir Time Size Name\n");
+ }
+
+ i = 1;
while (* data != 0) {
UChar* name;
Int bytes_read, diridx;
+ Int uu_time, uu_size; /* unused, and a guess */
name = data;
data += VG_(strlen) ((Char *) data) + 1;
diridx = read_leb128 (data, & bytes_read, 0);
data += bytes_read;
- read_leb128 (data, & bytes_read, 0);
+ uu_time = read_leb128 (data, & bytes_read, 0);
data += bytes_read;
- read_leb128 (data, & bytes_read, 0);
+ uu_size = read_leb128 (data, & bytes_read, 0);
data += bytes_read;
addto_WordArray( &filenames, (Word)ML_(addStr)(si,name,-1) );
addto_WordArray( &fnidx2dir, (Word)diridx );
if (0) VG_(printf)("file %s diridx %d\n", name, diridx );
+ if (si->ddump_line)
+ VG_(printf)(" %d\t%d\t%d\t%d\t%s\n",
+ i, diridx, uu_time, uu_size, name);
+ i++;
}
+
+ if (si->ddump_line)
+ VG_(printf)("\n");
+
if (*data != 0) {
ML_(symerr)("can't find NUL at end of DWARF2 file name table");
goto out;
}
data ++;
+ if (si->ddump_line)
+ VG_(printf)(" Line Number Statements:\n");
+
/* Now display the statements. */
while (data < end_of_sequence) {
@@ -603,12 +678,19 @@
* info.li_min_insn_length;
advAddr = adv;
state_machine_regs.address += adv;
+
if (0) VG_(printf)("smr.a += %p\n", adv );
adv = (op_code % info.li_line_range) + info.li_line_base;
if (0) VG_(printf)("1002: si->o %p, smr.a %p\n",
debug_offset, state_machine_regs.address );
state_machine_regs.line += adv;
+ if (si->ddump_line)
+ VG_(printf)(" Special opcode %d: advance Address by %d "
+ "to 0x%lx and Line by %d to %d\n",
+ (Int)op_code, advAddr, state_machine_regs.address,
+ (Int)adv, (Int)state_machine_regs.line );
+
if (state_machine_regs.is_stmt) {
/* only add a statement if there was a previous boundary */
if (state_machine_regs.last_address)
@@ -630,7 +712,8 @@
}
- else /* ! (op_code >= info.li_opcode_base) */
+ else { /* ! (op_code >= info.li_opcode_base) */
+
switch (op_code) {
case DW_LNS_extended_op:
data += process_extended_line_op (
@@ -660,6 +743,8 @@
state_machine_regs.last_line = state_machine_regs.line;
}
state_machine_regs.basic_block = 0; /* JRS added */
+ if (si->ddump_line)
+ VG_(printf)(" Copy\n");
break;
case DW_LNS_advance_pc:
@@ -668,34 +753,49 @@
data += bytes_read;
state_machine_regs.address += adv;
if (0) VG_(printf)("smr.a += %p\n", adv );
+ if (si->ddump_line)
+ VG_(printf)(" Advance PC by %d to 0x%lx\n",
+ (Int)adv, state_machine_regs.address);
break;
case DW_LNS_advance_line:
adv = read_leb128 (data, & bytes_read, 1);
data += bytes_read;
state_machine_regs.line += adv;
+ if (si->ddump_line)
+ VG_(printf)(" Advance Line by %d to %d\n",
+ (Int)adv, (Int)state_machine_regs.line);
break;
case DW_LNS_set_file:
adv = read_leb128 (data, & bytes_read, 0);
data += bytes_read;
state_machine_regs.file = adv;
+ if (si->ddump_line)
+ VG_(printf)(" Set File Name to entry %d in the File Name Table\n",
+ (Int)adv);
break;
case DW_LNS_set_column:
adv = read_leb128 (data, & bytes_read, 0);
data += bytes_read;
state_machine_regs.column = adv;
+ if (si->ddump_line)
+ VG_(printf)(" DWARF2-line: set_column\n");
break;
case DW_LNS_negate_stmt:
adv = state_machine_regs.is_stmt;
adv = ! adv;
state_machine_regs.is_stmt = adv;
+ if (si->ddump_line)
+ VG_(printf)(" DWARF2-line: negate_stmt\n");
break;
case DW_LNS_set_basic_block:
state_machine_regs.basic_block = 1;
+ if (si->ddump_line)
+ VG_(printf)(" DWARF2-line: set_basic_block\n");
break;
case DW_LNS_const_add_pc:
@@ -703,6 +803,9 @@
* info.li_min_insn_length);
state_machine_regs.address += adv;
if (0) VG_(printf)("smr.a += %p\n", adv );
+ if (si->ddump_line)
+ VG_(printf)(" Advance PC by constant %d to 0x%lx\n",
+ (Int)adv, (Addr)state_machine_regs.address);
break;
case DW_LNS_fixed_advance_pc:
@@ -711,17 +814,25 @@
data += 2;
state_machine_regs.address += adv;
if (0) VG_(printf)("smr.a += %p\n", adv );
+ if (si->ddump_line)
+ VG_(printf)(" DWARF2-line: fixed_advance_pc\n");
break;
case DW_LNS_set_prologue_end:
+ if (si->ddump_line)
+ VG_(printf)(" DWARF2-line: set_prologue_end\n");
break;
case DW_LNS_set_epilogue_begin:
+ if (si->ddump_line)
+ VG_(printf)(" DWARF2-line: set_epilogue_begin\n");
break;
case DW_LNS_set_isa:
adv = read_leb128 (data, & bytes_read, 0);
data += bytes_read;
+ if (si->ddump_line)
+ VG_(printf)(" DWARF2-line: set_isa\n");
break;
default: {
@@ -730,12 +841,19 @@
read_leb128 (data, &bytes_read, 0);
data += bytes_read;
}
+ if (si->ddump_line)
+ VG_(printf)(" Unknown opcode %d\n", (Int)op_code);
+ break;
}
- break;
} /* switch (op_code) */
+ } /* if (op_code >= info.li_opcode_base) */
+
} /* while (data < end_of_sequence) */
+ if (si->ddump_line)
+ VG_(printf)("\n");
+
out:
free_WordArray(&filenames);
free_WordArray(&dirnames);
@@ -788,7 +906,8 @@
void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui,
UChar* unitblock_img,
UChar* debugabbrev_img,
- UChar* debugstr_img )
+ UChar* debugstr_img,
+ struct _SegInfo* si )
{
UInt acode, abcode;
ULong atoffs, blklen;
@@ -997,7 +1116,7 @@
if (0)
VG_(printf)( "Reading UnitInfo at 0x%x.....\n",
block_img - debuginfo_img );
- read_unitinfo_dwarf2( &ui, block_img, debugabbrev_img, debugstr_img );
+ read_unitinfo_dwarf2( &ui, block_img, debugabbrev_img, debugstr_img, si );
if (0)
VG_(printf)( " => LINES=0x%llx NAME=%s DIR=%s\n",
ui.stmt_list, ui.name, ui.compdir );
@@ -2056,11 +2175,15 @@
Int i = 0;
UChar hi2 = (instr[i] >> 6) & 3;
UChar lo6 = instr[i] & 0x3F;
+ Addr printing_bias = ((Addr)ctx->initloc) - ((Addr)si->text_start_avma);
i++;
if (hi2 == DW_CFA_advance_loc) {
delta = (UInt)lo6;
ctx->loc += delta;
+ if (si->ddump_frames)
+ VG_(printf)(" DW_CFA_advance_loc: %d to %08lx\n",
+ (Int)delta, (Addr)ctx->loc + printing_bias);
return i;
}
@@ -2073,6 +2196,10 @@
return 0; /* fail */
ctx->reg[reg].tag = RR_CFAoff;
ctx->reg[reg].coff = off * ctx->data_a_f;
+ if (si->ddump_frames)
+ VG_(printf)(" DW_CFA_offset: r%d at cfa%s%d\n",
+ (Int)reg, ctx->reg[reg].coff < 0 ? "" : "+",
+ (Int)ctx->reg[reg].coff );
return i;
}
@@ -2083,6 +2210,8 @@
if (restore_ctx == NULL)
return 0; /* fail */
ctx->reg[reg] = restore_ctx->reg[reg];
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_restore\n");
return i;
}
@@ -2090,6 +2219,8 @@
switch (lo6) {
case DW_CFA_nop:
+ if (si->ddump_frames)
+ VG_(printf)(" DW_CFA_nop\n");
break;
case DW_CFA_set_loc:
/* WAS:
@@ -2097,18 +2228,26 @@
Was this ever right? */
ctx->loc = read_encoded_Addr(&len, adi, &instr[i]);
i += len;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_set_loc\n");
break;
case DW_CFA_advance_loc1:
delta = (UInt)read_UChar(&instr[i]); i+= sizeof(UChar);
ctx->loc += delta;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_advance_loc1\n");
break;
case DW_CFA_advance_loc2:
delta = (UInt)read_UShort(&instr[i]); i+= sizeof(UShort);
ctx->loc += delta;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_advance_loc2\n");
break;
case DW_CFA_advance_loc4:
delta = (UInt)read_UInt(&instr[i]); i+= sizeof(UInt);
ctx->loc += delta;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_advance_loc4\n");
break;
case DW_CFA_def_cfa:
@@ -2120,6 +2259,8 @@
return 0; /* fail */
ctx->cfa_reg = reg;
ctx->cfa_offset = off;
+ if (si->ddump_frames)
+ VG_(printf)(" DW_CFA_def_cfa: r%d ofs %d\n", (Int)reg, (Int)off);
break;
case DW_CFA_def_cfa_sf:
@@ -2131,6 +2272,8 @@
return 0; /* fail */
ctx->cfa_reg = reg;
ctx->cfa_offset = off;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_def_cfa_sf\n");
break;
case DW_CFA_register:
@@ -2144,6 +2287,8 @@
return 0; /* fail */
ctx->reg[reg].tag = RR_Reg;
ctx->reg[reg].reg = reg2;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_register\n");
break;
case DW_CFA_offset_extended:
@@ -2155,6 +2300,8 @@
return 0; /* fail */
ctx->reg[reg].tag = RR_CFAoff;
ctx->reg[reg].coff = off * ctx->data_a_f;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_offset_extended\n");
break;
case DW_CFA_offset_extended_sf:
@@ -2166,6 +2313,8 @@
return 0; /* fail */
ctx->reg[reg].tag = RR_CFAoff;
ctx->reg[reg].coff = off * ctx->data_a_f;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_offset_extended_sf\n");
break;
case DW_CFA_GNU_negative_offset_extended:
@@ -2177,6 +2326,8 @@
return 0; /* fail */
ctx->reg[reg].tag = RR_CFAoff;
ctx->reg[reg].coff = -off * ctx->data_a_f;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_GNU_negative_offset_extended\n");
break;
case DW_CFA_restore_extended:
@@ -2187,6 +2338,8 @@
if (restore_ctx == NULL)
return 0; /* fail */
ctx->reg[reg] = restore_ctx->reg[reg];
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_restore_extended\n");
break;
case DW_CFA_val_offset:
@@ -2198,6 +2351,8 @@
return 0; /* fail */
ctx->reg[reg].tag = RR_CFAValoff;
ctx->reg[reg].coff = off * ctx->data_a_f;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_val_offset\n");
break;
case DW_CFA_val_offset_sf:
@@ -2209,6 +2364,8 @@
return 0; /* fail */
ctx->reg[reg].tag = RR_CFAValoff;
ctx->reg[reg].coff = off * ctx->data_a_f;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_val_offset_sf\n");
break;
case DW_CFA_def_cfa_register:
@@ -2217,18 +2374,24 @@
if (reg < 0 || reg >= N_CFI_REGS)
return 0; /* fail */
ctx->cfa_reg = reg;
+ if (si->ddump_frames)
+ VG_(printf)(" DW_CFA_def_cfa_reg: r%d\n", (Int)reg );
break;
case DW_CFA_def_cfa_offset:
off = read_leb128( &instr[i], &nleb, 0);
i += nleb;
ctx->cfa_offset = off;
+ if (si->ddump_frames)
+ VG_(printf)(" DW_CFA_def_cfa_offset: %d\n", (Int)off);
break;
case DW_CFA_def_cfa_offset_sf:
off = read_leb128( &instr[i], &nleb, 1);
i += nleb;
ctx->cfa_offset = off * ctx->data_a_f;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_def_cfa_offset_sf\n");
break;
case DW_CFA_undefined:
@@ -2239,6 +2402,8 @@
ctx->reg[reg].tag = RR_Undef;
ctx->reg[reg].coff = 0;
ctx->reg[reg].reg = 0;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_undefined\n");
break;
case DW_CFA_GNU_args_size:
@@ -2246,6 +2411,8 @@
ignores these. */
off = read_leb128( &instr[i], &nleb, 0 );
i += nleb;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_GNU_args_size (ignored)\n");
break;
case DW_CFA_expression:
@@ -2262,6 +2429,8 @@
if (reg < 0 || reg >= N_CFI_REGS)
return 0; /* fail */
ctx->reg[reg].tag = RR_Expr;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_expression (ignored)\n");
break;
case DW_CFA_val_expression:
@@ -2278,6 +2447,8 @@
if (reg < 0 || reg >= N_CFI_REGS)
return 0; /* fail */
ctx->reg[reg].tag = RR_ValExpr;
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_val_expression (ignored)\n");
break;
case DW_CFA_def_cfa_expression:
@@ -2288,16 +2459,22 @@
i += nleb;
i += len;
ctx->cfa_reg = -1; /* indicating we don't know */
+ if (si->ddump_frames)
+ VG_(printf)(" rci:DW_CFA_def_cfa_expression (ignored)\n");
break;
case DW_CFA_GNU_window_save:
/* Ignored. This appears to be sparc-specific; quite why it
turns up in SuSE-supplied x86 .so's beats me. */
+ if (si->ddump_frames)
+ VG_(printf)("DW_CFA_GNU_window_save\n");
break;
default:
VG_(message)(Vg_DebugMsg, "DWARF2 CFI reader: unhandled CFI "
"instruction 0:%d", (Int)lo6);
+ if (si->ddump_frames)
+ VG_(printf)(" rci:run_CF_instruction:default\n");
i = 0;
break;
}
@@ -2306,13 +2483,16 @@
}
-/* Show a CFI instruction, and also return its length. */
+/* Show a CFI instruction, and also return its length. Show it as
+ close as possible (preferably identical) to how GNU binutils
+ readelf --debug-dump=frames would. */
static Int show_CF_instruction ( UChar* instr,
- AddressDecodingInfo* adi )
+ AddressDecodingInfo* adi,
+ Int code_a_f, Int data_a_f )
{
UInt delta;
- Int off, reg, reg2, nleb, len;
+ Int off, coff, reg, reg2, nleb, len;
Addr loc;
Int i = 0;
UChar hi2 = (instr[i] >> 6) & 3;
@@ -2325,19 +2505,21 @@
instr[i+4], instr[i+5], instr[i+6], instr[i+7] );
if (hi2 == DW_CFA_advance_loc) {
- VG_(printf)("DW_CFA_advance_loc(%d)\n", (Int)lo6);
+ VG_(printf)(" sci:DW_CFA_advance_loc(%d)\n", (Int)lo6);
return i;
}
if (hi2 == DW_CFA_offset) {
off = read_leb128( &instr[i], &nleb, 0 );
i += nleb;
- VG_(printf)("DW_CFA_offset(r%d + %d x data_af)\n", (Int)lo6, off);
+ coff = off * data_a_f;
+ VG_(printf)(" DW_CFA_offset: r%d at cfa%s%d\n",
+ (Int)lo6, coff < 0 ? "" : "+", (Int)coff );
return i;
}
if (hi2 == DW_CFA_restore) {
- VG_(printf)("DW_CFA_restore(r%d)\n", (Int)lo6);
+ VG_(printf)(" sci:DW_CFA_restore(r%d)\n", (Int)lo6);
return i;
}
@@ -2346,29 +2528,29 @@
switch (lo6) {
case DW_CFA_nop:
- VG_(printf)("DW_CFA_nop\n");
+ VG_(printf)(" DW_CFA_nop\n");
break;
case DW_CFA_set_loc:
/* WAS: loc = read_Addr(&instr[i]); i+= sizeof(Addr); */
loc = read_encoded_Addr(&len, adi, &instr[i]);
i += len;
- VG_(printf)("DW_CFA_set_loc(%p)\n", loc);
+ VG_(printf)(" sci:DW_CFA_set_loc(%p)\n", loc);
break;
case DW_CFA_advance_loc1:
delta = (UInt)read_UChar(&instr[i]); i+= sizeof(UChar);
- VG_(printf)("DW_CFA_advance_loc1(%d)\n", delta);
+ VG_(printf)(" sci:DW_CFA_advance_loc1(%d)\n", delta);
break;
case DW_CFA_advance_loc2:
delta = (UInt)read_UShort(&instr[i]); i+= sizeof(UShort);
- VG_(printf)("DW_CFA_advance_loc2(%d)\n", delta);
+ VG_(printf)(" sci:DW_CFA_advance_loc2(%d)\n", delta);
break;
case DW_CFA_advance_loc4:
delta = (UInt)read_UInt(&instr[i]); i+= sizeof(UInt);
- VG_(printf)("DW_CFA_advance_loc4(%d)\n", delta);
+ VG_(printf)(" sci:DW_CFA_advance_loc4(%d)\n", delta);
break;
case DW_CFA_def_cfa:
@@ -2376,7 +2558,7 @@
i += nleb;
off = read_leb128( &instr[i], &nleb, 0 );
i += nleb;
- VG_(printf)("DW_CFA_def_cfa(r%d, off %d)\n", reg, off);
+ VG_(printf)(" DW_CFA_def_cfa: r%d ofs %d\n", (Int)reg, (Int)off);
break;
case DW_CFA_def_cfa_sf:
@@ -2384,7 +2566,7 @@
i += nleb;
off = read_leb128( &instr[i], &nleb, 1 );
i += nleb;
- VG_(printf)("DW_CFA_def_cfa_sf(r%d, off %d)\n", reg, off);
+ VG_(printf)(" DW_CFA_def_cfa_sf: r%d ofs %d\n", (Int)reg, (Int)off);
break;
case DW_CFA_register:
@@ -2392,64 +2574,64 @@
i += nleb;
reg2 = read_leb128( &instr[i], &nleb, 0);
i += nleb;
- VG_(printf)("DW_CFA_register(r%d, r%d)\n", reg, reg2);
+ VG_(printf)(" sci:DW_CFA_register(r%d, r%d)\n", reg, reg2);
break;
case DW_CFA_def_cfa_register:
reg = read_leb128( &instr[i], &nleb, 0);
i += nleb;
- VG_(printf)("DW_CFA_def_cfa_register(r%d)\n", reg);
+ VG_(printf)(" sci:DW_CFA_def_cfa_register(r%d)\n", reg);
break;
case DW_CFA_def_cfa_offset:
off = read_leb128( &instr[i], &nleb, 0);
i += nleb;
- VG_(printf)("DW_CFA_def_cfa_offset(%d)\n", off);
+ VG_(printf)(" sci:DW_CFA_def_cfa_offset(%d)\n", off);
break;
case DW_CFA_def_cfa_offset_sf:
off = read_leb128( &instr[i], &nleb, 1);
i += nleb;
- VG_(printf)("DW_CFA_def_cfa_offset_sf(%d)\n", off);
+ VG_(printf)(" sci:DW_CFA_def_cfa_offset_sf(%d)\n", off);
break;
case DW_CFA_restore_extended:
reg = read_leb128( &instr[i], &nleb, 0);
i += nleb;
- VG_(printf)("DW_CFA_restore_extended(r%d)\n", reg);
+ VG_(printf)(" sci:DW_CFA_restore_extended(r%d)\n", reg);
break;
case DW_CFA_undefined:
reg = read_leb128( &instr[i], &nleb, 0);
i += nleb;
- VG_(printf)("DW_CFA_undefined(r%d)\n", reg);
+ VG_(printf)(" sci:DW_CFA_undefined(r%d)\n", reg);
break;
case DW_CFA_same_value:
reg = read_leb128( &instr[i], &nleb, 0);
i += nleb;
- VG_(printf)("DW_CFA_same_value(r%d)\n", reg);
+ VG_(printf)(" sci:DW_CFA_same_value(r%d)\n", reg);
break;
case DW_CFA_remember_state:
- VG_(printf)("DW_CFA_remember_state\n");
+ VG_(printf)(" sci:DW_CFA_remember_state\n");
break;
case DW_CFA_restore_state:
- VG_(printf)("DW_CFA_restore_state\n");
+ VG_(printf)(" sci:DW_CFA_restore_state\n");
break;
case DW_CFA_GNU_args_size:
off = read_leb128( &instr[i], &nleb, 0 );
i += nleb;
- VG_(printf)("DW_CFA_GNU_args_size(%d)\n", off );
+ VG_(printf)(" sci:DW_CFA_GNU_args_size(%d)\n", off );
break;
case DW_CFA_def_cfa_expression:
len = read_leb128( &instr[i], &nleb, 0 );
i += nleb;
i += len;
- VG_(printf)("DW_CFA_def_cfa_expression(length %d)\n", len);
+ VG_(printf)(" sci:DW_CFA_def_cfa_expression(length %d)\n", len);
break;
case DW_CFA_expression:
@@ -2458,7 +2640,7 @@
len = read_leb128( &instr[i], &nleb, 0 );
i += nleb;
i += len;
- VG_(printf)("DW_CFA_expression(r%d, length %d)\n", reg, len);
+ VG_(printf)(" sci:DW_CFA_expression(r%d, length %d)\n", reg, len);
break;
case DW_CFA_val_expression:
@@ -2467,7 +2649,7 @@
len = read_leb128( &instr[i], &nleb, 0 );
i += nleb;
i += len;
- VG_(printf)("DW_CFA_val_expression(r%d, length %d)\n", reg, len);
+ VG_(printf)(" sci:DW_CFA_val_expression(r%d, length %d)\n", reg, len);
break;
case DW_CFA_offset_extended:
@@ -2475,7 +2657,8 @@
i += nleb;
off = read_leb128( &instr[i], &nleb, 0 );
i += nleb;
- VG_(printf)("DW_CFA_offset_extended(r%d, off %d x data_af)\n", reg, off);
+ VG_(printf)(" sci:DW_CFA_offset_extended(r%d, "
+ "off %d x data_af)\n", reg, off);
break;
case DW_CFA_offset_extended_sf:
@@ -2483,7 +2666,8 @@
i += nleb;
off = read_leb128( &instr[i], &nleb, 1 );
i += nleb;
- VG_(printf)("DW_CFA_offset_extended_sf(r%d, off %d x data_af)\n", reg, off);
+ VG_(printf)(" sci:DW_CFA_offset_extended_sf"
+ "(r%d, off %d x data_af)\n", reg, off);
break;
case DW_CFA_GNU_negative_offset_extended:
@@ -2491,7 +2675,8 @@
i += nleb;
off = read_leb128( &instr[i], &nleb, 0 );
i += nleb;
- VG_(printf)("DW_CFA_GNU_negative_offset_extended(r%d, off %d x data_af)\n", reg, -off);
+ VG_(printf)(" sci:DW_CFA_GNU_negative_offset_extended"
+ "(r%d, off %d x data_af)\n", reg, -off);
break;
case DW_CFA_val_offset:
@@ -2499,7 +2684,8 @@
i += nleb;
off = read_leb128( &instr[i], &nleb, 0 );
i += nleb;
- VG_(printf)("DW_CFA_val_offset(r%d, off %d x data_af)\n", reg, off);
+ VG_(printf)(" sci:DW_CFA_val_offset(r%d, off %d x data_af)\n",
+ reg, off);
break;
case DW_CFA_val_offset_sf:
@@ -2507,15 +2693,16 @@
i += nleb;
off = read_leb128( &instr[i], &nleb, 1 );
i += nleb;
- VG_(printf)("DW_CFA_val_offset_sf(r%d, off %d x data_af)\n", reg, off);
+ VG_(printf)(" sci:DW_CFA_val_offset_sf(r%d, off %d x data_af)\n",
+ reg, off);
break;
case DW_CFA_GNU_window_save:
- VG_(printf)("DW_CFA_GNU_window_save\n");
+ VG_(printf)(" sci:DW_CFA_GNU_window_save\n");
break;
default:
- VG_(printf)("0:%d\n", (Int)lo6);
+ VG_(printf)(" sci:0:%d\n", (Int)lo6);
break;
}
@@ -2523,13 +2710,15 @@
}
+/* Show the instructions in instrs[0 .. ilen-1]. */
static void show_CF_instructions ( UChar* instrs, Int ilen,
- AddressDecodingInfo* adi )
+ AddressDecodingInfo* adi,
+ Int code_a_f, Int data_a_f )
{
Int i = 0;
while (True) {
if (i >= ilen) break;
- i += show_CF_instruction( &instrs[i], adi );
+ i += show_CF_instruction( &instrs[i], adi, code_a_f, data_a_f );
}
}
@@ -2597,6 +2786,7 @@
*/
static
Bool run_CF_instructions ( struct _SegInfo* si,
+ Bool record,
UnwindContext* ctx, UChar* instrs, Int ilen,
UWord fde_arange,
UnwindContext* restore_ctx,
@@ -2611,13 +2801,14 @@
while (True) {
loc_prev = ctx->loc;
if (i >= ilen) break;
- if (0) (void)show_CF_instruction( &instrs[i], adi );
+ if (0) (void)show_CF_instruction( &instrs[i], adi,
+ ctx->code_a_f, ctx->data_a_f );
j = run_CF_instruction( ctx, &instrs[i], restore_ctx, adi, si );
if (j == 0)
return False; /* execution failed */
i += j;
if (0) ppUnwindContext(ctx);
- if (loc_prev != ctx->loc && si) {
+ if (record && loc_prev != ctx->loc) {
summ_ok = summarise_context ( &cfsi, loc_prev, ctx, si );
if (summ_ok) {
kludge_then_addDiCfSI(si, &cfsi);
@@ -2629,7 +2820,7 @@
if (ctx->loc < fde_arange) {
loc_prev = ctx->loc;
ctx->loc = fde_arange;
- if (si) {
+ if (record) {
summ_ok = summarise_context ( &cfsi, loc_prev, ctx, si );
if (summ_ok) {
kludge_then_addDiCfSI(si, &cfsi);
@@ -2753,8 +2944,12 @@
of the sequence. ?? Neither the DWARF2 spec not the AMD64
ABI spec say this, though. */
if (ciefde_len == 0) {
- if (data == ehframe_image + ehframe_sz)
+ if (data == ehframe_image + ehframe_sz) {
+ if (si->ddump_frames)
+ VG_(printf)("%08lx ZERO terminator\n\n",
+ ((Addr)ciefde_start) - ((Addr)ehframe_image));
return;
+ }
how = "zero-sized CIE/FDE but not at section end";
goto bad;
}
@@ -2791,9 +2986,17 @@
later when looking at an FDE. */
the_CIEs[this_CIE].offset = ciefde_start - ehframe_image;
+ if (si->ddump_frames)
+ VG_(printf)("%08lx %08lx %08lx CIE\n",
+ ((Addr)ciefde_start) - ((Addr)ehframe_image),
+ (Addr)ciefde_len,
+ (Addr)cie_pointer );
+
cie_version = read_UChar(data); data += sizeof(UChar);
if (si->trace_cfi)
VG_(printf)("cie.version = %d\n", (Int)cie_version);
+ if (si->ddump_frames)
+ VG_(printf)(" Version: %d\n", (Int)cie_version);
if (cie_version != 1) {
how = "unexpected CIE version (not 1)";
goto bad;
@@ -2803,6 +3006,8 @@
data += 1 + VG_(strlen)(cie_augmentation);
if (si->trace_cfi)
VG_(printf)("cie.augment = \"%s\"\n", cie_augmentation);
+ if (si->ddump_frames)
+ VG_(printf)(" Augmentation: \"%s\"\n", cie_augmentation);
if (cie_augmentation[0] == 'e' && cie_augmentation[1] == 'h') {
data += sizeof(Addr);
@@ -2814,18 +3019,28 @@
if (si->trace_cfi)
VG_(printf)("cie.code_af = %d\n",
the_CIEs[this_CIE].code_a_f);
+ if (si->ddump_frames)
+ VG_(printf)(" Code alignment factor: %d\n",
+ (Int)the_CIEs[this_CIE].code_a_f);
the_CIEs[this_CIE].data_a_f = read_leb128( data, &nbytes, 1);
data += nbytes;
if (si->trace_cfi)
VG_(printf)("cie.data_af = %d\n",
the_CIEs[this_CIE].data_a_f);
+ if (si->ddump_frames)
+ VG_(printf)(" Data alignment factor: %d\n",
+ (Int)the_CIEs[this_CIE].data_a_f);
the_CIEs[this_CIE].ra_reg = (Int)read_UChar(data);
data += sizeof(UChar);
if (si->trace_cfi)
VG_(printf)("cie.ra_reg = %d\n",
the_CIEs[this_CIE].ra_reg);
+ if (si->ddump_frames)
+ VG_(printf)(" Return address column: %d\n",
+ (Int)the_CIEs[this_CIE].ra_reg);
+
if (the_CIEs[this_CIE].ra_reg < 0
|| the_CIEs[this_CIE].ra_reg >= N_CFI_REGS) {
how = "cie.ra_reg has implausible value";
@@ -2839,6 +3054,13 @@
data += nbytes;
the_CIEs[this_CIE].instrs = data + length;
cie_augmentation++;
+ if (si->ddump_frames) {
+ UInt i;
+ VG_(printf)(" Augmentation data: ");
+ for (i = 0; i < length; i++)
+ VG_(printf)("%02x", (UInt)data[i]);
+ VG_(printf)("\n");
+ }
} else {
the_CIEs[this_CIE].instrs = NULL;
}
@@ -2896,15 +3118,25 @@
data += the_CIEs[this_CIE].ilen;
- if (si->trace_cfi) {
+ /* Show the CIE's instructions (the preamble for each FDE
+ that uses this CIE). */
+ if (si->ddump_frames)
+ VG_(printf)("\n");
+
+ if (si->trace_cfi || si->ddump_frames) {
AddressDecodingInfo adi;
adi.encoding = the_CIEs[this_CIE].address_encoding;
adi.ehframe_image = ehframe_image;
adi.ehframe_avma = ehframe_avma;
- show_CF_instructions(the_CIEs[this_CIE].instrs,
- the_CIEs[this_CIE].ilen, &adi );
+ show_CF_instructions( the_CIEs[this_CIE].instrs,
+ the_CIEs[this_CIE].ilen, &adi,
+ the_CIEs[this_CIE].code_a_f,
+ the_CIEs[this_CIE].data_a_f );
}
+ if (si->ddump_frames)
+ VG_(printf)("\n");
+
} else {
AddressDecodingInfo adi;
@@ -2954,6 +3186,15 @@
if (si->trace_cfi)
VG_(printf)("fde.arangec = %p\n", (void*)fde_arange);
+ if (si->ddump_frames)
+ VG_(printf)("%08lx %08lx %08lx FDE cie=%08lx pc=%08lx..%08lx\n",
+ ((Addr)ciefde_start) - ((Addr)ehframe_image),
+ (Addr)ciefde_len,
+ (Addr)cie_pointer,
+ (Addr)look_for,
+ ((Addr)fde_initloc) - si->text_start_avma,
+ ((Addr)fde_initloc) - si->text_start_avma + fde_arange);
+
if (the_CIEs[cie].saw_z_augmentation) {
data += read_leb128( data, &nbytes, 0);
data += nbytes;
@@ -2978,7 +3219,9 @@
adi.ehframe_avma = ehframe_avma;
if (si->trace_cfi)
- show_CF_instructions(fde_instrs, fde_ilen, &adi);
+ show_CF_instructions( fde_instrs, fde_ilen, &adi,
+ the_CIEs[cie].code_a_f,
+ the_CIEs[cie].data_a_f );
initUnwindContext(&ctx);
ctx.code_a_f = the_CIEs[cie].code_a_f;
@@ -2986,18 +3229,32 @@
ctx.initloc = fde_initloc;
ctx.ra_reg = the_CIEs[cie].ra_reg;
- initUnwindContext(&restore_ctx);
-
- ok = run_CF_instructions(
- NULL, &ctx, the_CIEs[cie].instrs,
- the_CIEs[cie].ilen, 0, NULL, &adi
- );
+ /* Run the CIE's instructions. Ugly hack: if
+ --debug-dump=frames is in effect, suppress output for
+ these instructions since they will already have been shown
+ at the time the CIE was first encountered. Note, not
+ thread safe - if this reader is ever made threaded, should
+ fix properly. */
+ { Bool hack = si->ddump_frames;
+ si->ddump_frames = False;
+ initUnwindContext(&restore_ctx);
+ ok = run_CF_instructions(
+ si, False, &ctx, the_CIEs[cie].instrs,
+ the_CIEs[cie].ilen, 0, NULL, &adi
+ );
+ si->ddump_frames = hack;
+ }
+ /* And now run the instructions for the FDE, starting from
+ the state created by running the CIE preamble
+ instructions. */
if (ok) {
restore_ctx = ctx;
ok = run_CF_instructions(
- si, &ctx, fde_instrs, fde_ilen, fde_arange,
+ si, True, &ctx, fde_instrs, fde_ilen, fde_arange,
&restore_ctx, &adi
);
+ if (si->ddump_frames)
+ VG_(printf)("\n");
}
}
}
|
|
From: <sv...@va...> - 2007-02-16 14:10:26
|
Author: sewardj
Date: 2007-02-16 14:10:24 +0000 (Fri, 16 Feb 2007)
New Revision: 6596
Log:
Make VG_(printf) et al conform to ANSI w.r.t. capitalisation of
hex numbers: %x produces lowercase hex, and %X produces uppercase.
Unfortunately this probably changes the output in dozens of places.
Modified:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuglog.c
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c 2007-02-16 13:57:07 UTC (rev 6595)
+++ trunk/coregrind/m_debuginfo/debuginfo.c 2007-02-16 14:10:24 UTC (rev 6596)
@@ -902,7 +902,7 @@
1/10 to the file name, leaving 1/10 for all the fixed-length
stuff. */
APPEND("<frame>");
- VG_(sprintf)(ibuf,"<ip>0x%llx</ip>", (ULong)eip);
+ VG_(sprintf)(ibuf,"<ip>0x%llX</ip>", (ULong)eip);
APPEND(maybe_newline);
APPEND(ibuf);
if (know_objname) {
@@ -940,7 +940,7 @@
} else {
/* Print for humans to read */
- VG_(sprintf)(ibuf,"0x%llx: ", (ULong)eip);
+ VG_(sprintf)(ibuf,"0x%llX: ", (ULong)eip);
APPEND(ibuf);
if (know_fnname) {
APPEND(buf_fn);
Modified: trunk/coregrind/m_debuglog.c
===================================================================
--- trunk/coregrind/m_debuglog.c 2007-02-16 13:57:07 UTC (rev 6595)
+++ trunk/coregrind/m_debuglog.c 2007-02-16 14:10:24 UTC (rev 6596)
@@ -543,13 +543,14 @@
Int flags,
Int base,
Int width,
+ Bool capitalised,
ULong p )
{
HChar buf[40];
Int ind = 0;
Int i, nc = 0;
Bool neg = False;
- HChar* digits = "0123456789ABCDEF";
+ HChar* digits = capitalised ? "0123456789ABCDEF" : "0123456789abcdef";
UInt ret = 0;
if (base < 2 || base > 16)
@@ -620,7 +621,7 @@
Int flags;
Int width;
Int n_ls = 0;
- Bool is_long;
+ Bool is_long, caps;
/* We assume that vargs has already been initialised by the
caller, using va_start, and that the caller will similarly
@@ -686,33 +687,35 @@
case 'd': /* %d */
flags |= VG_MSG_SIGNED;
if (is_long)
- ret += myvprintf_int64(send, send_arg2, flags, 10, width,
+ ret += myvprintf_int64(send, send_arg2, flags, 10, width, False,
(ULong)(va_arg (vargs, Long)));
else
- ret += myvprintf_int64(send, send_arg2, flags, 10, width,
+ ret += myvprintf_int64(send, send_arg2, flags, 10, width, False,
(ULong)(va_arg (vargs, Int)));
break;
case 'u': /* %u */
if (is_long)
- ret += myvprintf_int64(send, send_arg2, flags, 10, width,
+ ret += myvprintf_int64(send, send_arg2, flags, 10, width, False,
(ULong)(va_arg (vargs, ULong)));
else
- ret += myvprintf_int64(send, send_arg2, flags, 10, width,
+ ret += myvprintf_int64(send, send_arg2, flags, 10, width, False,
(ULong)(va_arg (vargs, UInt)));
break;
case 'p': /* %p */
ret += 2;
send('0',send_arg2);
send('x',send_arg2);
- ret += myvprintf_int64(send, send_arg2, flags, 16, width,
+ ret += myvprintf_int64(send, send_arg2, flags, 16, width, True,
(ULong)((UWord)va_arg (vargs, void *)));
break;
case 'x': /* %x */
+ case 'X': /* %X */
+ caps = toBool(format[i] == 'X');
if (is_long)
- ret += myvprintf_int64(send, send_arg2, flags, 16, width,
+ ret += myvprintf_int64(send, send_arg2, flags, 16, width, caps,
(ULong)(va_arg (vargs, ULong)));
else
- ret += myvprintf_int64(send, send_arg2, flags, 16, width,
+ ret += myvprintf_int64(send, send_arg2, flags, 16, width, caps,
(ULong)(va_arg (vargs, UInt)));
break;
case 'c': /* %c */
@@ -843,9 +846,9 @@
}
(void)myvprintf_str ( add_to_buf, &buf, 0, 2, "--", False );
- (void)myvprintf_int64 ( add_to_buf, &buf, 0, 10, 1, (ULong)pid );
+ (void)myvprintf_int64 ( add_to_buf, &buf, 0, 10, 1, False, (ULong)pid );
(void)myvprintf_str ( add_to_buf, &buf, 0, 1, ":", False );
- (void)myvprintf_int64 ( add_to_buf, &buf, 0, 10, 1, (ULong)level );
+ (void)myvprintf_int64 ( add_to_buf, &buf, 0, 10, 1, False, (ULong)level );
(void)myvprintf_str ( add_to_buf, &buf, 0, 1, ":", False );
(void)myvprintf_str ( add_to_buf, &buf, 0, 8, (HChar*)modulename, False );
(void)myvprintf_str ( add_to_buf, &buf, 0, indent, "", False );
|
|
From: <sv...@va...> - 2007-02-16 13:57:08
|
Author: sewardj
Date: 2007-02-16 13:57:07 +0000 (Fri, 16 Feb 2007)
New Revision: 6595
Log:
--wait-for-gdb=yes: gcc 4.1.2 now appears to delete do-nothing loops, so
make the loop variable volatile so it can't do that.
Modified:
trunk/coregrind/m_main.c
Modified: trunk/coregrind/m_main.c
===================================================================
--- trunk/coregrind/m_main.c 2007-02-16 13:17:40 UTC (rev 6594)
+++ trunk/coregrind/m_main.c 2007-02-16 13:57:07 UTC (rev 6595)
@@ -1586,7 +1586,8 @@
/* Hook to delay things long enough so we can get the pid and
attach GDB in another shell. */
if (VG_(clo_wait_for_gdb)) {
- Long q, iters;
+ Long iters;
+ volatile Long q;
VG_(debugLog)(1, "main", "Wait for GDB\n");
VG_(printf)("pid=%d, entering delay loop\n", VG_(getpid)());
|
|
From: <sv...@va...> - 2007-02-16 13:17:43
|
Author: weidendo
Date: 2007-02-16 13:17:40 +0000 (Fri, 16 Feb 2007)
New Revision: 6594
Log:
Update. I hope I got the right section ;-)
Modified:
trunk/docs/internals/3_2_BUGSTATUS.txt
Modified: trunk/docs/internals/3_2_BUGSTATUS.txt
===================================================================
--- trunk/docs/internals/3_2_BUGSTATUS.txt 2007-02-16 13:12:43 UTC (rev 6593)
+++ trunk/docs/internals/3_2_BUGSTATUS.txt 2007-02-16 13:17:40 UTC (rev 6594)
@@ -102,6 +102,8 @@
pending pending 138702 amd64->IR: 0xF0 0xF 0xC0 0x90
(lock xadd %dl,0xb5(%rax))
+r6593 pending 139363 callgrind: fix --collect-systime=yes
+ with "no instrumentation" mode
------- Bugs reported and fixed in 3.2.2 ------
|
|
From: <sv...@va...> - 2007-02-16 13:12:46
|
Author: weidendo
Date: 2007-02-16 13:12:43 +0000 (Fri, 16 Feb 2007)
New Revision: 6593
Log:
callgrind: fix --collect-systime=yes with "no instrumentation" mode
(see bug 139363)
Modified:
trunk/callgrind/main.c
Modified: trunk/callgrind/main.c
===================================================================
--- trunk/callgrind/main.c 2007-02-16 11:57:18 UTC (rev 6592)
+++ trunk/callgrind/main.c 2007-02-16 13:12:43 UTC (rev 6593)
@@ -883,7 +883,8 @@
static
void CLG_(post_syscalltime)(ThreadId tid, UInt syscallno, SysRes res)
{
- if (CLG_(clo).collect_systime) {
+ if (CLG_(clo).collect_systime &&
+ CLG_(current_state).bbcc) {
Int o = CLG_(sets).off_full_systime;
#if CLG_MICROSYSTIME
struct vki_timeval tv_now;
|
|
From: <sv...@va...> - 2007-02-16 11:57:20
|
Author: njn
Date: 2007-02-16 11:57:18 +0000 (Fri, 16 Feb 2007)
New Revision: 6592
Log:
correctify
Modified:
trunk/docs/xml/manual-writing-tools.xml
Modified: trunk/docs/xml/manual-writing-tools.xml
===================================================================
--- trunk/docs/xml/manual-writing-tools.xml 2007-02-16 11:13:53 UTC (rev 6591)
+++ trunk/docs/xml/manual-writing-tools.xml 2007-02-16 11:57:18 UTC (rev 6592)
@@ -123,7 +123,8 @@
<listitem>
<para>Edit <filename>Makefile.am</filename>, adding the new directory
<filename>foobar</filename> to the
- <computeroutput>TOOLS</computeroutput> variable.</para>
+ <computeroutput>TOOLS</computeroutput> and
+ <computeroutput>SUBDIRS</computeroutput>variables.</para>
</listitem>
<listitem>
|
|
From: <sv...@va...> - 2007-02-16 11:14:01
|
Author: weidendo
Date: 2007-02-16 11:13:53 +0000 (Fri, 16 Feb 2007)
New Revision: 6591
Log:
lackey: Take possible condition invertion for Jccs into account
Modified:
trunk/lackey/lk_main.c
Modified: trunk/lackey/lk_main.c
===================================================================
--- trunk/lackey/lk_main.c 2007-02-13 10:24:32 UTC (rev 6590)
+++ trunk/lackey/lk_main.c 2007-02-16 11:13:53 UTC (rev 6591)
@@ -240,6 +240,8 @@
static ULong n_guest_instrs = 0;
static ULong n_Jccs = 0;
static ULong n_Jccs_untaken = 0;
+static ULong n_IJccs = 0;
+static ULong n_IJccs_untaken = 0;
static void add_one_func_call(void)
{
@@ -276,6 +278,16 @@
n_Jccs_untaken++;
}
+static void add_one_inverted_Jcc(void)
+{
+ n_IJccs++;
+}
+
+static void add_one_inverted_Jcc_untaken(void)
+{
+ n_IJccs_untaken++;
+}
+
/*------------------------------------------------------------*/
/*--- Stuff for --detailed-counts ---*/
/*------------------------------------------------------------*/
@@ -600,6 +612,9 @@
Char fnname[100];
IRType type;
IRTypeEnv* tyenv = sbIn->tyenv;
+ Addr iaddr = 0, dst;
+ UInt ilen = 0;
+ Bool condition_inverted = False;
if (gWordTy != hWordTy) {
/* We don't currently support this case. */
@@ -661,6 +676,10 @@
case Ist_IMark:
if (clo_basic_counts) {
+ /* Needed to be able to check for inverted condition in Ist_Exit */
+ iaddr = st->Ist.IMark.addr;
+ ilen = st->Ist.IMark.len;
+
/* Count guest instruction. */
di = unsafeIRDirty_0_N( 0, "add_one_guest_instr",
VG_(fnptr_to_fnentry)( &add_one_guest_instr ),
@@ -770,10 +789,23 @@
case Ist_Exit:
if (clo_basic_counts) {
+ // The condition of a branch was inverted by VEX if a taken
+ // branch is in fact a fall trough according to client address
+ tl_assert(iaddr != 0);
+ dst = (sizeof(Addr) == 4) ? st->Ist.Exit.dst->Ico.U32 :
+ st->Ist.Exit.dst->Ico.U64;
+ condition_inverted = (dst == iaddr + ilen);
+
/* Count Jcc */
- di = unsafeIRDirty_0_N( 0, "add_one_Jcc",
+ if (!condition_inverted)
+ di = unsafeIRDirty_0_N( 0, "add_one_Jcc",
VG_(fnptr_to_fnentry)( &add_one_Jcc ),
mkIRExprVec_0() );
+ else
+ di = unsafeIRDirty_0_N( 0, "add_one_inverted_Jcc",
+ VG_(fnptr_to_fnentry)( &add_one_inverted_Jcc ),
+ mkIRExprVec_0() );
+
addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
}
if (clo_trace_mem) {
@@ -784,10 +816,17 @@
if (clo_basic_counts) {
/* Count non-taken Jcc */
- di = unsafeIRDirty_0_N( 0, "add_one_Jcc_untaken",
+ if (!condition_inverted)
+ di = unsafeIRDirty_0_N( 0, "add_one_Jcc_untaken",
VG_(fnptr_to_fnentry)(
&add_one_Jcc_untaken ),
mkIRExprVec_0() );
+ else
+ di = unsafeIRDirty_0_N( 0, "add_one_inverted_Jcc_untaken",
+ VG_(fnptr_to_fnentry)(
+ &add_one_inverted_Jcc_untaken ),
+ mkIRExprVec_0() );
+
addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
}
break;
@@ -823,16 +862,19 @@
tl_assert(clo_fnname[0]);
if (clo_basic_counts) {
+ ULong total_Jccs = n_Jccs + n_IJccs;
+ ULong taken_Jccs = (n_Jccs - n_Jccs_untaken) + n_IJccs_untaken;
+
VG_(message)(Vg_UserMsg,
"Counted %,llu calls to %s()", n_func_calls, clo_fnname);
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "Jccs:");
- VG_(message)(Vg_UserMsg, " total: %,llu", n_Jccs);
- VG_(percentify)((n_Jccs - n_Jccs_untaken), (n_Jccs ? n_Jccs : 1),
+ VG_(message)(Vg_UserMsg, " total: %,llu", total_Jccs);
+ VG_(percentify)(taken_Jccs, (total_Jccs ? total_Jccs : 1),
percentify_decs, percentify_size, percentify_buf);
VG_(message)(Vg_UserMsg, " taken: %,llu (%s)",
- (n_Jccs - n_Jccs_untaken), percentify_buf);
+ taken_Jccs, percentify_buf);
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "Executed:");
|
|
From: <js...@ac...> - 2007-02-16 09:21:12
|
Nightly build on minnie ( SuSE 10.0, ppc32 ) started at 2007-02-16 09: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 == 219 tests, 10 stderr failures, 6 stdout failures, 0 posttest failures == memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-fp (stderr) none/tests/ppc32/round (stdout) none/tests/ppc32/round (stderr) none/tests/ppc32/test_fx (stdout) none/tests/ppc32/test_fx (stderr) none/tests/ppc32/test_gx (stdout) |
|
From: Julian S. <js...@ac...> - 2007-02-16 08:41:01
|
On Thursday 15 February 2007 21:56, Josef Weidendorfer wrote: > On Thursday 15 February 2007, Julian Seward wrote: > > > (2) Correct it and show how to do it the right way > > > > > > Solution (2) complicates lackey (a little?), but if it is also > > > a tutorial about branch counting, it should be correct. > > > > I agree. Sounds like a good solution to me. > > Here is a proposed patch: Looks good to me. > I checked the instrumentation; and in fact, VEX does 4x unrolling. > It seems to do the right thing now. Yes, up to 8x for the IR corresponding to 'rep movsb' etc. J |
|
From: Julian S. <js...@ac...> - 2007-02-16 08:34:14
|
On Friday 16 February 2007 00:22, Nicholas Nethercote wrote:
> On Thu, 15 Feb 2007, Josef Weidendorfer wrote:
> >> Also, if we ever do more aggressive block formation which speculatively
> >> chases across conditional branches ("trace formation"), then some branch
> >> conditions will have to be inverted - it is unavoidable.
> >
> > Is such a speculative chasing useful? I assume that you take the
> > outcome of the first execution, which does the translation. It is not
> > clear to me why the first execution will stay a good speculation in
> > the run of a program.
>
> Systems that do this kind of thing normally do so after doing some run-time
> profiling for a while -- eg. optimise the hot blocks after they've run
> enough times.
That sounds like the right solution, but adds lots of complexity in
code cache management, which is already a bit hairy, what with redirection,
wrapping, discarding.
A couple of months back I did some experiments with trace selection
using static branch "prediction", predicting backwards branches taken
and forwards ones not taken. IIRC that gives about 68% correct rate
on spec cpu2000 'test'. Because, by default, vex ends basic blocks
at a conditional branch, this is better than it sounds - even a 50%
correct predict rate could in principle halve the number of block-to-
block transitions through the scheduler.
Some programs ran significantly faster (gzip) and many ran a couple
of percent faster. But it tends to slow down program startup because
the JIT produces (even) more code. Overall it didn't seem worth it.
J
|
|
From: <js...@ac...> - 2007-02-16 05:31:32
|
Nightly build on phoenix ( SuSE 10.0 ) started at 2007-02-16 04:55:02 GMT 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 == 254 tests, 6 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/pth_detached (stdout) ================================================= == Results from 24 hours ago == ================================================= 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 == 254 tests, 6 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Fri Feb 16 05:13:33 2007 --- new.short Fri Feb 16 05:31:56 2007 *************** *** 10,12 **** ! == 254 tests, 6 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/leak-tree (stderr) --- 10,12 ---- ! == 254 tests, 6 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/leak-tree (stderr) *************** *** 18,19 **** --- 18,20 ---- none/tests/mremap2 (stdout) + none/tests/pth_detached (stdout) |
|
From: Tom H. <th...@cy...> - 2007-02-16 04:11:16
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2007-02-16 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 == 290 tests, 6 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/tls (stdout) |
|
From: Tom H. <th...@cy...> - 2007-02-16 03:25:34
|
Nightly build on dellow ( x86_64, Fedora Core 6 ) started at 2007-02-16 03:10:08 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 == 288 tests, 4 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/pth_detached (stdout) |
|
From: Tom H. <th...@cy...> - 2007-02-16 03:23:18
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2007-02-16 03:15:02 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Last 20 lines of verbose log follow echo /tmp/cckjMlb7.s:4393: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cckjMlb7.s:4513: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cckjMlb7.s:4633: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cckjMlb7.s:4753: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cckjMlb7.s:4873: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cckjMlb7.s:4993: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cckjMlb7.s:5113: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cckjMlb7.s:5233: Error: no such instruction: `fisttpq -56(%ebp)' make[5]: *** [insn_sse3.o] Error 1 rm insn_mmx.c insn_sse2.c insn_fpu.c insn_mmxext.c insn_sse.c insn_sse3.c insn_cmov.c insn_basic.c make[5]: Leaving directory `/tmp/valgrind.4774/valgrind/none/tests/x86' make[4]: *** [check-am] Error 2 make[4]: Leaving directory `/tmp/valgrind.4774/valgrind/none/tests/x86' make[3]: *** [check-recursive] Error 1 make[3]: Leaving directory `/tmp/valgrind.4774/valgrind/none/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/valgrind.4774/valgrind/none' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/valgrind.4774/valgrind' make: *** [check] Error 2 ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Last 20 lines of verbose log follow echo /tmp/ccIQclxp.s:4393: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccIQclxp.s:4513: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccIQclxp.s:4633: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccIQclxp.s:4753: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccIQclxp.s:4873: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccIQclxp.s:4993: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccIQclxp.s:5113: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccIQclxp.s:5233: Error: no such instruction: `fisttpq -56(%ebp)' make[5]: *** [insn_sse3.o] Error 1 rm insn_mmx.c insn_sse2.c insn_fpu.c insn_mmxext.c insn_sse.c insn_sse3.c insn_cmov.c insn_basic.c make[5]: Leaving directory `/tmp/valgrind.4774/valgrind/none/tests/x86' make[4]: *** [check-am] Error 2 make[4]: Leaving directory `/tmp/valgrind.4774/valgrind/none/tests/x86' make[3]: *** [check-recursive] Error 1 make[3]: Leaving directory `/tmp/valgrind.4774/valgrind/none/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/valgrind.4774/valgrind/none' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/valgrind.4774/valgrind' make: *** [check] Error 2 ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Fri Feb 16 03:19:22 2007 --- new.short Fri Feb 16 03:23:10 2007 *************** *** 7,16 **** Last 20 lines of verbose log follow echo ! /tmp/ccIQclxp.s:4393: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccIQclxp.s:4513: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccIQclxp.s:4633: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccIQclxp.s:4753: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccIQclxp.s:4873: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccIQclxp.s:4993: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccIQclxp.s:5113: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccIQclxp.s:5233: Error: no such instruction: `fisttpq -56(%ebp)' make[5]: *** [insn_sse3.o] Error 1 --- 7,16 ---- Last 20 lines of verbose log follow echo ! /tmp/cckjMlb7.s:4393: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cckjMlb7.s:4513: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cckjMlb7.s:4633: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cckjMlb7.s:4753: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cckjMlb7.s:4873: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cckjMlb7.s:4993: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cckjMlb7.s:5113: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cckjMlb7.s:5233: Error: no such instruction: `fisttpq -56(%ebp)' make[5]: *** [insn_sse3.o] Error 1 |
|
From: Tom H. <th...@cy...> - 2007-02-16 03:18:48
|
Nightly build on lloyd ( x86_64, Fedora Core 3 ) started at 2007-02-16 03:05:07 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 == 288 tests, 6 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: <js...@ac...> - 2007-02-16 01:16:34
|
Nightly build on g5 ( SuSE 10.1, ppc970 ) started at 2007-02-16 02:00:01 CET 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 == 225 tests, 6 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: Nicholas N. <nj...@cs...> - 2007-02-16 00:22:11
|
On Thu, 15 Feb 2007, Josef Weidendorfer wrote:
>> Also, if we ever do more aggressive block formation which speculatively
>> chases across conditional branches ("trace formation"), then some branch
>> conditions will have to be inverted - it is unavoidable.
>
> Is such a speculative chasing useful? I assume that you take the
> outcome of the first execution, which does the translation. It is not
> clear to me why the first execution will stay a good speculation in
> the run of a program.
Systems that do this kind of thing normally do so after doing some run-time
profiling for a while -- eg. optimise the hot blocks after they've run
enough times.
Nick
|