|
From: <sv...@va...> - 2005-06-25 20:49:37
|
Author: njn
Date: 2005-06-25 21:49:33 +0100 (Sat, 25 Jun 2005)
New Revision: 4025
Log:
Made m_debuginfo not depend on m_aspacemgr, breaking the direct circular
dependence between them. (There's still an indirect one via m_libcmman.)
As a result, I was able to move the Segment type declaration into
pub_core_aspacemgr.h, which is a much better spot. I was also able to
remove a couple of #includes.
Modified:
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/m_redir.c
trunk/coregrind/m_stacktrace.c
trunk/coregrind/pub_core_aspacemgr.h
trunk/coregrind/pub_core_debuginfo.h
Modified: trunk/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-06-25 20:22:43 UTC (rev =
4024)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-06-25 20:49:33 UTC (rev =
4025)
@@ -792,13 +792,16 @@
&& ( (addr+len < VG_(valgrind_base) || addr > VG_(valgrind_last))
|| is_stage2
)
- && (flags & (SF_MMAP|SF_NOSYMS)) =3D=3D SF_MMAP) {
+ && (flags & (SF_MMAP|SF_NOSYMS)) =3D=3D SF_MMAP
+ ) {
if (off =3D=3D 0
&& s->fnIdx !=3D -1
&& (prot & (VKI_PROT_READ|VKI_PROT_EXEC)) =3D=3D (VKI_PROT_READ|VKI_P=
ROT_EXEC)
&& len >=3D VKI_PAGE_SIZE
- && VG_(is_object_file)((void *)addr)) {
- s->seginfo =3D VG_(read_seg_symbols)(s);
+ && VG_(is_object_file)((void *)addr)
+ ) {
+ s->seginfo =3D VG_(read_seg_symbols)(s->addr, s->len, s->offset=
,
+ s->filename);
if (s->seginfo !=3D NULL) {
s->flags |=3D SF_DYNLIB;
}
Modified: trunk/coregrind/m_debuginfo/symtab.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_debuginfo/symtab.c 2005-06-25 20:22:43 UTC (rev 402=
4)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-25 20:49:33 UTC (rev 402=
5)
@@ -31,8 +31,6 @@
=20
#include "pub_core_basics.h"
#include "pub_core_threadstate.h"
-#include "pub_core_debuginfo.h" // Needed for pub_core_aspacemgr :(
-#include "pub_core_aspacemgr.h" // For Segment type
#include "pub_core_debuginfo.h"
#include "pub_core_demangle.h"
#include "pub_core_libcbase.h"
@@ -1618,22 +1616,21 @@
address ranges, and as a result the SegInfos in this list describe
disjoint address ranges.=20
*/
-SegInfo *VG_(read_seg_symbols) ( Segment *seg )
+SegInfo *VG_(read_seg_symbols) ( Addr seg_addr, SizeT seg_len,
+ OffT seg_offset, const Char* seg_filena=
me)
{
SegInfo* si;
=20
- vg_assert(seg->seginfo =3D=3D NULL);
-
VGP_PUSHCC(VgpReadSyms);
=20
/* Get the record initialised right. */
si =3D VG_(arena_malloc)(VG_AR_SYMTAB, sizeof(SegInfo));
=20
VG_(memset)(si, 0, sizeof(*si));
- si->start =3D seg->addr;
- si->size =3D seg->len;
- si->foffset =3D seg->offset;
- si->filename =3D VG_(arena_strdup)(VG_AR_SYMTAB, seg->filename);
+ si->start =3D seg_addr;
+ si->size =3D seg_len;
+ si->foffset =3D seg_offset;
+ si->filename =3D VG_(arena_strdup)(VG_AR_SYMTAB, seg_filename);
=20
si->ref =3D 1;
=20
Modified: trunk/coregrind/m_redir.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_redir.c 2005-06-25 20:22:43 UTC (rev 4024)
+++ trunk/coregrind/m_redir.c 2005-06-25 20:49:33 UTC (rev 4025)
@@ -31,8 +31,7 @@
*/
=20
#include "pub_core_basics.h"
-#include "pub_core_debuginfo.h" // Needed for pub_core_aspacemgr :(
-#include "pub_core_aspacemgr.h" // Needed for pub_core_redir.h :(
+#include "pub_core_debuginfo.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
Modified: trunk/coregrind/m_stacktrace.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_stacktrace.c 2005-06-25 20:22:43 UTC (rev 4024)
+++ trunk/coregrind/m_stacktrace.c 2005-06-25 20:49:33 UTC (rev 4025)
@@ -30,7 +30,7 @@
=20
#include "pub_core_basics.h"
#include "pub_core_threadstate.h"
-#include "pub_core_debuginfo.h" // Needed for pub_core_aspacemgr :(
+#include "pub_core_debuginfo.h"
#include "pub_core_aspacemgr.h" // For VG_(is_addressable)()
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
Modified: trunk/coregrind/pub_core_aspacemgr.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_aspacemgr.h 2005-06-25 20:22:43 UTC (rev 402=
4)
+++ trunk/coregrind/pub_core_aspacemgr.h 2005-06-25 20:49:33 UTC (rev 402=
5)
@@ -87,6 +87,8 @@
#define SF_CODE (1 << 14) // segment contains cached code
#define SF_DEVICE (1 << 15) // device mapping; avoid careless touching
=20
+typedef struct _Segment Segment;
+
struct _Segment {
UInt prot; // VKI_PROT_*
UInt flags; // SF_*
Modified: trunk/coregrind/pub_core_debuginfo.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_debuginfo.h 2005-06-25 20:22:43 UTC (rev 402=
4)
+++ trunk/coregrind/pub_core_debuginfo.h 2005-06-25 20:49:33 UTC (rev 402=
5)
@@ -41,10 +41,9 @@
=20
#include "pub_tool_debuginfo.h"
=20
-typedef struct _Segment Segment;
-
extern Bool VG_(is_object_file) ( const void *hdr );
-extern SegInfo * VG_(read_seg_symbols) ( Segment *seg );
+extern SegInfo *VG_(read_seg_symbols) ( Addr addr, SizeT len,
+ OffT offset, const Char* filenam=
e);
extern void VG_(seginfo_incref) ( SegInfo * );
extern void VG_(seginfo_decref) ( SegInfo *, Addr a );
=20
|