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-12 22:38:56
|
Author: njn Date: 2007-02-12 22:38:50 +0000 (Mon, 12 Feb 2007) New Revision: 6589 Log: update Modified: trunk/NEWS Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2007-02-12 17:47:14 UTC (rev 6588) +++ trunk/NEWS 2007-02-12 22:38:50 UTC (rev 6589) @@ -23,6 +23,8 @@ Developer-visible changes: +- New debugging command line options: --debug-dump, --trace-symtab-patt... + - The names of some functions and types within the Vex IR have changed. So any existing tools will have to be updated to reflect these changes. The new names should be clearer. The file |
|
From: <sv...@va...> - 2007-02-12 17:47:34
|
Author: sewardj
Date: 2007-02-12 17:47:14 +0000 (Mon, 12 Feb 2007)
New Revision: 6588
Log:
Essentially non-functional tidyings and improvements to debuginfo
reading. Two sets of changes:
* New flags for debugging the readers.
--debug-dump=syms
--debug-dump=line
--debug-dump=frames
These (currently accepted but nonfunctional) are intended to
create output in the style of (that is, identical to)
/usr/bin/readelf --syms
/usr/bin/readelf --debug-dump=line
/usr/bin/readelf --debug-dump=frames
respectively. The plan is that flaws in these readers can then
be easily found by diff-ing the output against that from readelf.
Also, a new flag --trace-symtab-patt=<object filename pattern>
which is used to limit all debuginfo-related debug info to the
set of shared object names matching the given pattern. This
facilitates extracting the debuginfo details of one specific
shared object, which is usually what is required, rather than
having to wade through megabytes of junk from every object in
the process.
* Propagate the avma/svma/image address-naming scheme
(as described at the top of debuginfo.c) through large parts of
readelf.c and readdwarf.c.
Modified:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/priv_storage.h
trunk/coregrind/m_debuginfo/readdwarf.c
trunk/coregrind/m_debuginfo/readelf.c
trunk/coregrind/m_debuginfo/storage.c
trunk/coregrind/m_main.c
trunk/coregrind/m_options.c
trunk/coregrind/pub_core_options.h
trunk/include/pub_tool_options.h
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c 2007-02-12 11:28:38 UTC (rev 6587)
+++ trunk/coregrind/m_debuginfo/debuginfo.c 2007-02-12 17:47:14 UTC (rev 6588)
@@ -85,7 +85,8 @@
This terminology is not used consistently, but a start has been
made. readelf.c and the call-frame info reader in readdwarf.c now
use it. Specifically, various variables and structure fields have
- been annotated with _avma / _svma / _image / _bias.
+ been annotated with _avma / _svma / _image / _bias. In places _img
+ is used instead of _image for the sake of brevity.
*/
@@ -112,8 +113,12 @@
const UChar* filename,
const UChar* memname)
{
- SegInfo* si = VG_(arena_calloc)(VG_AR_SYMTAB, 1, sizeof(SegInfo));
+ Bool traceme;
+ SegInfo* si;
+ vg_assert(filename);
+
+ si = VG_(arena_calloc)(VG_AR_SYMTAB, 1, sizeof(SegInfo));
si->text_start_avma = start;
si->text_size = size;
si->foffset = foffset;
@@ -122,7 +127,23 @@
? VG_(arena_strdup)(VG_AR_SYMTAB, memname)
: NULL;
- // Everything else -- pointers, sizes, arrays -- is zeroed by calloc.
+ /* Everything else -- pointers, sizes, arrays -- is zeroed by calloc.
+ Now set up the debugging-output flags. */
+ traceme
+ = VG_(string_match)( VG_(clo_trace_symtab_patt), filename )
+ || (memname && VG_(string_match)( VG_(clo_trace_symtab_patt),
+ memname ));
+ 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
+ }
+
+
return si;
}
Modified: trunk/coregrind/m_debuginfo/priv_storage.h
===================================================================
--- trunk/coregrind/m_debuginfo/priv_storage.h 2007-02-12 11:28:38 UTC (rev 6587)
+++ trunk/coregrind/m_debuginfo/priv_storage.h 2007-02-12 17:47:14 UTC (rev 6588)
@@ -194,6 +194,16 @@
UInt data_size;
Addr bss_start_avma;
UInt bss_size;
+
+ /* Used for debugging only - indicate what stuff to dump whilst
+ reading stuff into the seginfo. Are computed as early in the
+ lifetime of the SegInfo as possible. Use these when deciding
+ what to spew out; do not use the global VG_(clo_blah) flags. */
+ Bool trace_symtab; /* symbols, our style */
+ Bool trace_cfi; /* dwarf frame unwind, our style */
+ Bool ddump_syms; /* mimic /usr/bin/readelf --syms */
+ Bool ddump_line; /* mimic /usr/bin/readelf --debug-dump=line */
+ Bool ddump_frames; /* mimic /usr/bin/readelf --debug-dump=frames */
};
/* --------------------- functions --------------------- */
@@ -250,7 +260,7 @@
#define TRACE_SYMTAB(format, args...) \
- if (VG_(clo_trace_symtab)) { VG_(printf)(format, ## args); }
+ if (si->trace_symtab) { VG_(printf)(format, ## args); }
#endif /* ndef __PRIV_STORAGE_H */
Modified: trunk/coregrind/m_debuginfo/readdwarf.c
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf.c 2007-02-12 11:28:38 UTC (rev 6587)
+++ trunk/coregrind/m_debuginfo/readdwarf.c 2007-02-12 17:47:14 UTC (rev 6588)
@@ -253,12 +253,12 @@
Read 32-bit value from p. If it is 0xFFFFFFFF, instead read a
64-bit bit value from p+4. This is used in 64-bit dwarf to encode
some table lengths. */
-static ULong read_initial_length_field ( UChar* p, /*OUT*/Bool* is64 )
+static ULong read_initial_length_field ( UChar* p_img, /*OUT*/Bool* is64 )
{
- UInt w32 = *((UInt*)p);
+ UInt w32 = *((UInt*)p_img);
if (w32 == 0xFFFFFFFF) {
*is64 = True;
- return *((ULong*)(p+4));
+ return *((ULong*)(p_img+4));
} else {
*is64 = False;
return (ULong)w32;
@@ -390,7 +390,7 @@
static
void read_dwarf2_lineblock ( struct _SegInfo* si, OffT debug_offset,
UnitInfo* ui,
- UChar* theBlock,
+ UChar* theBlock, /* IMAGE */
Int noLargerThan )
{
DebugLineInfo info;
@@ -786,9 +786,9 @@
*/
static
void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui,
- UChar* unitblock,
- UChar* debugabbrev,
- UChar* debugstr )
+ UChar* unitblock_img,
+ UChar* debugabbrev_img,
+ UChar* debugstr_img )
{
UInt acode, abcode;
ULong atoffs, blklen;
@@ -796,9 +796,9 @@
UShort ver;
UChar addr_size;
- UChar* p = unitblock;
- UChar* end;
- UChar* abbrev;
+ UChar* p = unitblock_img;
+ UChar* end_img;
+ UChar* abbrev_img;
VG_(memset)( ui, 0, sizeof( UnitInfo ) );
ui->stmt_list = -1LL;
@@ -821,12 +821,14 @@
addr_size = *p;
p += 1;
- end = unitblock + blklen + (ui->dw64 ? 12 : 4); /* End of this block */
- level = 0; /* Level in the abbrev tree */
- abbrev = debugabbrev + atoffs; /* Abbreviation data for this block */
+ end_img = unitblock_img
+ + blklen + (ui->dw64 ? 12 : 4); /* End of this block */
+ level = 0; /* Level in the abbrev tree */
+ abbrev_img = debugabbrev_img
+ + atoffs; /* Abbreviation data for this block */
/* Read the compilation unit entries */
- while ( p < end ) {
+ while ( p < end_img ) {
Bool has_child;
UInt tag;
@@ -839,18 +841,18 @@
}
/* Read abbreviation header */
- abcode = read_leb128U( &abbrev ); /* abbreviation code */
+ abcode = read_leb128U( &abbrev_img ); /* abbreviation code */
if ( acode != abcode ) {
/* We are in in children list, and must rewind to a
* previously declared abbrev code. This code works but is
* not triggered since we shortcut the parsing once we have
* read the compile_unit block. This should only occur when
* level > 0 */
- abbrev = lookup_abbrev( debugabbrev + atoffs, acode );
+ abbrev_img = lookup_abbrev( debugabbrev_img + atoffs, acode );
}
- tag = read_leb128U( &abbrev );
- has_child = *(abbrev++) == 1; /* DW_CHILDREN_yes */
+ tag = read_leb128U( &abbrev_img );
+ has_child = *(abbrev_img++) == 1; /* DW_CHILDREN_yes */
if ( has_child )
level++;
@@ -861,8 +863,8 @@
UInt name, form;
ULong cval = -1LL; /* Constant value read */
Char *sval = NULL; /* String value read */
- name = read_leb128U( &abbrev );
- form = read_leb128U( &abbrev );
+ name = read_leb128U( &abbrev_img );
+ form = read_leb128U( &abbrev_img );
if ( name == 0 )
break;
@@ -885,10 +887,10 @@
/* 2006-01-01: only generate a value if
debugstr is non-NULL (which means that a
debug_str section was found) */
- if (debugstr && !ui->dw64)
- sval = debugstr + *((UInt*)p);
- if (debugstr && ui->dw64)
- sval = debugstr + *((ULong*)p);
+ if (debugstr_img && !ui->dw64)
+ sval = debugstr_img + *((UInt*)p);
+ if (debugstr_img && ui->dw64)
+ sval = debugstr_img + *((ULong*)p);
p += ui->dw64 ? 8 : 4;
break;
case 0x08: /* FORM_string */ sval = (Char*)p;
@@ -951,15 +953,15 @@
*/
void ML_(read_debuginfo_dwarf2)
( struct _SegInfo* si, OffT debug_offset,
- UChar* debuginfo, Int debug_info_sz, /* .debug_info */
- UChar* debugabbrev, /* .debug_abbrev */
- UChar* debugline, Int debug_line_sz, /* .debug_line */
- UChar* debugstr ) /* .debug_str */
+ UChar* debuginfo_img, Int debug_info_sz, /* .debug_info */
+ UChar* debugabbrev_img, /* .debug_abbrev */
+ UChar* debugline_img, Int debug_line_sz, /* .debug_line */
+ UChar* debugstr_img ) /* .debug_str */
{
UnitInfo ui;
UShort ver;
- UChar* block;
- UChar* end = debuginfo + debug_info_sz;
+ UChar* block_img;
+ UChar* end_img = debuginfo_img + debug_info_sz;
ULong blklen;
Bool blklen_is_64;
Int blklen_len = 0;
@@ -971,20 +973,21 @@
}
/* Iterate on all the blocks we find in .debug_info */
- for ( block = debuginfo; block < end - 4; block += blklen + blklen_len ) {
+ for ( block_img = debuginfo_img; block_img < end_img - 4;
+ block_img += blklen + blklen_len ) {
/* Read the compilation unit header in .debug_info section - See
p 70 */
/* This block length */
- blklen = read_initial_length_field( block, &blklen_is_64 );
+ blklen = read_initial_length_field( block_img, &blklen_is_64 );
blklen_len = blklen_is_64 ? 12 : 4;
- if ( block + blklen + blklen_len > end ) {
+ if ( block_img + blklen + blklen_len > end_img ) {
ML_(symerr)( "Last block truncated in .debug_info; ignoring" );
return;
}
/* version should be 2 */
- ver = *((UShort*)( block + blklen_len ));
+ ver = *((UShort*)( block_img + blklen_len ));
if ( ver != 2 ) {
ML_(symerr)( "Ignoring non-dwarf2 block in .debug_info" );
continue;
@@ -992,8 +995,9 @@
/* Fill ui with offset in .debug_line and compdir */
if (0)
- VG_(printf)( "Reading UnitInfo at 0x%x.....\n", block - debuginfo );
- read_unitinfo_dwarf2( &ui, block, debugabbrev, debugstr );
+ VG_(printf)( "Reading UnitInfo at 0x%x.....\n",
+ block_img - debuginfo_img );
+ read_unitinfo_dwarf2( &ui, block_img, debugabbrev_img, debugstr_img );
if (0)
VG_(printf)( " => LINES=0x%llx NAME=%s DIR=%s\n",
ui.stmt_list, ui.name, ui.compdir );
@@ -1006,8 +1010,9 @@
VG_(printf)("debug_line_sz %d, ui.stmt_list %lld %s\n",
debug_line_sz, ui.stmt_list, ui.name );
/* Read the .debug_line block for this compile unit */
- read_dwarf2_lineblock( si, debug_offset, &ui, debugline + ui.stmt_list,
- debug_line_sz - ui.stmt_list );
+ read_dwarf2_lineblock(
+ si, debug_offset, &ui, debugline_img + ui.stmt_list,
+ debug_line_sz - ui.stmt_list );
}
}
@@ -1759,7 +1764,8 @@
*/
static Bool summarise_context( /*OUT*/DiCfSI* si,
Addr loc_start,
- UnwindContext* ctx )
+ UnwindContext* ctx,
+ struct _SegInfo* seginfo )
{
Int why = 0;
initCfiSI(si);
@@ -1824,7 +1830,7 @@
return True;
failed:
- if (VG_(clo_verbosity) > 2 || VG_(clo_trace_cfi)) {
+ if (VG_(clo_verbosity) > 2 || seginfo->trace_cfi) {
VG_(message)(Vg_DebugMsg,
"summarise_context(loc_start = %p)"
": cannot summarise(why=%d): ", loc_start, why);
@@ -2042,7 +2048,8 @@
static Int run_CF_instruction ( /*MOD*/UnwindContext* ctx,
UChar* instr,
UnwindContext* restore_ctx,
- AddressDecodingInfo* adi )
+ AddressDecodingInfo* adi,
+ struct _SegInfo* si )
{
Int off, reg, reg2, nleb, len;
UInt delta;
@@ -2244,7 +2251,7 @@
case DW_CFA_expression:
/* Too difficult to really handle; just skip over it and say
that we don't know what do to with the register. */
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("DWARF2 CFI reader: "
"ignoring DW_CFA_expression\n");
reg = read_leb128( &instr[i], &nleb, 0 );
@@ -2260,7 +2267,7 @@
case DW_CFA_val_expression:
/* Too difficult to really handle; just skip over it and say
that we don't know what do to with the register. */
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("DWARF2 CFI reader: "
"ignoring DW_CFA_val_expression\n");
reg = read_leb128( &instr[i], &nleb, 0 );
@@ -2274,7 +2281,7 @@
break;
case DW_CFA_def_cfa_expression:
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("DWARF2 CFI reader: "
"ignoring DW_CFA_def_cfa_expression\n");
len = read_leb128( &instr[i], &nleb, 0 );
@@ -2558,7 +2565,7 @@
/* Oh, well, let's kludge it into the text segment, then. */
/* First, though, complain: */
- if (VG_(clo_trace_cfi) || complaints > 0) {
+ if (si->trace_cfi || complaints > 0) {
complaints--;
if (VG_(clo_verbosity) > 1) {
VG_(message)(
@@ -2570,7 +2577,7 @@
si->text_bias + cfsi->base + cfsi->len - 1
);
}
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
ML_(ppDiCfSI)(cfsi);
}
@@ -2605,16 +2612,16 @@
loc_prev = ctx->loc;
if (i >= ilen) break;
if (0) (void)show_CF_instruction( &instrs[i], adi );
- j = run_CF_instruction( ctx, &instrs[i], restore_ctx, adi );
+ 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) {
- summ_ok = summarise_context ( &cfsi, loc_prev, ctx );
+ summ_ok = summarise_context ( &cfsi, loc_prev, ctx, si );
if (summ_ok) {
kludge_then_addDiCfSI(si, &cfsi);
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
ML_(ppDiCfSI)(&cfsi);
}
}
@@ -2623,10 +2630,10 @@
loc_prev = ctx->loc;
ctx->loc = fde_arange;
if (si) {
- summ_ok = summarise_context ( &cfsi, loc_prev, ctx );
+ summ_ok = summarise_context ( &cfsi, loc_prev, ctx, si );
if (summ_ok) {
kludge_then_addDiCfSI(si, &cfsi);
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
ML_(ppDiCfSI)(&cfsi);
}
}
@@ -2686,7 +2693,7 @@
return;
# endif
- if (VG_(clo_trace_cfi)) {
+ if (si->trace_cfi) {
VG_(printf)("\n-----------------------------------------------\n");
VG_(printf)("CFI info: szB %d, _avma %p, _image %p\n",
ehframe_sz, (void*)ehframe_avma, (void*)ehframe_image );
@@ -2734,12 +2741,12 @@
Figure out which it is. */
ciefde_start = data;
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("\ncie/fde.start = %p (ehframe_image + 0x%x)\n",
ciefde_start, ciefde_start - ehframe_image);
ciefde_len = read_UInt(data); data += sizeof(UInt);
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("cie/fde.length = %d\n", ciefde_len);
/* Apparently, if the .length field is zero, we are at the end
@@ -2754,7 +2761,7 @@
cie_pointer = read_UInt(data);
data += sizeof(UInt); /* XXX see XXX below */
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("cie.pointer = %d\n", cie_pointer);
/* If cie_pointer is zero, we've got a CIE; else it's an FDE. */
@@ -2765,7 +2772,7 @@
UChar* cie_augmentation;
/* --------- CIE --------- */
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("------ new CIE (#%d of 0 .. %d) ------\n",
n_CIEs, N_CIEs - 1);
@@ -2785,7 +2792,7 @@
the_CIEs[this_CIE].offset = ciefde_start - ehframe_image;
cie_version = read_UChar(data); data += sizeof(UChar);
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("cie.version = %d\n", (Int)cie_version);
if (cie_version != 1) {
how = "unexpected CIE version (not 1)";
@@ -2794,7 +2801,7 @@
cie_augmentation = data;
data += 1 + VG_(strlen)(cie_augmentation);
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("cie.augment = \"%s\"\n", cie_augmentation);
if (cie_augmentation[0] == 'e' && cie_augmentation[1] == 'h') {
@@ -2804,19 +2811,19 @@
the_CIEs[this_CIE].code_a_f = read_leb128( data, &nbytes, 0);
data += nbytes;
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("cie.code_af = %d\n",
the_CIEs[this_CIE].code_a_f);
the_CIEs[this_CIE].data_a_f = read_leb128( data, &nbytes, 1);
data += nbytes;
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("cie.data_af = %d\n",
the_CIEs[this_CIE].data_a_f);
the_CIEs[this_CIE].ra_reg = (Int)read_UChar(data);
data += sizeof(UChar);
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("cie.ra_reg = %d\n",
the_CIEs[this_CIE].ra_reg);
if (the_CIEs[this_CIE].ra_reg < 0
@@ -2869,14 +2876,14 @@
done_augmentation:
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("cie.encoding = 0x%x\n",
the_CIEs[this_CIE].address_encoding);
the_CIEs[this_CIE].instrs = data;
the_CIEs[this_CIE].ilen
= ciefde_start + ciefde_len + sizeof(UInt) - data;
- if (VG_(clo_trace_cfi)) {
+ if (si->trace_cfi) {
VG_(printf)("cie.instrs = %p\n", the_CIEs[this_CIE].instrs);
VG_(printf)("cie.ilen = %d\n", the_CIEs[this_CIE].ilen);
}
@@ -2889,7 +2896,7 @@
data += the_CIEs[this_CIE].ilen;
- if (VG_(clo_trace_cfi)) {
+ if (si->trace_cfi) {
AddressDecodingInfo adi;
adi.encoding = the_CIEs[this_CIE].address_encoding;
adi.ehframe_image = ehframe_image;
@@ -2936,7 +2943,7 @@
adi.ehframe_avma = ehframe_avma;
fde_initloc = read_encoded_Addr(&nbytes, &adi, data);
data += nbytes;
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("fde.initloc = %p\n", (void*)fde_initloc);
adi.encoding = the_CIEs[cie].address_encoding & 0xf;
@@ -2944,7 +2951,7 @@
adi.ehframe_avma = ehframe_avma;
fde_arange = read_encoded_Addr(&nbytes, &adi, data);
data += nbytes;
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("fde.arangec = %p\n", (void*)fde_arange);
if (the_CIEs[cie].saw_z_augmentation) {
@@ -2954,7 +2961,7 @@
fde_instrs = data;
fde_ilen = ciefde_start + ciefde_len + sizeof(UInt) - data;
- if (VG_(clo_trace_cfi)) {
+ if (si->trace_cfi) {
VG_(printf)("fde.instrs = %p\n", fde_instrs);
VG_(printf)("fde.ilen = %d\n", (Int)fde_ilen);
}
@@ -2970,7 +2977,7 @@
adi.ehframe_image = ehframe_image;
adi.ehframe_avma = ehframe_avma;
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
show_CF_instructions(fde_instrs, fde_ilen, &adi);
initUnwindContext(&ctx);
Modified: trunk/coregrind/m_debuginfo/readelf.c
===================================================================
--- trunk/coregrind/m_debuginfo/readelf.c 2007-02-12 11:28:38 UTC (rev 6587)
+++ trunk/coregrind/m_debuginfo/readelf.c 2007-02-12 17:47:14 UTC (rev 6588)
@@ -419,7 +419,7 @@
sym_name = (Char*)(o_strtab + sym->st_name);
sym_addr = o_symtab_offset + sym->st_value;
- if (VG_(clo_trace_symtab))
+ if (si->trace_symtab)
show_raw_elf_symbol(i, sym, sym_name, sym_addr, False);
if (get_elf_symbol_info(si, sym, sym_name, sym_addr,
@@ -438,7 +438,7 @@
vg_assert(risym.tocptr == 0); /* has no role except on ppc64-linux */
ML_(addSym) ( si, &risym );
- if (VG_(clo_trace_symtab)) {
+ if (si->trace_symtab) {
VG_(printf)(" record [%4d]: "
" val %010p, sz %4d %s\n",
i, (void*)risym.addr, (Int)risym.size,
@@ -527,7 +527,7 @@
sym_name = (Char*)(o_strtab + sym->st_name);
sym_addr = o_symtab_offset + sym->st_value;
- if (VG_(clo_trace_symtab))
+ if (si->trace_symtab)
show_raw_elf_symbol(i, sym, sym_name, sym_addr, True);
if (get_elf_symbol_info(si, sym, sym_name, sym_addr,
@@ -580,7 +580,7 @@
/* Only one or the other is possible (I think) */
vg_assert(!(modify_size && modify_tocptr));
- if (modify_size && VG_(clo_trace_symtab)) {
+ if (modify_size && si->trace_symtab) {
VG_(printf)(" modify (old sz %4d) "
" val %010p, toc %010p, sz %4d %s\n",
old_size,
@@ -590,7 +590,7 @@
(HChar*)prev->key.name
);
}
- if (modify_tocptr && VG_(clo_trace_symtab)) {
+ if (modify_tocptr && si->trace_symtab) {
VG_(printf)(" modify (upd tocptr) "
" val %010p, toc %010p, sz %4d %s\n",
(void*) prev->key.addr,
@@ -610,7 +610,7 @@
elem->size = sym_size;
elem->from_opd = from_opd;
VG_(OSet_Insert)(oset, elem);
- if (VG_(clo_trace_symtab)) {
+ if (si->trace_symtab) {
VG_(printf)(" to-oset [%4d]: "
" val %010p, toc %010p, sz %4d %s\n",
i, (void*) elem->key.addr,
@@ -638,7 +638,7 @@
vg_assert(risym.name != NULL);
ML_(addSym) ( si, &risym );
- if (VG_(clo_trace_symtab)) {
+ if (si->trace_symtab) {
VG_(printf)(" record [%4d]: "
" val %010p, toc %010p, sz %4d %s\n",
i, (void*) risym.addr,
@@ -1013,35 +1013,35 @@
/* Find interesting sections, read the symbol table(s), read any debug
information */
{
- /* Pointers to start of sections (in the oimage, not in the
- running image) -- image addresses */
- UChar* o_strtab = NULL; /* .strtab */
- ElfXX_Sym* o_symtab = NULL; /* .symtab */
- UChar* o_dynstr = NULL; /* .dynstr */
- ElfXX_Sym* o_dynsym = NULL; /* .dynsym */
- Char* debuglink = NULL; /* .gnu_debuglink */
- UChar* stab = NULL; /* .stab (stabs) */
- UChar* stabstr = NULL; /* .stabstr (stabs) */
- UChar* debug_line = NULL; /* .debug_line (dwarf2) */
- UChar* debug_info = NULL; /* .debug_info (dwarf2) */
- UChar* debug_abbv = NULL; /* .debug_abbrev (dwarf2) */
- UChar* debug_str = NULL; /* .debug_str (dwarf2) */
- UChar* dwarf1d = NULL; /* .debug (dwarf1) */
- UChar* dwarf1l = NULL; /* .line (dwarf1) */
- UChar* ehframe = NULL; /* .eh_frame (dwarf2) */
- UChar* opd_filea = NULL; /* .opd (dwarf2, ppc64-linux) */
- UChar* dummy_filea = NULL;
+ /* IMAGE addresses: pointers to start of sections (in the
+ oimage, not in the running image) -- image addresses */
+ UChar* strtab_img = NULL; /* .strtab */
+ ElfXX_Sym* symtab_img = NULL; /* .symtab */
+ UChar* dynstr_img = NULL; /* .dynstr */
+ ElfXX_Sym* dynsym_img = NULL; /* .dynsym */
+ Char* debuglink_img = NULL; /* .gnu_debuglink */
+ UChar* stab_img = NULL; /* .stab (stabs) */
+ UChar* stabstr_img = NULL; /* .stabstr (stabs) */
+ UChar* debug_line_img = NULL; /* .debug_line (dwarf2) */
+ UChar* debug_info_img = NULL; /* .debug_info (dwarf2) */
+ UChar* debug_abbv_img = NULL; /* .debug_abbrev (dwarf2) */
+ UChar* debug_str_img = NULL; /* .debug_str (dwarf2) */
+ UChar* dwarf1d_img = NULL; /* .debug (dwarf1) */
+ UChar* dwarf1l_img = NULL; /* .line (dwarf1) */
+ UChar* ehframe_img = NULL; /* .eh_frame (dwarf2) */
+ UChar* opd_filea_img = NULL; /* .opd (dwarf2, ppc64-linux) */
+ UChar* dummy_filea_img = NULL;
- OffT o_symtab_offset = offset_oimage;
- OffT o_dynsym_offset = offset_oimage;
+ OffT symtab_offset = offset_oimage;
+ OffT dynsym_offset = offset_oimage;
OffT debug_offset = offset_oimage;
OffT opd_offset = offset_oimage;
/* Section sizes, in bytes */
- UInt o_strtab_sz = 0;
- UInt o_symtab_sz = 0;
- UInt o_dynstr_sz = 0;
- UInt o_dynsym_sz = 0;
+ UInt strtab_sz = 0;
+ UInt symtab_sz = 0;
+ UInt dynstr_sz = 0;
+ UInt dynsym_sz = 0;
UInt debuglink_sz = 0;
UInt stab_sz = 0;
UInt stabstr_sz = 0;
@@ -1093,45 +1093,46 @@
/* Nb: must find where .got and .plt sections will be in the
* executable image, not in the object image transiently loaded. */
- /* NAME SIZE ADDR_IN_OIMAGE ADDR_WHEN_MAPPED */
- FIND(".dynsym", o_dynsym_sz, o_dynsym, dummy_avma)
- FIND(".dynstr", o_dynstr_sz, o_dynstr, dummy_avma)
- FIND(".symtab", o_symtab_sz, o_symtab, dummy_avma)
- FIND(".strtab", o_strtab_sz, o_strtab, dummy_avma)
+ /* NAME SIZE IMAGE addr AVMA */
+ FIND(".dynsym", dynsym_sz, dynsym_img, dummy_avma)
+ FIND(".dynstr", dynstr_sz, dynstr_img, dummy_avma)
+ FIND(".symtab", symtab_sz, symtab_img, dummy_avma)
+ FIND(".strtab", strtab_sz, strtab_img, dummy_avma)
- FIND(".gnu_debuglink", debuglink_sz, debuglink, dummy_avma)
+ FIND(".gnu_debuglink", debuglink_sz, debuglink_img, dummy_avma)
- FIND(".stab", stab_sz, stab, dummy_avma)
- FIND(".stabstr", stabstr_sz, stabstr, dummy_avma)
+ FIND(".stab", stab_sz, stab_img, dummy_avma)
+ FIND(".stabstr", stabstr_sz, stabstr_img, dummy_avma)
- FIND(".debug_line", debug_line_sz, debug_line, dummy_avma)
- FIND(".debug_info", debug_info_sz, debug_info, dummy_avma)
- FIND(".debug_abbrev", debug_abbv_sz, debug_abbv, dummy_avma)
- FIND(".debug_str", debug_str_sz, debug_str, dummy_avma)
+ FIND(".debug_line", debug_line_sz, debug_line_img, dummy_avma)
+ FIND(".debug_info", debug_info_sz, debug_info_img, dummy_avma)
+ FIND(".debug_abbrev", debug_abbv_sz, debug_abbv_img, dummy_avma)
+ FIND(".debug_str", debug_str_sz, debug_str_img, dummy_avma)
- FIND(".debug", dwarf1d_sz, dwarf1d, dummy_avma)
- FIND(".line", dwarf1l_sz, dwarf1l, dummy_avma)
- FIND(".eh_frame", ehframe_sz, ehframe, ehframe_avma)
+ FIND(".debug", dwarf1d_sz, dwarf1d_img, dummy_avma)
+ FIND(".line", dwarf1l_sz, dwarf1l_img, dummy_avma)
+ FIND(".eh_frame", ehframe_sz, ehframe_img, ehframe_avma)
- FIND(".got", si->got_size, dummy_filea, si->got_start_avma)
- FIND(".plt", si->plt_size, dummy_filea, si->plt_start_avma)
- FIND(".opd", si->opd_size, opd_filea, si->opd_start_avma)
+ FIND(".got", si->got_size, dummy_filea_img, si->got_start_avma)
+ FIND(".plt", si->plt_size, dummy_filea_img, si->plt_start_avma)
+ FIND(".opd", si->opd_size, opd_filea_img, si->opd_start_avma)
# undef FIND
}
/* Did we find a debuglink section? */
- if (debuglink != NULL) {
- UInt crc_offset = VG_ROUNDUP(VG_(strlen)(debuglink)+1, 4);
+ if (debuglink_img != NULL) {
+ UInt crc_offset = VG_ROUNDUP(VG_(strlen)(debuglink_img)+1, 4);
UInt crc;
vg_assert(crc_offset + sizeof(UInt) <= debuglink_sz);
/* Extract the CRC from the debuglink section */
- crc = *(UInt *)(debuglink + crc_offset);
+ crc = *(UInt *)(debuglink_img + crc_offset);
/* See if we can find a matching debug file */
- if ((dimage = find_debug_file(si->filename, debuglink, crc, &n_dimage)) != 0) {
+ dimage = find_debug_file(si->filename, debuglink_img, crc, &n_dimage);
+ if (dimage != 0) {
ehdr = (ElfXX_Ehdr*)dimage;
if (n_dimage >= sizeof(ElfXX_Ehdr)
@@ -1139,7 +1140,7 @@
&& ehdr->e_phoff + ehdr->e_phnum*sizeof(ElfXX_Phdr) <= n_dimage
&& ehdr->e_shoff + ehdr->e_shnum*sizeof(ElfXX_Shdr) <= n_dimage)
{
- Bool need_symtab = (NULL == o_symtab);
+ Bool need_symtab = (NULL == symtab_img);
for (i = 0; i < ehdr->e_phnum; i++) {
ElfXX_Phdr *o_phdr = &((ElfXX_Phdr *)(dimage + ehdr->e_phoff))[i];
@@ -1151,7 +1152,7 @@
debug_offset = offset_dimage;
if (need_symtab)
- o_symtab_offset = offset_dimage;
+ symtab_offset = offset_dimage;
shdr = (ElfXX_Shdr*)(dimage + ehdr->e_shoff);
sh_strtab = (UChar*)(dimage + shdr[ehdr->e_shstrndx].sh_offset);
@@ -1181,17 +1182,17 @@
} \
}
- /* ?? NAME SIZE ADDR_IN_OIMAGE */
- FIND(need_symtab, ".symtab", o_symtab_sz, o_symtab)
- FIND(need_symtab, ".strtab", o_strtab_sz, o_strtab)
- FIND(1, ".stab", stab_sz, stab)
- FIND(1, ".stabstr", stabstr_sz, stabstr)
- FIND(1, ".debug_line", debug_line_sz, debug_line)
- FIND(1, ".debug_info", debug_info_sz, debug_info)
- FIND(1, ".debug_abbrev", debug_abbv_sz, debug_abbv)
- FIND(1, ".debug_str", debug_str_sz, debug_str)
- FIND(1, ".debug", dwarf1d_sz, dwarf1d)
- FIND(1, ".line", dwarf1l_sz, dwarf1l)
+ /* ?? NAME SIZE IMAGE addr */
+ FIND(need_symtab, ".symtab", symtab_sz, symtab_img)
+ FIND(need_symtab, ".strtab", strtab_sz, strtab_img)
+ FIND(1, ".stab", stab_sz, stab_img)
+ FIND(1, ".stabstr", stabstr_sz, stabstr_img)
+ FIND(1, ".debug_line", debug_line_sz, debug_line_img)
+ FIND(1, ".debug_info", debug_info_sz, debug_info_img)
+ FIND(1, ".debug_abbrev", debug_abbv_sz, debug_abbv_img)
+ FIND(1, ".debug_str", debug_str_sz, debug_str_img)
+ FIND(1, ".debug", dwarf1d_sz, dwarf1d_img)
+ FIND(1, ".line", dwarf1l_sz, dwarf1l_img)
# undef FIND
}
@@ -1200,8 +1201,8 @@
}
/* Check some sizes */
- vg_assert((o_dynsym_sz % sizeof(ElfXX_Sym)) == 0);
- vg_assert((o_symtab_sz % sizeof(ElfXX_Sym)) == 0);
+ vg_assert((dynsym_sz % sizeof(ElfXX_Sym)) == 0);
+ vg_assert((symtab_sz % sizeof(ElfXX_Sym)) == 0);
/* Read symbols */
{
@@ -1213,27 +1214,29 @@
read_elf_symtab = read_elf_symtab__normal;
# endif
read_elf_symtab(si, "symbol table",
- o_symtab, o_symtab_sz, o_symtab_offset,
- o_strtab, o_strtab_sz, opd_filea, opd_offset);
+ symtab_img, symtab_sz, symtab_offset,
+ strtab_img, strtab_sz,
+ opd_filea_img, opd_offset);
read_elf_symtab(si, "dynamic symbol table",
- o_dynsym, o_dynsym_sz, o_dynsym_offset,
- o_dynstr, o_dynstr_sz, opd_filea, opd_offset);
+ dynsym_img, dynsym_sz, dynsym_offset,
+ dynstr_img, dynstr_sz,
+ opd_filea_img, opd_offset);
}
/* Read .eh_frame (call-frame-info) if any */
- if (ehframe) {
+ if (ehframe_img) {
ML_(read_callframe_info_dwarf2)
- ( si, ehframe/*image*/, ehframe_sz, ehframe_avma );
+ ( si, ehframe_img, ehframe_sz, ehframe_avma );
}
/* Read the stabs and/or dwarf2 debug information, if any. It
appears reading stabs stuff on amd64-linux doesn't work, so
we ignore it. */
# if !defined(VGP_amd64_linux)
- if (stab && stabstr) {
- ML_(read_debuginfo_stabs) ( si, debug_offset, stab, stab_sz,
- stabstr, stabstr_sz );
+ if (stab_img && stabstr_img) {
+ ML_(read_debuginfo_stabs) ( si, debug_offset, stab_img, stab_sz,
+ stabstr_img, stabstr_sz );
}
# endif
/* jrs 2006-01-01: icc-8.1 has been observed to generate
@@ -1241,16 +1244,17 @@
debuginfo reading for that reason, but, in
read_unitinfo_dwarf2, do check that debugstr is non-NULL
before using it. */
- if (debug_info && debug_abbv && debug_line /* && debug_str */) {
+ if (debug_info_img && debug_abbv_img && debug_line_img
+ /* && debug_str_img */) {
ML_(read_debuginfo_dwarf2) ( si, debug_offset,
- debug_info, debug_info_sz,
- debug_abbv,
- debug_line, debug_line_sz,
- debug_str );
+ debug_info_img, debug_info_sz,
+ debug_abbv_img,
+ debug_line_img, debug_line_sz,
+ debug_str_img );
}
- if (dwarf1d && dwarf1l) {
- ML_(read_debuginfo_dwarf1) ( si, dwarf1d, dwarf1d_sz,
- dwarf1l, dwarf1l_sz );
+ if (dwarf1d_img && dwarf1l_img) {
+ ML_(read_debuginfo_dwarf1) ( si, dwarf1d_img, dwarf1d_sz,
+ dwarf1l_img, dwarf1l_sz );
}
}
res = True;
Modified: trunk/coregrind/m_debuginfo/storage.c
===================================================================
--- trunk/coregrind/m_debuginfo/storage.c 2007-02-12 11:28:38 UTC (rev 6587)
+++ trunk/coregrind/m_debuginfo/storage.c 2007-02-12 17:47:14 UTC (rev 6588)
@@ -397,7 +397,7 @@
so we can misdescribe memcmp() as bcmp()). This is hard to avoid.
It's mentioned in the FAQ file.
*/
-static DiSym* prefersym ( DiSym* a, DiSym* b )
+static DiSym* prefersym ( struct _SegInfo* si, DiSym* a, DiSym* b )
{
Int lena, lenb; /* full length */
Int vlena, vlenb; /* length without version */
@@ -476,7 +476,7 @@
n_merged++;
/* merge the two into one */
si->symtab[si->symtab_used++]
- = *prefersym(&si->symtab[i], &si->symtab[i+1]);
+ = *prefersym(si, &si->symtab[i], &si->symtab[i+1]);
i++;
} else {
si->symtab[si->symtab_used++] = si->symtab[i];
@@ -499,7 +499,7 @@
continue;
/* There's an overlap. Truncate one or the other. */
- if (VG_(clo_trace_symtab)) {
+ if (si->trace_symtab) {
VG_(printf)("overlapping address ranges in symbol table\n\t");
ML_(ppSym)( i, &si->symtab[i] );
VG_(printf)("\t");
@@ -683,7 +683,7 @@
si->cfsi_maxaddr = here_max;
}
- if (VG_(clo_trace_cfi))
+ if (si->trace_cfi)
VG_(printf)("canonicaliseCfiSI: %d entries, %p .. %p\n",
si->cfsi_used,
si->cfsi_minaddr, si->cfsi_maxaddr);
Modified: trunk/coregrind/m_main.c
===================================================================
--- trunk/coregrind/m_main.c 2007-02-12 11:28:38 UTC (rev 6587)
+++ trunk/coregrind/m_main.c 2007-02-12 17:47:14 UTC (rev 6588)
@@ -159,7 +159,11 @@
" --trace-syscalls=no|yes show all system calls? [no]\n"
" --trace-signals=no|yes show signal handling details? [no]\n"
" --trace-symtab=no|yes show symbol table details? [no]\n"
+" --trace-symtab-patt=<patt> limit debuginfo tracing to obj name <patt>\n"
" --trace-cfi=no|yes show call-frame-info details? [no]\n"
+" --debug-dump=syms mimic /usr/bin/readelf --syms\n"
+" --debug-dump=line mimic /usr/bin/readelf --debug-dump=line\n"
+" --debug-dump=frames mimic /usr/bin/readelf --debug-dump=frames\n"
" --trace-redir=no|yes show redirection details? [no]\n"
" --trace-sched=no|yes show thread scheduler details? [no]\n"
" --wait-for-gdb=yes|no pause on startup to wait for gdb attach\n"
@@ -352,12 +356,16 @@
else VG_BOOL_CLO(arg, "--trace-sched", VG_(clo_trace_sched))
else VG_BOOL_CLO(arg, "--trace-signals", VG_(clo_trace_signals))
else VG_BOOL_CLO(arg, "--trace-symtab", VG_(clo_trace_symtab))
+ else VG_STR_CLO (arg, "--trace-symtab-patt", VG_(clo_trace_symtab_patt))
else VG_BOOL_CLO(arg, "--trace-cfi", VG_(clo_trace_cfi))
+ else VG_XACT_CLO(arg, "--debug-dump=syms", VG_(clo_debug_dump_syms))
+ else VG_XACT_CLO(arg, "--debug-dump=line", VG_(clo_debug_dump_line))
+ else VG_XACT_CLO(arg, "--debug-dump=frames", VG_(clo_debug_dump_frames))
else VG_BOOL_CLO(arg, "--trace-redir", VG_(clo_trace_redir))
+
else VG_BOOL_CLO(arg, "--trace-syscalls", VG_(clo_trace_syscalls))
else VG_BOOL_CLO(arg, "--trace-pthreads", VG_(clo_trace_pthreads))
else VG_BOOL_CLO(arg, "--wait-for-gdb", VG_(clo_wait_for_gdb))
-
else VG_STR_CLO (arg, "--db-command", VG_(clo_db_command))
else VG_STR_CLO (arg, "--sim-hints", VG_(clo_sim_hints))
else VG_BOOL_CLO(arg, "--sym-offsets", VG_(clo_sym_offsets))
Modified: trunk/coregrind/m_options.c
===================================================================
--- trunk/coregrind/m_options.c 2007-02-12 11:28:38 UTC (rev 6587)
+++ trunk/coregrind/m_options.c 2007-02-12 17:47:14 UTC (rev 6588)
@@ -63,7 +63,11 @@
Bool VG_(clo_trace_syscalls) = False;
Bool VG_(clo_trace_signals) = False;
Bool VG_(clo_trace_symtab) = False;
+HChar* VG_(clo_trace_symtab_patt) = "*";
Bool VG_(clo_trace_cfi) = False;
+Bool VG_(clo_debug_dump_syms) = False;
+Bool VG_(clo_debug_dump_line) = False;
+Bool VG_(clo_debug_dump_frames) = False;
Bool VG_(clo_trace_redir) = False;
Bool VG_(clo_trace_sched) = False;
Bool VG_(clo_trace_pthreads) = False;
Modified: trunk/coregrind/pub_core_options.h
===================================================================
--- trunk/coregrind/pub_core_options.h 2007-02-12 11:28:38 UTC (rev 6587)
+++ trunk/coregrind/pub_core_options.h 2007-02-12 17:47:14 UTC (rev 6588)
@@ -112,8 +112,16 @@
extern Bool VG_(clo_trace_signals);
/* DEBUG: print symtab details? default: NO */
extern Bool VG_(clo_trace_symtab);
+/* DEBUG: restrict symtab etc details to object name pattern. Default: "*" */
+extern HChar* VG_(clo_trace_symtab_patt);
/* DEBUG: print call-frame-info details? default: NO */
extern Bool VG_(clo_trace_cfi);
+/* DEBUG: mimic /usr/bin/readelf --syms? default: NO */
+extern Bool VG_(clo_debug_dump_syms);
+/* DEBUG: mimic /usr/bin/readelf --debug-dump=line? default: NO */
+extern Bool VG_(clo_debug_dump_line);
+/* DEBUG: mimic /usr/bin/readelf --debug-dump=frames? default: NO */
+extern Bool VG_(clo_debug_dump_frames);
/* DEBUG: print redirection details? default: NO */
extern Bool VG_(clo_trace_redir);
/* DEBUG: print thread scheduling events? default: NO */
Modified: trunk/include/pub_tool_options.h
===================================================================
--- trunk/include/pub_tool_options.h 2007-02-12 11:28:38 UTC (rev 6587)
+++ trunk/include/pub_tool_options.h 2007-02-12 17:47:14 UTC (rev 6588)
@@ -63,6 +63,12 @@
if ((qq_var) > (qq_hi)) (qq_var) = (qq_hi); \
}
+/* Bool arg whose value is denoted by the exact presence of the given string. */
+#define VG_XACT_CLO(qq_arg, qq_option, qq_var) \
+ if (VG_CLO_STREQ(qq_arg, qq_option)) { \
+ (qq_var) = True; \
+ } /* else leave it alone */
+
/* Verbosity level: 0 = silent, 1 (default), > 1 = more verbose. */
extern Int VG_(clo_verbosity);
|
|
From: <sv...@va...> - 2007-02-12 11:28:48
|
Author: njn
Date: 2007-02-12 11:28:38 +0000 (Mon, 12 Feb 2007)
New Revision: 6587
Log:
This code shouldn't be run unless --trace-mem was specified.
Modified:
trunk/lackey/lk_main.c
Modified: trunk/lackey/lk_main.c
===================================================================
--- trunk/lackey/lk_main.c 2007-02-12 10:37:37 UTC (rev 6586)
+++ trunk/lackey/lk_main.c 2007-02-12 11:28:38 UTC (rev 6587)
@@ -500,6 +500,7 @@
static void addEvent_Ir ( IRSB* sb, IRAtom* iaddr, UInt isize )
{
Event* evt;
+ tl_assert(clo_trace_mem);
tl_assert( (VG_MIN_INSTR_SZB <= isize && isize <= VG_MAX_INSTR_SZB)
|| VG_CLREQ_SZB == isize );
if (events_used == N_EVENTS)
@@ -516,6 +517,7 @@
void addEvent_Dr ( IRSB* sb, IRAtom* daddr, Int dsize )
{
Event* evt;
+ tl_assert(clo_trace_mem);
tl_assert(isIRAtom(daddr));
tl_assert(dsize >= 1 && dsize <= MAX_DSIZE);
if (events_used == N_EVENTS)
@@ -533,6 +535,7 @@
{
Event* lastEvt;
Event* evt;
+ tl_assert(clo_trace_mem);
tl_assert(isIRAtom(daddr));
tl_assert(dsize >= 1 && dsize <= MAX_DSIZE);
@@ -744,20 +747,22 @@
break;
case Ist_Dirty: {
- Int dsize;
- IRDirty* d = st->Ist.Dirty.details;
- if (d->mFx != Ifx_None) {
- // This dirty helper accesses memory. Collect the details.
- tl_assert(d->mAddr != NULL);
- tl_assert(d->mSize != 0);
- dsize = d->mSize;
- if (d->mFx == Ifx_Read || d->mFx == Ifx_Modify)
- addEvent_Dr( sbOut, d->mAddr, dsize );
- if (d->mFx == Ifx_Write || d->mFx == Ifx_Modify)
- addEvent_Dw( sbOut, d->mAddr, dsize );
- } else {
- tl_assert(d->mAddr == NULL);
- tl_assert(d->mSize == 0);
+ if (clo_trace_mem) {
+ Int dsize;
+ IRDirty* d = st->Ist.Dirty.details;
+ if (d->mFx != Ifx_None) {
+ // This dirty helper accesses memory. Collect the details.
+ tl_assert(d->mAddr != NULL);
+ tl_assert(d->mSize != 0);
+ dsize = d->mSize;
+ if (d->mFx == Ifx_Read || d->mFx == Ifx_Modify)
+ addEvent_Dr( sbOut, d->mAddr, dsize );
+ if (d->mFx == Ifx_Write || d->mFx == Ifx_Modify)
+ addEvent_Dw( sbOut, d->mAddr, dsize );
+ } else {
+ tl_assert(d->mAddr == NULL);
+ tl_assert(d->mSize == 0);
+ }
}
addStmtToIRSB( sbOut, st );
break;
|
|
From: <sv...@va...> - 2007-02-12 10:37:48
|
Author: njn Date: 2007-02-12 10:37:37 +0000 (Mon, 12 Feb 2007) New Revision: 6586 Log: Update for changes to lackey Modified: trunk/NEWS Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2007-02-12 08:42:13 UTC (rev 6585) +++ trunk/NEWS 2007-02-12 10:37:37 UTC (rev 6586) @@ -16,6 +16,11 @@ they just return 3 (as before). Also, SET_VBITS doesn't report definedness errors if any of the V bits are undefined. +- The behaviour of the tool Lackey has changed slightly. First, the output + from --trace-mem has been made more compact, to reduce the size of the + traces. Second, a new option --trace-superblocks has been added, which + shows the addresses of superblocks (code blocks) as they are executed. + Developer-visible changes: - The names of some functions and types within the Vex IR have changed. |
|
From: <js...@ac...> - 2007-02-12 09:05:18
|
Nightly build on minnie ( SuSE 10.0, ppc32 ) started at 2007-02-12 09:00:01 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: <sv...@va...> - 2007-02-12 08:42:15
|
Author: sewardj
Date: 2007-02-12 08:42:13 +0000 (Mon, 12 Feb 2007)
New Revision: 6585
Log:
* make the --trace-mem output format more concise
* new option --trace-superblocks for getting a log of superblock entries
Modified:
trunk/lackey/docs/lk-manual.xml
trunk/lackey/lk_main.c
Modified: trunk/lackey/docs/lk-manual.xml
===================================================================
--- trunk/lackey/docs/lk-manual.xml 2007-02-12 08:39:54 UTC (rev 6584)
+++ trunk/lackey/docs/lk-manual.xml 2007-02-12 08:42:13 UTC (rev 6585)
@@ -89,6 +89,17 @@
</para>
</listitem>
+ <listitem>
+ <para>When command line option
+ <computeroutput>--trace-superblocks=yes</computeroutput> is
+ specified, it prints out the address of every superblock
+ (extended basic block) executed by the program. This is
+ primarily of interest to Valgrind developers. See the comments at
+ the top of the file <computeroutput>lackey/lk_main.c</computeroutput>
+ for details about the output format.
+ </para>
+ </listitem>
+
</orderedlist>
<para>Note that Lackey runs quite slowly, especially when
@@ -98,6 +109,13 @@
its role as a simple example tool. Hence we have chosen not to do
so.</para>
+<para>Note also that <computeroutput>--trace-mem=yes</computeroutput>
+and <computeroutput>--trace-superblocks=yes</computeroutput> create
+immense amounts of output. If you are saving the output in a file,
+you can eat up tens of gigabytes of disk space very quickly.
+As a result of printing out so much stuff, they also cause the program
+to run absolutely utterly unbelievably slowly.</para>
+
</sect1>
@@ -127,6 +145,27 @@
</listitem>
</varlistentry>
+ <varlistentry id="opt.trace-mem" xreflabel="--trace-mem">
+ <term>
+ <option><![CDATA[--trace-mem=<no|yes> [default: no] ]]></option>
+ </term>
+ <listitem>
+ <para>Print a line of text giving the address and size of each
+ data and instruction memory access done by the program.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry id="opt.trace-superblocks" xreflabel="--trace-superblocks">
+ <term>
+ <option><![CDATA[--trace-superblocks=<no|yes> [default: no] ]]></option>
+ </term>
+ <listitem>
+ <para>Print a line of text giving the address of each superblock
+ (single entry, multiple exit chunk of code) executed
+ by the program.</para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
<!-- end of xi:include in the manpage -->
Modified: trunk/lackey/lk_main.c
===================================================================
--- trunk/lackey/lk_main.c 2007-02-12 08:39:54 UTC (rev 6584)
+++ trunk/lackey/lk_main.c 2007-02-12 08:42:13 UTC (rev 6585)
@@ -30,7 +30,7 @@
// This tool shows how to do some basic instrumentation.
//
-// There are three kinds of instrumentation it can do. They can be turned
+// There are four kinds of instrumentation it can do. They can be turned
// on/off independently with command line options:
//
// * --basic-counts : do basic counts, eg. number of instructions
@@ -38,9 +38,12 @@
// * --detailed-counts: do more detailed counts: number of loads, stores
// and ALU operations of different sizes.
// * --trace-mem=yes: trace all (data) memory accesses.
+// * --trace-superblocks=yes:
+// trace all superblock entries. Mostly of interest
+// to the Valgrind developers.
//
// The code for each kind of instrumentation is guarded by a clo_* variable:
-// clo_basic_counts, clo_detailed_counts and clo_trace_mem.
+// clo_basic_counts, clo_detailed_counts, clo_trace_mem and clo_trace_sbs.
//
// If you want to modify any of the instrumentation code, look for the code
// that is guarded by the relevant clo_* variable (eg. clo_trace_mem)
@@ -59,19 +62,19 @@
//
// It prints memory data access traces that look like this:
//
-// instr : 0x0023C790, 2 # instruction read at 0x0023C790 of size 2
-// instr : 0x0023C792, 5
-// store : 0xBE80199C, 4 # data store at 0xBE80199C of size 4
-// instr : 0x0025242B, 3
-// load : 0xBE801950, 4 # data load at 0xBE801950 of size 4
-// instr : 0x0023D476, 7
-// modify: 0x0025747C, 1 # data modify at 0x0025747C of size 1
-// instr : 0x0023DC20, 2
-// load : 0x00254962, 1
-// load : 0xBE801FB3, 1
-// instr : 0x00252305, 1
-// load : 0x00254AEB, 1
-// store : 0x00257998, 1
+// I 0023C790,2 # instruction read at 0x0023C790 of size 2
+// I 0023C792,5
+// S BE80199C,4 # data store at 0xBE80199C of size 4
+// I 0025242B,3
+// L BE801950,4 # data load at 0xBE801950 of size 4
+// I 0023D476,7
+// M 0025747C,1 # data modify at 0x0025747C of size 1
+// I 0023DC20,2
+// L 00254962,1
+// L BE801FB3,1
+// I 00252305,1
+// L 00254AEB,1
+// S 00257998,1
//
// Every instruction executed has an "instr" event representing it.
// Instructions that do memory accesses are followed by one or more "load",
@@ -137,7 +140,35 @@
// uses the same basic technique for tracing memory accesses, but also groups
// events together for processing into twos and threes so that fewer C calls
// are made and things run faster.
+//
+// Specific Details about --trace-superblocks=yes
+// ----------------------------------------------
+// Valgrind splits code up into single entry, multiple exit blocks
+// known as superblocks. By itself, --trace-superblocks=yes just
+// prints a message as each superblock is run:
+//
+// SB 04013170
+// SB 04013177
+// SB 04013173
+// SB 04013177
+//
+// The hex number is the address of the first instruction in the
+// superblock. You can see the relationship more obviously if you use
+// --trace-superblocks=yes and --trace-mem=yes together. Then a "SB"
+// message at address X is immediately followed by an "instr:" message
+// for that address, as the first instruction in the block is
+// executed, for example:
+//
+// SB 04014073
+// I 04014073,3
+// L 7FEFFF7F8,8
+// I 04014076,4
+// I 0401407A,3
+// I 0401407D,3
+// I 04014080,3
+// I 04014083,6
+
#include "pub_tool_basics.h"
#include "pub_tool_tooliface.h"
#include "pub_tool_libcassert.h"
@@ -156,6 +187,7 @@
static Bool clo_basic_counts = True;
static Bool clo_detailed_counts = False;
static Bool clo_trace_mem = False;
+static Bool clo_trace_sbs = False;
/* The name of the function of which the number of calls (under
* --basic-counts=yes) is to be counted, with default. Override with command
@@ -165,9 +197,10 @@
static Bool lk_process_cmd_line_option(Char* arg)
{
VG_STR_CLO(arg, "--fnname", clo_fnname)
- else VG_BOOL_CLO(arg, "--basic-counts", clo_basic_counts)
- else VG_BOOL_CLO(arg, "--detailed-counts", clo_detailed_counts)
- else VG_BOOL_CLO(arg, "--trace-mem", clo_trace_mem)
+ else VG_BOOL_CLO(arg, "--basic-counts", clo_basic_counts)
+ else VG_BOOL_CLO(arg, "--detailed-counts", clo_detailed_counts)
+ else VG_BOOL_CLO(arg, "--trace-mem", clo_trace_mem)
+ else VG_BOOL_CLO(arg, "--trace-superblocks", clo_trace_sbs)
else
return False;
@@ -182,6 +215,7 @@
" --basic-counts=no|yes count instructions, jumps, etc. [no]\n"
" --detailed-counts=no|yes count loads, stores and alu ops [no]\n"
" --trace-mem=no|yes trace all loads and stores [no]\n"
+" --trace-superblocks=no|yes trace all superblock entries [no]\n"
" --fnname=<name> count calls to <name> (only used if\n"
" --basic-count=yes) [_dl_runtime_resolve]\n"
);
@@ -200,8 +234,8 @@
/* Nb: use ULongs because the numbers can get very big */
static ULong n_func_calls = 0;
-static ULong n_BBs_entered = 0;
-static ULong n_BBs_completed = 0;
+static ULong n_SBs_entered = 0;
+static ULong n_SBs_completed = 0;
static ULong n_IRStmts = 0;
static ULong n_guest_instrs = 0;
static ULong n_Jccs = 0;
@@ -212,14 +246,14 @@
n_func_calls++;
}
-static void add_one_BB_entered(void)
+static void add_one_SB_entered(void)
{
- n_BBs_entered++;
+ n_SBs_entered++;
}
-static void add_one_BB_completed(void)
+static void add_one_SB_completed(void)
{
- n_BBs_completed++;
+ n_SBs_completed++;
}
static void add_one_IRStmt(void)
@@ -302,7 +336,7 @@
}
/* A helper that adds the instrumentation for a detail. */
-static void instrument_detail(IRSB* bb, Op op, IRType type)
+static void instrument_detail(IRSB* sb, Op op, IRType type)
{
IRDirty* di;
IRExpr** argv;
@@ -315,7 +349,7 @@
di = unsafeIRDirty_0_N( 1, "increment_detail",
VG_(fnptr_to_fnentry)( &increment_detail ),
argv);
- addStmtToIRSB( bb, IRStmt_Dirty(di) );
+ addStmtToIRSB( sb, IRStmt_Dirty(di) );
}
/* Summarize and print the details. */
@@ -368,7 +402,7 @@
/* Maintain an ordered list of memory events which are outstanding, in
the sense that no IR has yet been generated to do the relevant
- helper calls. The BB is scanned top to bottom and memory events
+ helper calls. The SB is scanned top to bottom and memory events
are added to the end of the list, merging with the most recent
notified event where possible (Dw immediately following Dr and
having the same size and EA can be merged).
@@ -398,26 +432,26 @@
static VG_REGPARM(2) void trace_instr(Addr addr, SizeT size)
{
- VG_(printf)("instr : %08p, %d\n", addr, size);
+ VG_(printf)("I %08lx,%d\n", addr, size);
}
static VG_REGPARM(2) void trace_load(Addr addr, SizeT size)
{
- VG_(printf)(" load : %08p, %d\n", addr, size);
+ VG_(printf)(" L %08lx,%d\n", addr, size);
}
static VG_REGPARM(2) void trace_store(Addr addr, SizeT size)
{
- VG_(printf)(" store : %08p, %d\n", addr, size);
+ VG_(printf)(" S %08lx,%d\n", addr, size);
}
static VG_REGPARM(2) void trace_modify(Addr addr, SizeT size)
{
- VG_(printf)(" modify: %08p, %d\n", addr, size);
+ VG_(printf)(" M %08lx,%d\n", addr, size);
}
-static void flushEvents(IRSB* bb)
+static void flushEvents(IRSB* sb)
{
Int i;
Char* helperName;
@@ -452,7 +486,7 @@
di = unsafeIRDirty_0_N( /*regparms*/2,
helperName, VG_(fnptr_to_fnentry)( helperAddr ),
argv );
- addStmtToIRSB( bb, IRStmt_Dirty(di) );
+ addStmtToIRSB( sb, IRStmt_Dirty(di) );
}
events_used = 0;
@@ -463,13 +497,13 @@
// must still call this function, addEvent_Ir() -- it is necessary to add
// the Ir events to the events list so that merging of paired load/store
// events into modify events works correctly.
-static void addEvent_Ir ( IRSB* bb, IRAtom* iaddr, UInt isize )
+static void addEvent_Ir ( IRSB* sb, IRAtom* iaddr, UInt isize )
{
Event* evt;
tl_assert( (VG_MIN_INSTR_SZB <= isize && isize <= VG_MAX_INSTR_SZB)
|| VG_CLREQ_SZB == isize );
if (events_used == N_EVENTS)
- flushEvents(bb);
+ flushEvents(sb);
tl_assert(events_used >= 0 && events_used < N_EVENTS);
evt = &events[events_used];
evt->ekind = Event_Ir;
@@ -479,13 +513,13 @@
}
static
-void addEvent_Dr ( IRSB* bb, IRAtom* daddr, Int dsize )
+void addEvent_Dr ( IRSB* sb, IRAtom* daddr, Int dsize )
{
Event* evt;
tl_assert(isIRAtom(daddr));
tl_assert(dsize >= 1 && dsize <= MAX_DSIZE);
if (events_used == N_EVENTS)
- flushEvents(bb);
+ flushEvents(sb);
tl_assert(events_used >= 0 && events_used < N_EVENTS);
evt = &events[events_used];
evt->ekind = Event_Dr;
@@ -495,7 +529,7 @@
}
static
-void addEvent_Dw ( IRSB* bb, IRAtom* daddr, Int dsize )
+void addEvent_Dw ( IRSB* sb, IRAtom* daddr, Int dsize )
{
Event* lastEvt;
Event* evt;
@@ -515,7 +549,7 @@
// No. Add as normal.
if (events_used == N_EVENTS)
- flushEvents(bb);
+ flushEvents(sb);
tl_assert(events_used >= 0 && events_used < N_EVENTS);
evt = &events[events_used];
evt->ekind = Event_Dw;
@@ -526,6 +560,16 @@
/*------------------------------------------------------------*/
+/*--- Stuff for --trace-superblocks ---*/
+/*------------------------------------------------------------*/
+
+static void trace_superblock(Addr addr)
+{
+ VG_(printf)("SB %08lx\n", addr);
+}
+
+
+/*------------------------------------------------------------*/
/*--- Basic tool functions ---*/
/*------------------------------------------------------------*/
@@ -542,47 +586,57 @@
static
IRSB* lk_instrument ( VgCallbackClosure* closure,
- IRSB* bbIn,
+ IRSB* sbIn,
VexGuestLayout* layout,
VexGuestExtents* vge,
IRType gWordTy, IRType hWordTy )
{
IRDirty* di;
Int i;
- IRSB* bbOut;
+ IRSB* sbOut;
Char fnname[100];
IRType type;
- IRTypeEnv* tyenv = bbIn->tyenv;
+ IRTypeEnv* tyenv = sbIn->tyenv;
if (gWordTy != hWordTy) {
/* We don't currently support this case. */
VG_(tool_panic)("host/guest word size mismatch");
}
- /* Set up BB */
- bbOut = deepCopyIRSBExceptStmts(bbIn);
+ /* Set up SB */
+ sbOut = deepCopyIRSBExceptStmts(sbIn);
// Copy verbatim any IR preamble preceding the first IMark
i = 0;
- while (i < bbIn->stmts_used && bbIn->stmts[i]->tag != Ist_IMark) {
- addStmtToIRSB( bbOut, bbIn->stmts[i] );
+ while (i < sbIn->stmts_used && sbIn->stmts[i]->tag != Ist_IMark) {
+ addStmtToIRSB( sbOut, sbIn->stmts[i] );
i++;
}
if (clo_basic_counts) {
- /* Count this basic block. */
- di = unsafeIRDirty_0_N( 0, "add_one_BB_entered",
- VG_(fnptr_to_fnentry)( &add_one_BB_entered ),
+ /* Count this superblock. */
+ di = unsafeIRDirty_0_N( 0, "add_one_SB_entered",
+ VG_(fnptr_to_fnentry)( &add_one_SB_entered ),
mkIRExprVec_0() );
- addStmtToIRSB( bbOut, IRStmt_Dirty(di) );
+ addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
}
+ if (clo_trace_sbs) {
+ /* Print this superblock's address. */
+ di = unsafeIRDirty_0_N(
+ 0, "trace_superblock",
+ VG_(fnptr_to_fnentry)( &trace_superblock ),
+ mkIRExprVec_1( mkIRExpr_HWord( vge->base[0] ) )
+ );
+ addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
+ }
+
if (clo_trace_mem) {
events_used = 0;
}
- for (/*use current i*/; i < bbIn->stmts_used; i++) {
- IRStmt* st = bbIn->stmts[i];
+ for (/*use current i*/; i < sbIn->stmts_used; i++) {
+ IRStmt* st = sbIn->stmts[i];
if (!st || st->tag == Ist_NoOp) continue;
if (clo_basic_counts) {
@@ -590,7 +644,7 @@
di = unsafeIRDirty_0_N( 0, "add_one_IRStmt",
VG_(fnptr_to_fnentry)( &add_one_IRStmt ),
mkIRExprVec_0() );
- addStmtToIRSB( bbOut, IRStmt_Dirty(di) );
+ addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
}
switch (st->tag) {
@@ -599,7 +653,7 @@
case Ist_Put:
case Ist_PutI:
case Ist_MFence:
- addStmtToIRSB( bbOut, st );
+ addStmtToIRSB( sbOut, st );
break;
case Ist_IMark:
@@ -608,17 +662,17 @@
di = unsafeIRDirty_0_N( 0, "add_one_guest_instr",
VG_(fnptr_to_fnentry)( &add_one_guest_instr ),
mkIRExprVec_0() );
- addStmtToIRSB( bbOut, IRStmt_Dirty(di) );
+ addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
/* An unconditional branch to a known destination in the
* guest's instructions can be represented, in the IRSB to
* instrument, by the VEX statements that are the
* translation of that known destination. This feature is
- * called 'BB chasing' and can be influenced by command
+ * called 'SB chasing' and can be influenced by command
* line option --vex-guest-chase-thresh.
*
* To get an accurate count of the calls to a specific
- * function, taking BB chasing into account, we need to
+ * function, taking SB chasing into account, we need to
* check for each guest instruction (Ist_IMark) if it is
* the entry point of a function.
*/
@@ -631,17 +685,17 @@
0, "add_one_func_call",
VG_(fnptr_to_fnentry)( &add_one_func_call ),
mkIRExprVec_0() );
- addStmtToIRSB( bbOut, IRStmt_Dirty(di) );
+ addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
}
}
if (clo_trace_mem) {
// WARNING: do not remove this function call, even if you
// aren't interested in instruction reads. See the comment
// above the function itself for more detail.
- addEvent_Ir( bbOut, mkIRExpr_HWord( (HWord)st->Ist.IMark.addr ),
+ addEvent_Ir( sbOut, mkIRExpr_HWord( (HWord)st->Ist.IMark.addr ),
st->Ist.IMark.len );
}
- addStmtToIRSB( bbOut, st );
+ addStmtToIRSB( sbOut, st );
break;
case Ist_WrTmp:
@@ -649,44 +703,44 @@
if (clo_trace_mem) {
IRExpr* data = st->Ist.WrTmp.data;
if (data->tag == Iex_Load) {
- addEvent_Dr( bbOut, data->Iex.Load.addr,
+ addEvent_Dr( sbOut, data->Iex.Load.addr,
sizeofIRType(data->Iex.Load.ty) );
}
}
if (clo_detailed_counts) {
IRExpr* expr = st->Ist.WrTmp.data;
- type = typeOfIRExpr(bbOut->tyenv, expr);
+ type = typeOfIRExpr(sbOut->tyenv, expr);
tl_assert(type != Ity_INVALID);
switch (expr->tag) {
case Iex_Load:
- instrument_detail( bbOut, OpLoad, type );
+ instrument_detail( sbOut, OpLoad, type );
break;
case Iex_Unop:
case Iex_Binop:
case Iex_Triop:
case Iex_Qop:
case Iex_Mux0X:
- instrument_detail( bbOut, OpAlu, type );
+ instrument_detail( sbOut, OpAlu, type );
break;
default:
break;
}
}
- addStmtToIRSB( bbOut, st );
+ addStmtToIRSB( sbOut, st );
break;
case Ist_Store:
if (clo_trace_mem) {
IRExpr* data = st->Ist.Store.data;
- addEvent_Dw( bbOut, st->Ist.Store.addr,
+ addEvent_Dw( sbOut, st->Ist.Store.addr,
sizeofIRType(typeOfIRExpr(tyenv, data)) );
}
if (clo_detailed_counts) {
- type = typeOfIRExpr(bbOut->tyenv, st->Ist.Store.data);
+ type = typeOfIRExpr(sbOut->tyenv, st->Ist.Store.data);
tl_assert(type != Ity_INVALID);
- instrument_detail( bbOut, OpStore, type );
+ instrument_detail( sbOut, OpStore, type );
}
- addStmtToIRSB( bbOut, st );
+ addStmtToIRSB( sbOut, st );
break;
case Ist_Dirty: {
@@ -698,14 +752,14 @@
tl_assert(d->mSize != 0);
dsize = d->mSize;
if (d->mFx == Ifx_Read || d->mFx == Ifx_Modify)
- addEvent_Dr( bbOut, d->mAddr, dsize );
+ addEvent_Dr( sbOut, d->mAddr, dsize );
if (d->mFx == Ifx_Write || d->mFx == Ifx_Modify)
- addEvent_Dw( bbOut, d->mAddr, dsize );
+ addEvent_Dw( sbOut, d->mAddr, dsize );
} else {
tl_assert(d->mAddr == NULL);
tl_assert(d->mSize == 0);
}
- addStmtToIRSB( bbOut, st );
+ addStmtToIRSB( sbOut, st );
break;
}
@@ -715,13 +769,13 @@
di = unsafeIRDirty_0_N( 0, "add_one_Jcc",
VG_(fnptr_to_fnentry)( &add_one_Jcc ),
mkIRExprVec_0() );
- addStmtToIRSB( bbOut, IRStmt_Dirty(di) );
+ addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
}
if (clo_trace_mem) {
- flushEvents(bbOut);
+ flushEvents(sbOut);
}
- addStmtToIRSB( bbOut, st ); // Original statement
+ addStmtToIRSB( sbOut, st ); // Original statement
if (clo_basic_counts) {
/* Count non-taken Jcc */
@@ -729,7 +783,7 @@
VG_(fnptr_to_fnentry)(
&add_one_Jcc_untaken ),
mkIRExprVec_0() );
- addStmtToIRSB( bbOut, IRStmt_Dirty(di) );
+ addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
}
break;
@@ -740,18 +794,18 @@
if (clo_basic_counts) {
/* Count this basic block. */
- di = unsafeIRDirty_0_N( 0, "add_one_BB_completed",
- VG_(fnptr_to_fnentry)( &add_one_BB_completed ),
+ di = unsafeIRDirty_0_N( 0, "add_one_SB_completed",
+ VG_(fnptr_to_fnentry)( &add_one_SB_completed ),
mkIRExprVec_0() );
- addStmtToIRSB( bbOut, IRStmt_Dirty(di) );
+ addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
}
if (clo_trace_mem) {
- /* At the end of the bbIn. Flush outstandings. */
- flushEvents(bbOut);
+ /* At the end of the sbIn. Flush outstandings. */
+ flushEvents(sbOut);
}
- return bbOut;
+ return sbOut;
}
static void lk_fini(Int exitcode)
@@ -777,18 +831,18 @@
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "Executed:");
- VG_(message)(Vg_UserMsg, " BBs entered: %,llu", n_BBs_entered);
- VG_(message)(Vg_UserMsg, " BBs completed: %,llu", n_BBs_completed);
+ VG_(message)(Vg_UserMsg, " SBs entered: %,llu", n_SBs_entered);
+ VG_(message)(Vg_UserMsg, " SBs completed: %,llu", n_SBs_completed);
VG_(message)(Vg_UserMsg, " guest instrs: %,llu", n_guest_instrs);
VG_(message)(Vg_UserMsg, " IRStmts: %,llu", n_IRStmts);
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "Ratios:");
- tl_assert(n_BBs_entered); // Paranoia time.
- VG_(message)(Vg_UserMsg, " guest instrs : BB entered = %3u : 10",
- 10 * n_guest_instrs / n_BBs_entered);
- VG_(message)(Vg_UserMsg, " IRStmts : BB entered = %3u : 10",
- 10 * n_IRStmts / n_BBs_entered);
+ tl_assert(n_SBs_entered); // Paranoia time.
+ VG_(message)(Vg_UserMsg, " guest instrs : SB entered = %3u : 10",
+ 10 * n_guest_instrs / n_SBs_entered);
+ VG_(message)(Vg_UserMsg, " IRStmts : SB entered = %3u : 10",
+ 10 * n_IRStmts / n_SBs_entered);
tl_assert(n_guest_instrs); // Paranoia time.
VG_(message)(Vg_UserMsg, " IRStmts : guest instr = %3u : 10",
10 * n_IRStmts / n_guest_instrs);
|
|
From: <sv...@va...> - 2007-02-12 08:40:01
|
Author: sewardj
Date: 2007-02-12 08:39:54 +0000 (Mon, 12 Feb 2007)
New Revision: 6584
Log:
Get rid of the unused --model-pthreads flag.
Modified:
trunk/coregrind/m_main.c
trunk/coregrind/m_options.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/pub_core_options.h
Modified: trunk/coregrind/m_main.c
===================================================================
--- trunk/coregrind/m_main.c 2007-02-11 09:09:20 UTC (rev 6583)
+++ trunk/coregrind/m_main.c 2007-02-12 08:39:54 UTC (rev 6584)
@@ -357,7 +357,6 @@
else VG_BOOL_CLO(arg, "--trace-syscalls", VG_(clo_trace_syscalls))
else VG_BOOL_CLO(arg, "--trace-pthreads", VG_(clo_trace_pthreads))
else VG_BOOL_CLO(arg, "--wait-for-gdb", VG_(clo_wait_for_gdb))
- else VG_BOOL_CLO(arg, "--model-pthreads", VG_(clo_model_pthreads))
else VG_STR_CLO (arg, "--db-command", VG_(clo_db_command))
else VG_STR_CLO (arg, "--sim-hints", VG_(clo_sim_hints))
@@ -1779,13 +1778,6 @@
VG_(ii_finalise_image)( the_iifii );
//--------------------------------------------------------------
- // Initialise the pthread model
- // p: ?
- //--------------------------------------------------------------
- //if (VG_(clo_model_pthreads))
- // VG_(pthread_init)();
-
- //--------------------------------------------------------------
// Initialise the signal handling subsystem
// p: n/a
//--------------------------------------------------------------
@@ -1892,8 +1884,6 @@
// jrs: Huh? but they surely are already gone
VG_(reap_threads)(tid);
- VG_(clo_model_pthreads) = False;
-
// Clean the client up before the final report
// this causes the libc_freeres function to run
final_tidyup(tid);
@@ -1910,8 +1900,6 @@
// that none of the other threads ever run again.
vg_assert( VG_(count_living_threads)() >= 1 );
- VG_(clo_model_pthreads) = False;
-
// Clean the client up before the final report
// this causes the libc_freeres function to run
// perhaps this is unsafe, as per comment above
Modified: trunk/coregrind/m_options.c
===================================================================
--- trunk/coregrind/m_options.c 2007-02-11 09:09:20 UTC (rev 6583)
+++ trunk/coregrind/m_options.c 2007-02-12 08:39:54 UTC (rev 6584)
@@ -74,7 +74,6 @@
Bool VG_(clo_run_libc_freeres) = True;
Bool VG_(clo_track_fds) = False;
Bool VG_(clo_show_below_main)= False;
-Bool VG_(clo_model_pthreads) = False;
Bool VG_(clo_show_emwarns) = False;
Int VG_(clo_max_stackframe) = 2000000;
Bool VG_(clo_wait_for_gdb) = False;
Modified: trunk/coregrind/m_scheduler/scheduler.c
===================================================================
--- trunk/coregrind/m_scheduler/scheduler.c 2007-02-11 09:09:20 UTC (rev 6583)
+++ trunk/coregrind/m_scheduler/scheduler.c 2007-02-12 08:39:54 UTC (rev 6584)
@@ -1121,9 +1121,6 @@
vg_assert(VG_(is_exiting)(tid));
- //if (VG_(clo_model_pthreads))
- // VG_(tm_thread_exit)(tid);
-
return tst->exitreason;
}
Modified: trunk/coregrind/pub_core_options.h
===================================================================
--- trunk/coregrind/pub_core_options.h 2007-02-11 09:09:20 UTC (rev 6583)
+++ trunk/coregrind/pub_core_options.h 2007-02-12 08:39:54 UTC (rev 6584)
@@ -141,8 +141,6 @@
extern Bool VG_(clo_run_libc_freeres);
/* Continue stack traces below main()? Default: NO */
extern Bool VG_(clo_show_below_main);
-/* Model the pthread library */
-extern Bool VG_(clo_model_pthreads);
/* Should we show VEX emulation warnings? Default: NO */
extern Bool VG_(clo_show_emwarns);
|
|
From: <js...@ac...> - 2007-02-12 05:32:04
|
Nightly build on phoenix ( SuSE 10.0 ) started at 2007-02-12 04:55:01 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) |
|
From: Tom H. <th...@cy...> - 2007-02-12 04:44:31
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2007-02-12 03:00:34 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-12 03:23:14
|
Nightly build on dellow ( x86_64, Fedora Core 6 ) started at 2007-02-12 03:10:04 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-12 03:22:43
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2007-02-12 03:15:01 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/ccPo80uk.s:4393: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccPo80uk.s:4513: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccPo80uk.s:4633: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccPo80uk.s:4753: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccPo80uk.s:4873: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccPo80uk.s:4993: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccPo80uk.s:5113: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/ccPo80uk.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.28168/valgrind/none/tests/x86' make[4]: *** [check-am] Error 2 make[4]: Leaving directory `/tmp/valgrind.28168/valgrind/none/tests/x86' make[3]: *** [check-recursive] Error 1 make[3]: Leaving directory `/tmp/valgrind.28168/valgrind/none/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/valgrind.28168/valgrind/none' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/valgrind.28168/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/cc2AOVX6.s:4393: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc2AOVX6.s:4513: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc2AOVX6.s:4633: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc2AOVX6.s:4753: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc2AOVX6.s:4873: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc2AOVX6.s:4993: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc2AOVX6.s:5113: Error: no such instruction: `fisttpq -56(%ebp)' /tmp/cc2AOVX6.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.28168/valgrind/none/tests/x86' make[4]: *** [check-am] Error 2 make[4]: Leaving directory `/tmp/valgrind.28168/valgrind/none/tests/x86' make[3]: *** [check-recursive] Error 1 make[3]: Leaving directory `/tmp/valgrind.28168/valgrind/none/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/valgrind.28168/valgrind/none' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/valgrind.28168/valgrind' make: *** [check] Error 2 ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Mon Feb 12 03:18:50 2007 --- new.short Mon Feb 12 03:22:34 2007 *************** *** 7,16 **** Last 20 lines of verbose log follow echo ! /tmp/cc2AOVX6.s:4393: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc2AOVX6.s:4513: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc2AOVX6.s:4633: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc2AOVX6.s:4753: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc2AOVX6.s:4873: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc2AOVX6.s:4993: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc2AOVX6.s:5113: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/cc2AOVX6.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/ccPo80uk.s:4393: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccPo80uk.s:4513: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccPo80uk.s:4633: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccPo80uk.s:4753: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccPo80uk.s:4873: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccPo80uk.s:4993: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccPo80uk.s:5113: Error: no such instruction: `fisttpq -56(%ebp)' ! /tmp/ccPo80uk.s:5233: Error: no such instruction: `fisttpq -56(%ebp)' make[5]: *** [insn_sse3.o] Error 1 |
|
From: Tom H. <th...@cy...> - 2007-02-12 03:18:12
|
Nightly build on lloyd ( x86_64, Fedora Core 3 ) started at 2007-02-12 03:05:04 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, 5 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) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: <js...@ac...> - 2007-02-12 01:16:55
|
Nightly build on g5 ( SuSE 10.1, ppc970 ) started at 2007-02-12 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) |