12 Replies Latest reply on Apr 6, 2010 6:16 AM by AndrewSmart

    Can't see any source code in CodeAnalyst

    AndrewSmart

      Hi folks,

      I've been struggling to get this working for a week or two now. I'm trying to time-based profile my application "Midnight.exe" using CodeAnalyst which is integrated to VS2008 Pro.

      When viewing the results, under the "Processes" tab, I can see that Midnight.exe has a result of 5.91 Timer samples.

      Drilling into this, it then shows the breakdown of processes within Midnight.exe, of which the .exe itself shows 24.68 Timer Samples.

      Drilling further, it shows a list of function names with offsets and the number of timer samples for each. Here the symbol names for the functions are being displayed correctly.

      The problem comes when I drill down 1 more level into any of these functions. It displays the actual name of the source file that contains the relevant function, but no source code. The source files is listed with Timer Samples = 0 which doesn't seem right

      I've made sure the path is set correctly to my source files in the Options dialog within VS, and various other combinations of settings, but nothing seems to bring the source code up.

      When trying the "classic.exe" example that comes with CodeAnalyst, this works fine and I can see the actual source code.

      Can anyone suggest what might be wrong, or some other things to check as I've run out of ideas

      Thanks for any help

       

       

        • Can't see any source code in CodeAnalyst
          leiy

          Is the "midnight.exe" .NET application or native?

          In the "midnight.exe - data" view tab, you can find the instruction addresses that have samples.

          In the source view, can you trun on the disassembly by clicking "asm"? Does the start address of the function in source view match up with the function address in data view tab?

          Does the midnihgt.exe sync up with the .pdb file?

          -Lei

            • Can't see any source code in CodeAnalyst
              AndrewSmart

              Hi,

              Thanks for your reply

              Midnight.exe is a native application

              I cannot get any disassembly listing in the source view, only the filename of the file containing the function. It will not expand further than that.

              The "data" view contains all correct function names with offsets for each sample.

              How can I tell that Midnight.exe sync's up with the .pdb file ?

              Andrew

                • Can't see any source code in CodeAnalyst
                  AndrewSmart

                  Hi, can anyone see any other areas or things I could check to fix this issue ?

                  It seems odd that I can see the function names ok, but cannot drill into the source code to see which parts of those functions are getting hit most often.

                  It would seem like the program cannot locate the source files, but the directory containing the source is clearly defined in the options path

                    • Can't see any source code in CodeAnalyst
                      leiy

                      Andrew,

                      Please use the tool, Chkmatch (http://www.debuginfo.com/tools/chkmatch.html), to check if the .pdb sync up with the binary.

                      In side CodeAnalyst, please turn on "Alert when no source is available" on "Tool | CodeAnalyst Options | General tab".

                      If there is a relocsrcfile.map file under CodeAnalyst project directory, please delete it.

                      Let us know if it helps.

                       

                        • Can't see any source code in CodeAnalyst
                          AndrewSmart

                          Thanks for the suggestions:

                          Chkmatch confirms the .exe and .pdb are sync'd ok

                          Options are set as you suggest and I tried deleting the relocsrcfile.map file with no results either. I'm completely stumped on this one.

                          I checked the .pdb file with a text editor, and the source file paths embedded into the .pdb file do actually contain the source files so I don't think that is the issue.

                          I also tried ensuring that the .pdb and source files were in the same directory as the .exe file and this didn't make any difference either

                          Is it the .pdb file, or maybe the tool configuration ? How can we narrow the issue down somehow ?

                           

                            • Can't see any source code in CodeAnalyst
                              AndrewSmart

                              Hi,

                               

                              Still struggling to get this working. A few more details to what seems to be happening:

                              If I try to drill down into some standard library or DirectX routines / macros then I get presented with the relevant ASM code and symbols where available. I can also see the source code. There is an error if the source is not available.

                              But when I try to drill down into the routines that I have developed, then I don't get presented with anything. Neither the ASM or source code or anything. It seems like the analyst cannot locate the source/line information, even though it does correctly identify and list the source file in question. There is no error message to say that source information is not available, like there is when I'm drilling into other routines/libraries.

                              I tried upgrading to the latest version last night 2.95.781.0488, but the above issue still exists.

                              Are there any other things I can try to nail this problem as I'm determined to find it, but seem to spend so much time getting nowhere ?

                                • Can't see any source code in CodeAnalyst
                                  leiy

                                  THat's odd.

                                  The source code view maybe related to the pdb file. But you should be able to assembly view.

                                  Can you turn on the "Tools | CodeAnalyst Options | General Tab | Bypass Source (disassembly only)"? Then double click the mdoule you have, does it show disassembly view this time?

                                  If not, can you send us your binary for investigation?

                                  -Lei

                                    • Can't see any source code in CodeAnalyst
                                      AndrewSmart

                                      Hi Lei,

                                      When I turn on the "Bypass Source" option then I am now getting the ASM code when drilling into the individual functions. The address of the instructions in the asm view does match the address in the data view.

                                      If the "Bypass Source" option is left off, then I get nothing when drilling down into the individual functions.

                                      Does this help to narrow things down ? Does it point to a problem with the .pdb file ?

                                      Many thanks for your continued help

                                      Andrew