tools/profiler/LulElfExt.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/profiler/LulElfExt.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,66 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=8 sts=2 et sw=2 tw=80: */
     1.6 +
     1.7 +// Copyright (c) 2006, 2011, 2012 Google Inc.
     1.8 +// All rights reserved.
     1.9 +//
    1.10 +// Redistribution and use in source and binary forms, with or without
    1.11 +// modification, are permitted provided that the following conditions are
    1.12 +// met:
    1.13 +//
    1.14 +//     * Redistributions of source code must retain the above copyright
    1.15 +// notice, this list of conditions and the following disclaimer.
    1.16 +//     * Redistributions in binary form must reproduce the above
    1.17 +// copyright notice, this list of conditions and the following disclaimer
    1.18 +// in the documentation and/or other materials provided with the
    1.19 +// distribution.
    1.20 +//     * Neither the name of Google Inc. nor the names of its
    1.21 +// contributors may be used to endorse or promote products derived from
    1.22 +// this software without specific prior written permission.
    1.23 +//
    1.24 +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    1.25 +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    1.26 +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    1.27 +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    1.28 +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.29 +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.30 +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    1.31 +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    1.32 +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    1.33 +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    1.34 +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.35 +
    1.36 +// This file is derived from the following files in
    1.37 +// toolkit/crashreporter/google-breakpad:
    1.38 +//   src/common/linux/dump_symbols.h
    1.39 +
    1.40 +#ifndef LulElfExt_h
    1.41 +#define LulElfExt_h
    1.42 +
    1.43 +// These two functions are the external interface to the
    1.44 +// ELF/Dwarf/EXIDX reader.
    1.45 +
    1.46 +#include "LulMainInt.h"
    1.47 +
    1.48 +using lul::SecMap;
    1.49 +
    1.50 +namespace lul {
    1.51 +
    1.52 +// Find all the unwind information in OBJ_FILE, an ELF executable
    1.53 +// or shared library, and add it to SMAP.
    1.54 +bool ReadSymbolData(const std::string& obj_file,
    1.55 +                    const std::vector<std::string>& debug_dirs,
    1.56 +                    SecMap* smap, void* rx_avma,
    1.57 +                    void (*log)(const char*));
    1.58 +
    1.59 +// The same as ReadSymbolData, except that OBJ_FILE is assumed to
    1.60 +// point to a mapped-in image of OBJ_FILENAME.
    1.61 +bool ReadSymbolDataInternal(const uint8_t* obj_file,
    1.62 +                            const std::string& obj_filename,
    1.63 +                            const std::vector<std::string>& debug_dirs,
    1.64 +                            SecMap* smap, void* rx_avma,
    1.65 +                            void (*log)(const char*));
    1.66 +
    1.67 +}  // namespace lul
    1.68 +
    1.69 +#endif // LulElfExt_h

mercurial