toolsandutils/e32tools/checklib/object/coff/coff_symbol.cpp
changeset 0 83f4b4db085c
child 1 d4b442d23379
equal deleted inserted replaced
-1:000000000000 0:83f4b4db085c
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "coff_symbol.h"
       
    17 
       
    18 
       
    19 namespace coff
       
    20 {
       
    21     Symbol::Symbol(const char* p1, const char* p2)
       
    22         : m_data( reinterpret_cast<const coff_symentry_t*>(p1) )
       
    23     {
       
    24         if ( unsigned(p2 - p1 + 1) < sizeof(coff_symentry_t) )
       
    25         {
       
    26              //throw
       
    27         }
       
    28     }
       
    29 
       
    30     unsigned Symbol::get_entrysize()
       
    31     {
       
    32         return sizeof(coff_symentry_t);
       
    33     }
       
    34 
       
    35     unsigned Symbol::get_name() const
       
    36     {
       
    37         // At the moment we can't handle inlined names. It shouldn't be necessary
       
    38         // right now, though, as the mangled name of all ::operator new functions
       
    39         // are more than eight characters long.
       
    40         if (m_data->is_inline)
       
    41         {
       
    42             return 0;
       
    43         }
       
    44 
       
    45         return m_data->offset;
       
    46     }
       
    47 
       
    48     unsigned Symbol::get_section() const
       
    49     {
       
    50         return m_data->section;
       
    51     }
       
    52 
       
    53     unsigned Symbol::get_auxcount() const
       
    54     {
       
    55         return m_data->aux_count;
       
    56     }
       
    57 
       
    58 }
       
    59 
       
    60