&& ( (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;
}
#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"
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;
*/
#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"
#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"
#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_*
#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 );