Results 1 to 4 of 4

Thread: 8.2 source search path problem

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    2

    8.2 source search path problem

    Hi,
    I just tried to use 8.2 but I can't get the source search path to work like it did in 8.0.

    In 8.0, I set EXECUTABLE_PATH to .:/rel/cvs which worked great. TVD would pick up files out of my local sandbox first then look in the repository for the rest.

    Using the same search path in 8.2, I only get assembly.

    The only way I could find to get TVD to pick up files from my local sandbox was to set this:
    Code:
    dset   -version 12 SOURCE_SEARCH_MAPPINGS {;^.*(lib/.*)$;=;./\1;}
    Or I can use this one to pick up sources out of the repository:
    Code:
    dset   -version 12 SOURCE_SEARCH_MAPPINGS {;^.*(lib/.*)$;=;/rel/cvs/\1;}
    But I can't figure out how to do both. Any ideas?

    I could probably figure out the mapping if I knew what paths TVD was picking up out of the executable. Is there a command I can use to see the directories TVD is using for a symbol?

    Unfortunately, 8.2 is useless if I can't get this working so I've reverted to 8.0.

  2. #2

    Re: [bwilson] 8.2 source search path problem

    Hi,

    I'm confused. I really haven't explored this feature, but from my reading of it you should be able to set multiple mappings, separated by colons ":". Have you tried


    [size 4]dset -version 12 SOURCE_SEARCH_MAPPINGS {;^.*(lib/.*)$;=;./\1;:;^.*(lib/.*)$;=;/rel/cvs/\1;}

    and, if so, what happened?

    TotalView is using the path information specified by the compiler at build time. What exactly is included depends on your compiler. Some include full path names, which should pick up everything in you sandbox, though I'm not sure what it will do if some of the files are still in the repository. Other compilers use relative paths so the debugger gets confused when the executables are built in one directory and then moved to a different directory. Of course many makefiles cd to a source directory, compile everything there, and then move on to another directory, and the final product may be pulling .o files from many places. So that tends to increase the problem with relative paths. Some compilers, IBM xlc and xlf compilers come to mind, allow you to specify that the full pathname gets used, with the -qfullpath option.

    Does that help at all?

    Regards,


    [/size]

    Pete Thompson
    TotalView Customer Services

  3. #3
    Junior Member
    Join Date
    Jul 2007
    Posts
    2

    Re: [Peter-TotalView-Tech] 8.2 source search path problem

    Thanks for the response.

    I'm not sure if I tried both before posting but maybe because I just tried putting both and the first one wins. Ie. it'll find the sandbox sources if I put the version you suggest. If I switch the order of the mappings, it'll find the source in the repository but not my sandbox.

    Let's forget about mappings for a second because they seem to be designed for manipulating the path. But I can't get TVD (in 8.2) to pull sources from the repository using a search path. Shouldn't that work? ie. shouldn't the following work (as it does in 8.0)
    Code:
    dset -version 12 SOURCE_SEARCH_PATH {${COMPILATION_DIRECTORY}:/rel/cvs/}
    I'm on RedHat linux compiling with gcc. If I do "nm -l a.out" here's examples of the two types of symbol references:
    Code:
    ACS_cut      lib/acs/acs_copy.c:986
    delete_mt_key_ui     lib/mt/obj/debug-ws4-x86_64-gcc3.4_64/src/mt_key_ui.cc:246
    These match what I see in the "Preferred scope:" field if I do "Lookup Function..." so I'm assuming TVD is finding these paths.

    The first is a symbol where the source is from the repository. Prefixing /rel/cvs/ would find the source.

    The second is from the sandbox. Prefixing the current directory would find the source. Putting "." in the search path doesn't work. Weird but...

    Putting ${COMPILATION_DIRECTORY} in the search path does find the sandbox sources so this is fine.

    Ok, I just remembered, if I put /rel/cvs/lib/acs in the search path it will find acs_copy.c. I guess I could list all 400 libraries in /rel/cvs/lib individually but that seems stupid when the location is there and 8.0 handled this properly.

  4. #4
    Senior Member
    Join Date
    Jun 2006
    Location
    Natick MA
    Posts
    145

    Re: [bwilson] 8.2 source search path problem

    Let me see if I can help. TotalView 8.1 introduced a new Search Path mechanism. It is documented in the Help for the Search Path dialog, which you can find online here http://<a href="http://www.totalview...-12.html </a>.

    The problem with the search path with versions of TotalView before 8.1 is that it preferred the user specified directories specified in EXECUTABLE_PATH (which was equivalent to the File > Search Path) over the directories where the compiler told us where the source files live. In most cases this really is where the source files live unless the compiler hasn't told us about it or the source files have moved. What the new version offers is, first a more reasonable default of searching the directories the compilers told us about and second a very flexible way of changing it. SOURCE_SEARCH_PATH is the search path used to find sources. It defaults to this:

    d1.<> dset SOURCE_SEARCH_PATH
    ${COMPILATION_DIRECTORY}:${EXECUTABLE_PATH}:${EXEC UTABLE_DIRECTORY}:$links(${EXECUTABLE_DIRECTORY}): .:${TOTALVIEW_SRC}

    ${COMPILATION_DIRECTORY} is where the compiler tells us your source are.

    If I were to guess what is happening in your case, your setting for EXECUTABLE_PATH had no effect in earlier versions. The source files did not live in /rel/src itself and TVD never searched the whole source tree. What was happening is that it first searched what you had in EXECUTABLE_PATH and then found the directories in the COMPILATION_DIRECTORY which you couldn't change or omit in older versions. In TVD 8.2 you somehow removed COMPILATION_DIRECTORY from SOURCE_SEARCH_PATH and as a result TVD couldn't find your source files.

    What I would do is revert to the defaults and see if TVD finds your source. Only then only change the Search Path if you need to, but in no case completly omit the COMPILATION_DIRECTORY. To revert to defaults open the GUI and go to File > Search Path, click on the Sources tab and hit the Defaults button.

    FWIW, if you do need to specify the root of the source tree, do something like this:

    $tree(/rel/cvs)

    this will tell TVD to search recursively in all directories rooted from /rel/cvs.

    Search path mappings do not apply to this case.

    Let us know if this helps.
    Josh Carlson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •