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
(21) |
2
(18) |
3
(19) |
4
(16) |
5
(20) |
6
(22) |
7
(17) |
|
8
(13) |
9
(1) |
10
(3) |
11
(28) |
12
(13) |
13
(12) |
14
(25) |
|
15
(15) |
16
(29) |
17
(19) |
18
(15) |
19
(27) |
20
(29) |
21
(21) |
|
22
(16) |
23
(24) |
24
(18) |
25
(26) |
26
(27) |
27
(21) |
28
(30) |
|
29
(23) |
30
(3) |
31
(19) |
|
|
|
|
|
From: <sv...@va...> - 2012-07-13 17:55:43
|
florian 2012-07-13 18:55:36 +0100 (Fri, 13 Jul 2012)
New Revision: 12741
Log:
Fix ppCfiReg for s390 so --trace-cfi=yes no longer asserts.
Modified files:
trunk/coregrind/m_debuginfo/storage.c
Modified: trunk/coregrind/m_debuginfo/storage.c (+1 -0)
===================================================================
--- trunk/coregrind/m_debuginfo/storage.c 2012-07-13 15:04:03 +01:00 (rev 12740)
+++ trunk/coregrind/m_debuginfo/storage.c 2012-07-13 18:55:36 +01:00 (rev 12741)
@@ -634,6 +634,7 @@
case Creg_ARM_R15: VG_(printf)("R15"); break;
case Creg_ARM_R14: VG_(printf)("R14"); break;
case Creg_MIPS_RA: VG_(printf)("RA"); break;
+ case Creg_S390_R14: VG_(printf)("R14"); break;
default: vg_assert(0);
}
}
|
|
From: <sv...@va...> - 2012-07-13 14:13:15
|
florian 2012-07-13 15:13:06 +0100 (Fri, 13 Jul 2012)
New Revision: 2428
Log:
Use vpanic, not vassert, you silly.
Modified files:
trunk/priv/host_s390_isel.c
Modified: trunk/priv/host_s390_isel.c (+1 -1)
===================================================================
--- trunk/priv/host_s390_isel.c 2012-07-13 14:41:41 +01:00 (rev 2427)
+++ trunk/priv/host_s390_isel.c 2012-07-13 15:13:06 +01:00 (rev 2428)
@@ -156,7 +156,7 @@
/* counter is used both as 4-byte and as 8-byte entity */
case S390X_GUEST_OFFSET(guest_counter)+1 ... S390X_GUEST_OFFSET(guest_counter)+3:
case S390X_GUEST_OFFSET(guest_counter)+5 ... S390X_GUEST_OFFSET(guest_counter)+7:
- vassert("partial update of this guest state register is not allowed");
+ vpanic("partial update of this guest state register is not allowed");
break;
default: break;
|
|
From: <sv...@va...> - 2012-07-13 14:04:13
|
sewardj 2012-07-13 15:04:03 +0100 (Fri, 13 Jul 2012)
New Revision: 12740
Log:
Update w/ recent bug fixes.
Modified files:
trunk/NEWS
trunk/docs/internals/3_7_BUGSTATUS.txt
Modified: trunk/docs/internals/3_7_BUGSTATUS.txt (+17 -18)
===================================================================
--- trunk/docs/internals/3_7_BUGSTATUS.txt 2012-07-13 14:34:31 +01:00 (rev 12739)
+++ trunk/docs/internals/3_7_BUGSTATUS.txt 2012-07-13 15:04:03 +01:00 (rev 12740)
@@ -15,6 +15,7 @@
-- add allocator-mismatch checking?
-- 302709, minor tidying needed?
-- reconsider https://bugs.kde.org/show_bug.cgi?id=253657 (AMD64 seg regs)
+-- make sure it works OK on Ubuntu 12.04 and Fedora latest
284004 Application under test hangs after call to __posix_spawn (Darwin)
open, not started
@@ -65,9 +66,6 @@
289360 parse_type_DIE confused by DW_TAG_enumeration_type
low prio; --read-var-info=yes problem; OP queried
-289470 Loading of large Mach-O thin binaries fails.
- **possible 3.8.0; w/ patch; apparently harmless; easy fix
-
289578 Backtraces with unwind tables (=without debug symbols)
using offline symbol resolving
wishlist
@@ -177,9 +175,6 @@
296166 Add support for ARM in ptrcheck
**no patch yet
-296229 Linux user input device ioctls missing wrappers
- **possible 3.8.0, but wrong patch; OP queried
-
296308 helgrind tests fail on Linux/x86 due to clone syscall
missing unwind info
**possible 3.8.0; has low risk patch
@@ -187,9 +182,6 @@
296311 Wrong stack traces due to -fomit-frame-pointer (x86)
**not sure what to do about this. Is it serious?
-296318 ELF Debug info improvements (more than one rx/rw mapping)
- **this is probably important for 3.8.0
-
296480 valgrind hangs early when run on Python
OSX. Not started.
@@ -205,9 +197,6 @@
297407 Failed reading debug information for Fortran codes; invalid cuOff
Tromey made a patch for this. Dunno if it should land. Queried.
-297701 Another alias for strncasecmp_l in libc-2.13.so
- **possible 3.8.0, trivial fix
-
298097 on ppc32 (e500mc core) target, valgrind report a app a
mem error but the app is good to me.
probably closable (may be dup of 296318)
@@ -227,12 +216,6 @@
300102 memcheck tester
unclear what status is
-300140 ARM - Missing (T2) SMMUL
- **possible 3.8.0, has patch but needs testcase
-
-300195 read_elf_debug_info() should accept 'executable' .got sections
- **possible 3.8.0, simple patch, needs checking over
-
301011 vex x86->IR: 0xF3 0xF 0xBC 0xDE (TZCNT)
**possible 3.8.0; see also 295808 (64 bit)
@@ -290,3 +273,19 @@
**possible 3.8.0, has patch, should take
-- Thurs 5 July 2012, mid afternoon.
+
+303116] New: Add support for the POWER instruction popcntb
+
+303127] New: Power test suite fixes for frsqrte, vrefp, and vrsqrtefp
+instructions.
+
+303250] New: "Assertion `instrs_in->arr_used <= 10000' failed" on
+OpenSSL with --track-origins=yes
+
+303460] New: Killed by fatal signal at doRegisterAllocation
+
+303466] New: vex amd64->IR: unhandled instruction bytes: 0xC5 0x7A
+0x10 0x35 0x61 0x2D 0x20 0x0
+== generic avx
+
+-- Friday 13 July 2012 16:02 CEST
Modified: trunk/NEWS (+7 -0)
===================================================================
--- trunk/NEWS 2012-07-13 14:34:31 +01:00 (rev 12739)
+++ trunk/NEWS 2012-07-13 15:04:03 +01:00 (rev 12740)
@@ -138,6 +138,7 @@
287260 Incorrect conditional jump or move depends on uninitialised value(s)
287301 vex amd64->IR: 0x66 0xF 0x38 0x41 0xC0 0xB8 0x0 0x0 (PHMINPOSUW)
287858 VG_(strerror): unknown error
+289470 Loading of large Mach-O thin binaries fails.
289699 vgdb connection in relay mode erroneously closed due to buffer overrun
289823 (duplicate of 293754) vex amd64->IR: 0x66 0xF 0x3A 0x60 0xCA 0x45 0x66 0xF
289939 wish: complete monitor cmd 'leak_check' with details about leaked or reachable blocks
@@ -176,6 +177,8 @@
295590 Helgrind: Assertion 'cvi->nWaiters > 0' failed when cond var being waited upon destroyed
295617 ARM - Add some missing syscalls
295799 Missing \n with get_vbits in gdbserver when line is % 80 and there are some unaddressable bytes
+296229 Linux user input device ioctls missing wrappers
+296318 ELF Debug info improvements (more than one rx/rw mapping)
296422 Add translation chaining support
296457 vex amd64->IR: 0x66 0xF 0x3A 0xDF 0xD1 0x1 0xE8 0x6A (dup of AES)
296792 [PATCH] valgrind 3.7.0: add SIOCSHWTSTAMP (0x89B0) ioctl wrapper
@@ -187,6 +190,7 @@
297329 VEX should disallow decoding of IBM Power Decimal Floating Point
instructions on machines that do not support it
297497 POWER Processor decimal floating point instruction support missing
+297701 Another alias for strncasecmp_l in libc-2.13.so
297976 s390x: revisit EX implementation
297911 valgrind does not report 'invalid write' when using APIs for custom memory allocators.
297991 Valgrind interferes with mmap()+ftell()
@@ -218,6 +222,9 @@
n-i-bz Add missing gdbserver xml files for shadow registers for ppc32
n-i-bz Fix false positive in sys_clone on amd64 when optional args are not given (e.g. child_tidptr)
n-i-bz Fix assert in gdbserver for watchpoints watching the same address
+300140 ARM - Missing (T1) SMMUL
+300195 read_elf_debug_info() should accept 'executable' .got sections
+ == 296318
300389 AMD Bulldozer system: vex: priv/main_main.c:315 (LibVEX_Translate):
Assertion `are_valid_hwcaps(VexArchAMD64, vta->archinfo_host.hwcaps)' failed.
300414 FCOM and FCOMP unimplemented for amd64 guest
|
|
From: <sv...@va...> - 2012-07-13 13:41:47
|
florian 2012-07-13 14:41:41 +0100 (Fri, 13 Jul 2012)
New Revision: 2427
Log:
Use a proper type for sign_mask.
Modified files:
trunk/priv/guest_s390_toIR.c
Modified: trunk/priv/guest_s390_toIR.c (+3 -3)
===================================================================
--- trunk/priv/guest_s390_toIR.c 2012-07-13 13:48:39 +01:00 (rev 2426)
+++ trunk/priv/guest_s390_toIR.c 2012-07-13 14:41:41 +01:00 (rev 2427)
@@ -6847,7 +6847,7 @@
IRTemp p2 = newTemp(Ity_I64);
IRTemp op = newTemp(Ity_I64);
IRTemp result = newTemp(Ity_I64);
- Long sign_mask;
+ ULong sign_mask;
IRTemp shift_amount = newTemp(Ity_I64);
assign(p1, unop(Iop_32Uto64, get_gpr_w1(r1)));
@@ -6857,8 +6857,8 @@
sign_mask = 1ULL << 63;
assign(shift_amount, binop(Iop_And64, mkexpr(op2addr), mkU64(63)));
assign(result, binop(Iop_Or64, binop(Iop_And64, binop(Iop_Shl64, mkexpr(op),
- unop(Iop_64to8, mkexpr(shift_amount))), mkU64((ULong)(~sign_mask))),
- binop(Iop_And64, mkexpr(op), mkU64((ULong)sign_mask))));
+ unop(Iop_64to8, mkexpr(shift_amount))), mkU64(~sign_mask)),
+ binop(Iop_And64, mkexpr(op), mkU64(sign_mask))));
put_gpr_w1(r1, unop(Iop_64HIto32, mkexpr(result)));
put_gpr_w1(r1 + 1, unop(Iop_64to32, mkexpr(result)));
s390_cc_thunk_putZZ(S390_CC_OP_SHIFT_LEFT_64, op, shift_amount);
|
|
From: <sv...@va...> - 2012-07-13 13:34:42
|
sewardj 2012-07-13 14:34:31 +0100 (Fri, 13 Jul 2012)
New Revision: 12739
Log:
Fix loading of large Mach-O thin binaries. Bug #289470.
(Scott Byer, sco...@ch...)
Modified files:
trunk/coregrind/m_ume/macho.c
Modified: trunk/coregrind/m_ume/macho.c (+1 -1)
===================================================================
--- trunk/coregrind/m_ume/macho.c 2012-07-13 14:21:11 +01:00 (rev 12738)
+++ trunk/coregrind/m_ume/macho.c 2012-07-13 14:34:31 +01:00 (rev 12739)
@@ -487,7 +487,7 @@
print("couldn't read load commands from executable\n");
return -1;
}
- headers_end = headers + size;
+ headers_end = headers + len;
// Map some segments into client memory:
|
|
From: <sv...@va...> - 2012-07-13 13:21:22
|
sewardj 2012-07-13 14:21:11 +0100 (Fri, 13 Jul 2012)
New Revision: 12738
Log:
Add another intercept for strncasecmp_l. Fixes #297701.
Modified files:
trunk/memcheck/mc_replace_strmem.c
Modified: trunk/memcheck/mc_replace_strmem.c (+1 -0)
===================================================================
--- trunk/memcheck/mc_replace_strmem.c 2012-07-13 14:15:10 +01:00 (rev 12737)
+++ trunk/memcheck/mc_replace_strmem.c 2012-07-13 14:21:11 +01:00 (rev 12738)
@@ -678,6 +678,7 @@
#if defined(VGO_linux)
STRNCASECMP_L(VG_Z_LIBC_SONAME, strncasecmp_l)
STRNCASECMP_L(VG_Z_LIBC_SONAME, __GI_strncasecmp_l)
+ STRNCASECMP_L(VG_Z_LIBC_SONAME, __GI___strncasecmp_l)
#elif defined(VGO_darwin)
//STRNCASECMP_L(VG_Z_LIBC_SONAME, strncasecmp_l)
|
|
From: <sv...@va...> - 2012-07-13 13:15:20
|
sewardj 2012-07-13 14:15:10 +0100 (Fri, 13 Jul 2012)
New Revision: 12737
Log:
Add ioctl wrappers for "Linux user input device". Fixes #296229.
(Chase Douglas, cha...@ca...)
Modified files:
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/include/vki/vki-linux.h
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c (+18 -0)
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c 2012-07-13 13:58:55 +01:00 (rev 12736)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c 2012-07-13 14:15:10 +01:00 (rev 12737)
@@ -4215,6 +4215,10 @@
/* KVM ioctls that dont check for a numeric value as parameter */
case VKI_KVM_S390_ENABLE_SIE:
case VKI_KVM_S390_INITIAL_RESET:
+
+ /* User input device creation */
+ case VKI_UI_DEV_CREATE:
+ case VKI_UI_DEV_DESTROY:
PRINT("sys_ioctl ( %ld, 0x%lx )",ARG1,ARG2);
PRE_REG_READ2(long, "ioctl",
unsigned int, fd, unsigned int, request);
@@ -5350,6 +5354,20 @@
}
break;
+ /* User input device creation */
+ case VKI_UI_SET_EVBIT:
+ case VKI_UI_SET_KEYBIT:
+ case VKI_UI_SET_RELBIT:
+ case VKI_UI_SET_ABSBIT:
+ case VKI_UI_SET_MSCBIT:
+ case VKI_UI_SET_LEDBIT:
+ case VKI_UI_SET_SNDBIT:
+ case VKI_UI_SET_FFBIT:
+ case VKI_UI_SET_SWBIT:
+ case VKI_UI_SET_PROPBIT:
+ /* These just take an int by value */
+ break;
+
# if defined(VGPV_arm_linux_android)
/* ashmem */
case VKI_ASHMEM_GET_SIZE:
Modified: trunk/include/vki/vki-linux.h (+19 -0)
===================================================================
--- trunk/include/vki/vki-linux.h 2012-07-13 13:58:55 +01:00 (rev 12736)
+++ trunk/include/vki/vki-linux.h 2012-07-13 14:15:10 +01:00 (rev 12737)
@@ -2990,6 +2990,25 @@
int rx_filter;
};
+//----------------------------------------------------------------------
+// From linux-2.6.12-rc2/include/linux/uinput.h
+//----------------------------------------------------------------------
+
+#define VKI_UINPUT_IOCTL_BASE 'U'
+#define VKI_UI_DEV_CREATE _VKI_IO(VKI_UINPUT_IOCTL_BASE, 1)
+#define VKI_UI_DEV_DESTROY _VKI_IO(VKI_UINPUT_IOCTL_BASE, 2)
+
+#define VKI_UI_SET_EVBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 100, int)
+#define VKI_UI_SET_KEYBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 101, int)
+#define VKI_UI_SET_RELBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 102, int)
+#define VKI_UI_SET_ABSBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 103, int)
+#define VKI_UI_SET_MSCBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 104, int)
+#define VKI_UI_SET_LEDBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 105, int)
+#define VKI_UI_SET_SNDBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 106, int)
+#define VKI_UI_SET_FFBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 107, int)
+#define VKI_UI_SET_SWBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 109, int)
+#define VKI_UI_SET_PROPBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 110, int)
+
#endif // __VKI_LINUX_H
/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2012-07-13 12:59:02
|
sewardj 2012-07-13 13:58:55 +0100 (Fri, 13 Jul 2012)
New Revision: 12736
Log:
Clean up the PDB reader somewhat, mostly in the area of biasing.
#296318 comment 9. (Jiri Hruska, ji...@fu...)
Modified files:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/priv_readpdb.h
trunk/coregrind/m_debuginfo/priv_storage.h
trunk/coregrind/m_debuginfo/readpdb.c
trunk/coregrind/m_debuginfo/storage.c
trunk/coregrind/pub_core_debuginfo.h
Modified: trunk/coregrind/m_debuginfo/priv_storage.h (+1 -0)
===================================================================
--- trunk/coregrind/m_debuginfo/priv_storage.h 2012-07-13 12:24:05 +01:00 (rev 12735)
+++ trunk/coregrind/m_debuginfo/priv_storage.h 2012-07-13 13:58:55 +01:00 (rev 12736)
@@ -754,6 +754,7 @@
UWord fpo_size;
Addr fpo_minavma;
Addr fpo_maxavma;
+ Addr fpo_base_avma;
/* Expandable arrays of characters -- the string table. Pointers
into this are stable (the arrays are not reallocated). */
Modified: trunk/coregrind/m_debuginfo/priv_readpdb.h (+1 -1)
===================================================================
--- trunk/coregrind/m_debuginfo/priv_readpdb.h 2012-07-13 12:24:05 +01:00 (rev 12735)
+++ trunk/coregrind/m_debuginfo/priv_readpdb.h 2012-07-13 13:58:55 +01:00 (rev 12736)
@@ -41,7 +41,7 @@
extern Bool ML_(read_pdb_debug_info)(
DebugInfo* di,
Addr obj_avma,
- PtrdiffT unknown_purpose__reloc,
+ PtrdiffT obj_bias,
void* pdbimage,
SizeT n_pdbimage,
Char* pdbname,
Modified: trunk/coregrind/pub_core_debuginfo.h (+1 -1)
===================================================================
--- trunk/coregrind/pub_core_debuginfo.h 2012-07-13 12:24:05 +01:00 (rev 12735)
+++ trunk/coregrind/pub_core_debuginfo.h 2012-07-13 13:58:55 +01:00 (rev 12736)
@@ -72,7 +72,7 @@
/* this should really return ULong, as per VG_(di_notify_mmap). */
extern void VG_(di_notify_pdb_debuginfo)( Int fd, Addr avma,
SizeT total_size,
- PtrdiffT unknown_purpose__reloc );
+ PtrdiffT bias );
/* this should also really return ULong */
extern void VG_(di_notify_vm_protect)( Addr a, SizeT len, UInt prot );
Modified: trunk/coregrind/m_debuginfo/debuginfo.c (+4 -5)
===================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c 2012-07-13 12:24:05 +01:00 (rev 12735)
+++ trunk/coregrind/m_debuginfo/debuginfo.c 2012-07-13 13:58:55 +01:00 (rev 12736)
@@ -1031,8 +1031,7 @@
/* this should really return ULong, as per VG_(di_notify_mmap). */
void VG_(di_notify_pdb_debuginfo)( Int fd_obj, Addr avma_obj,
- SizeT total_size,
- PtrdiffT unknown_purpose__reloc )
+ SizeT total_size, PtrdiffT bias_obj )
{
Int i, r, sz_exename;
ULong obj_mtime, pdb_mtime;
@@ -1048,8 +1047,8 @@
VG_(message)(Vg_UserMsg, "\n");
VG_(message)(Vg_UserMsg,
"LOAD_PDB_DEBUGINFO: clreq: fd=%d, avma=%#lx, total_size=%lu, "
- "uu_reloc=%#lx\n",
- fd_obj, avma_obj, total_size, unknown_purpose__reloc
+ "bias=%#lx\n",
+ fd_obj, avma_obj, total_size, bias_obj
);
}
@@ -1239,7 +1238,7 @@
/* don't set up any of the di-> fields; let
ML_(read_pdb_debug_info) do it. */
- ML_(read_pdb_debug_info)( di, avma_obj, unknown_purpose__reloc,
+ ML_(read_pdb_debug_info)( di, avma_obj, bias_obj,
pdbimage, n_pdbimage, pdbname, pdb_mtime );
// JRS fixme: take notice of return value from read_pdb_debug_info,
// and handle failure
Modified: trunk/coregrind/m_debuginfo/readpdb.c (+47 -87)
===================================================================
--- trunk/coregrind/m_debuginfo/readpdb.c 2012-07-13 12:24:05 +01:00 (rev 12735)
+++ trunk/coregrind/m_debuginfo/readpdb.c 2012-07-13 13:58:55 +01:00 (rev 12736)
@@ -61,46 +61,23 @@
/*--- ---*/
/*------------------------------------------------------------*/
-/* JRS 2009-Apr-13: Mostly this PDB reader is straightforward. But
- the biasing is incomprehensible, and I don't claim to understand it
- at all. There are four places where biasing is required:
+/* There are just two simple ways of biasing in use here.
- - when reading symbol addresses (DEBUG_SnarfCodeView)
- - when reading old-style line number tables (DEBUG_SnarfLinetab)
- - when reading new-style line number tables (codeview_dump_linetab2)
- - when reading FPO (stack-unwind) tables (pdb_dump)
+ The CodeView debug info entries contain virtual addresses
+ relative to segment (here it is one PE section), which in
+ turn specifies its start as a VA relative to "image base".
- To complicate matters further, Wine supplies us, via the
- VG_USERREQ__LOAD_PDB_DEBUGINFO client request that initiates PDB
- reading, a value 'unknown_purpose__reloc' which, if you read
- 'virtual.c' in the Wine sources, looks a lot like a text bias
- value. Yet the code below ignores it.
+ The second type of debug info (FPOs) contain VAs relative
+ directly to the image base, without the segment indirection.
- To make future experimentation with biasing easier, here are four
- macros which give the bias to use in each of the four cases. Be
- warned, they can and do refer to local vars in the relevant
- functions. */
+ The original/preferred image base is set in the PE header,
+ but it can change as long as the file contains relocation
+ data. So everything is biased using the current image base,
+ which is the base AVMA passed by Wine.
-/* The BIAS_FOR_{SYMBOLS,LINETAB,LINETAB2} are as in JohnR's original
- patch. BIAS_FOR_FPO was originally hardwired to zero, but that
- doesn't make much sense. Here, we use text_bias as empirically
- producing the most ranges that fall inside the text segments for a
- multi-dll program. Of course, it could still be nonsense :-) */
-#define BIAS_FOR_SYMBOLS (di->text_avma)
-#define BIAS_FOR_LINETAB (di->text_avma)
-#define BIAS_FOR_LINETAB2 (di->text_bias)
-#define BIAS_FOR_FPO (di->text_bias)
-/* Using di->text_bias for the FPOs causes 981 in range and 1 out of
- range. Using rx_map_avma gives 953 in range and 29 out of range,
- so di->text_bias looks like a better bet.:
- $ grep FPO spew-B-text_bias | grep keep | wc
- 981 4905 57429
- $ grep FPO spew-B-text_bias | grep SKIP | wc
- 1 5 53
- $ grep FPO spew-B-rx_map_avma | grep keep | wc
- 953 4765 55945
- $ grep FPO spew-B-rx_map_avma | grep SKIP | wc
- 29 145 1537
+ The difference between the original image base and current
+ image base, which is what Wine sends here in the last
+ argument of VG_(di_notify_pdb_debuginfo), is not used.
*/
/* This module leaks space; enable m_main's calling of
@@ -1223,6 +1200,7 @@
static ULong DEBUG_SnarfCodeView(
DebugInfo* di,
+ PtrdiffT bias,
IMAGE_SECTION_HEADER* sectp,
void* root, /* FIXME: better name */
Int offset,
@@ -1235,7 +1213,6 @@
Char symname[4096 /*WIN32_PATH_MAX*/];
Bool debug = di->trace_symtab;
- Addr bias = BIAS_FOR_SYMBOLS;
ULong n_syms_read = 0;
if (debug)
@@ -1538,6 +1515,7 @@
static ULong DEBUG_SnarfLinetab(
DebugInfo* di,
+ PtrdiffT bias,
IMAGE_SECTION_HEADER* sectp,
Char* linetab,
Int size
@@ -1559,7 +1537,6 @@
Int this_seg;
Bool debug = di->trace_symtab;
- Addr bias = BIAS_FOR_LINETAB;
ULong n_lines_read = 0;
if (debug)
@@ -1708,6 +1685,8 @@
static ULong codeview_dump_linetab2(
DebugInfo* di,
+ Addr bias,
+ IMAGE_SECTION_HEADER* sectp,
Char* linetab,
DWORD size,
Char* strimage,
@@ -1721,7 +1700,6 @@
struct codeview_linetab2_file* fd;
Bool debug = di->trace_symtab;
- Addr bias = BIAS_FOR_LINETAB2;
ULong n_line2s_read = 0;
if (*(const DWORD*)linetab != 0x000000f4)
@@ -1780,8 +1758,10 @@
if (lbh->nlines > 1) {
for (i = 0; i < lbh->nlines-1; i++) {
- svma_s = lbh->start + lbh->l[i].offset;
- svma_e = lbh->start + lbh->l[i+1].offset-1;
+ svma_s = sectp[lbh->seg - 1].VirtualAddress + lbh->start
+ + lbh->l[i].offset;
+ svma_e = sectp[lbh->seg - 1].VirtualAddress + lbh->start
+ + lbh->l[i+1].offset-1;
if (debug)
VG_(printf)("%s line %d: %08lx to %08lx\n",
pfx, lbh->l[i].lineno ^ 0x80000000, svma_s, svma_e);
@@ -1791,8 +1771,10 @@
lbh->l[i].lineno ^ 0x80000000, 0 );
n_line2s_read++;
}
- svma_s = lbh->start + lbh->l[ lbh->nlines-1].offset;
- svma_e = lbh->start + lbh->size - 1;
+ svma_s = sectp[lbh->seg - 1].VirtualAddress + lbh->start
+ + lbh->l[ lbh->nlines-1].offset;
+ svma_e = sectp[lbh->seg - 1].VirtualAddress + lbh->start
+ + lbh->size - 1;
if (debug)
VG_(printf)("%s line %d: %08lx to %08lx\n",
pfx, lbh->l[ lbh->nlines-1 ].lineno ^ 0x80000000,
@@ -1835,8 +1817,8 @@
/* JRS fixme: compare with version in current Wine sources */
static void pdb_dump( struct pdb_reader* pdb,
DebugInfo* di,
- Addr pe_avma,
- Int unknown_purpose__reloc,
+ Addr pe_avma,
+ PtrdiffT pe_bias,
IMAGE_SECTION_HEADER* sectp_avma )
{
Int header_size;
@@ -1848,7 +1830,6 @@
char *file;
Bool debug = di->trace_symtab;
- Addr bias_for_fpo = BIAS_FOR_FPO;
ULong n_fpos_read = 0, n_syms_read = 0,
n_lines_read = 0, n_line2s_read = 0;
@@ -1875,26 +1856,6 @@
}
}
- if (VG_(clo_verbosity) > 1) {
- VG_(message)(Vg_DebugMsg,
- "PDB_READER:\n");
- VG_(message)(Vg_DebugMsg,
- " BIAS_FOR_SYMBOLS = %#08lx %s\n",
- (PtrdiffT)BIAS_FOR_SYMBOLS, VG_STRINGIFY(BIAS_FOR_SYMBOLS));
- VG_(message)(Vg_DebugMsg,
- " BIAS_FOR_LINETAB = %#08lx %s\n",
- (PtrdiffT)BIAS_FOR_LINETAB, VG_STRINGIFY(BIAS_FOR_LINETAB));
- VG_(message)(Vg_DebugMsg,
- " BIAS_FOR_LINETAB2 = %#08lx %s\n",
- (PtrdiffT)BIAS_FOR_LINETAB2, VG_STRINGIFY(BIAS_FOR_LINETAB2));
- VG_(message)(Vg_DebugMsg,
- " BIAS_FOR_FPO = %#08lx %s\n",
- (PtrdiffT)BIAS_FOR_FPO, VG_STRINGIFY(BIAS_FOR_FPO));
- VG_(message)(Vg_DebugMsg,
- " RELOC = %#08lx\n",
- (PtrdiffT)unknown_purpose__reloc);
- }
-
/* Since we just use the FPO data without reformatting, at least
do a basic sanity check on the struct layout. */
vg_assert(sizeof(FPO_DATA) == 16);
@@ -1914,6 +1875,7 @@
di->fpo_size = sz;
if (0) VG_(printf)("FPO: got fpo_size %lu\n", (UWord)sz);
vg_assert(0 == (di->fpo_size % sizeof(FPO_DATA)));
+ di->fpo_base_avma = pe_avma;
} else {
vg_assert(di->fpo == NULL);
vg_assert(di->fpo_size == 0);
@@ -1997,7 +1959,7 @@
/* Now bias the table. This can't be done in the same pass as
the sanity check, hence a second loop. */
for (i = 0; i < di->fpo_size; i++) {
- di->fpo[i].ulOffStart += bias_for_fpo;
+ di->fpo[i].ulOffStart += pe_avma;
// make sure the biasing didn't royally screw up, by wrapping
// the range around the end of the address space
vg_assert(0xFFFFFFFF - di->fpo[i].ulOffStart /* "remaining space" */
@@ -2098,7 +2060,7 @@
VG_(umsg)("\n");
if (VG_(clo_verbosity) > 1)
VG_(message)(Vg_UserMsg, "Reading global symbols\n" );
- DEBUG_SnarfCodeView( di, sectp_avma, modimage, 0, len_modimage );
+ DEBUG_SnarfCodeView( di, pe_avma, sectp_avma, modimage, 0, len_modimage );
ML_(dinfo_free)( (void*)modimage );
}
@@ -2141,7 +2103,7 @@
VG_(message)(Vg_UserMsg, "Reading symbols for %s\n",
file_name );
n_syms_read
- += DEBUG_SnarfCodeView( di, sectp_avma, modimage,
+ += DEBUG_SnarfCodeView( di, pe_avma, sectp_avma, modimage,
sizeof(unsigned long),
symbol_size );
}
@@ -2152,7 +2114,7 @@
if (VG_(clo_verbosity) > 1)
VG_(message)(Vg_UserMsg, "Reading lines for %s\n", file_name );
n_lines_read
- += DEBUG_SnarfLinetab( di, sectp_avma,
+ += DEBUG_SnarfLinetab( di, pe_avma, sectp_avma,
modimage + symbol_size, lineno_size );
}
@@ -2162,7 +2124,8 @@
*/
n_line2s_read
+= codeview_dump_linetab2(
- di, (char*)modimage + symbol_size + lineno_size,
+ di, pe_avma, sectp_avma,
+ (char*)modimage + symbol_size + lineno_size,
total_size - (symbol_size + lineno_size),
/* if filesimage is NULL, pass that directly onwards
to codeview_dump_linetab2, so it knows not to
@@ -2211,7 +2174,7 @@
Bool ML_(read_pdb_debug_info)(
DebugInfo* di,
Addr obj_avma,
- PtrdiffT unknown_purpose__reloc,
+ PtrdiffT obj_bias,
void* pdbimage,
SizeT n_pdbimage,
Char* pdbname,
@@ -2259,27 +2222,28 @@
+ OFFSET_OF(IMAGE_NT_HEADERS, OptionalHeader)
+ ntheaders_avma->FileHeader.SizeOfOptionalHeader;
- /* Iterate over PE(?) headers. Try to establish the text_bias,
- that's all we really care about. */
+ /* Iterate over PE headers and fill our section mapping table. */
for ( i = 0;
i < ntheaders_avma->FileHeader.NumberOfSections;
i++, pe_seg_avma += sizeof(IMAGE_SECTION_HEADER) ) {
pe_sechdr_avma = (IMAGE_SECTION_HEADER *)pe_seg_avma;
- if (VG_(clo_verbosity) > 1)
+ if (VG_(clo_verbosity) > 1) {
+ /* Copy name, it can be 8 chars and not NUL-terminated */
+ char name[9];
+ VG_(memcpy)(name, pe_sechdr_avma->Name, 8);
+ name[8] = '\0';
VG_(message)(Vg_UserMsg,
- " Scanning PE section %s at avma %p svma %#lx\n",
- pe_sechdr_avma->Name, pe_seg_avma,
+ " Scanning PE section %ps at avma %#lx svma %#lx\n",
+ name, obj_avma + pe_sechdr_avma->VirtualAddress,
pe_sechdr_avma->VirtualAddress);
+ }
if (pe_sechdr_avma->Characteristics & IMAGE_SCN_MEM_DISCARDABLE)
continue;
mapped_avma = (Addr)obj_avma + pe_sechdr_avma->VirtualAddress;
mapped_end_avma = mapped_avma + pe_sechdr_avma->Misc.VirtualSize;
- if (VG_(clo_verbosity) > 1)
- VG_(message)(Vg_DebugMsg,
- " ::: mapped_avma is %#lx\n", mapped_avma);
struct _DebugInfoMapping map;
map.avma = mapped_avma;
@@ -2345,11 +2309,7 @@
TRACE_SYMTAB("\n");
}
- if (di->text_present) {
- di->text_bias = di->text_avma - di->text_svma;
- } else {
- di->text_bias = 0;
- }
+ di->text_bias = obj_bias;
if (VG_(clo_verbosity) > 1) {
for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
@@ -2393,7 +2353,7 @@
pdbname, pdbmtime, root->version, root->TimeDateStamp );
ML_(dinfo_free)( root );
}
- pdb_dump( &reader, di, obj_avma, unknown_purpose__reloc, sectp_avma );
+ pdb_dump( &reader, di, obj_avma, obj_bias, sectp_avma );
}
else
if (0==VG_(strncmp)((char const *)&signature, "JG\0\0", 4)) {
@@ -2405,7 +2365,7 @@
pdbname, pdbmtime, root->version, root->TimeDateStamp);
ML_(dinfo_free)( root );
}
- pdb_dump( &reader, di, obj_avma, unknown_purpose__reloc, sectp_avma );
+ pdb_dump( &reader, di, obj_avma, obj_bias, sectp_avma );
}
if (1) {
Modified: trunk/coregrind/m_debuginfo/storage.c (+1 -1)
===================================================================
--- trunk/coregrind/m_debuginfo/storage.c 2012-07-13 12:24:05 +01:00 (rev 12735)
+++ trunk/coregrind/m_debuginfo/storage.c 2012-07-13 13:58:55 +01:00 (rev 12736)
@@ -1858,7 +1858,7 @@
Word ML_(search_one_fpotab) ( struct _DebugInfo* di, Addr ptr )
{
- Addr const addr = ptr - di->text_avma;
+ Addr const addr = ptr - di->fpo_base_avma;
Addr a_mid_lo, a_mid_hi;
Word mid, size,
lo = 0,
|
|
From: <sv...@va...> - 2012-07-13 12:48:51
|
florian 2012-07-13 13:48:39 +0100 (Fri, 13 Jul 2012)
New Revision: 2426
Log:
Remove redundant break statements.
Modified files:
trunk/priv/host_mips_defs.c
trunk/priv/host_mips_isel.c
trunk/priv/host_s390_defs.c
Modified: trunk/priv/host_mips_defs.c (+0 -3)
===================================================================
--- trunk/priv/host_mips_defs.c 2012-07-11 17:46:47 +01:00 (rev 2425)
+++ trunk/priv/host_mips_defs.c 2012-07-13 13:48:39 +01:00 (rev 2426)
@@ -2619,7 +2619,6 @@
opc1 = 55;
vassert(mode64);
break;
- break;
default:
vassert(0);
break;
@@ -3375,7 +3374,6 @@
opc = 55;
vassert(mode64);
break;
- break;
default:
goto bad;
}
@@ -3400,7 +3398,6 @@
opc = 55;
vassert(mode64);
break;
- break;
default:
goto bad;
}
Modified: trunk/priv/host_s390_defs.c (+6 -4)
===================================================================
--- trunk/priv/host_s390_defs.c 2012-07-11 17:46:47 +01:00 (rev 2425)
+++ trunk/priv/host_s390_defs.c 2012-07-13 13:48:39 +01:00 (rev 2426)
@@ -7383,10 +7383,12 @@
mode and no FPC modification is necessary. So we handle them
upfront. */
switch (insn->variant.bfp_unop.tag) {
- case S390_BFP_F128_TO_I32: return s390_emit_CFXBR(buf, rounding_mode,
- r1, r2_hi); break;
- case S390_BFP_F128_TO_I64: return s390_emit_CGXBR(buf, rounding_mode,
- r1, r2_hi); break;
+ case S390_BFP_F128_TO_I32:
+ return s390_emit_CFXBR(buf, rounding_mode, r1, r2_hi);
+
+ case S390_BFP_F128_TO_I64:
+ return s390_emit_CGXBR(buf, rounding_mode, r1, r2_hi);
+
default: break;
}
Modified: trunk/priv/host_mips_isel.c (+0 -2)
===================================================================
--- trunk/priv/host_mips_isel.c 2012-07-11 17:46:47 +01:00 (rev 2425)
+++ trunk/priv/host_mips_isel.c 2012-07-13 13:48:39 +01:00 (rev 2426)
@@ -840,8 +840,6 @@
addInstr(env, MIPSInstr_Cmp(syned, size32, dst, r1, r2, cc));
return dst;
-
- break;
}
if (e->Iex.Binop.op == Iop_Max32U) {
|
|
From: <sv...@va...> - 2012-07-13 11:24:19
|
sewardj 2012-07-13 12:24:05 +0100 (Fri, 13 Jul 2012)
New Revision: 12735
Log:
Allow multiple rw and rx mappings in the ELF debuginfo reader.
Fixes #296318 (patch on comment 8). (Jiナ凖ュ Hruナ。ka, ji...@fu...)
Modified files:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/priv_storage.h
trunk/coregrind/m_debuginfo/readelf.c
trunk/coregrind/m_debuginfo/readmacho.c
trunk/coregrind/m_debuginfo/readpdb.c
trunk/coregrind/m_debuginfo/storage.c
Modified: trunk/coregrind/m_debuginfo/readelf.c (+149 -138)
===================================================================
--- trunk/coregrind/m_debuginfo/readelf.c 2012-07-12 00:06:07 -23:00 (rev 12734)
+++ trunk/coregrind/m_debuginfo/readelf.c 2012-07-13 12:24:05 +01:00 (rev 12735)
@@ -554,9 +554,8 @@
background. */
Bool in_rx;
vg_assert(di->fsm.have_rx_map);
- in_rx = (!(*sym_avma_out + *sym_size_out <= di->fsm.rx_map_avma
- || *sym_avma_out >= di->fsm.rx_map_avma
- + di->fsm.rx_map_size));
+ in_rx = (ML_(find_rx_mapping)(di, *sym_avma_out,
+ *sym_avma_out + *sym_size_out) != NULL);
if (in_text)
vg_assert(in_rx);
if (!in_rx) {
@@ -1266,12 +1265,6 @@
supplied DebugInfo.
*/
-/* Temporarily holds information copied out of PT_LOAD entries
- in ML_(read_elf_debug_info. */
-typedef
- struct { Addr svma_base; Addr svma_limit; PtrdiffT bias; }
- RangeAndBias;
-
Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
{
/* This function is long and complex. That, and the presence of
@@ -1283,7 +1276,7 @@
/* TOPLEVEL */
Bool res, ok;
SysRes fd, sres;
- Word i;
+ Word i, j;
Bool dynbss_present = False;
Bool sdynbss_present = False;
@@ -1312,19 +1305,19 @@
UChar* shdr_strtab_img = NULL;
/* SVMAs covered by rx and rw segments and corresponding biases.
- We keep separate lists of rx and rw areas. Each can have up to
- N_RX_RW_AREAS entries. Normally each object would provide just
- one rx and one rw area, but Mike Hommey's elfhack creates
- objects with two rx PT_LOAD entries, hence the generality. */
- const Int N_RX_RW_AREAS = 2;
+ Normally each object would provide just one rx and one rw area,
+ but various ELF mangling tools create objects with multiple
+ such entries, hence the generality. */
+ typedef
+ struct {
+ Addr svma_base;
+ Addr svma_limit;
+ PtrdiffT bias;
+ Bool exec;
+ }
+ RangeAndBias;
- RangeAndBias rx[N_RX_RW_AREAS];
- RangeAndBias rw[N_RX_RW_AREAS];
- Word n_rx = 0; /* 0 .. N_RX_RW_AREAS */
- Word n_rw = 0; /* 0 .. N_RX_RW_AREAS */
- /* Pointless paranoia: */
- VG_(memset)( rx, 0, sizeof(rx) );
- VG_(memset)( rw, 0, sizeof(rw) );
+ XArray* /* of RangeAndBias */ svma_ranges = NULL;
/* Build ID */
Char* buildid = NULL;
@@ -1332,8 +1325,6 @@
vg_assert(di);
vg_assert(di->fsm.have_rx_map == True);
vg_assert(di->fsm.have_rw_map == True);
- vg_assert(di->fsm.rx_map_size > 0);
- vg_assert(di->fsm.rw_map_size > 0);
vg_assert(di->have_dinfo == False);
vg_assert(di->fsm.filename);
vg_assert(!di->symtab);
@@ -1343,19 +1334,35 @@
vg_assert(!di->strchunks);
vg_assert(!di->soname);
- /* If these don't hold true, it means that m_syswrap/m_aspacemgr
- managed to do a mapping where the start isn't page aligned.
- Which sounds pretty bogus to me. */
- vg_assert(VG_IS_PAGE_ALIGNED(di->fsm.rx_map_avma));
- vg_assert(VG_IS_PAGE_ALIGNED(di->fsm.rw_map_avma));
+ {
+ Bool has_nonempty_rx = False;
+ Bool has_nonempty_rw = False;
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i);
+ if (map->rx) {
+ if (map->size > 0)
+ has_nonempty_rx = True;
+ } else if (map->rw) {
+ if (map->size > 0)
+ has_nonempty_rw = True;
+ } else
+ continue;
+ /* If this doesn't hold true, it means that m_syswrap/m_aspacemgr
+ managed to do a mapping where the start isn't page aligned.
+ Which sounds pretty bogus to me. */
+ vg_assert(VG_IS_PAGE_ALIGNED(map->avma));
+ }
+ vg_assert(has_nonempty_rx);
+ vg_assert(has_nonempty_rw);
+ }
+
/* ----------------------------------------------------------
At this point, there is very little information in the
DebugInfo. We only know that something that looks like an ELF
- file has been mapped rx-ishly as recorded with the di->*rx_map*
- fields and has also been mapped rw-ishly as recorded with the
- di->*rw_map* fields. First we examine the file's ELF Program
- Header, and, by comparing that against the di->*r{w,x}_map*
+ file has been mapped rx-ishly and rw-ishly as recorded in the
+ di->fsm.maps array items. First we examine the file's ELF
+ Program Header, and, by comparing that against the di->fsm.maps
info, try to figure out the AVMAs for the sections we care
about, that should have been mapped: text, data, sdata, bss,
got, plt, and toc.
@@ -1365,8 +1372,8 @@
oimage = (Addr)NULL;
if (VG_(clo_verbosity) > 1 || VG_(clo_trace_redir))
- VG_(message)(Vg_DebugMsg, "Reading syms from %s (%#lx)\n",
- di->fsm.filename, di->fsm.rx_map_avma );
+ VG_(message)(Vg_DebugMsg, "Reading syms from %s\n",
+ di->fsm.filename );
/* mmap the object image aboard, so that we can read symbols and
line number info out of it. It will be munmapped immediately
@@ -1441,10 +1448,18 @@
phdr_img, phdr_nent, phdr_ent_szB);
TRACE_SYMTAB("shdr: img %p nent %ld ent_szB %ld\n",
shdr_img, shdr_nent, shdr_ent_szB);
- TRACE_SYMTAB("rx_map: avma %#lx size %lu foff %lu\n",
- di->fsm.rx_map_avma, di->fsm.rx_map_size, di->fsm.rx_map_foff);
- TRACE_SYMTAB("rw_map: avma %#lx size %lu foff %lu\n",
- di->fsm.rw_map_avma, di->fsm.rw_map_size, di->fsm.rw_map_foff);
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i);
+ if (map->rx)
+ TRACE_SYMTAB("rx_map: avma %#lx size %lu foff %lu\n",
+ map->avma, map->size, map->foff);
+ }
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i);
+ if (map->rw)
+ TRACE_SYMTAB("rw_map: avma %#lx size %lu foff %lu\n",
+ map->avma, map->size, map->foff);
+ }
if (phdr_nent == 0
|| !contained_within(
@@ -1478,10 +1493,12 @@
TRACE_SYMTAB("shdr: string table at %p\n", shdr_strtab_img );
+ svma_ranges = VG_(newXA)(ML_(dinfo_zalloc), "di.relfdi.1",
+ ML_(dinfo_free), sizeof(RangeAndBias));
+
/* TOPLEVEL */
/* Look through the program header table, and:
- - copy information from suitable PT_LOAD entries into rx[] or
- rw[]
+ - copy information from suitable PT_LOAD entries into svma_ranges
- find (or fake up) the .soname for this object.
*/
TRACE_SYMTAB("\n");
@@ -1496,10 +1513,8 @@
/* Make sure the PT_LOADable entries are in order and
non-overlapping. This in turn means the address ranges
- slurped into rx[] and rw[] are in order and
+ slurped into svma_ranges are in order and
non-overlapping. */
- vg_assert(n_rx >= 0 && n_rx <= N_RX_RW_AREAS);
- vg_assert(n_rw >= 0 && n_rw <= N_RX_RW_AREAS);
if (phdr->p_type == PT_LOAD) {
TRACE_SYMTAB("PT_LOAD[%ld]: p_vaddr %#lx (prev %#lx)\n",
@@ -1516,42 +1531,41 @@
goto out;
}
prev_svma = phdr->p_vaddr;
- if (phdr->p_offset >= di->fsm.rx_map_foff
- && phdr->p_offset < di->fsm.rx_map_foff + di->fsm.rx_map_size
- && phdr->p_offset + phdr->p_filesz
- <= di->fsm.rx_map_foff + di->fsm.rx_map_size
- && (phdr->p_flags & (PF_R | PF_W | PF_X)) == (PF_R | PF_X)) {
- if (n_rx == N_RX_RW_AREAS) {
- ML_(symerr)(di, True,
- "N_RX_RW_AREAS is too low; "
- "increase and recompile.");
- goto out;
+ if (phdr->p_memsz > 0) {
+ Bool loaded = False;
+ for (j = 0; j < VG_(sizeXA)(di->fsm.maps); j++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, j);
+ if ( (map->rx || map->rw)
+ && phdr->p_offset >= map->foff
+ && phdr->p_offset < map->foff + map->size
+ && phdr->p_offset + phdr->p_filesz <= map->foff
+ + map->size) {
+ RangeAndBias item;
+ item.svma_base = phdr->p_vaddr;
+ item.svma_limit = phdr->p_vaddr + phdr->p_memsz;
+ item.bias = map->avma - map->foff
+ + phdr->p_offset - phdr->p_vaddr;
+ if ( map->rw
+ && (phdr->p_flags & (PF_R | PF_W)) == (PF_R | PF_W)) {
+ item.exec = False;
+ VG_(addToXA)(svma_ranges, &item);
+ TRACE_SYMTAB("PT_LOAD[%ld]: acquired as rw\n", i);
+ loaded = True;
+ }
+ if ( map->rx
+ && (phdr->p_flags & (PF_R | PF_X)) == (PF_R | PF_X)) {
+ item.exec = True;
+ VG_(addToXA)(svma_ranges, &item);
+ TRACE_SYMTAB("PT_LOAD[%ld]: acquired as rx\n", i);
+ loaded = True;
+ }
+ }
}
- rx[n_rx].svma_base = phdr->p_vaddr;
- rx[n_rx].svma_limit = phdr->p_vaddr + phdr->p_memsz;
- rx[n_rx].bias = di->fsm.rx_map_avma - di->fsm.rx_map_foff
- + phdr->p_offset - phdr->p_vaddr;
- n_rx++;
- TRACE_SYMTAB("PT_LOAD[%ld]: acquired as rx\n", i);
- }
- else
- if (phdr->p_offset >= di->fsm.rw_map_foff
- && phdr->p_offset < di->fsm.rw_map_foff + di->fsm.rw_map_size
- && phdr->p_offset + phdr->p_filesz
- <= di->fsm.rw_map_foff + di->fsm.rw_map_size
- && (phdr->p_flags & (PF_R | PF_W | PF_X)) == (PF_R | PF_W)) {
- if (n_rw == N_RX_RW_AREAS) {
- ML_(symerr)(di, True,
- "N_RX_RW_AREAS is too low; "
- "increase and recompile.");
+ if (!loaded) {
+ ML_(symerr)(di, False,
+ "ELF section outside all mapped regions");
goto out;
}
- rw[n_rw].svma_base = phdr->p_vaddr;
- rw[n_rw].svma_limit = phdr->p_vaddr + phdr->p_memsz;
- rw[n_rw].bias = di->fsm.rw_map_avma - di->fsm.rw_map_foff
- + phdr->p_offset - phdr->p_vaddr;
- n_rw++;
- TRACE_SYMTAB("PT_LOAD[%ld]: acquired as rw\n", i);
}
}
@@ -1564,7 +1578,6 @@
+ phdr->p_offset);
Word stroff = -1;
UChar* strtab = NULL;
- Word j;
for (j = 0; dyn_img[j].d_tag != DT_NULL; j++) {
switch (dyn_img[j].d_tag) {
case DT_SONAME: {
@@ -1608,34 +1621,37 @@
di->soname = ML_(dinfo_strdup)("di.redi.2", "NONE");
}
- vg_assert(n_rx >= 0 && n_rx <= N_RX_RW_AREAS);
- vg_assert(n_rw >= 0 && n_rw <= N_RX_RW_AREAS);
- for (i = 0; i < n_rx; i++) {
- vg_assert(rx[i].svma_limit != 0);
- }
- for (i = 0; i < n_rw; i++) {
- vg_assert(rw[i].svma_limit != 0);
- }
+ vg_assert(VG_(sizeXA)(svma_ranges) != 0);
/* Now read the section table. */
TRACE_SYMTAB("\n");
TRACE_SYMTAB("------ Examining the section headers ------\n");
- TRACE_SYMTAB("rx: at %#lx are mapped foffsets %ld .. %ld\n",
- di->fsm.rx_map_avma,
- di->fsm.rx_map_foff,
- di->fsm.rx_map_foff + di->fsm.rx_map_size - 1 );
- for (i = 0; i < n_rx; i++) {
- TRACE_SYMTAB("rx[%ld]: contains svmas %#lx .. %#lx with bias %#lx\n",
- i, rx[i].svma_base, rx[i].svma_limit - 1, rx[i].bias );
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i);
+ if (map->rx)
+ TRACE_SYMTAB("rx: at %#lx are mapped foffsets %ld .. %ld\n",
+ map->avma, map->foff, map->foff + map->size - 1 );
}
- TRACE_SYMTAB("rw: at %#lx are mapped foffsets %ld .. %ld\n",
- di->fsm.rw_map_avma,
- di->fsm.rw_map_foff,
- di->fsm.rw_map_foff + di->fsm.rw_map_size - 1 );
- for (i = 0; i < n_rw; i++) {
- TRACE_SYMTAB("rw[%ld]: contains svmas %#lx .. %#lx with bias %#lx\n",
- i, rw[i].svma_base, rw[i].svma_limit - 1, rw[i].bias );
+ TRACE_SYMTAB("rx: contains these svma regions:\n");
+ for (i = 0; i < VG_(sizeXA)(svma_ranges); i++) {
+ RangeAndBias* reg = VG_(indexXA)(svma_ranges, i);
+ if (reg->exec)
+ TRACE_SYMTAB(" svmas %#lx .. %#lx with bias %#lx\n",
+ reg->svma_base, reg->svma_limit - 1, reg->bias );
}
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i);
+ if (map->rw)
+ TRACE_SYMTAB("rw: at %#lx are mapped foffsets %ld .. %ld\n",
+ map->avma, map->foff, map->foff + map->size - 1 );
+ }
+ TRACE_SYMTAB("rw: contains these svma regions:\n");
+ for (i = 0; i < VG_(sizeXA)(svma_ranges); i++) {
+ RangeAndBias* reg = VG_(indexXA)(svma_ranges, i);
+ if (!reg->exec)
+ TRACE_SYMTAB(" svmas %#lx .. %#lx with bias %#lx\n",
+ reg->svma_base, reg->svma_limit - 1, reg->bias );
+ }
/* TOPLEVEL */
/* Iterate over section headers */
@@ -1653,19 +1669,17 @@
leave the relevant pointer at NULL. */
RangeAndBias* inrx = NULL;
RangeAndBias* inrw = NULL;
- { Word j;
- for (j = 0; j < n_rx; j++) {
- if (svma >= rx[j].svma_base && svma < rx[j].svma_limit) {
- inrx = &rx[j];
- break;
- }
- }
- for (j = 0; j < n_rw; j++) {
- if (svma >= rw[j].svma_base && svma < rw[j].svma_limit) {
- inrw = &rw[j];
- break;
- }
- }
+ for (j = 0; j < VG_(sizeXA)(svma_ranges); j++) {
+ RangeAndBias* rng = VG_(indexXA)(svma_ranges, j);
+ if (svma >= rng->svma_base && svma < rng->svma_limit) {
+ if (!inrx && rng->exec) {
+ inrx = rng;
+ } else if (!inrw && !rng->exec) {
+ inrw = rng;
+ }
+ if (inrx && inrw)
+ break;
+ }
}
TRACE_SYMTAB(" [sec %2ld] %s %s al%2u foff %6ld .. %6ld "
@@ -2268,10 +2282,8 @@
UChar* shdr_strtab_dimg = NULL;
/* SVMAs covered by rx and rw segments and corresponding bias. */
- /* Addr rx_dsvma_base = 0; */ /* UNUSED */
Addr rx_dsvma_limit = 0;
PtrdiffT rx_dbias = 0;
- /* Addr rw_dsvma_base = 0; */ /* UNUSED */
Addr rw_dsvma_limit = 0;
PtrdiffT rw_dbias = 0;
@@ -2324,29 +2336,25 @@
= INDEX_BIS( (void*)(dimage + ehdr_dimg->e_phoff),
i, phdr_ent_szB );
if (phdr->p_type == PT_LOAD) {
- if (rx_dsvma_limit == 0
- && phdr->p_offset >= di->fsm.rx_map_foff
- && phdr->p_offset
- < di->fsm.rx_map_foff + di->fsm.rx_map_size
- && phdr->p_offset + phdr->p_filesz
- <= di->fsm.rx_map_foff + di->fsm.rx_map_size) {
- /* rx_dsvma_base = phdr->p_vaddr; */ /* UNUSED */
- rx_dsvma_limit = phdr->p_vaddr + phdr->p_memsz;
- rx_dbias = di->fsm.rx_map_avma - di->fsm.rx_map_foff
- + phdr->p_offset - phdr->p_vaddr;
+ for (j = 0; j < VG_(sizeXA)(di->fsm.maps); j++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, j);
+ if ( phdr->p_offset >= map->foff
+ && phdr->p_offset < map->foff + map->size
+ && phdr->p_offset + phdr->p_filesz < map->foff
+ + map->size) {
+ if (map->rx && rx_dsvma_limit == 0) {
+ rx_dsvma_limit = phdr->p_vaddr + phdr->p_memsz;
+ rx_dbias = map->avma - map->foff + phdr->p_offset
+ - phdr->p_vaddr;
+ }
+ if (map->rw && rw_dsvma_limit == 0) {
+ rw_dsvma_limit = phdr->p_vaddr + phdr->p_memsz;
+ rw_dbias = map->avma - map->foff + phdr->p_offset
+ - phdr->p_vaddr;
+ }
+ break;
+ }
}
- else
- if (rw_dsvma_limit == 0
- && phdr->p_offset >= di->fsm.rw_map_foff
- && phdr->p_offset
- < di->fsm.rw_map_foff + di->fsm.rw_map_size
- && phdr->p_offset + phdr->p_filesz
- <= di->fsm.rw_map_foff + di->fsm.rw_map_size) {
- /* rw_dsvma_base = phdr->p_vaddr; */ /* UNUSED */
- rw_dsvma_limit = phdr->p_vaddr + phdr->p_memsz;
- rw_dbias = di->fsm.rw_map_avma - di->fsm.rw_map_foff
- + phdr->p_offset - phdr->p_vaddr;
- }
}
}
@@ -2562,7 +2570,6 @@
exp-sgcheck.) */
if (0 && (VG_(needs).var_info || VG_(clo_read_var_info))) {
UWord nVars = 0;
- Word j;
if (di->varinfo) {
for (j = 0; j < VG_(sizeXA)(di->varinfo); j++) {
OSet* /* of DiAddrRange */ scope
@@ -2596,6 +2603,10 @@
}
m_res = VG_(am_munmap_valgrind) ( oimage, n_oimage );
vg_assert(!sr_isError(m_res));
+
+ if (svma_ranges)
+ VG_(deleteXA)(svma_ranges);
+
return res;
} /* out: */
Modified: trunk/coregrind/m_debuginfo/storage.c (+30 -30)
===================================================================
--- trunk/coregrind/m_debuginfo/storage.c 2012-07-12 00:06:07 -23:00 (rev 12734)
+++ trunk/coregrind/m_debuginfo/storage.c 2012-07-13 12:24:05 +01:00 (rev 12735)
@@ -385,8 +385,7 @@
See "Comment_Regarding_Text_Range_Checks" elsewhere in this file
for background and rationale. */
vg_assert(di->fsm.have_rx_map && di->fsm.have_rw_map);
- if (next-1 < di->fsm.rx_map_avma
- || this >= di->fsm.rx_map_avma + di->fsm.rx_map_size ) {
+ if (ML_(find_rx_mapping)(di, this, next - 1) == NULL) {
if (0)
VG_(message)(Vg_DebugMsg,
"warning: ignoring line info entry falling "
@@ -436,6 +435,8 @@
UInt new_sz, i;
DiCfSI* new_tab;
SSizeT delta;
+ struct _DebugInfoMapping* map;
+ struct _DebugInfoMapping* map2;
/* copy the original, so we can mess with it */
DiCfSI cfsi = *cfsi_orig;
@@ -456,27 +457,30 @@
vg_assert(cfsi.len < 5000000);
vg_assert(di->fsm.have_rx_map && di->fsm.have_rw_map);
- /* If we have an empty r-x mapping (is that possible?) then the
- DiCfSI can't possibly fall inside it. In which case skip. */
- if (di->fsm.rx_map_size == 0)
- return;
+ /* Find mapping where at least one end of the CFSI falls into. */
+ map = ML_(find_rx_mapping)(di, cfsi.base, cfsi.base);
+ map2 = ML_(find_rx_mapping)(di, cfsi.base + cfsi.len - 1,
+ cfsi.base + cfsi.len - 1);
+ if (map == NULL)
+ map = map2;
+ else if (map2 == NULL)
+ map2 = map;
- /* Rule out ones which are completely outside the r-x mapped area.
+ /* Rule out ones which are completely outside the r-x mapped area
+ (or which span across different areas).
See "Comment_Regarding_Text_Range_Checks" elsewhere in this file
for background and rationale. */
- if (cfsi.base + cfsi.len - 1 < di->fsm.rx_map_avma
- || cfsi.base >= di->fsm.rx_map_avma + di->fsm.rx_map_size) {
+ if (map == NULL || map != map2) {
static Int complaints = 10;
if (VG_(clo_trace_cfi) || complaints > 0) {
complaints--;
if (VG_(clo_verbosity) > 1) {
VG_(message)(
Vg_DebugMsg,
- "warning: DiCfSI %#lx .. %#lx outside segment %#lx .. %#lx\n",
+ "warning: DiCfSI %#lx .. %#lx outside mapped rw segments (%s)\n",
cfsi.base,
cfsi.base + cfsi.len - 1,
- di->text_avma,
- di->text_avma + di->text_size - 1
+ di->soname
);
}
if (VG_(clo_trace_cfi))
@@ -493,27 +497,27 @@
will fail. See
"Comment_on_IMPORTANT_CFSI_REPRESENTATIONAL_INVARIANTS" in
priv_storage.h for background. */
- if (cfsi.base < di->fsm.rx_map_avma) {
+ if (cfsi.base < map->avma) {
/* Lower end is outside the mapped area. Hence upper end must
be inside it. */
if (0) VG_(printf)("XXX truncate lower\n");
- vg_assert(cfsi.base + cfsi.len - 1 >= di->fsm.rx_map_avma);
- delta = (SSizeT)(di->fsm.rx_map_avma - cfsi.base);
+ vg_assert(cfsi.base + cfsi.len - 1 >= map->avma);
+ delta = (SSizeT)(map->avma - cfsi.base);
vg_assert(delta > 0);
vg_assert(delta < (SSizeT)cfsi.len);
cfsi.base += delta;
cfsi.len -= delta;
}
else
- if (cfsi.base + cfsi.len - 1 > di->fsm.rx_map_avma
- + di->fsm.rx_map_size - 1) {
+ if (cfsi.base + cfsi.len - 1 > map->avma + map->size - 1) {
/* Upper end is outside the mapped area. Hence lower end must be
inside it. */
if (0) VG_(printf)("XXX truncate upper\n");
- vg_assert(cfsi.base <= di->fsm.rx_map_avma + di->fsm.rx_map_size - 1);
+ vg_assert(cfsi.base <= map->avma + map->size - 1);
delta = (SSizeT)( (cfsi.base + cfsi.len - 1)
- - (di->fsm.rx_map_avma + di->fsm.rx_map_size - 1) );
- vg_assert(delta > 0); vg_assert(delta < (SSizeT)cfsi.len);
+ - (map->avma + map->size - 1) );
+ vg_assert(delta > 0);
+ vg_assert(delta < (SSizeT)cfsi.len);
cfsi.len -= delta;
}
@@ -526,9 +530,9 @@
vg_assert(cfsi.len > 0);
/* Similar logic applies for the next two assertions. */
- vg_assert(cfsi.base >= di->fsm.rx_map_avma);
+ vg_assert(cfsi.base >= map->avma);
vg_assert(cfsi.base + cfsi.len - 1
- <= di->fsm.rx_map_avma + di->fsm.rx_map_size - 1);
+ <= map->avma + map->size - 1);
if (di->cfsi_used == di->cfsi_size) {
new_sz = 2 * di->cfsi_size;
@@ -918,16 +922,12 @@
and it is re-checked at the start of
ML_(read_elf_debug_info). */
vg_assert(di->fsm.have_rx_map && di->fsm.have_rw_map);
- if (level > 0
- && (aMax < di->fsm.rx_map_avma
- || aMin >= di->fsm.rx_map_avma + di->fsm.rx_map_size)) {
+ if (level > 0 && ML_(find_rx_mapping)(di, aMin, aMax) == NULL) {
if (VG_(clo_verbosity) >= 0) {
VG_(message)(Vg_DebugMsg,
"warning: addVar: in range %#lx .. %#lx outside "
- "segment %#lx .. %#lx (%s)\n",
- aMin, aMax,
- di->text_avma, di->text_avma + di->text_size -1,
- name
+ "all rx mapped areas (%s)\n",
+ aMin, aMax, name
);
}
return;
@@ -1858,7 +1858,7 @@
Word ML_(search_one_fpotab) ( struct _DebugInfo* di, Addr ptr )
{
- Addr const addr = ptr - di->fsm.rx_map_avma;
+ Addr const addr = ptr - di->text_avma;
Addr a_mid_lo, a_mid_hi;
Word mid, size,
lo = 0,
Modified: trunk/coregrind/m_debuginfo/readmacho.c (+23 -7)
===================================================================
--- trunk/coregrind/m_debuginfo/readmacho.c 2012-07-12 00:06:07 -23:00 (rev 12734)
+++ trunk/coregrind/m_debuginfo/readmacho.c 2012-07-13 12:24:05 +01:00 (rev 12735)
@@ -676,19 +676,35 @@
ImageInfo ii; /* main file */
ImageInfo iid; /* auxiliary .dSYM file */
Bool ok;
+ Word i;
+ struct _DebugInfoMapping* rx_map = NULL;
+ struct _DebugInfoMapping* rw_map = NULL;
/* mmap the object file to look for di->soname and di->text_bias
and uuid and nlist and STABS */
- if (VG_(clo_verbosity) > 1)
- VG_(message)(Vg_DebugMsg,
- "%s (%#lx)\n", di->fsm.filename, di->fsm.rx_map_avma );
-
/* This should be ensured by our caller (that we're in the accept
state). */
vg_assert(di->fsm.have_rx_map);
vg_assert(di->fsm.have_rw_map);
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i);
+ if (map->rx && !rx_map)
+ rx_map = map;
+ if (map->rw && !rw_map)
+ rw_map = map;
+ if (rx_map && rw_map)
+ break;
+ }
+ vg_assert(rx_map);
+ vg_assert(rw_map);
+
+ if (VG_(clo_verbosity) > 1)
+ VG_(message)(Vg_DebugMsg,
+ "%s (rx at %#lx, rw at %#lx)\n", di->fsm.filename,
+ rx_map->avma, rw_map->avma );
+
VG_(memset)(&ii, 0, sizeof(ii));
VG_(memset)(&iid, 0, sizeof(iid));
VG_(memset)(&uuid, 0, sizeof(uuid));
@@ -779,7 +795,7 @@
&& seg->fileoff == 0 && seg->filesize != 0) {
di->text_present = True;
di->text_svma = (Addr)seg->vmaddr;
- di->text_avma = di->fsm.rx_map_avma;
+ di->text_avma = rx_map->avma;
di->text_size = seg->vmsize;
di->text_bias = di->text_avma - di->text_svma;
/* Make the _debug_ values be the same as the
@@ -796,7 +812,7 @@
/* && DDD:seg->fileoff == 0 */ && seg->filesize != 0) {
di->data_present = True;
di->data_svma = (Addr)seg->vmaddr;
- di->data_avma = di->fsm.rw_map_avma;
+ di->data_avma = rw_map->avma;
di->data_size = seg->vmsize;
di->data_bias = di->data_avma - di->data_svma;
di->data_debug_svma = di->data_svma;
@@ -829,7 +845,7 @@
struct NLIST *syms;
UChar *strs;
XArray* /* DiSym */ candSyms = NULL;
- Word i, nCandSyms;
+ Word nCandSyms;
if (ii.macho_img_szB < symcmd->stroff + symcmd->strsize
|| ii.macho_img_szB < symcmd->symoff + symcmd->nsyms
Modified: trunk/coregrind/m_debuginfo/priv_storage.h (+32 -32)
===================================================================
--- trunk/coregrind/m_debuginfo/priv_storage.h 2012-07-12 00:06:07 -23:00 (rev 12734)
+++ trunk/coregrind/m_debuginfo/priv_storage.h 2012-07-13 12:24:05 +01:00 (rev 12735)
@@ -421,13 +421,9 @@
true. The initial state is one in which we have no observations,
so have_rx_map and have_rw_map are both false.
- This is all rather ad-hoc; for example it has no way to record more
- than one rw or rx mapping for a given object, not because such
- events have never been observed, but because we've never needed to
- note more than the first one of any such in order when to decide to
- read debug info. It may be that in future we need to track more
- state in order to make the decision, so this struct would then get
- expanded.
+ This all started as a rather ad-hoc solution, but was further
+ expanded to handle weird object layouts, e.g. more than one rw
+ or rx mapping for one binary.
The normal sequence of events is one of
@@ -444,28 +440,22 @@
where the upgrade is done by a call to vm_protect. Hence we
need to also track this possibility.
*/
+
+struct _DebugInfoMapping
+{
+ Addr avma; /* these fields record the file offset, length */
+ SizeT size; /* and map address of each mapping */
+ OffT foff;
+ Bool rx, rw, ro; /* memory access flags for this mapping */
+};
+
struct _DebugInfoFSM
{
- /* --- all targets --- */
- UChar* filename; /* in mallocville (VG_AR_DINFO) */
-
+ UChar* filename; /* in mallocville (VG_AR_DINFO) */
+ XArray* maps; /* XArray of _DebugInfoMapping structs */
Bool have_rx_map; /* did we see a r?x mapping yet for the file? */
Bool have_rw_map; /* did we see a rw? mapping yet for the file? */
-
- Addr rx_map_avma; /* these fields record the file offset, length */
- SizeT rx_map_size; /* and map address of the r?x mapping we believe */
- OffT rx_map_foff; /* is the .text segment mapping */
-
- Addr rw_map_avma; /* ditto, for the rw? mapping we believe is the */
- SizeT rw_map_size; /* .data segment mapping */
- OffT rw_map_foff;
-
- /* --- OSX 10.7, 32-bit only --- */
Bool have_ro_map; /* did we see a r-- mapping yet for the file? */
-
- Addr ro_map_avma; /* file offset, length, avma for said mapping */
- SizeT ro_map_size;
- OffT ro_map_foff;
};
@@ -545,17 +535,17 @@
Comment_on_IMPORTANT_CFSI_REPRESENTATIONAL_INVARIANTS: we require that
- either (rx_map_size == 0 && cfsi == NULL) (the degenerate case)
+ either (size of all rx maps == 0 && cfsi == NULL) (the degenerate case)
or the normal case, which is the AND of the following:
- (0) rx_map_size > 0
- (1) no two DebugInfos with rx_map_size > 0
- have overlapping [rx_map_avma,+rx_map_size)
- (2) [cfsi_minavma,cfsi_maxavma] does not extend
- beyond [rx_map_avma,+rx_map_size); that is, the former is a
- subrange or equal to the latter.
+ (0) size of at least one rx mapping > 0
+ (1) no two DebugInfos with some rx mapping of size > 0
+ have overlapping rx mappings
+ (2) [cfsi_minavma,cfsi_maxavma] does not extend beyond
+ [avma,+size) of one rx mapping; that is, the former
+ is a subrange or equal to the latter.
(3) all DiCfSI in the cfsi array all have ranges that fall within
- [rx_map_avma,+rx_map_size).
+ [avma,+size) of that rx mapping.
(4) all DiCfSI in the cfsi array are non-overlapping
The cumulative effect of these restrictions is to ensure that
@@ -808,6 +798,11 @@
/* An array of guarded DWARF3 expressions. */
XArray* admin_gexprs;
+
+ /* Cached last rx mapping matched and returned by ML_(find_rx_mapping).
+ This helps performance a lot during ML_(addLineInfo) etc., which can
+ easily be invoked hundreds of thousands of times. */
+ struct _DebugInfoMapping* last_rx_map;
};
/* --------------------- functions --------------------- */
@@ -876,6 +871,11 @@
if not found. Binary search. */
extern Word ML_(search_one_fpotab) ( struct _DebugInfo* di, Addr ptr );
+/* Helper function for the most often needed searching for an rx mapping
+ containing the specified address range. */
+extern struct _DebugInfoMapping* ML_(find_rx_mapping) ( struct _DebugInfo* di,
+ Addr lo, Addr hi );
+
/* ------ Misc ------ */
/* Show a non-fatal debug info reading error. Use vg_panic if
Modified: trunk/coregrind/m_debuginfo/readpdb.c (+44 -50)
===================================================================
--- trunk/coregrind/m_debuginfo/readpdb.c 2012-07-12 00:06:07 -23:00 (rev 12734)
+++ trunk/coregrind/m_debuginfo/readpdb.c 2012-07-13 12:24:05 +01:00 (rev 12735)
@@ -86,8 +86,8 @@
doesn't make much sense. Here, we use text_bias as empirically
producing the most ranges that fall inside the text segments for a
multi-dll program. Of course, it could still be nonsense :-) */
-#define BIAS_FOR_SYMBOLS (di->fsm.rx_map_avma)
-#define BIAS_FOR_LINETAB (di->fsm.rx_map_avma)
+#define BIAS_FOR_SYMBOLS (di->text_avma)
+#define BIAS_FOR_LINETAB (di->text_avma)
#define BIAS_FOR_LINETAB2 (di->text_bias)
#define BIAS_FOR_FPO (di->text_bias)
/* Using di->text_bias for the FPOs causes 981 in range and 1 out of
@@ -2259,8 +2259,6 @@
+ OFFSET_OF(IMAGE_NT_HEADERS, OptionalHeader)
+ ntheaders_avma->FileHeader.SizeOfOptionalHeader;
- di->fsm.rx_map_avma = (Addr)obj_avma;
-
/* Iterate over PE(?) headers. Try to establish the text_bias,
that's all we really care about. */
for ( i = 0;
@@ -2283,6 +2281,12 @@
VG_(message)(Vg_DebugMsg,
" ::: mapped_avma is %#lx\n", mapped_avma);
+ struct _DebugInfoMapping map;
+ map.avma = mapped_avma;
+ map.size = pe_sechdr_avma->Misc.VirtualSize;
+ map.foff = pe_sechdr_avma->PointerToRawData;
+ map.ro = False;
+
if (pe_sechdr_avma->Characteristics & IMAGE_SCN_CNT_CODE) {
/* Ignore uninitialised code sections - if you have
incremental linking enabled in Visual Studio then you will
@@ -2290,60 +2294,44 @@
the real text section and valgrind will compute the wrong
avma value and hence the wrong bias. */
if (!(pe_sechdr_avma->Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA)) {
+ map.rx = True;
+ map.rw = False;
+ VG_(addToXA)(di->fsm.maps, &map);
di->fsm.have_rx_map = True;
- if (di->fsm.rx_map_avma == 0) {
- di->fsm.rx_map_avma = mapped_avma;
- }
- if (di->fsm.rx_map_size==0) {
- di->fsm.rx_map_foff = pe_sechdr_avma->PointerToRawData;
- }
+
di->text_present = True;
- if (di->text_avma==0) {
+ if (di->text_avma == 0) {
+ di->text_svma = pe_sechdr_avma->VirtualAddress;
di->text_avma = mapped_avma;
+ di->text_size = pe_sechdr_avma->Misc.VirtualSize;
+ } else {
+ di->text_size = mapped_end_avma - di->text_avma;
}
- di->text_size += pe_sechdr_avma->Misc.VirtualSize;
- di->fsm.rx_map_size += pe_sechdr_avma->Misc.VirtualSize;
}
}
else if (pe_sechdr_avma->Characteristics
& IMAGE_SCN_CNT_INITIALIZED_DATA) {
+ map.rx = False;
+ map.rw = True;
+ VG_(addToXA)(di->fsm.maps, &map);
di->fsm.have_rw_map = True;
- if (di->fsm.rw_map_avma == 0) {
- di->fsm.rw_map_avma = mapped_avma;
- }
- if (di->fsm.rw_map_size==0) {
- di->fsm.rw_map_foff = pe_sechdr_avma->PointerToRawData;
- }
+
di->data_present = True;
- if (di->data_avma==0) {
+ if (di->data_avma == 0) {
di->data_avma = mapped_avma;
+ di->data_size = pe_sechdr_avma->Misc.VirtualSize;
+ } else {
+ di->data_size = mapped_end_avma - di->data_avma;
}
- di->fsm.rw_map_size += pe_sechdr_avma->Misc.VirtualSize;
- di->data_size += pe_sechdr_avma->Misc.VirtualSize;
}
else if (pe_sechdr_avma->Characteristics
& IMAGE_SCN_CNT_UNINITIALIZED_DATA) {
di->bss_present = True;
- di->bss_avma = mapped_avma;
- di->bss_size = pe_sechdr_avma->Misc.VirtualSize;
- }
-
- mapped_avma = VG_PGROUNDDN(mapped_avma);
- mapped_end_avma = VG_PGROUNDUP(mapped_end_avma);
-
- /* Urr. These tests are bogus; ->fsm.rx_map_avma is not necessarily
- the start of the text section. */
- if ((1 /*VG_(needs).data_syms*/
- || (pe_sechdr_avma->Characteristics & IMAGE_SCN_CNT_CODE))
- && mapped_avma >= di->fsm.rx_map_avma
- && mapped_avma <= (di->fsm.rx_map_avma+di->text_size)
- && mapped_end_avma > (di->fsm.rx_map_avma+di->text_size)) {
- UInt newsz = mapped_end_avma - di->fsm.rx_map_avma;
- if (newsz > di->text_size) {
- /* extending the mapping is always needed for PE files
- under WINE */
- di->text_size = newsz;
- di->fsm.rx_map_size = newsz;
+ if (di->bss_avma == 0) {
+ di->bss_avma = mapped_avma;
+ di->bss_size = pe_sechdr_avma->Misc.VirtualSize;
+ } else {
+ di->bss_size = mapped_end_avma - di->bss_avma;
}
}
}
@@ -2364,14 +2352,20 @@
}
if (VG_(clo_verbosity) > 1) {
- VG_(message)(Vg_DebugMsg,
- "rx_map: avma %#lx size %7lu foff %llu\n",
- di->fsm.rx_map_avma, di->fsm.rx_map_size,
- (Off64T)di->fsm.rx_map_foff);
- VG_(message)(Vg_DebugMsg,
- "rw_map: avma %#lx size %7lu foff %llu\n",
- di->fsm.rw_map_avma, di->fsm.rw_map_size,
- (Off64T)di->fsm.rw_map_foff);
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i);
+ if (map->rx)
+ VG_(message)(Vg_DebugMsg,
+ "rx_map: avma %#lx size %7lu foff %llu\n",
+ map->avma, map->size, (Off64T)map->foff);
+ }
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i);
+ if (map->rw)
+ VG_(message)(Vg_DebugMsg,
+ "rw_map: avma %#lx size %7lu foff %llu\n",
+ map->avma, map->size, (Off64T)map->foff);
+ }
VG_(message)(Vg_DebugMsg,
" text: avma %#lx svma %#lx size %7lu bias %#lx\n",
Modified: trunk/coregrind/m_debuginfo/debuginfo.c (+137 -107)
===================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c 2012-07-12 00:06:07 -23:00 (rev 12734)
+++ trunk/coregrind/m_debuginfo/debuginfo.c 2012-07-13 12:24:05 +01:00 (rev 12735)
@@ -178,6 +178,9 @@
di = ML_(dinfo_zalloc)("di.debuginfo.aDI.1", sizeof(DebugInfo));
di->handle = handle_counter++;
di->fsm.filename = ML_(dinfo_strdup)("di.debuginfo.aDI.2", filename);
+ di->fsm.maps = VG_(newXA)(
+ ML_(dinfo_zalloc), "di.debuginfo.aDI.3",
+ ML_(dinfo_free), sizeof(struct _DebugInfoMapping));
/* Everything else -- pointers, sizes, arrays -- is zeroed by
ML_(dinfo_zalloc). Now set up the debugging-output flags. */
@@ -204,6 +207,7 @@
GExpr* gexpr;
vg_assert(di != NULL);
+ if (di->fsm.maps) VG_(deleteXA)(di->fsm.maps);
if (di->fsm.filename) ML_(dinfo_free)(di->fsm.filename);
if (di->soname) ML_(dinfo_free)(di->soname);
if (di->loctab) ML_(dinfo_free)(di->loctab);
@@ -385,33 +389,21 @@
}
-/* Do the basic rx_ and rw_ mappings of the two DebugInfos overlap in
- any way? */
+/* Do the basic mappings of the two DebugInfos overlap in any way? */
static Bool do_DebugInfos_overlap ( DebugInfo* di1, DebugInfo* di2 )
{
+ Word i, j;
vg_assert(di1);
vg_assert(di2);
+ for (i = 0; i < VG_(sizeXA)(di1->fsm.maps); i++) {
+ struct _DebugInfoMapping* map1 = VG_(indexXA)(di1->fsm.maps, i);
+ for (j = 0; j < VG_(sizeXA)(di2->fsm.maps); j++) {
+ struct _DebugInfoMapping* map2 = VG_(indexXA)(di2->fsm.maps, j);
+ if (ranges_overlap(map1->avma, map1->size, map2->avma, map2->size))
+ return True;
+ }
+ }
- if (di1->fsm.have_rx_map && di2->fsm.have_rx_map
- && ranges_overlap(di1->fsm.rx_map_avma, di1->fsm.rx_map_size,
- di2->fsm.rx_map_avma, di2->fsm.rx_map_size))
- return True;
-
- if (di1->fsm.have_rx_map && di2->fsm.have_rw_map
- && ranges_overlap(di1->fsm.rx_map_avma, di1->fsm.rx_map_size,
- di2->fsm.rw_map_avma, di2->fsm.rw_map_size))
- return True;
-
- if (di1->fsm.have_rw_map && di2->fsm.have_rx_map
- && ranges_overlap(di1->fsm.rw_map_avma, di1->fsm.rw_map_size,
- di2->fsm.rx_map_avma, di2->fsm.rx_map_size))
- return True;
-
- if (di1->fsm.have_rw_map && di2->fsm.have_rw_map
- && ranges_overlap(di1->fsm.rw_map_avma, di1->fsm.rw_map_size,
- di2->fsm.rw_map_avma, di2->fsm.rw_map_size))
- return True;
-
return False;
}
@@ -441,8 +433,7 @@
/* Discard any elements of debugInfo_list which overlap with diRef.
- Clearly diRef must have its rx_ and rw_ mapping information set to
- something sane. */
+ Clearly diRef must have its mapping information set to something sane. */
static void discard_DebugInfos_which_overlap_with ( DebugInfo* diRef )
{
DebugInfo* di;
@@ -490,41 +481,67 @@
static void check_CFSI_related_invariants ( DebugInfo* di )
{
DebugInfo* di2 = NULL;
+ Bool has_nonempty_rx = False;
+ Bool cfsi_fits = False;
+ Word i, j;
vg_assert(di);
/* This fn isn't called until after debuginfo for this object has
been successfully read. And that shouldn't happen until we have
both a r-x and rw- mapping for the object. Hence: */
vg_assert(di->fsm.have_rx_map);
vg_assert(di->fsm.have_rw_map);
- /* degenerate case: r-x section is empty */
- if (di->fsm.rx_map_size == 0) {
- vg_assert(di->cfsi == NULL);
- return;
- }
- /* normal case: r-x section is nonempty */
- /* invariant (0) */
- vg_assert(di->fsm.rx_map_size > 0);
- /* invariant (1) */
- for (di2 = debugInfo_list; di2; di2 = di2->next) {
- if (di2 == di)
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i);
+ /* We are interested in r-x mappings only */
+ if (!map->rx)
continue;
- if (di2->fsm.rx_map_size == 0)
+
+ /* degenerate case: r-x section is empty */
+ if (map->size == 0)
continue;
- vg_assert(
- di->fsm.rx_map_avma + di->fsm.rx_map_size <= di2->fsm.rx_map_avma
- || di2->fsm.rx_map_avma + di2->fsm.rx_map_size <= di->fsm.rx_map_avma
- );
+ has_nonempty_rx = True;
+
+ /* normal case: r-x section is nonempty */
+ /* invariant (0) */
+ vg_assert(map->size > 0);
+
+ /* invariant (1) */
+ for (di2 = debugInfo_list; di2; di2 = di2->next) {
+ if (di2 == di)
+ continue;
+ for (j = 0; j < VG_(sizeXA)(di2->fsm.maps); j++) {
+ struct _DebugInfoMapping* map2 = VG_(indexXA)(di2->fsm.maps, j);
+ if (!map2->rx || map2->size == 0)
+ continue;
+ vg_assert(!ranges_overlap(map->avma, map->size,
+ map2->avma, map2->size));
+ }
+ }
+ di2 = NULL;
+
+ /* invariant (2) */
+ if (di->cfsi) {
+ vg_assert(di->cfsi_minavma <= di->cfsi_maxavma); /* duh! */
+ /* Assume the csfi fits completely into one individual mapping
+ for now. This might need to be improved/reworked later. */
+ if (di->cfsi_minavma >= map->avma &&
+ di->cfsi_maxavma < map->avma + map->size)
+ cfsi_fits = True;
+ }
}
- di2 = NULL;
- /* invariant (2) */
- if (di->cfsi) {
- vg_assert(di->cfsi_minavma <= di->cfsi_maxavma); /* duh! */
- vg_assert(di->cfsi_minavma >= di->fsm.rx_map_avma);
- vg_assert(di->cfsi_maxavma < di->fsm.rx_map_avma + di->fsm.rx_map_size);
+
+ /* degenerate case: all r-x sections are empty */
+ if (!has_nonempty_rx) {
+ vg_assert(di->cfsi == NULL);
+ return;
}
+
+ /* invariant (2) - cont. */
+ if (di->cfsi)
+ vg_assert(cfsi_fits);
+
/* invariants (3) and (4) */
if (di->cfsi) {
- Word i;
vg_assert(di->cfsi_used > 0);
vg_assert(di->cfsi_size > 0);
for (i = 0; i < di->cfsi_used; i++) {
@@ -601,9 +618,9 @@
TRACE_SYMTAB("\n");
/* We're going to read symbols and debug info for the avma
- ranges [rx_map_avma, +rx_map_size) and [rw_map_avma,
- +rw_map_size). First get rid of any other DebugInfos which
- overlap either of those ranges (to avoid total confusion). */
+ ranges specified in the _DebugInfoFsm mapping array. First
+ get rid of any other DebugInfos which overlap any of those
+ ranges (to avoid total confusion). */
discard_DebugInfos_which_overlap_with( di );
/* .. and acquire new info. */
@@ -874,42 +891,21 @@
di = find_or_create_DebugInfo_for( filename );
vg_assert(di);
- if (is_rx_map) {
- /* We have a text-like mapping. Note the details. */
- if (!di->fsm.have_rx_map) {
- di->fsm.have_rx_map = True;
- di->fsm.rx_map_avma = a;
- di->fsm.rx_map_size = seg->end + 1 - seg->start;
- di->fsm.rx_map_foff = seg->offset;
- } else {
- /* FIXME: complain about a second text-like mapping */
- }
- }
+ /* Note the details about the mapping. */
+ struct _DebugInfoMapping map;
+ map.avma = a;
+ map.size = seg->end + 1 - seg->start;
+ map.foff = seg->offset;
+ map.rx = is_rx_map;
+ map.rw = is_rw_map;
+ map.ro = is_ro_map;
+ VG_(addToXA)(di->fsm.maps, &map);
- if (is_rw_map) {
- /* We have a data-like mapping. Note the details. */
- if (!di->fsm.have_rw_map) {
- di->fsm.have_rw_map = True;
- di->fsm.rw_map_avma = a;
- di->fsm.rw_map_size = seg->end + 1 - seg->start;
- di->fsm.rw_map_foff = seg->offset;
- } else {
- /* FIXME: complain about a second data-like mapping */
- }
- }
+ /* Update flags about what kind of mappings we've already seen. */
+ di->fsm.have_rx_map |= is_rx_map;
+ di->fsm.have_rw_map |= is_rw_map;
+ di->fsm.have_ro_map |= is_ro_map;
- if (is_ro_map) {
- /* We have a r-- mapping. Note the details (OSX 10.7, 32-bit only) */
- if (!di->fsm.have_ro_map) {
- di->fsm.have_ro_map = True;
- di->fsm.ro_map_avma = a;
- di->fsm.ro_map_size = seg->end + 1 - seg->start;
- di->fsm.ro_map_foff = seg->offset;
- } else {
- /* FIXME: complain about a second r-- mapping */
- }
- }
-
/* So, finally, are we in an accept state? */
if (di->fsm.have_rx_map && di->fsm.have_rw_map && !di->have_dinfo) {
/* Ok, so, finally, we found what we need, and we haven't
@@ -977,6 +973,8 @@
is found, conclude we're in an accept state and read debuginfo
accordingly. */
DebugInfo* di;
+ struct _DebugInfoMapping *map = NULL;
+ Word i;
for (di = debugInfo_list; di; di = di->next) {
vg_assert(di->fsm.filename);
if (di->have_dinfo)
@@ -987,36 +985,45 @@
continue; /* rx- mapping already exists */
if (!di->fsm.have_rw_map)
continue; /* need to have a rw- mapping */
- if (di->fsm.ro_map_avma != a || di->fsm.ro_map_size != len)
- continue; /* this isn't an upgrade of the r-- mapping */
+ /* Try to find a mapping matching the memory area. */
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ map = (struct _DebugInfoMapping*)VG_(indexXA)(di->fsm.maps, i);
+ if (map->ro && map->avma == a && map->size == len)
+ break;
+ map = NULL;
+ }
+ if (!map)
+ continue; /* this isn't an upgrade of an r-- mapping */
/* looks like we're in luck! */
break;
}
if (di == NULL)
return; /* didn't find anything */
- /* Do the upgrade. Copy the RO map info into the RX map info and
- pretend we never saw the RO map at all. */
- vg_assert(di->fsm.have_rw_map);
+ /* Do the upgrade. Simply update the flags of the mapping
+ and pretend we never saw the RO map at all. */
vg_assert(di->fsm.have_ro_map);
- vg_assert(!di->fsm.have_rx_map);
-
+ map->rx = True;
+ map->ro = False;
di->fsm.have_rx_map = True;
- di->fsm.rx_map_avma = di->fsm.ro_map_avma;
- di->fsm.rx_map_size = di->fsm.ro_map_size;
- di->fsm.rx_map_foff = di->fsm.ro_map_foff;
-
di->fsm.have_ro_map = False;
- di->fsm.ro_map_avma = 0;
- di->fsm.ro_map_size = 0;
- di->fsm.ro_map_foff = 0;
+ /* See if there are any more ro mappings */
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ map = (struct _DebugInfoMapping*)VG_(indexXA)(di->fsm.maps, i);
+ if (map->ro) {
+ di->fsm.have_ro_map = True;
+ break;
+ }
+ }
- /* And since we're now in an accept state, read debuginfo. Finally. */
- ULong di_handle __attribute__((unused))
- = di_notify_ACHIEVE_ACCEPT_STATE( di );
- /* di_handle is ignored. That's not a problem per se -- it just
- means nobody will ever be able to refer to this debuginfo by
- handle since nobody will know what the handle value is. */
+ /* Check if we're now in an accept state and read debuginfo. Finally. */
+ if (di->fsm.have_rx_map && di->fsm.have_rw_map && !di->have_dinfo) {
+ ULong di_handle __attribute__((unused))
+ = di_notify_ACHIEVE_ACCEPT_STATE( di );
+ /* di_handle is ignored. That's not a problem per se -- it just
+ means nobody will ever be able to refer to this debuginfo by
+ handle since nobody will know what the handle value is. */
+ }
}
@@ -1273,6 +1280,31 @@
}
+struct _DebugInfoMapping* ML_(find_rx_mapping) ( struct _DebugInfo* di,
+ Addr lo, Addr hi )
+{
+ Word i;
+ vg_assert(lo <= hi);
+
+ /* Optimization: Try to use the last matched rx mapping first */
+ if ( di->last_rx_map
+ && lo >= di->last_rx_map->avma
+ && hi < di->last_rx_map->avma + di->last_rx_map->size)
+ return di->last_rx_map;
+
+ for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) {
+ struct _DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i);
+ if ( map->rx && map->size > 0
+ && lo >= map->avma && hi < map->avma + map->size) {
+ di->last_rx_map = map;
+ return map;
+ }
+ }
+
+ return NULL;
+}
+
+
/*------------------------------------------------------------*/
/*--- Use of symbol table & location info to create ---*/
/*--- plausible-looking stack dumps. ---*/
@@ -1300,9 +1332,7 @@
See Comment_Regarding_Text_Range_Checks in storage.c for
details. */
inRange = di->fsm.have_rx_map
- && di->fsm.rx_map_size > 0
- && di->fsm.rx_map_avma <= ptr
- && ptr < di->fsm.rx_map_avma + di->fsm.rx_map_size;
+ && (ML_(find_rx_mapping)(di, ptr, ptr) != NULL);
} else {
inRange = (di->data_present
&& di->data_size > 0
|
|
From: Julian S. <js...@ac...> - 2012-07-13 09:38:49
|
On Friday, July 13, 2012, Florian Krohm wrote: > I did some measurements with a modified patch that incorporates all your > suggested changes. Runtime is unchanged. > Instruction measurements show no significant detriment: > > trunk unmodified > bz2 transtab: new 3,698 (99,519 -> 1,566,490; ratio 157:10) > fbench transtab: new 2,336 (55,102 -> 877,541; ratio 159:10) > ffbench transtab: new 2,115 (51,832 -> 828,083; ratio 159:10) > heap transtab: new 1,846 (40,908 -> 663,257; ratio 162:10) > tinycc transtab: new 4,662 (119,656 -> 1,926,502; ratio 161:10) > > trunk with patches > bz2 transtab: new 3,698 (99,519 -> 1,566,490; ratio 157:10) > fbench transtab: new 2,336 (55,102 -> 877,534; ratio 159:10) > ffbench transtab: new 2,115 (51,832 -> 828,090; ratio 159:10) > heap transtab: new 1,846 (40,903 -> 663,264; ratio 162:10) > tinycc transtab: new 4,662 (119,646 -> 1,926,509; ratio 161:10) > > Virtually identical insn counts. Thanks for the numbers. I am surprised they are different at all considering that IIUC, the instrumentation IR you are generating on all non-s390 platforms should be unchanged. > > I don't think that iropt can remove "PUT(offs) = GET(offs)". Not 100% > > sure it can't though. Doesn't affect correctness. > > Throwing those out should be allowed for those guests offsets that do > not require precise memory exceptions. I did not check whether > redundant_put_removal actually throws them out. redundant_put_removal does a different transformation. It does PUT(offs) = e1 # no intervening GET of offs PUT(offs) = e2 ==> # no intervening GET of offs PUT(offs) = e2 which is a very common idiom in the initial IR, when the independent translations of each instruction are concatenated (as they are). So it won't remove the PUT(offs) = GET(offs) as that doesn't fit this pattern. Maybe doesn't matter; I imagine this will happen only very rarely. > I have an updated patch which I will post when s390 passes. There is > currently one testcase that is failing and I need to find out why. Could > be some latent bug that is exposed by these changes. Good. J |
|
From: Florian K. <br...@ac...> - 2012-07-13 03:23:43
|
Thanks for looking over the patches..
On 07/10/2012 11:45 AM, Julian Seward wrote:
>
> It'd be reassuring to test some completely deterministic app on x86-64
> (eg, perf/bz2.c compiled -O2) to check that the quantity of JIT generated
> code is unchanged.
>
I did some measurements with a modified patch that incorporates all your
suggested changes. Runtime is unchanged.
Instruction measurements show no significant detriment:
trunk unmodified
bz2 transtab: new 3,698 (99,519 -> 1,566,490; ratio 157:10)
fbench transtab: new 2,336 (55,102 -> 877,541; ratio 159:10)
ffbench transtab: new 2,115 (51,832 -> 828,083; ratio 159:10)
heap transtab: new 1,846 (40,908 -> 663,257; ratio 162:10)
tinycc transtab: new 4,662 (119,656 -> 1,926,502; ratio 161:10)
trunk with patches
bz2 transtab: new 3,698 (99,519 -> 1,566,490; ratio 157:10)
fbench transtab: new 2,336 (55,102 -> 877,534; ratio 159:10)
ffbench transtab: new 2,115 (51,832 -> 828,090; ratio 159:10)
heap transtab: new 1,846 (40,903 -> 663,264; ratio 162:10)
tinycc transtab: new 4,662 (119,646 -> 1,926,509; ratio 161:10)
Virtually identical insn counts.
> Looks plausible. Couple of things:
>
> (trivial)
> -
> /*------------------------------------------------------------*/
>
> pls can you leave the blank line there? I like 2 blank lines
> before section breaks (more artistically pleasing :)
Yes, sure. This was unintentional. I share your artistic preference.
> + /* If the complaint is to be issued under a guard condition, AND that
> + guard condition. */
> + if (guard && ! isTRUE(di->guard)) {
>
...snip ...
> That said, I would much prefer that you removed the " && ! isTRUE(di->guard)",
> hence always constructing the And against di->guard if it is non-NULL, and
> rely in ir_opt to tidy up afterwards if di->guard is a constant.
Ok. No problem. Above insn numbers show that your confidence in the
optimisers is warranted.
> + We assume here, that the validity of GUARD has already been checked.
> s/validity/definedness
Yep.
> I don't think that iropt can remove "PUT(offs) = GET(offs)". Not 100%
> sure it can't though. Doesn't affect correctness.
Throwing those out should be allowed for those guests offsets that do
not require precise memory exceptions. I did not check whether
redundant_put_removal actually throws them out.
> Presumably there is some way in all this that MC will complain if the
> guard expression is undefined. Maybe the existing code already does that?
Yes, the existing code already checks the definedness of the guard
expression.
>> patch-5 modifies the amd64 insn selector which would otherwise assert.
>
> + addInstr(env, AMD64Instr_Test64(0xFFFFFFFF,reg));
>
> Shouldn't that be 0x1 ? IIUC, as you have it, rflags.NZ will get set to 1
> if any of the bits in reg are nonzero.
I wasn't sure about this one. I take your word and change it.
I have an updated patch which I will post when s390 passes. There is
currently one testcase that is failing and I need to find out why. Could
be some latent bug that is exposed by these changes.
Florian
|