Thread: Symbol not found?

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    7

    Symbol not found?

    Hi,
    My Source Insight (a code reading software) could not find the definition of the symbol "_mfn", then I searched for the whole project of source files but still couldn't find it's definition. How can that be??? Thanks in advance.

    Here's the code:
    Code:
    static inline mfn_t gfn_to_mfn(struct domain *d, unsigned long gfn)
    {
        if ( !paging_mode_translate(d) )
            return _mfn(gfn); /* It is HERE. */
        if ( likely(current->domain == d) )
            return gfn_to_mfn_current(gfn);
        else 
            return gfn_to_mfn_foreign(d, gfn);
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    So does it compile?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    maybe it's a define.

  4. #4
    Registered User
    Join Date
    Oct 2007
    Posts
    7
    I think it does, for the code is from a release version of an open source project. Could that symbol be something related with the compiler? But "_mfn" which stands for "Machine Frame Number" doesn't look like a compiler-related thing.

  5. #5
    Registered User
    Join Date
    Oct 2007
    Posts
    7
    Quote Originally Posted by robwhit View Post
    maybe it's a define.
    But, if such is the case, I'd have been able to find it by search. I'm at a loss.
    Last edited by pighogswine; 10-27-2007 at 01:39 PM.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Have you done a simple text search as opposed to any kind of symbol lookup?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  7. #7
    Registered User
    Join Date
    Oct 2007
    Posts
    7
    Yes, I did the simple string search, and only found the using of the _mfn macro/function or whatever.

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well if it compiles, then it must be in a file which isn't in your project.

    Perhaps try a directory search using explorer, or say "grep -R" to search all the files in the project tree.

    Another possibility is that it is a constructed symbol by some clever use of the ## pre-processor operator to construct the symbol on the fly at compile time. Such symbols would be invisible to the likes of SI.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  9. #9
    Registered User
    Join Date
    Oct 2007
    Posts
    7
    Quote Originally Posted by Salem View Post
    Well if it compiles, then it must be in a file which isn't in your project.

    Perhaps try a directory search using explorer, or say "grep -R" to search all the files in the project tree.
    Still no satisfying result
    Someone might be kind enough to have a try. The source of the whole project is here:
    http://bits.xensource.com/oss-xen/re...-3.1.0-src.tgz

  10. #10
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    A couple of things to try

    1. Compile that source file with the "-E" flag to see whether _mfn is a real symbol, or something which was substituted using a macro.

    2. Link with the "--trace-symbol=symbol" option of the linker to get a report of where the symbol is declared and used.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. inet_aton()... Noob needs help with sockets :|
    By Maz in forum C++ Programming
    Replies: 3
    Last Post: 11-22-2005, 04:33 PM
  2. help!!!!
    By johnh444 in forum C++ Programming
    Replies: 5
    Last Post: 07-04-2004, 01:16 PM
  3. Output Question
    By Drew in forum C++ Programming
    Replies: 2
    Last Post: 09-16-2003, 05:40 PM
  4. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 03:01 PM