|
From: <sv...@va...> - 2008-09-13 03:01:00
|
Author: sewardj
Date: 2008-09-13 04:00:43 +0100 (Sat, 13 Sep 2008)
New Revision: 8609
Log:
Un-break the AIX build (mostly). exp-ptrcheck is still not buildable yet.
Modified:
branches/PTRCHECK/coregrind/m_debuginfo/d3basics.c
branches/PTRCHECK/coregrind/m_debuginfo/debuginfo.c
branches/PTRCHECK/coregrind/m_debuginfo/readdwarf3.c
branches/PTRCHECK/coregrind/m_debuginfo/readxcoff.c
branches/PTRCHECK/coregrind/m_initimg/initimg-aix5.c
branches/PTRCHECK/coregrind/m_libcfile.c
branches/PTRCHECK/coregrind/m_machine.c
branches/PTRCHECK/coregrind/m_main.c
branches/PTRCHECK/coregrind/m_syswrap/syswrap-aix5.c
branches/PTRCHECK/include/pub_tool_machine.h
Modified: branches/PTRCHECK/coregrind/m_debuginfo/d3basics.c
===================================================================
--- branches/PTRCHECK/coregrind/m_debuginfo/d3basics.c 2008-09-13 00:52:11 UTC (rev 8608)
+++ branches/PTRCHECK/coregrind/m_debuginfo/d3basics.c 2008-09-13 03:00:43 UTC (rev 8609)
@@ -832,6 +832,34 @@
}
+void ML_(pp_GX) ( GExpr* gx ) {
+ Addr aMin, aMax;
+ UChar uc;
+ UShort nbytes;
+ UChar* p = &gx->payload[0];
+ uc = *p++;
+ VG_(printf)("GX(%s){", uc == 0 ? "final" : "Breqd" );
+ vg_assert(uc == 0 || uc == 1);
+ while (True) {
+ uc = *p++;
+ if (uc == 1)
+ break; /*isEnd*/
+ vg_assert(uc == 0);
+ aMin = * (Addr*)p; p += sizeof(Addr);
+ aMax = * (Addr*)p; p += sizeof(Addr);
+ nbytes = * (UShort*)p; p += sizeof(UShort);
+ VG_(printf)("[%#lx,%#lx]=", aMin, aMax);
+ while (nbytes > 0) {
+ VG_(printf)("%02x", (UInt)*p++);
+ nbytes--;
+ }
+ if (*p == 0)
+ VG_(printf)(",");
+ }
+ VG_(printf)("}");
+}
+
+
/*--------------------------------------------------------------------*/
/*--- end d3basics.c ---*/
/*--------------------------------------------------------------------*/
Modified: branches/PTRCHECK/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- branches/PTRCHECK/coregrind/m_debuginfo/debuginfo.c 2008-09-13 00:52:11 UTC (rev 8608)
+++ branches/PTRCHECK/coregrind/m_debuginfo/debuginfo.c 2008-09-13 03:00:43 UTC (rev 8609)
@@ -785,7 +785,7 @@
read debug info for it -- or conversely, have recently been dumped,
in which case the relevant debug info has to be unloaded. */
-void VG_(di_aix5_notify_segchange)(
+ULong VG_(di_aix5_notify_segchange)(
Addr code_start,
Word code_len,
Addr data_start,
@@ -795,6 +795,8 @@
Bool is_mainexe,
Bool acquire )
{
+ ULong hdl = 0;
+
if (acquire) {
Bool ok;
@@ -836,6 +838,8 @@
VG_(redir_notify_new_DebugInfo)( di );
/* Note that we succeeded */
di->have_dinfo = True;
+ hdl = di->handle;
+ vg_assert(hdl > 0);
} else {
/* Something went wrong (eg. bad XCOFF file). */
discard_DebugInfo( di );
@@ -850,6 +854,8 @@
discard_syms_in_range( code_start, code_len );
}
+
+ return hdl;
}
Modified: branches/PTRCHECK/coregrind/m_debuginfo/readdwarf3.c
===================================================================
--- branches/PTRCHECK/coregrind/m_debuginfo/readdwarf3.c 2008-09-13 00:52:11 UTC (rev 8608)
+++ branches/PTRCHECK/coregrind/m_debuginfo/readdwarf3.c 2008-09-13 03:00:43 UTC (rev 8609)
@@ -461,33 +461,10 @@
location list. Zero length ranges, with aMax == aMin-1, are not
allowed.
*/
-void ML_(pp_GX) ( GExpr* gx ) {
- Addr aMin, aMax;
- UChar uc;
- UShort nbytes;
- UChar* p = &gx->payload[0];
- uc = *p++;
- VG_(printf)("GX(%s){", uc == 0 ? "final" : "Breqd" );
- vg_assert(uc == 0 || uc == 1);
- while (True) {
- uc = *p++;
- if (uc == 1)
- break; /*isEnd*/
- vg_assert(uc == 0);
- aMin = * (Addr*)p; p += sizeof(Addr);
- aMax = * (Addr*)p; p += sizeof(Addr);
- nbytes = * (UShort*)p; p += sizeof(UShort);
- VG_(printf)("[%#lx,%#lx]=", aMin, aMax);
- while (nbytes > 0) {
- VG_(printf)("%02x", (UInt)*p++);
- nbytes--;
- }
- if (*p == 0)
- VG_(printf)(",");
- }
- VG_(printf)("}");
-}
+/* 2008-sept-12: moved ML_(pp_GX) from here to d3basics.c, where
+ it more logically belongs. */
+
/* "Comment_Regarding_DWARF3_Text_Biasing" (is referred to elsewhere)
-----------------------------------------------------------------
apply_kludgey_text_bias() is our mechanism for biasing text
Modified: branches/PTRCHECK/coregrind/m_debuginfo/readxcoff.c
===================================================================
--- branches/PTRCHECK/coregrind/m_debuginfo/readxcoff.c 2008-09-13 00:52:11 UTC (rev 8608)
+++ branches/PTRCHECK/coregrind/m_debuginfo/readxcoff.c 2008-09-13 03:00:43 UTC (rev 8609)
@@ -569,8 +569,8 @@
add the rest to 'syms'.
---------------------------------------------------------- */
- syms = VG_(newXA)( ML_(dinfo_zalloc), ML_(dinfo_free),
- sizeof(XCoffSym) );
+ syms = VG_(newXA)( ML_(dinfo_zalloc), "di.readxcoff.rst.1",
+ ML_(dinfo_free), sizeof(XCoffSym) );
if (SHOW && SHOW_SYMS_P1) {
VG_(printf)("--- BEGIN Phase1 (find text symbol starts) ---\n");
@@ -2149,7 +2149,7 @@
Int i;
SysRes sr, fd;
- struct vki_stat stat_buf;
+ struct vg_stat stat_buf;
vg_assert(o_name);
@@ -2460,14 +2460,14 @@
if (di->memname) {
/* set the soname to "archive.a(member.o)" */
Int nbytes = VG_(strlen)(p) + 1 + VG_(strlen)(di->memname) + 1 + 1;
- UChar* so = ML_(dinfo_zalloc)(nbytes);
+ UChar* so = ML_(dinfo_zalloc)("di.readxcoff.rxdi.1", nbytes);
vg_assert(so);
VG_(sprintf)(so, "%s(%s)", p, di->memname);
vg_assert(VG_(strlen)(so) == nbytes-1);
di->soname = so;
} else {
/* no member name, hence soname = "archive.a" */
- di->soname = ML_(dinfo_strdup)(p);
+ di->soname = ML_(dinfo_strdup)("di.readxcoff.rxdi.2", p);
}
}
if (SHOW)
Modified: branches/PTRCHECK/coregrind/m_initimg/initimg-aix5.c
===================================================================
--- branches/PTRCHECK/coregrind/m_initimg/initimg-aix5.c 2008-09-13 00:52:11 UTC (rev 8608)
+++ branches/PTRCHECK/coregrind/m_initimg/initimg-aix5.c 2008-09-13 03:00:43 UTC (rev 8609)
@@ -115,7 +115,7 @@
+ VG_(strlen)( _so )
+ 1 /*NUL*/;
vg_assert(pltool_len > 0);
- pltool_str = VG_(malloc)( pltool_len );
+ pltool_str = VG_(malloc)( "initimg-aix5.ici.1", pltool_len );
pltool_str[0] = 0;
VG_(strcat)( pltool_str, VG_(libdir) );
VG_(strcat)( pltool_str, "/" );
@@ -134,7 +134,7 @@
+ VG_(strlen)( vgpreload_core_so )
+ 1 /*NUL*/;
vg_assert(plcore_len > 0);
- plcore_str = VG_(malloc)( plcore_len );
+ plcore_str = VG_(malloc)( "initimg-aix5.ici.2", plcore_len );
plcore_str[0] = 0;
VG_(strcat)( plcore_str, VG_(libdir) );
VG_(strcat)( plcore_str, "/" );
@@ -151,7 +151,7 @@
if (ld_pre_str && VG_(strlen)(ld_pre_str) > 0) {
have_ld_pre = True;
ld_pre_len = VG_(strlen)(ld_pre_str) + 1/*NUL*/;
- ld_pre_str = VG_(malloc)( ld_pre_len );
+ ld_pre_str = VG_(malloc)( "initimg-aix5.ici.3", ld_pre_len );
ld_pre_str[0] = 0;
VG_(strcat)( ld_pre_str, VG_(getenv)("LD_PRELOAD") );
vg_assert( ld_pre_str[ld_pre_len-1] == 0);
Modified: branches/PTRCHECK/coregrind/m_libcfile.c
===================================================================
--- branches/PTRCHECK/coregrind/m_libcfile.c 2008-09-13 00:52:11 UTC (rev 8608)
+++ branches/PTRCHECK/coregrind/m_libcfile.c 2008-09-13 03:00:43 UTC (rev 8609)
@@ -186,14 +186,23 @@
return res;
}
# elif defined(VGO_aix5)
- res = VG_(do_syscall4)(__NR_AIX5_statx,
- (UWord)file_name,
- (UWord)buf,
- sizeof(struct vki_stat),
- VKI_STX_NORMAL);
- if (!res.isError)
- TRANSLATE_TO_vg_stat(vgbuf, &buf);
- return res;
+ { struct vki_stat buf;
+ res = VG_(do_syscall4)(__NR_AIX5_statx,
+ (UWord)file_name,
+ (UWord)&buf,
+ sizeof(struct vki_stat),
+ VKI_STX_NORMAL);
+ if (!res.isError) {
+ VG_(memset)(vgbuf, 0, sizeof(*vgbuf));
+ vgbuf->st_dev = (ULong)buf.st_dev;
+ vgbuf->st_ino = (ULong)buf.st_ino;
+ vgbuf->st_mode = (UInt)buf.st_mode;
+ vgbuf->st_uid = (UInt)buf.st_uid;
+ vgbuf->st_gid = (UInt)buf.st_gid;
+ vgbuf->st_size = (Long)buf.st_size;
+ }
+ return res;
+ }
# else
# error Unknown OS
# endif
Modified: branches/PTRCHECK/coregrind/m_machine.c
===================================================================
--- branches/PTRCHECK/coregrind/m_machine.c 2008-09-13 00:52:11 UTC (rev 8608)
+++ branches/PTRCHECK/coregrind/m_machine.c 2008-09-13 03:00:43 UTC (rev 8609)
@@ -78,17 +78,26 @@
INSTR_PTR( VG_(threads)[tid].arch ) = ip;
}
-void VG_(set_syscall_return_shadows) ( ThreadId tid, UWord s1, UWord s2 )
+void VG_(set_syscall_return_shadows) ( ThreadId tid,
+ /* shadow vals for the result */
+ UWord s1res, UWord s2res,
+ /* shadow vals for the error val */
+ UWord s1err, UWord s2err )
{
# if defined(VGP_x86_linux)
- VG_(threads)[tid].arch.vex_shadow1.guest_EAX = s1;
- VG_(threads)[tid].arch.vex_shadow2.guest_EAX = s2;
+ VG_(threads)[tid].arch.vex_shadow1.guest_EAX = s1res;
+ VG_(threads)[tid].arch.vex_shadow2.guest_EAX = s2res;
# elif defined(VGP_amd64_linux)
- VG_(threads)[tid].arch.vex_shadow1.guest_RAX = s1;
- VG_(threads)[tid].arch.vex_shadow2.guest_RAX = s2;
+ VG_(threads)[tid].arch.vex_shadow1.guest_RAX = s1res;
+ VG_(threads)[tid].arch.vex_shadow2.guest_RAX = s2res;
# elif defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
- VG_(threads)[tid].arch.vex_shadow1.guest_GPR3 = s1;
- VG_(threads)[tid].arch.vex_shadow2.guest_GPR3 = s2;
+ VG_(threads)[tid].arch.vex_shadow1.guest_GPR3 = s1res;
+ VG_(threads)[tid].arch.vex_shadow2.guest_GPR3 = s2res;
+# elif defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ VG_(threads)[tid].arch.vex_shadow1.guest_GPR3 = s1res;
+ VG_(threads)[tid].arch.vex_shadow2.guest_GPR3 = s2res;
+ VG_(threads)[tid].arch.vex_shadow1.guest_GPR4 = s1err;
+ VG_(threads)[tid].arch.vex_shadow2.guest_GPR4 = s2err;
# else
# error "Unknown plat"
# endif
Modified: branches/PTRCHECK/coregrind/m_main.c
===================================================================
--- branches/PTRCHECK/coregrind/m_main.c 2008-09-13 00:52:11 UTC (rev 8608)
+++ branches/PTRCHECK/coregrind/m_main.c 2008-09-13 03:00:43 UTC (rev 8609)
@@ -1770,7 +1770,7 @@
/* Find out how many AixCodeSegChange records we will need,
and acquire them. */
changes_size = VG_(am_aix5_reread_procmap_howmany_directives)();
- changes = VG_(malloc)(changes_size * sizeof(AixCodeSegChange));
+ changes = VG_(malloc)("main.vm.3", changes_size * sizeof(AixCodeSegChange));
vg_assert(changes);
/* Now re-read /proc/<pid>/map and acquire a change set */
Modified: branches/PTRCHECK/coregrind/m_syswrap/syswrap-aix5.c
===================================================================
--- branches/PTRCHECK/coregrind/m_syswrap/syswrap-aix5.c 2008-09-13 00:52:11 UTC (rev 8608)
+++ branches/PTRCHECK/coregrind/m_syswrap/syswrap-aix5.c 2008-09-13 03:00:43 UTC (rev 8609)
@@ -125,8 +125,8 @@
/* Find out how many AixCodeSegChange records we will need, and
acquire them. */
changes_size = VG_(am_aix5_reread_procmap_howmany_directives)();
- changes = VG_(arena_malloc)(VG_AR_CORE,
- changes_size * sizeof(AixCodeSegChange));
+ changes = VG_(arena_malloc)(VG_AR_CORE, "syswrap-aix5.arpalou.1",
+ changes_size * sizeof(AixCodeSegChange));
vg_assert(changes);
/* Now re-read /proc/<pid>/map and acquire a change set */
@@ -135,24 +135,24 @@
/* And notify all parties of the changes. */
for (i = 0; i < changes_used; i++) {
- VG_(di_aix5_notify_segchange)(
- changes[i].code_start,
- changes[i].code_len,
- changes[i].data_start,
- changes[i].data_len,
- changes[i].file_name,
- changes[i].mem_name,
- changes[i].is_mainexe,
- changes[i].acquire
- );
+ ULong di_handle = VG_(di_aix5_notify_segchange)(
+ changes[i].code_start,
+ changes[i].code_len,
+ changes[i].data_start,
+ changes[i].data_len,
+ changes[i].file_name,
+ changes[i].mem_name,
+ changes[i].is_mainexe,
+ changes[i].acquire
+ );
if (changes[i].acquire) {
VG_TRACK( new_mem_mmap,
changes[i].code_start, changes[i].code_len,
- /*r*/True, /*w*/False, /*x*/True );
+ /*r*/True, /*w*/False, /*x*/True, di_handle );
VG_TRACK( new_mem_mmap,
changes[i].data_start, changes[i].data_len,
- /*r*/True, /*w*/True, /*x*/False );
+ /*r*/True, /*w*/True, /*x*/False, 0/*or di_handle?*/ );
} else {
VG_TRACK( die_mem_munmap,
changes[i].code_start, changes[i].code_len );
@@ -962,7 +962,8 @@
tot_args++;
}
// allocate
- argv = VG_(malloc)( (tot_args+1) * sizeof(HChar*) );
+ argv = VG_(malloc)( "syswrap-aix5.pre_sys_execve.1",
+ (tot_args+1) * sizeof(HChar*) );
if (argv == 0) goto hosed;
// copy
j = 0;
@@ -1711,7 +1712,7 @@
Bool r = (prot & VKI_PROT_READ) > 0;
Bool w = (prot & VKI_PROT_WRITE) > 0;
Bool x = (prot & VKI_PROT_EXEC) > 0;
- VG_TRACK( new_mem_mmap, addr, len, r,w,x );
+ VG_TRACK( new_mem_mmap, addr, len, r,w,x, 0/*di_handle*/ );
Bool d = VG_(am_notify_client_mmap)( addr, len, prot, flags,
0/*fake fd*/, 0/*fake offset*/);
if (d)
@@ -2116,7 +2117,7 @@
/* we don't distinguish whether it's read-only or
* read-write -- it doesn't matter really. */
- VG_TRACK( new_mem_mmap, RES, segmentSize, True, True, False );
+ VG_TRACK( new_mem_mmap, RES, segmentSize, True, True, False, 0/*di_handle*/ );
if (d)
VG_(discard_translations)( (Addr64)RES,
(ULong)VG_PGROUNDUP(segmentSize),
Modified: branches/PTRCHECK/include/pub_tool_machine.h
===================================================================
--- branches/PTRCHECK/include/pub_tool_machine.h 2008-09-13 00:52:11 UTC (rev 8608)
+++ branches/PTRCHECK/include/pub_tool_machine.h 2008-09-13 03:00:43 UTC (rev 8609)
@@ -96,9 +96,13 @@
/*DST*/Int shadowNo, OffT offset, SizeT size,
/*SRC*/const UChar* src );
-// Sets the shadow values for the syscall return value register.
+// Sets the shadow values for the syscall return value register(s).
// This is platform specific.
-void VG_(set_syscall_return_shadows) ( ThreadId tid, UWord s1, UWord s2 );
+void VG_(set_syscall_return_shadows) ( ThreadId tid,
+ /* shadow vals for the result */
+ UWord s1res, UWord s2res,
+ /* shadow vals for the error val */
+ UWord s1err, UWord s2err );
// Apply a function 'f' to all the general purpose registers in all the
// current threads.
|