]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added VG_(get_obj)().
authorNicholas Nethercote <njn@valgrind.org>
Tue, 28 Jan 2003 20:40:57 +0000 (20:40 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Tue, 28 Jan 2003 20:40:57 +0000 (20:40 +0000)
Also added declaration for VG_(get_error_where)() to vg_skin.h (which should
have been included with the last commit).

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

coregrind/vg_symtab2.c
include/vg_skin.h

index 8c149a9107a2009d8052d6f2b0ac9f670fe596fd..c36d32b258cb1c015638577a822ddb82d5da3937 100644 (file)
@@ -2177,6 +2177,21 @@ Bool VG_(get_objname) ( Addr a, Char* buf, Int nbuf )
    return False;
 }
 
+/* Map a code address to its SegInfo.  Returns NULL if not found.  Doesn't
+   require debug info. */
+SegInfo* VG_(get_obj) ( Addr a )
+{
+   SegInfo* si;
+
+   ensure_debug_info_inited();
+   for (si = segInfo; si != NULL; si = si->next) {
+      if (si->start <= a && a < si->start+si->size) {
+         return si;
+      }
+   }
+   return False;
+}
+
 
 /* Map a code address to a filename.  Returns True if successful.  */
 Bool VG_(get_filename)( Addr a, Char* filename, Int n_filename )
index 4a19b5ab271fd8090b555d9aefccb4203e3301df..3958de9819891847a49878f40b7974157b57cea8 100644 (file)
@@ -1062,10 +1062,11 @@ typedef
    Error;
 
 /* Useful in SK_(error_matches_suppression)(), SK_(pp_SkinError)(), etc */
-SuppKind VG_(get_error_kind)    ( Error* err );
-Addr     VG_(get_error_address) ( Error* err );
-Char*    VG_(get_error_string)  ( Error* err );
-void*    VG_(get_error_extra)   ( Error* err );
+ExeContext* VG_(get_error_where)   ( Error* err );
+SuppKind    VG_(get_error_kind)    ( Error* err );
+Addr        VG_(get_error_address) ( Error* err );
+Char*       VG_(get_error_string)  ( Error* err );
+void*       VG_(get_error_extra)   ( Error* err );
 
 /* Call this when an error occurs.  It will be recorded if it hasn't been
    seen before.  If it has, the existing error record will have its count
@@ -1129,11 +1130,15 @@ extern Bool VG_(get_objname)  ( Addr a, Char* objname,  Int n_objname  );
 /* A way to get information about what segments are mapped */
 typedef struct _SegInfo SegInfo;
 
-extern const SegInfo* VG_(next_seginfo)(const SegInfo *);
-extern Addr VG_(seg_start)(const SegInfo *);
-extern UInt VG_(seg_size)(const SegInfo *);
-extern const UChar* VG_(seg_filename)(const SegInfo *);
-extern UInt VG_(seg_sym_offset)(const SegInfo *);
+/* Returns NULL if the SegInfo isn't found.  It doesn't matter if debug info
+   is present or not. */
+extern SegInfo* VG_(get_obj)  ( Addr a );
+
+extern const SegInfo* VG_(next_seginfo)  ( const SegInfo *seg );
+extern       Addr     VG_(seg_start)     ( const SegInfo *seg );
+extern       UInt     VG_(seg_size)      ( const SegInfo *seg );
+extern const UChar*   VG_(seg_filename)  ( const SegInfo *seg );
+extern       UInt     VG_(seg_sym_offset)( const SegInfo *seg );
 
 typedef
    enum {