]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Made m_debuginfo not depend on m_aspacemgr, breaking the direct circular
authorNicholas Nethercote <njn@valgrind.org>
Sat, 25 Jun 2005 20:49:33 +0000 (20:49 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sat, 25 Jun 2005 20:49:33 +0000 (20:49 +0000)
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.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4025

coregrind/m_aspacemgr/aspacemgr.c
coregrind/m_debuginfo/symtab.c
coregrind/m_redir.c
coregrind/m_stacktrace.c
coregrind/pub_core_aspacemgr.h
coregrind/pub_core_debuginfo.h

index 9cc3ea404914cfcd863b0dc3c54ea2d778875f89..64745c64707414586e47bf904dd58ba4dacb9ccc 100644 (file)
@@ -792,13 +792,16 @@ VG_(map_file_segment)( Addr addr, SizeT len,
        && ( (addr+len < VG_(valgrind_base) || addr > VG_(valgrind_last))
             || is_stage2
           )
-       && (flags & (SF_MMAP|SF_NOSYMS)) == SF_MMAP) {
+       && (flags & (SF_MMAP|SF_NOSYMS)) == SF_MMAP
+   ) {
       if (off == 0
          && s->fnIdx != -1
          && (prot & (VKI_PROT_READ|VKI_PROT_EXEC)) == (VKI_PROT_READ|VKI_PROT_EXEC)
          && len >= VKI_PAGE_SIZE
-          && VG_(is_object_file)((void *)addr)) {
-         s->seginfo = VG_(read_seg_symbols)(s);
+          && VG_(is_object_file)((void *)addr)
+      ) {
+         s->seginfo = VG_(read_seg_symbols)(s->addr, s->len, s->offset,
+                                            s->filename);
          if (s->seginfo != NULL) {
             s->flags |= SF_DYNLIB;
          }
index b37dd2bf99cdf513f58e03078b8137fe3491aedd..729128dea6d906a35ecbaf0f53fa8ba462c0b7c6 100644 (file)
@@ -31,8 +31,6 @@
 
 #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 @@ Bool read_lib_symbols ( SegInfo* si )
    address ranges, and as a result the SegInfos in this list describe
    disjoint address ranges. 
 */
-SegInfo *VG_(read_seg_symbols) ( Segment *seg )
+SegInfo *VG_(read_seg_symbols) ( Addr seg_addr, SizeT seg_len,
+                                 OffT seg_offset, const Char* seg_filename)
 {
    SegInfo* si;
 
-   vg_assert(seg->seginfo == NULL);
-
    VGP_PUSHCC(VgpReadSyms);
 
    /* Get the record initialised right. */
    si = VG_(arena_malloc)(VG_AR_SYMTAB, sizeof(SegInfo));
 
    VG_(memset)(si, 0, sizeof(*si));
-   si->start    = seg->addr;
-   si->size     = seg->len;
-   si->foffset  = seg->offset;
-   si->filename = VG_(arena_strdup)(VG_AR_SYMTAB, seg->filename);
+   si->start    = seg_addr;
+   si->size     = seg_len;
+   si->foffset  = seg_offset;
+   si->filename = VG_(arena_strdup)(VG_AR_SYMTAB, seg_filename);
 
    si->ref = 1;
 
index 9048b2d846033ad6c197d3dc1a7388a1c5cb0e8b..78e29eeef14a546693ceea82ec53e28ea955b60e 100644 (file)
@@ -31,8 +31,7 @@
 */
 
 #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"
index 08e4b0ad081735b1b31169b15d99be95bb111384..65bd00d54ed63326349f85bacde1365fea0b0d75 100644 (file)
@@ -30,7 +30,7 @@
 
 #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"
index 7f5af754e85fe5bfdeaaa07fc1b4d1d8be3a0c61..13690dfd04dc98d4c245651716bf4ce9fb020a38 100644 (file)
@@ -87,6 +87,8 @@ extern SysRes VG_(mprotect_native) ( void *start, SizeT length, UInt prot );
 #define SF_CODE     (1 << 14) // segment contains cached code
 #define SF_DEVICE   (1 << 15) // device mapping; avoid careless touching
 
+typedef struct _Segment Segment;
+
 struct _Segment {
    UInt         prot;         // VKI_PROT_*
    UInt         flags;        // SF_*
index 65ab647fe51251e374b2932066b06edd7a75efac..f5de7f1ed3ee7f09575e9a50be6f81365897dddf 100644 (file)
 
 #include "pub_tool_debuginfo.h"
 
-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* filename);
 extern void VG_(seginfo_incref)   ( SegInfo * );
 extern void VG_(seginfo_decref)   ( SegInfo *, Addr a );