parseauxv.h

Go to the documentation of this file.
00001 /*
00002  * See the dyninst/COPYRIGHT file for copyright information.
00003  * 
00004  * We provide the Paradyn Tools (below described as "Paradyn")
00005  * on an AS IS basis, and do not warrant its validity or performance.
00006  * We reserve the right to update, modify, or discontinue this
00007  * software at any time.  We shall have no obligation to supply such
00008  * updates or modifications or any other form of support to you.
00009  * 
00010  * By your use of Paradyn, you understand and agree that we (or any
00011  * other person or entity with proprietary rights in Paradyn) are
00012  * under no obligation to provide either maintenance services,
00013  * update services, notices of latent defects, or correction of
00014  * defects for Paradyn.
00015  * 
00016  * This library is free software; you can redistribute it and/or
00017  * modify it under the terms of the GNU Lesser General Public
00018  * License as published by the Free Software Foundation; either
00019  * version 2.1 of the License, or (at your option) any later version.
00020  * 
00021  * This library is distributed in the hope that it will be useful,
00022  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00024  * Lesser General Public License for more details.
00025  * 
00026  * You should have received a copy of the GNU Lesser General Public
00027  * License along with this library; if not, write to the Free Software
00028  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00029  */
00030 
00031 #ifndef auxvparser_h
00032 #define auxvparser_h
00033 
00034 #include "common/h/Types.h"
00035 #include <map>
00036 
00037 class AuxvParser
00038 {
00039  private:
00040    int pid;
00041    unsigned ref_count;
00042    bool create_err;
00043    Address interpreter_base;
00044    Address vsyscall_base;
00045    Address vsyscall_text;
00046    Address vsyscall_end;
00047    bool found_vsyscall;
00048    Address phdr;
00049 
00050    unsigned page_size;
00051    unsigned addr_size;
00052    
00053    bool readAuxvInfo();
00054    void *readAuxvFromProc();
00055    void *readAuxvFromStack();
00056    Address getStackTop(bool &err);
00057    AuxvParser(int pid, unsigned asize); 
00058 
00059    static std::map<int, AuxvParser *> pid_to_parser;
00060 
00061  public:
00062    static AuxvParser *createAuxvParser(int pid, unsigned asize);
00063 
00064    void deleteAuxvParser();
00065    ~AuxvParser();
00066 
00067    Address getInterpreterBase();
00068    bool parsedVsyscall();
00069    Address getVsyscallBase();
00070    Address getVsyscallText();
00071    Address getVsyscallEnd();
00072    Address getProgramBase();
00073    Address getPageSize();
00074 };
00075 
00076 
00077 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1