Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.243

Navigation: Debugging > How-to guides

Scroll Prev Top Next More

Locating the source code

In this topic:

Locating files from View / Symbols

Locate files from an open Editor document

Original path to the source files is known

Original path to the source files is unknown

Use relative paths to make the workspace configuration portable

 

 

Use the Directories page to:

Locate the source code referenced in Symbol Files, which is necessary to allow source-level debugging or

Use these examples to share a winIDEA workspace between your coworkers from a computer where the application was compiled to a computer where you want to start debugging.

 

You can locate files:

From View  / Symbols

From an open Editor document

If the original path to the source files is known

If the original path to the source files is unknown

Use relative paths to make the workspace configuration portable

 

 

Locating files from View / Symbols

The Symbols view shows Modules whose source are not found in grayed color.

 

number1

Right-click and select Locate Source.

number2

Browse to the actual location of the clicked file and select it.

winIDEA will:

Determine the correct path conversion.

Adjust configuration in Debug / Configure Session / Application / Directories.

Try locating the sources (without breaking live session).

Symbols window and editor LoC (Line of Code) markers will be refreshed.

locate-source

 

 

Locate files from an open Editor document

This use case assumes that you opened the correct source files manually.

 

number1

Right-click in the Editor to open the context menu.

number2

Via Associate to symbol file, select one of the presented paths

These are the paths that are reported in the Symbols File. If multiple applications or symbol files contain a file with this name, all will be presented. Make sure to select the one(s) who actually contain this exact file.

 

winIDEA will:

Determine the correct path conversion.

Adjust configuration in Debug / Configure Session / Application / Directories.

Try locating the sources (without breaking live session).

Symbols window and editor LoC (Line of Code) markers will be refreshed.

 

locate-sources

 

 

Original path to the source files is known

For these examples we use:

Source files location of a compiled application: C:\Project

Source files location of a debugged application: L:\Mirror\Project

In the Directories page you can define source files if you know where the source files are located on both computers or if you don’t know the original path to the source files.

 

number1

Go to Debug / Configure Session / Application / Directories.

number2

Enable Convert source file paths.

number3

Replace the old path with the new path.

Type into the field C:\Project=L:\Mirror\Project.

convert-source-file-paths

 

 

Original path to the source files is unknown

number1

Perform a Download.

You can use the Demo Mode.

 

number2

Go to the View / Debug / Symbols Browser and select Modules.

number3

Click on one of the files and the path displays under the list of files.

Number4

Compare this path to the actual path and identify the required replacement.

convert-source-file-paths2

Number5

Open Debug / Configure Session / Application / Directories.

number6

Enable Convert source file paths.

number7

Replace the old path with the new path.

Type into the field C:\Project=L:\Mirror\Project.

convert-source-file-paths3

 

 

Use relative paths to make the workspace configuration portable

You may specify the new path relative to the workspace file, when the workspace file is located in the same folder hierarchy.

 

If a winIDEA directory is created next to the sources the relative path from the workspace file in this case is ..\Project.

If you specify the relative path it will allow you to copy the entire L:\Mirror directory to any other location or PC and winIDEA will still locate the source code correctly.

Copyright © 2024 TASKING Germany GmbH