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
(11) |
2
(9) |
3
(14) |
4
(18) |
5
(13) |
|
6
(4) |
7
(12) |
8
(16) |
9
(14) |
10
(8) |
11
(9) |
12
(7) |
|
13
(12) |
14
(6) |
15
(14) |
16
(5) |
17
(10) |
18
(8) |
19
(5) |
|
20
(10) |
21
(16) |
22
(5) |
23
(14) |
24
(10) |
25
(11) |
26
(6) |
|
27
(9) |
28
(8) |
29
(11) |
30
(9) |
31
(18) |
|
|
|
From: <sv...@va...> - 2008-01-15 23:58:28
|
Author: sewardj
Date: 2008-01-15 23:58:21 +0000 (Tue, 15 Jan 2008)
New Revision: 7351
Log:
Tidy up readdwarf.c: don't pass around information which is also in
the DebugInfo* anyway.
Modified:
branches/DATASYMS/coregrind/m_debuginfo/priv_readdwarf.h
branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c
branches/DATASYMS/coregrind/m_debuginfo/readelf.c
Modified: branches/DATASYMS/coregrind/m_debuginfo/priv_readdwarf.h
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/priv_readdwarf.h 2008-01-15 08:42:56 UTC (rev 7350)
+++ branches/DATASYMS/coregrind/m_debuginfo/priv_readdwarf.h 2008-01-15 23:58:21 UTC (rev 7351)
@@ -43,7 +43,7 @@
-------------------- */
extern
void ML_(read_debuginfo_dwarf2)
- ( struct _DebugInfo* di, OffT debug_offset,
+ ( struct _DebugInfo* di,
UChar* debuginfo, Int debug_info_sz, /* .debug_info */
UChar* debugabbrev, /* .debug_abbrev */
UChar* debugline, Int debug_line_sz, /* .debug_line */
@@ -62,8 +62,7 @@
-------------------- */
extern
void ML_(read_callframe_info_dwarf3)
- ( /*OUT*/struct _DebugInfo* di,
- UChar* ehframe, Int ehframe_sz, Addr ehframe_addr );
+ ( /*OUT*/struct _DebugInfo* di, UChar* ehframe );
#endif /* ndef __PRIV_READDWARF_H */
Modified: branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c 2008-01-15 08:42:56 UTC (rev 7350)
+++ branches/DATASYMS/coregrind/m_debuginfo/readdwarf.c 2008-01-15 23:58:21 UTC (rev 7351)
@@ -327,7 +327,7 @@
/* Handled an extended line op starting at 'data'. Returns the number
of bytes that 'data' should be advanced by. */
static
-Word process_extended_line_op( struct _DebugInfo* di, OffT debug_offset,
+Word process_extended_line_op( struct _DebugInfo* di,
WordArray* filenames,
WordArray* dirnames,
WordArray* fnidx2dir,
@@ -357,7 +357,7 @@
switch (op_code) {
case DW_LNE_end_sequence:
if (0) VG_(printf)("1001: si->o %p, smr.a %p\n",
- debug_offset, state_machine_regs.address );
+ di->text_bias, state_machine_regs.address );
/* JRS: added for compliance with spec; is pointless due to
reset_state_machine below */
state_machine_regs.end_sequence = 1;
@@ -375,8 +375,8 @@
filename,
lookupDir( state_machine_regs.last_file,
fnidx2dir, dirnames ),
- debug_offset + state_machine_regs.last_address,
- debug_offset + state_machine_regs.address,
+ di->text_bias + state_machine_regs.last_address,
+ di->text_bias + state_machine_regs.address,
state_machine_regs.last_line, 0
);
}
@@ -430,7 +430,7 @@
* Output: - si debug info structures get updated
*/
static
-void read_dwarf2_lineblock ( struct _DebugInfo* di, OffT debug_offset,
+void read_dwarf2_lineblock ( struct _DebugInfo* di,
UnitInfo* ui,
UChar* theBlock, /* IMAGE */
Int noLargerThan )
@@ -719,7 +719,7 @@
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: di->o %p, smr.a %p\n",
- debug_offset, state_machine_regs.address );
+ di->text_bias, state_machine_regs.address );
state_machine_regs.line += adv;
if (di->ddump_line)
@@ -742,8 +742,8 @@
filename,
lookupDir( state_machine_regs.last_file,
&fnidx2dir, &dirnames ),
- debug_offset + state_machine_regs.last_address,
- debug_offset + state_machine_regs.address,
+ di->text_bias + state_machine_regs.last_address,
+ di->text_bias + state_machine_regs.address,
state_machine_regs.last_line,
0
);
@@ -760,13 +760,13 @@
switch (op_code) {
case DW_LNS_extended_op:
data += process_extended_line_op (
- di, debug_offset, &filenames, &dirnames, &fnidx2dir,
+ di, &filenames, &dirnames, &fnidx2dir,
data, info.li_default_is_stmt);
break;
case DW_LNS_copy:
if (0) VG_(printf)("1002: di->o %p, smr.a %p\n",
- debug_offset, state_machine_regs.address );
+ di->text_bias, state_machine_regs.address );
if (state_machine_regs.is_stmt) {
/* only add a statement if there was a previous boundary */
if (state_machine_regs.last_address) {
@@ -781,8 +781,8 @@
filename,
lookupDir( state_machine_regs.last_file,
&fnidx2dir, &dirnames ),
- debug_offset + state_machine_regs.last_address,
- debug_offset + state_machine_regs.address,
+ di->text_bias + state_machine_regs.last_address,
+ di->text_bias + state_machine_regs.address,
state_machine_regs.last_line,
0
);
@@ -1120,7 +1120,7 @@
* Output: update si to contain all the dwarf2 debug infos
*/
void ML_(read_debuginfo_dwarf2)
- ( struct _DebugInfo* di, OffT debug_offset,
+ ( struct _DebugInfo* di,
UChar* debuginfo_img, Int debug_info_sz, /* .debug_info */
UChar* debugabbrev_img, /* .debug_abbrev */
UChar* debugline_img, Int debug_line_sz, /* .debug_line */
@@ -1182,8 +1182,8 @@
debug_line_sz, ui.stmt_list, ui.name );
/* Read the .debug_line block for this compile unit */
read_dwarf2_lineblock(
- di, debug_offset, &ui, debugline_img + ui.stmt_list,
- debug_line_sz - ui.stmt_list );
+ di, &ui, debugline_img + ui.stmt_list,
+ debug_line_sz - ui.stmt_list );
}
}
@@ -3492,8 +3492,7 @@
void ML_(read_callframe_info_dwarf3)
- ( /*OUT*/struct _DebugInfo* di,
- UChar* ehframe_image, Int ehframe_sz, Addr ehframe_avma )
+ ( /*OUT*/struct _DebugInfo* di, UChar* ehframe_image )
{
Int nbytes;
HChar* how = NULL;
@@ -3507,10 +3506,11 @@
if (di->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 );
+ VG_(printf)("CFI info: szB %ld, _avma %p, _image %p\n",
+ di->ehframe_size, (void*)di->ehframe_avma,
+ (void*)ehframe_image );
VG_(printf)("CFI info: name %s\n",
- di->filename );
+ di->filename );
}
/* Loop over CIEs/FDEs */
@@ -3541,11 +3541,11 @@
Bool dw64;
/* Are we done? */
- if (data == ehframe_image + ehframe_sz)
+ if (data == ehframe_image + di->ehframe_size)
return;
/* Overshot the end? Means something is wrong */
- if (data > ehframe_image + ehframe_sz) {
+ if (data > ehframe_image + di->ehframe_size) {
how = "overran the end of .eh_frame";
goto bad;
}
@@ -3747,7 +3747,7 @@
}
if (the_CIEs[this_CIE].ilen < 0
- || the_CIEs[this_CIE].ilen > ehframe_sz) {
+ || the_CIEs[this_CIE].ilen > di->ehframe_size) {
how = "implausible # cie initial insns";
goto bad;
}
@@ -3763,7 +3763,7 @@
AddressDecodingInfo adi;
adi.encoding = the_CIEs[this_CIE].address_encoding;
adi.ehframe_image = ehframe_image;
- adi.ehframe_avma = ehframe_avma;
+ adi.ehframe_avma = di->ehframe_avma;
adi.text_bias = di->text_bias;
show_CF_instructions( the_CIEs[this_CIE].instrs,
the_CIEs[this_CIE].ilen, &adi,
@@ -3810,7 +3810,7 @@
adi.encoding = the_CIEs[cie].address_encoding;
adi.ehframe_image = ehframe_image;
- adi.ehframe_avma = ehframe_avma;
+ adi.ehframe_avma = di->ehframe_avma;
adi.text_bias = di->text_bias;
fde_initloc = read_encoded_Addr(&nbytes, &adi, data);
data += nbytes;
@@ -3819,7 +3819,7 @@
adi.encoding = the_CIEs[cie].address_encoding & 0xf;
adi.ehframe_image = ehframe_image;
- adi.ehframe_avma = ehframe_avma;
+ adi.ehframe_avma = di->ehframe_avma;
adi.text_bias = di->text_bias;
/* WAS (incorrectly):
@@ -3872,7 +3872,7 @@
VG_(printf)("fde.ilen = %d\n", (Int)fde_ilen);
}
- if (fde_ilen < 0 || fde_ilen > ehframe_sz) {
+ if (fde_ilen < 0 || fde_ilen > di->ehframe_size) {
how = "implausible # fde insns";
goto bad;
}
@@ -3881,7 +3881,7 @@
adi.encoding = the_CIEs[cie].address_encoding;
adi.ehframe_image = ehframe_image;
- adi.ehframe_avma = ehframe_avma;
+ adi.ehframe_avma = di->ehframe_avma;
adi.text_bias = di->text_bias;
if (di->trace_cfi)
Modified: branches/DATASYMS/coregrind/m_debuginfo/readelf.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-15 08:42:56 UTC (rev 7350)
+++ branches/DATASYMS/coregrind/m_debuginfo/readelf.c 2008-01-15 23:58:21 UTC (rev 7351)
@@ -999,8 +999,10 @@
Addr sbss_svma;
UInt bss_align;
UInt sbss_align;
+ UInt data_align;
+ SizeT bss_totsize;
+ Addr gen_bss_lowest_svma;
-
vg_assert(di);
vg_assert(di->have_rx_map == True);
vg_assert(di->have_rw_map == True);
@@ -1270,9 +1272,9 @@
/*UInt */ bss_align = 0;
/*UInt */ sbss_align = 0;
- UInt data_align = 0;
- SizeT bss_totsize = 0;
- Addr gen_bss_lowest_svma = ~((Addr)0);
+ /* UInt */ data_align = 0;
+ /* SizeT */ bss_totsize = 0;
+ /* Addr */ gen_bss_lowest_svma = ~((Addr)0);
/* Now read the section table. */
TRACE_SYMTAB("\n");
@@ -1867,8 +1869,7 @@
/* Read .eh_frame (call-frame-info) if any */
if (ehframe_img) {
vg_assert(ehframe_sz == di->ehframe_size);
- ML_(read_callframe_info_dwarf3)
- ( di, ehframe_img, di->ehframe_size, di->ehframe_avma );
+ ML_(read_callframe_info_dwarf3)( di, ehframe_img );
}
/* Read the stabs and/or dwarf2 debug information, if any. It
@@ -1887,7 +1888,7 @@
before using it. */
if (debug_info_img && debug_abbv_img && debug_line_img
/* && debug_str_img */) {
- ML_(read_debuginfo_dwarf2) ( di, di->text_bias,
+ ML_(read_debuginfo_dwarf2) ( di,
debug_info_img, debug_info_sz,
debug_abbv_img,
debug_line_img, debug_line_sz,
|
|
From: Julian S. <js...@ac...> - 2008-01-15 21:28:22
|
> [...] change SVal to 64-bit at some point (I vote for it!), I already did that in Nov 07, but did not commit due to increase in run time and space usage. The resulting patch is attached. It allows up to 24 bits for lock- and thread-set IDs. I can't remember now why I limited it to 24 bits -- could go up to about 30 bits. Really 64-bit for a SVal is too much but 32-bit is not enough. Something like 48 bits would be a good compromise, but there is no sensible way to do that in C. Oh well. The patch also changes CacheLine to have a dirty bit in an attempt to reduce the performance overhead from writing back cache lines. That helps, although it also adds to the complexity and overhead of verifying that the shadow memory system is functioning correctly. J |
|
From: Konstantin S. <kon...@gm...> - 2008-01-15 09:41:25
|
> > > So the only new method is to change HG_(initIterFM) (maybe better to > make a new one, HG_(initAtIterFM)). That requires to understand the > FM iteration mechanism. Not difficult, but I did not find the time > to study it. > > J > If you don't mind, I'll implement this one and send you the patch. --kcc |
|
From: Julian S. <js...@ac...> - 2008-01-15 09:39:56
|
On Tuesday 15 January 2008 10:32, Konstantin Serebryany wrote: > You mean it requires 32-bit hardware? or 32-bit-only os? or 32-bit > executable? I _think_ requires 32-bit executable. > I don't have any 32-bit-only hardware at the moment, so I can't check :) > Anyway, I've sent the question to oprofile folks already. Not their fault. The 64-bit x86 stack is difficult to unwind (completely different from 32-bit case) and OProfile maybe does not have the relevant information Dwarf CFA data available. J |
|
From: Julian S. <js...@ac...> - 2008-01-15 09:37:39
|
> I found out that ~85% of helgrind's time (on one of my tests) is spent in
> the following loop:
Yes. I saw a similar problem running OOo on Helgrind.
> ...
> /* FIXME: don't iterate over the complete lock set */
> HG_(initIterFM)( map_locks );
> while (HG_(nextIterFM)( map_locks,
> (Word*)&gla, (Word*)&lk )) {
> ...
>
> Average number of iterations of this loop is ~5600, which is the number of
> locks in the entire program (right)?
> Would you suggest a way to rewrite this loop so that it does not iterate
> over all locks?
> I mean, most of the time the deallocated memory contains no locks. We can
> check if the is the case by binary searching map_locks, can't we?
> We will need to extend hg_wordfm.c with few more methods...
> What do you think?
I think you are correct. I had thought about this before but did
not implement it.
Idea is to change HG_(initIterFM) so that it takes a key value:
void HG_(initIterFM)( WordFM* fm, Word start_at )
so that the first call to HG_(nextIterFM) produces (in "gla") the first
value >= start_at. So the loop now looks like this:
/* To scan memory address range s_start to s_end: */
HG_(initIterFM)( s_start );
while (True) {
Bool b = HG_(nextIterFM)( map_locks, (Word*)&gla, (Word*)&lk );
if (!b) break; /* no more entries in map */
if (gla > s_end) break; /* finished s_start .. s_end range */
/* do stuff with (gla, lk) */
}
if you see what I mean.
So the only new method is to change HG_(initIterFM) (maybe better to
make a new one, HG_(initAtIterFM)). That requires to understand the
FM iteration mechanism. Not difficult, but I did not find the time
to study it.
J
|
|
From: Konstantin S. <kon...@gm...> - 2008-01-15 09:31:57
|
You mean it requires 32-bit hardware? or 32-bit-only os? or 32-bit executable? I don't have any 32-bit-only hardware at the moment, so I can't check :) Anyway, I've sent the question to oprofile folks already. --kcc On Jan 15, 2008 12:19 PM, Julian Seward <js...@ac...> wrote: > On Tuesday 15 January 2008 10:04, Konstantin Serebryany wrote: > > Thanks for the answers! > > oprofile is indeed very useful, but unfortunately I can't make the > > call-graph (something wrong with my oprofile setup). > > I think oprofile cannot do call-graph on 64-bit x86, only on > 32-bit x86. I have successfully used it w/ call-graph on 32-bit > x86, on Helgrind. > > J > |
|
From: Konstantin S. <kon...@gm...> - 2008-01-15 09:24:56
|
Hi Julian, all,
I found out that ~85% of helgrind's time (on one of my tests) is spent in
the following loop:
static void shadow_mem_make_NoAccess ( Thread* thr, Addr aIN, SizeT len )
...
/* FIXME: don't iterate over the complete lock set */
HG_(initIterFM)( map_locks );
while (HG_(nextIterFM)( map_locks,
(Word*)&gla, (Word*)&lk )) {
...
Average number of iterations of this loop is ~5600, which is the number of
locks in the entire program (right)?
Would you suggest a way to rewrite this loop so that it does not iterate
over all locks?
Can we do a binary search in map_locks instead of iterating it?
I mean, most of the time the deallocated memory contains no locks. We can
check if the is the case by binary searching map_locks, can't we?
We will need to extend hg_wordfm.c with few more methods...
What do you think?
Thanks,
--kcc
|
|
From: Julian S. <js...@ac...> - 2008-01-15 09:21:26
|
On Tuesday 15 January 2008 10:04, Konstantin Serebryany wrote: > Thanks for the answers! > oprofile is indeed very useful, but unfortunately I can't make the > call-graph (something wrong with my oprofile setup). I think oprofile cannot do call-graph on 64-bit x86, only on 32-bit x86. I have successfully used it w/ call-graph on 32-bit x86, on Helgrind. J |
|
From: Konstantin S. <kon...@gm...> - 2008-01-15 09:04:49
|
Thanks for the answers! oprofile is indeed very useful, but unfortunately I can't make the call-graph (something wrong with my oprofile setup). Anyway, I found the guilty place in helgrind by manually inserting counters in the code. Details follow in separate thread. --kcc On Jan 13, 2008 2:26 AM, Nicholas Nethercote <nj...@cs...> wrote: > On Sun, 13 Jan 2008, Josef Weidendorfer wrote: > > >> Would it be possible to run helgrind under callgrind? Did you try > gprof? Any > >> other suggestions? > > > > Yes. > > Check out "Self hosting" in README_DEVELOPERS. > > > > To run callgrind on a Valgrind tool, you need to specify > > "--pop-on-jump=yes" for the the outer callgrind. Otherwise, the > callgraph > > will grow linear to run time, producting an "out-of-memory" condition > > after some time. > > > > Note that self hosting is _really_ slow, and it could take a while until > you > > reach the problematic phase. However, you can check out intermediate > dumps > > triggered by "callgrind_control". > > I've used Cachegrind and OProfile. OProfile is generally better because > it > is so much faster, and you know the numbers are real times, rather than > instruction counts which don't necessarily map exactly to real times. > But Cachegrind does give more detailed information. > > Nick > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers > |
|
From: <sv...@va...> - 2008-01-15 08:43:01
|
Author: sewardj
Date: 2008-01-15 08:42:56 +0000 (Tue, 15 Jan 2008)
New Revision: 7350
Log:
Intercept memcpy on 64-bit ld.so's.
Modified:
trunk/memcheck/mc_replace_strmem.c
Modified: trunk/memcheck/mc_replace_strmem.c
===================================================================
--- trunk/memcheck/mc_replace_strmem.c 2008-01-15 02:21:39 UTC (rev 7349)
+++ trunk/memcheck/mc_replace_strmem.c 2008-01-15 08:42:56 UTC (rev 7350)
@@ -401,6 +401,7 @@
MEMCPY(m_libc_soname, memcpy)
MEMCPY(m_ld_so_1, memcpy) /* ld.so.1 */
+MEMCPY(m_ld64_so_1, memcpy) /* ld64.so.1 */
/* icc9 blats these around all over the place. Not only in the main
executable but various .so's. They are highly tuned and read
memory beyond the source boundary (although work correctly and
|
|
From: Tom H. <th...@cy...> - 2008-01-15 03:38:34
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2008-01-15 03:05:09 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 371 tests, 8 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) exp-drd/tests/pth_cond_race (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 366 tests, 8 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) exp-drd/tests/pth_cond_race (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Tue Jan 15 03:19:47 2008 --- new.short Tue Jan 15 03:38:36 2008 *************** *** 8,10 **** ! == 366 tests, 8 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) --- 8,10 ---- ! == 371 tests, 8 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) |
|
From: Tom H. <th...@cy...> - 2008-01-15 03:29:04
|
Nightly build on dellow ( x86_64, Fedora 8 ) started at 2008-01-15 03:10:04 GMT Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 371 tests, 10 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/pth_detached (stdout) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) exp-drd/tests/pth_cond_race (stderr) exp-drd/tests/tc18_semabuse (stderr) ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 366 tests, 9 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/pth_cvsimple (stdout) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) exp-drd/tests/pth_cond_race (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Tue Jan 15 03:19:40 2008 --- new.short Tue Jan 15 03:29:07 2008 *************** *** 8,10 **** ! == 366 tests, 9 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) --- 8,10 ---- ! == 371 tests, 10 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) *************** *** 16,18 **** none/tests/mremap2 (stdout) ! none/tests/pth_cvsimple (stdout) helgrind/tests/tc18_semabuse (stderr) --- 16,18 ---- none/tests/mremap2 (stdout) ! none/tests/pth_detached (stdout) helgrind/tests/tc18_semabuse (stderr) *************** *** 21,22 **** --- 21,23 ---- exp-drd/tests/pth_cond_race (stderr) + exp-drd/tests/tc18_semabuse (stderr) |
|
From: Tom H. <th...@cy...> - 2008-01-15 03:11:53
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2008-01-15 03:00: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 matinv.c:252: warning: implicit declaration of function `pthread_barrier_destroy' matinv.c: At top level: matinv.c:258: warning: declaration of `a' shadows a global declaration matinv.c:30: warning: shadowed declaration is here matinv.c:276: warning: declaration of `a' shadows a global declaration matinv.c:30: warning: shadowed declaration is here matinv.c: In function `main': matinv.c:308: warning: declaration of `a' shadows a global declaration matinv.c:30: warning: shadowed declaration is here make[5]: *** [matinv.o] Error 1 make[5]: Leaving directory `/tmp/vgtest/2008-01-15/valgrind/exp-drd/tests' make[4]: *** [check-am] Error 2 make[4]: Leaving directory `/tmp/vgtest/2008-01-15/valgrind/exp-drd/tests' make[3]: *** [check-recursive] Error 1 make[3]: Leaving directory `/tmp/vgtest/2008-01-15/valgrind/exp-drd/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/vgtest/2008-01-15/valgrind/exp-drd' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/vgtest/2008-01-15/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 Regression test results follow == 368 tests, 30 stderr failures, 1 stdout failure, 0 post failures == memcheck/tests/addressable (stderr) memcheck/tests/badjump (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/malloc_free_fill (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/supp_unknown (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/blockfault (stderr) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/hg01_all_ok (stderr) helgrind/tests/hg02_deadlock (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc05_simple_race (stderr) helgrind/tests/tc06_two_races (stderr) helgrind/tests/tc09_bad_unlock (stderr) helgrind/tests/tc14_laog_dinphils (stderr) helgrind/tests/tc16_byterace (stderr) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Tue Jan 15 03:07:15 2008 --- new.short Tue Jan 15 03:11:55 2008 *************** *** 6,41 **** ! Regression test results follow ! ! == 368 tests, 30 stderr failures, 1 stdout failure, 0 post failures == ! memcheck/tests/addressable (stderr) ! memcheck/tests/badjump (stderr) ! memcheck/tests/describe-block (stderr) ! memcheck/tests/malloc_free_fill (stderr) ! memcheck/tests/match-overrun (stderr) ! memcheck/tests/pointer-trace (stderr) ! memcheck/tests/stack_switch (stderr) ! memcheck/tests/supp_unknown (stderr) ! memcheck/tests/x86/scalar (stderr) ! memcheck/tests/x86/scalar_supp (stderr) ! none/tests/blockfault (stderr) ! none/tests/fdleak_fcntl (stderr) ! none/tests/mremap (stderr) ! none/tests/mremap2 (stdout) ! helgrind/tests/hg01_all_ok (stderr) ! helgrind/tests/hg02_deadlock (stderr) ! helgrind/tests/hg03_inherit (stderr) ! helgrind/tests/hg04_race (stderr) ! helgrind/tests/hg05_race2 (stderr) ! helgrind/tests/tc01_simple_race (stderr) ! helgrind/tests/tc05_simple_race (stderr) ! helgrind/tests/tc06_two_races (stderr) ! helgrind/tests/tc09_bad_unlock (stderr) ! helgrind/tests/tc14_laog_dinphils (stderr) ! helgrind/tests/tc16_byterace (stderr) ! helgrind/tests/tc17_sembar (stderr) ! helgrind/tests/tc19_shadowmem (stderr) ! helgrind/tests/tc20_verifywrap (stderr) ! helgrind/tests/tc21_pthonce (stderr) ! helgrind/tests/tc22_exit_w_lock (stderr) ! helgrind/tests/tc23_bogus_condwait (stderr) ! --- 6,27 ---- ! Last 20 lines of verbose log follow echo ! matinv.c:252: warning: implicit declaration of function `pthread_barrier_destroy' ! matinv.c: At top level: ! matinv.c:258: warning: declaration of `a' shadows a global declaration ! matinv.c:30: warning: shadowed declaration is here ! matinv.c:276: warning: declaration of `a' shadows a global declaration ! matinv.c:30: warning: shadowed declaration is here ! matinv.c: In function `main': ! matinv.c:308: warning: declaration of `a' shadows a global declaration ! matinv.c:30: warning: shadowed declaration is here ! make[5]: *** [matinv.o] Error 1 ! make[5]: Leaving directory `/tmp/vgtest/2008-01-15/valgrind/exp-drd/tests' ! make[4]: *** [check-am] Error 2 ! make[4]: Leaving directory `/tmp/vgtest/2008-01-15/valgrind/exp-drd/tests' ! make[3]: *** [check-recursive] Error 1 ! make[3]: Leaving directory `/tmp/vgtest/2008-01-15/valgrind/exp-drd/tests' ! make[2]: *** [check-recursive] Error 1 ! make[2]: Leaving directory `/tmp/vgtest/2008-01-15/valgrind/exp-drd' ! make[1]: *** [check-recursive] Error 1 ! make[1]: Leaving directory `/tmp/vgtest/2008-01-15/valgrind' ! make: *** [check] Error 2 |
|
From: <sv...@va...> - 2008-01-15 02:21:38
|
Author: sewardj
Date: 2008-01-15 02:21:39 +0000 (Tue, 15 Jan 2008)
New Revision: 7349
Log:
Track recent changes in m_debuginfo, principally to the type DebugInfo
and the changed loginc in debuginfo.c.
Modified:
branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c
branches/DATASYMS/coregrind/m_debuginfo/priv_readxcoff.h
branches/DATASYMS/coregrind/m_debuginfo/readxcoff.c
Modified: branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-14 15:11:58 UTC (rev 7348)
+++ branches/DATASYMS/coregrind/m_debuginfo/debuginfo.c 2008-01-15 02:21:39 UTC (rev 7349)
@@ -177,7 +177,7 @@
while (curr) {
if (curr == di) {
- // Found it; remove from list and free it.
+ /* Found it; remove from list and free it. */
if (VG_(clo_verbosity) > 1 || VG_(clo_trace_redir))
VG_(message)(Vg_DebugMsg,
"Discarding syms at %p-%p in %s due to %s()",
@@ -195,13 +195,14 @@
curr = curr->next;
}
- // Not found.
+ /* Not found. */
}
-/* Repeatedly scan debugInfo_list, looking for DebugInfos intersecting
- [start,start+length), and call discard_DebugInfo to get rid of
- them. This modifies the list, hence the multiple iterations.
+/* Repeatedly scan debugInfo_list, looking for DebugInfos with text
+ AVMAs intersecting [start,start+length), and call discard_DebugInfo
+ to get rid of them. This modifies the list, hence the multiple
+ iterations.
*/
static void discard_syms_in_range ( Addr start, SizeT length )
{
@@ -231,52 +232,10 @@
}
}
-#if 0
-/* Create a new SegInfo with the specific address/length/vma offset,
- then snarf whatever info we can from the given filename into it. */
-static
-SegInfo* acquire_syms_for_range(
- /* ALL */ Addr seg_addr,
- /* ALL */ SizeT seg_len,
- /* ELF only */ OffT seg_offset,
- /* ALL */ const UChar* seg_filename,
- /* XCOFF only */ const UChar* seg_memname,
- /* XCOFF only */ Addr data_addr,
- /* XCOFF only */ SizeT data_len,
- /* XCOFF only */ Bool is_mainexe
- )
-{
- Bool ok;
- SegInfo* si = alloc_SegInfo(seg_addr, seg_len, seg_offset,
- seg_filename, seg_memname);
-# if defined(VGO_linux)
- ok = ML_(read_elf_debug_info) ( si );
-# elif defined(VGO_aix5)
- ok = ML_(read_xcoff_debug_info) ( si, data_addr, data_len, is_mainexe );
-# else
-# error Unknown OS
-# endif
- if (!ok) {
- // Something went wrong (eg. bad ELF file).
- free_SegInfo( si );
- si = NULL;
-
- } else {
- // Prepend si to segInfo_list
- si->next = segInfo_list;
- segInfo_list = si;
-
- ML_(canonicaliseTables) ( si );
-
- /* notify m_redir about it */
- VG_(redir_notify_new_SegInfo)( si );
- }
-
- return si;
-}
-#endif
-
+/* Does [s1,+len1) overlap [s2,+len2) ? Note: does not handle
+ wraparound at the end of the address space -- just asserts in that
+ case. */
static Bool ranges_overlap (Addr s1, SizeT len1, Addr s2, SizeT len2 )
{
Addr e1, e2;
@@ -293,6 +252,9 @@
return True;
}
+
+/* Do the basic rx_ and rw_ mappings of the two DebugInfos overlap in
+ any way? */
static Bool do_DebugInfos_overlap ( DebugInfo* di1, DebugInfo* di2 )
{
vg_assert(di1);
@@ -321,6 +283,9 @@
return False;
}
+
+/* Discard all elements of debugInfo_list whose .mark bit is set.
+*/
static void discard_marked_DebugInfos ( void )
{
DebugInfo* curr;
@@ -342,6 +307,13 @@
}
}
+
+/* Discard any elements of debugInfo_list which overlap with diRef.
+ Clearly diRef must have its rx_ and rw_ mapping information set to
+ something sane. */
+#if defined(VGO_aix5)
+__attribute__((unused))
+#endif
static void discard_DebugInfos_which_overlap_with ( DebugInfo* diRef )
{
DebugInfo* di;
@@ -359,6 +331,7 @@
discard_marked_DebugInfos();
}
+
/* Find the existing DebugInfo for (memname,filename) or if not found,
create one. In the latter case memname and filename are strdup'd
into VG_AR_DINFO, and the new DebugInfo is added to
@@ -630,38 +603,42 @@
Bool is_mainexe,
Bool acquire )
{
- SegInfo* si;
-
if (acquire) {
- acquire_syms_for_range(
- /* ALL */ code_start,
- /* ALL */ code_len,
- /* ELF only */ 0,
- /* ALL */ file_name,
- /* XCOFF only */ mem_name,
- /* XCOFF only */ data_start,
- /* XCOFF only */ data_len,
- /* XCOFF only */ is_mainexe
- );
+ Bool ok;
+ DebugInfo* di;
+ di = find_or_create_DebugInfo_for( file_name, mem_name );
+ vg_assert(di);
+ di->text_svma = 0; /* don't know yet */
+ di->text_bias = 0; /* don't know yet */
+ di->text_avma = code_start;
+ di->text_size = code_len;
+ di->data_svma = 0; /* don't know yet */
+ di->data_bias = 0; /* don't know yet */
+ di->data_avma = data_start;
+ di->data_size = data_len;
+
+ ok = ML_(read_xcoff_debug_info) ( di, is_mainexe );
+
+ if (ok) {
+ /* prepare read data for use */
+ ML_(canonicaliseTables)( di );
+ /* notify m_redir about it */
+ VG_(redir_notify_new_DebugInfo)( di );
+ /* Note that we succeeded */
+ di->have_dinfo = True;
+ } else {
+ /* Something went wrong (eg. bad XCOFF file). */
+ discard_DebugInfo( di );
+ di = NULL;
+ }
+
} else {
- /* Dump all the segInfos whose text segments intersect
+ /* Dump all the debugInfos whose text segments intersect
code_start/code_len. */
- while (True) {
- for (si = debugInfo_list; si; si = si->next) {
- if (code_start + code_len <= si->text_start_avma
- || si->text_start_avma + si->text_size <= code_start)
- continue; /* no overlap */
- else
- break;
- }
- if (si == NULL)
- break;
- /* Need to delete 'si' */
- discard_SegInfo(si);
- }
+ discard_syms_in_range( code_start, code_len );
}
}
Modified: branches/DATASYMS/coregrind/m_debuginfo/priv_readxcoff.h
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/priv_readxcoff.h 2008-01-14 15:11:58 UTC (rev 7348)
+++ branches/DATASYMS/coregrind/m_debuginfo/priv_readxcoff.h 2008-01-15 02:21:39 UTC (rev 7349)
@@ -39,9 +39,7 @@
/* Read whatever info we can from an XCOFF object file. */
extern
-Bool ML_(read_xcoff_debug_info) ( struct _SegInfo* si,
- Addr data_addr,
- SSizeT data_len,
+Bool ML_(read_xcoff_debug_info) ( struct _DebugInfo* di,
Bool is_mainexe );
#endif /* ndef __PRIV_READXCOFF_H */
Modified: branches/DATASYMS/coregrind/m_debuginfo/readxcoff.c
===================================================================
--- branches/DATASYMS/coregrind/m_debuginfo/readxcoff.c 2008-01-14 15:11:58 UTC (rev 7348)
+++ branches/DATASYMS/coregrind/m_debuginfo/readxcoff.c 2008-01-15 02:21:39 UTC (rev 7349)
@@ -505,7 +505,7 @@
success, or the text of an error message otherwise. */
static
HChar* read_symbol_table (
- /*MOD*/SegInfo* si,
+ /*MOD*/DebugInfo* di,
/* location of symbol table */
UChar* oi_symtab, UWord oi_nent_symtab,
@@ -524,8 +524,8 @@
Int sndata_1based_if_known,
/* where the mapped data section is */
- Addr data_avma,
- UWord data_alen,
+ /* Now in di->data_avma: Addr data_avma, */
+ /* Now in di->data_size: UWord data_alen, */
UWord data_alen_from_auxhdr,
/* where the mapped toc is (in the data section,
@@ -546,7 +546,7 @@
/* If the TOC avma is obviously bogus, get rid of it */
{
- UWord data_maxlen = data_alen;
+ UWord data_maxlen = di->data_size;
if (data_maxlen < data_alen_from_auxhdr)
data_maxlen = data_alen_from_auxhdr;
@@ -555,7 +555,8 @@
//VG_(printf)("dxxx_avma %p\n", data_avma + data_maxlen);
if (toc_avma != 0
- && (toc_avma < data_avma || toc_avma >= data_avma + data_maxlen))
+ && (toc_avma < di->data_avma
+ || toc_avma >= di->data_avma + data_maxlen))
toc_avma = 0;
//VG_(printf)("2toc_avma %p\n", toc_avma);
}
@@ -648,8 +649,8 @@
cand.last += text_bias;
cand.name = name;
- if (cand.last < si->text_start_avma
- || cand.first >= si->text_start_avma+si->text_size)
+ if (cand.last < di->text_avma
+ || cand.first >= di->text_avma + di->text_size)
continue;
if (cand.last < cand.first)
continue;
@@ -703,8 +704,8 @@
cand.last += text_bias;
cand.name = name;
- if (cand.last < si->text_start_avma
- || cand.first >= si->text_start_avma+si->text_size)
+ if (cand.last < di->text_avma
+ || cand.first >= di->text_avma + di->text_size)
continue;
if (cand.last < cand.first)
continue;
@@ -1212,7 +1213,7 @@
harmless enough. */
if ((!si_fname_str) && !is_empty_Name(p4currsym->fname)) {
si_dname_str = NULL;
- si_fname_str = ML_(addStr)(si, p4currsym->fname.vec,
+ si_fname_str = ML_(addStr)(di, p4currsym->fname.vec,
p4currsym->fname.len);
UChar* lastslash = VG_(strrchr)(si_fname_str, '/');
if (lastslash)
@@ -1228,7 +1229,7 @@
}
/* finally .. */
if (line_no >= 0)
- ML_(addLineInfo)(si, si_fname_str, si_dname_str,
+ ML_(addLineInfo)(di, si_fname_str, si_dname_str,
line_first_avma, line_last_avma+1,
line_no, i/*debugging only*/);
}
@@ -1312,8 +1313,8 @@
the actual text segment. Discard any that don't. */
Addr fndescr_0 = (Addr)fndescr[0];
- if (fndescr_0 < si->text_start_avma
- || fndescr_0 >= si->text_start_avma+si->text_size)
+ if (fndescr_0 < si->text_avma
+ || fndescr_0 >= si->text_avma+si->text_size)
continue;
/* Let's suppose that fndescr is the descriptor for a
@@ -1376,20 +1377,20 @@
if (SHOW)
VG_(printf)("Phase5: actual data segment: %p %p\n",
- data_avma, data_avma + data_alen);
+ di->data_avma, di->data_avma + di->data_size);
/* Skip obviously-missing data sections. */
- if (data_avma != 0 && data_alen >= sizeof(UWord)) {
+ if (di->data_avma != 0 && di->data_size >= sizeof(UWord)) {
/* set up for inspecting all the aligned words in the actual
data section. */
- Addr tmp = (Addr)data_avma;
+ Addr tmp = di->data_avma;
while (tmp & (sizeof(UWord)-1))
tmp++;
UWord* first_data_word = (UWord*)tmp;
- tmp = data_avma + data_alen - sizeof(UWord);
+ tmp = di->data_avma + di->data_size - sizeof(UWord);
while (tmp & (sizeof(UWord)-1))
tmp--;
UWord* last_data_word = (UWord*)tmp;
@@ -1411,14 +1412,14 @@
break; /* no space left for a 3-word descriptor */
w = wP[0];
- if (!(w >= si->text_start_avma
- && w < si->text_start_avma+si->text_size)) {
+ if (!(w >= di->text_avma
+ && w < di->text_avma + di->text_size)) {
wP++;
continue; /* entry pointer is not to text segment */
}
w = wP[1];
- if (!(w >= data_avma && w < data_avma + data_alen)) {
+ if (!(w >= di->data_avma && w < di->data_avma + di->data_size)) {
wP++;
if (SHOW && SHOW_SYMS_P5) {
VG_(memset)(&key, 0, sizeof(key));
@@ -1479,7 +1480,7 @@
}
for (i = 0; i < nsyms; i++) {
- DiSym di;
+ DiSym dis;
XCoffSym* s = (XCoffSym*)VG_(indexXA)(syms, i);
Addr addr = s->first;
UWord size = s->last + 1 - s->first;
@@ -1487,8 +1488,8 @@
/* If everything worked right, the symbol should fall within the
mapped text segment. Hence .. */
- Bool sane = addr >= si->text_start_avma
- && addr+size <= si->text_start_avma + si->text_size;
+ Bool sane = addr >= di->text_avma
+ && addr+size <= di->text_avma + di->text_size;
if (SHOW && SHOW_SYMS_P6) {
VG_(printf)("Phase6: %s %3d 0x%08lx-0x%08lx 0x%08lx ",
@@ -1520,18 +1521,18 @@
/* Actually add the symbol (finallyatlast) */
if (sane) {
UInt nlen;
- di.addr = addr;
- di.size = size;
- di.tocptr = s->r2known ? s->r2value : 0;
- di.isText = True;
+ dis.addr = addr;
+ dis.size = size;
+ dis.tocptr = s->r2known ? s->r2value : 0;
+ dis.isText = True;
vg_assert(!is_empty_Name(s->name));
nlen = s->name.len;
vg_assert(nlen > 0);
if (s->name.vec[0] == '.')
- di.name = ML_(addStr)(si, &s->name.vec[1], nlen-1 );
+ dis.name = ML_(addStr)(di, &s->name.vec[1], nlen-1 );
else
- di.name = ML_(addStr)(si, &s->name.vec[0], nlen-0 );
- ML_(addSym)( si, &di );
+ dis.name = ML_(addStr)(di, &s->name.vec[0], nlen-0 );
+ ML_(addSym)( di, &dis );
if (0 && s->r2known)
VG_(printf)("r2 known for %s\n", s->name);
@@ -1671,7 +1672,7 @@
[oimage .. oimage + n_oimage).
The VMA of where the relevant text section really got loaded (the
- "actual VMA", _avma) is [si->text_start_avma .. si->text_start_avma
+ "actual VMA", _avma) is [si->text_avma .. si->text_avma
+ si->text_size).
The VMA of the associated data section really got loaded
@@ -1684,11 +1685,11 @@
we get here.
*/
static
-Bool read_xcoff_mapped_object ( SegInfo* si,
- UChar* oimage, UWord n_oimage,
- Addr data_avma, UWord data_alen )
+Bool read_xcoff_mapped_object ( DebugInfo* di,
+ UChar* oimage, UWord n_oimage )
{
-#define BAD(_msg) do { ML_(symerr)(_msg); return False; } while (0)
+#define BAD(_msg) do { ML_(symerr)(di, True/*serious*/,_msg); \
+ return False; } while (0)
Int i, j;
@@ -1950,7 +1951,7 @@
.o files. These have a stated text VMA of zero, and so their
symbols start from zero and work upwards. In that case the
bias is precisely the offset where the text section is
- loaded (si->text_start_avma), that is, the actual text VMA.
+ loaded (si->text_avma), that is, the actual text VMA.
Except -- cryptically -- /usr/include/sys/ldr.h says that the
ld_info.ldinfo_textorg field is "start of loaded program
@@ -1974,15 +1975,15 @@
if (text_svma_known) {
#if 0
if (text_svma == 0) {
- text_bias = si->text_start_avma;
+ text_bias = di->text_avma;
if (sntext_1based_if_known >= 1
&& sntext_1based_if_known <= t_filehdr->f_nscns)
text_bias += t_scnhdr[sntext_1based_if_known - 1].s_scnptr;
} else {
- text_bias = si->text_start_avma - VG_PGROUNDDN(text_svma);
+ text_bias = di->text_avma - VG_PGROUNDDN(text_svma);
}
#else
- text_bias = si->text_start_avma - text_svma;
+ text_bias = di->text_avma - text_svma;
if (sntext_1based_if_known >= 1
&& sntext_1based_if_known <= t_filehdr->f_nscns)
text_bias += t_scnhdr[sntext_1based_if_known - 1].s_scnptr;
@@ -1991,7 +1992,7 @@
if (SHOW)
VG_(printf)(" text section: stated vma 0x%lx, "
"actual vma 0x%lx, bias 0x%lx\n",
- text_svma, si->text_start_avma, text_bias);
+ text_svma, di->text_avma, text_bias);
} else {
text_bias = 0;
if (SHOW)
@@ -1999,11 +2000,11 @@
}
if (data_svma_known) {
- data_bias = data_avma - data_svma;
+ data_bias = di->data_avma - data_svma;
if (SHOW)
VG_(printf)(" data section: stated vma 0x%lx, "
"actual vma 0x%lx, bias 0x%lx\n",
- data_svma, data_avma, data_bias);
+ data_svma, di->data_avma, data_bias);
} else {
data_bias = 0;
if (SHOW)
@@ -2078,13 +2079,13 @@
cursor = oimage;
cursor += t_filehdr->f_symptr;
HChar* badness = read_symbol_table(
- si,
+ di,
cursor, t_filehdr->f_nsyms,
oi_strtab, oi_n_strtab,
oi_debug, oi_n_debug,
oi_lnos, oi_nent_lnos,
sntext_1based_if_known, sndata_1based_if_known,
- data_avma, data_alen, data_alen_from_auxhdr,
+ data_alen_from_auxhdr,
toc_avma,
text_bias, data_bias
);
@@ -2138,9 +2139,8 @@
/* Returns True on success, False if any kind of problem. */
static
-Bool read_xcoff_o_or_a ( /*MOD*/SegInfo* si,
- HChar* a_name, HChar* o_name,
- Addr data_avma, UWord data_alen )
+Bool read_xcoff_o_or_a ( /*MOD*/DebugInfo* di,
+ HChar* a_name, HChar* o_name )
{
UChar* image = NULL;
Word n_image = 0;
@@ -2157,7 +2157,7 @@
sr = VG_(stat)( o_name, &stat_buf );
if (sr.isError) {
- ML_(symerr)("can't stat XCOFF object file");
+ ML_(symerr)(di, True, "can't stat XCOFF object file");
return False;
}
@@ -2165,13 +2165,13 @@
if (SHOW && SHOW_AR_DETAILS)
VG_(printf)("XCOFF object file size %ld\n", n_image);
if (n_image <= 0) {
- ML_(symerr)("implausible XCOFF object file size");
+ ML_(symerr)(di, True, "implausible XCOFF object file size");
return False;
}
fd = VG_(open)( o_name, VKI_O_RDONLY, 0 );
if (fd.isError) {
- ML_(symerr)("can't open XCOFF object file");
+ ML_(symerr)(di, True, "can't open XCOFF object file");
return False;
}
@@ -2180,13 +2180,12 @@
VG_(close)(fd.res);
if (sr.isError) {
- ML_(symerr)("can't mmap XCOFF object file");
+ ML_(symerr)(di, True, "can't mmap XCOFF object file");
return False;
}
image = (UChar*)sr.res;
- ok = read_xcoff_mapped_object( si, image, n_image,
- data_avma, data_alen );
+ ok = read_xcoff_mapped_object( di, image, n_image );
VG_(am_munmap_valgrind)( (Addr)image, n_image);
/* assert OK */
@@ -2200,7 +2199,7 @@
sr = VG_(stat)( a_name, &stat_buf );
if (sr.isError) {
- ML_(symerr)("can't stat XCOFF archive file");
+ ML_(symerr)(di, True, "can't stat XCOFF archive file");
return False;
}
@@ -2208,13 +2207,13 @@
if (SHOW && SHOW_AR_DETAILS)
VG_(printf)("XCOFF archive file size %ld\n", n_image);
if (n_image <= 0) {
- ML_(symerr)("implausible XCOFF archive file size");
+ ML_(symerr)(di, True, "implausible XCOFF archive file size");
return False;
}
fd = VG_(open)( a_name, VKI_O_RDONLY, 0 );
if (fd.isError) {
- ML_(symerr)("can't open XCOFF archive file");
+ ML_(symerr)(di, True, "can't open XCOFF archive file");
return False;
}
@@ -2223,7 +2222,7 @@
VG_(close)(fd.res);
if (sr.isError) {
- ML_(symerr)("can't mmap XCOFF archive file");
+ ML_(symerr)(di, True, "can't mmap XCOFF archive file");
return False;
}
@@ -2234,7 +2233,7 @@
peer at the archive's fixed header. */
if (n_image < sizeof(FL_HDR)) {
- ML_(symerr)("XCOFF archive too small for fixed header");
+ ML_(symerr)(di, True, "XCOFF archive too small for fixed header");
goto done;
}
@@ -2252,7 +2251,8 @@
&& s[6] == '>' && s[7] == '\n') {
/* ok */
} else {
- ML_(symerr)("Is not XCOFF 'big'-variant .a format archive");
+ ML_(symerr)(di, True,
+ "Is not XCOFF 'big'-variant .a format archive");
goto done;
}
}
@@ -2263,14 +2263,16 @@
AR_HDR* mt_hdr = (AR_HDR*)mtabC;
if (mtabC < image || mtabC + sizeof(AR_HDR) > image + n_image) {
- ML_(symerr)("XCOFF archive member table header exceeds image");
+ ML_(symerr)(di, True,
+ "XCOFF archive member table header exceeds image");
goto done;
}
/* should be: backquote newline */
if (mt_hdr->_ar_name.ar_name[0] != 0x60 /* backquote */
|| mt_hdr->_ar_name.ar_name[1] != 0x0A /* \n */) {
- ML_(symerr)("XCOFF archive member table header is invalid");
+ ML_(symerr)(di, True,
+ "XCOFF archive member table header is invalid");
goto done;
}
@@ -2285,7 +2287,7 @@
|| mtabC + sizeof(AR_HDR)
+ ascii_to_ULong(&mt_hdr->ar_size, 20)
> image + n_image) {
- ML_(symerr)("XCOFF archive member table exceeds image");
+ ML_(symerr)(di, True, "XCOFF archive member table exceeds image");
goto done;
}
@@ -2322,7 +2324,8 @@
/* Sanity check the selected member */
UChar* o_hdrC = image + objoff;
if (o_hdrC + sizeof(AR_HDR) >= image + n_image) {
- ML_(symerr)("XCOFF archive member header exceeds image");
+ ML_(symerr)(di, True,
+ "XCOFF archive member header exceeds image");
goto done;
}
AR_HDR* o_hdr = (AR_HDR*)o_hdrC;
@@ -2337,12 +2340,14 @@
VG_(printf)("member data = %p, size = %ld\n", o_data, o_size);
if (!(o_data >= image && o_data + o_size <= image + n_image)) {
- ML_(symerr)("XCOFF archive member exceeds image");
+ ML_(symerr)(di, True,
+ "XCOFF archive member exceeds image");
goto done;
}
if (o_size < sizeof(FILHDR)) {
- ML_(symerr)("XCOFF object file header is implausibly small (1)");
+ ML_(symerr)(di, True,
+ "XCOFF object file header is implausibly small (1)");
goto done;
}
@@ -2367,8 +2372,7 @@
if (SHOW && SHOW_AR_DETAILS)
VG_(printf)("\nimage: %p-%p object: %p-%p\n\n",
image, image+n_image-1, o_data, o_data+o_size-1);
- ok = read_xcoff_mapped_object( si, o_data, o_size,
- data_avma, data_alen );
+ ok = read_xcoff_mapped_object( di, o_data, o_size );
goto done;
vg_assert(0);
@@ -2386,7 +2390,7 @@
}
vg_assert(i == nmembers);
- ML_(symerr)("can't find object in XCOFF archive file");
+ ML_(symerr)(di, True, "can't find object in XCOFF archive file");
done:
if (image) {
@@ -2399,68 +2403,74 @@
}
-Bool ML_(read_xcoff_debug_info) ( struct _SegInfo* si,
- Addr data_avma,
- SSizeT data_alen,
- Bool is_mainexe )
+/* Main entry point for XCOFF reading. The following di fields must
+ be filled in by the caller:
+
+ filename
+ memname (optional)
+ text_avma, text_size
+ data_avma, data_size
+
+ and all other fields should be zeroed.
+*/
+Bool ML_(read_xcoff_debug_info) ( DebugInfo* di,
+ Bool is_mainexe )
{
Bool ok;
if (VG_(clo_verbosity) > 1 || VG_(clo_trace_redir)) {
- if (si->memname) {
+ if (di->memname) {
VG_(message)(Vg_DebugMsg, "Reading syms from %s(%s) (%p)",
- si->filename, si->memname, si->text_start_avma);
+ di->filename, di->memname, di->text_avma);
} else {
VG_(message)(Vg_DebugMsg, "Reading syms from %s (%p)",
- si->filename, si->text_start_avma);
+ di->filename, di->text_avma);
}
}
if (SHOW) {
VG_(printf)("------------------- BEGIN read xcoff ------------------\n");
- VG_(printf)("--- file: %s\n", si->filename);
- VG_(printf)("--- mem: %s\n", si->memname ? si->memname
+ VG_(printf)("--- file: %s\n", di->filename);
+ VG_(printf)("--- mem: %s\n", di->memname ? di->memname
: (UChar*)"(none)" );
- VG_(printf)("--- t actual vma: %p\n", si->text_start_avma);
- VG_(printf)("--- t actual len: %ld\n", si->text_size);
- VG_(printf)("--- d actual vma: %p\n", data_avma);
- VG_(printf)("--- d actual len: %ld\n", data_alen);
+ VG_(printf)("--- t actual vma: %p\n", di->text_avma);
+ VG_(printf)("--- t actual len: %ld\n", di->text_size);
+ VG_(printf)("--- d actual vma: %p\n", di->data_avma);
+ VG_(printf)("--- d actual len: %ld\n", di->data_size);
}
- if (si->memname) {
- /* XCOFF .a file. si->filename is its name, si->memname is the
+ if (di->memname) {
+ /* XCOFF .a file. di->filename is its name, di->memname is the
name of the required .o within it. */
- ok = read_xcoff_o_or_a( si, si->filename, si->memname,
- data_avma, (UWord)data_alen );
+ ok = read_xcoff_o_or_a( di, di->filename, di->memname );
} else {
- /* no archive member name, so si->filename is an XCOFF object */
- ok = read_xcoff_o_or_a( si, NULL, si->filename,
- data_avma, (UWord)data_alen );
+ /* no archive member name, so di->filename is an XCOFF object */
+ ok = read_xcoff_o_or_a( di, NULL, di->filename );
}
- si->soname = NULL;
+ di->soname = NULL;
if (ok) {
if (is_mainexe) {
- si->soname = "NONE";
+ di->soname = "NONE";
} else {
- UChar* p = VG_(strrchr)(si->filename, '/');
- p = p ? p+1 : si->filename;
+ UChar* p = VG_(strrchr)(di->filename, '/');
+ p = p ? p+1 : di->filename;
/* p points at the main filename */
- if (si->memname) {
+ if (di->memname) {
/* set the soname to "archive.a(member.o)" */
- Int nbytes = VG_(strlen)(p) + 1 + VG_(strlen)(si->memname) + 1 + 1;
+ Int nbytes = VG_(strlen)(p) + 1 + VG_(strlen)(di->memname) + 1 + 1;
UChar* so = malloc_AR_SYMTAB(nbytes);
vg_assert(so);
- VG_(sprintf)(so, "%s(%s)", p, si->memname);
+ VG_(sprintf)(so, "%s(%s)", p, di->memname);
vg_assert(VG_(strlen)(so) == nbytes-1);
- si->soname = so;
+ di->soname = so;
} else {
/* no member name, hence soname = "archive.a" */
- si->soname = VG_(arena_strdup)(VG_AR_DINFO, p);
+ di->soname = VG_(arena_strdup)(VG_AR_DINFO, p);
}
}
if (SHOW)
- VG_(printf)("Setting soname to %s\n", si->soname);
+ VG_(printf)("Setting soname to %s\n", di->soname);
}
if (SHOW)
|