diff --git a/Ghidra/Features/Base/src/main/help/help/topics/SourceFilesTablePlugin/SourceFilesTable.html b/Ghidra/Features/Base/src/main/help/help/topics/SourceFilesTablePlugin/SourceFilesTable.html index 8181c6f2b6..8dde529814 100644 --- a/Ghidra/Features/Base/src/main/help/help/topics/SourceFilesTablePlugin/SourceFilesTable.html +++ b/Ghidra/Features/Base/src/main/help/help/topics/SourceFilesTablePlugin/SourceFilesTable.html @@ -11,7 +11,93 @@ -

Source File Information

+

Source Files Table Plugin

+ +

This plugin shows the source file information (described below) associated with the current program and allows the user + to manage source file path transforms.

+ +

Source Files Table

+ +
+

Each row in this table corresponds to a Source File added to the program's source file + manager. The columns show the source file, path, transformed path, and number of source map + entries for a source file. If the Transformed Path column is empty for a given source + file, then no transformation applies to that file. Note that there are optional columns, + hidden by default, to show the SourceFileIdType and identifier of each source file.

+ +

Reload Model

+ +

This action reloads the Source File Table. Note that this can be an expensive operation + since the number of source map entries must be computed for each source file. For this + reason, the action is only enabled after program events which might change the data shown in + the table.

+ +

Show Source Map Entries

+ +

This action brings up a table which displays all of the source map entries for the + selected source file.

+ +

Transform File

+ +

This action allows you to create a file transform for the selected source file. The input + must be an absolute, normalized file path using forward slashes.

+ +

Transform Directory

+ +

This action allows you to create a directory transform whose source is a user-selected + parent directory of the corresponding source file. The input must be an absolute, normalized + directory path using forward slashes.

+
+ +

Transforms Table

+ +
+

This table shows all of the source file transformations defined for a program.

+ +

Remove Transform

+ +

This action removes the selected transform from the list of transforms.

+ +

Edit Transform

+ +

This action allows you to change the destination of a transform (but not the source).

+
+ +

Listing Actions

+ +
+

View Source

+ +

This Listing action is enabled if there is source map information for an address. It will + open the corresponding source file at the appropriate line in a source code viewer (currently + Eclipse and VS Code are supported). Options for configuring the viewer are described below. If there are multiple source map entries + defined for an address, the user will be prompted to select which one to send to the viewer. + Performing this action on a particular line of the Source Map Listing field will open the + corresponding file in the viewer even if there are multiple entries defined at the current + address.

+
+ +

Plugin Options

+ +

These options can be changed from the Code Browser via Edit->-Tool Options->Source + Files and Transforms.

+ +
+

Use Existing As Default

+ +

If enabled, the SourcePathTransformer will just return a SourceFile's path if no transform + applies to the file.

+ +

Viewer for Source Files

+ +

Selects the viewer to use for source files. The supported viewers are Eclipse and Visual + Studio Code. Your viewer of choice must be configured via the appropriate option in the + Front-End tool (aka Ghidra Project Window).

+
+ +

Source File Information

Ghidra can store information about the source files for a program, including their locations in the build environment and the correspondence between lines of source code and addresses in a @@ -26,8 +112,8 @@

    -
  1. A path, which must be an absolute, normalized path using forward slashes. - E.g., "/usr/src/main/file.c", "/C:/Users/Ghidra/sourceFile.cc".
  2. +
  3. A path, which must be an absolute, normalized path using forward slashes. E.g., + "/usr/src/main/file.c", "/C:/Users/Ghidra/sourceFile.cc".
  4. A SourceFileIdType, which can be NONE, UNKNOWN, TIMESTAMP_64, MD5, SHA1, SHA256, or SHA512.
  5. @@ -75,15 +161,18 @@

    Source File Manager

    -

    Source files and source map entries are managed by a program's source file manager (accessed - via Program.getSourceFileManager()). A source file must be added to a program before it can - used in a source map entry.

    +

    Source files and source map entries are managed by a program's source file manager. A source + file must be added to a program before it can used in a source map entry. The DWARF, PDB, and + Go analyzers add source files and source map entries to a program by default. There are no GUI + actions to add source files or source map entries to a program, but such information can be + added to a program via a Ghidra Script. There are example scripts in the "SourceMapping" script + category.

    NoteNote that adding source files, - removing source files, or changing the source map requires an exclusive checkout if - the program is in a shared Ghidra repository. Reading the source file list or source map does - not require an exclusive checkout.

    + removing source files, or changing the source map requires an exclusive checkout if the + program is in a shared Ghidra repository. Reading the source file list or source map does not + require an exclusive checkout.




    @@ -112,8 +201,9 @@ path.
  6. Directory Transforms, which replace a parent directory of a source file's path - with another directory. For example, the directory transform "/src/ -> "/usr/test/files/" - would transform the path "/src/dir1/file.c" to "/usr/test/files/dir1/file.c".
  7. + with another directory. For example, the directory transform "/src/ -> + "/usr/test/files/" would transform the path "/src/dir1/file.c" to + "/usr/test/files/dir1/file.c".


@@ -130,102 +220,17 @@ method UserDataPathTransformer.getPathTransformer(Program). Note that modifications to the path transformer are not affected by undo or redo actions in Ghidra.

-

Source Files Table Plugin

- -

This plugin shows the source file information associated with the current program and allows - the user to manage source file path transforms.

- -

Source Files Table

- -
-

Each row in this table corresponds to a Source File added to the program's source file - manager. The columns show the source file, path, transformed path, and number of source map - entries for a source file. If the Transformed Path column is empty for a given source - file, then no transformation applies to that file. Note that there are optional columns, - hidden by default, to show the SourceFileIdType and identifier of each source file.

- -

Reload Model

- -

This action reloads the Source File Table. Note that this can be an expensive operation - since the number of source map entries must be computed for each source file. For this - reason, the action is only enabled after program events which might change the data shown in - the table.

- -

Show Source Map Entries

- -

This action brings up a table which displays all of the source map entries for the - selected source file.

- -

Transform File

- -

This action allows you to create a file transform for the selected source file. The input - must be an absolute, normalized file path using forward slashes.

- -

Transform Directory

- -

This action allows you to create a directory transform whose source is a user-selected - parent directory of the corresponding source file. The input must be an absolute, normalized - directory path using forward slashes.

-
- -

Transforms Table

- -
-

This table shows all of the source file transformations defined for a program.

- -

Remove Transform

- -

This action removes the selected transform from the list of transforms.

- -

Edit Transform

- -

This action allows you to change the destination of a transform (but not the source).

-
- -

Listing Actions

- -
-

View Source

- -

This Listing action is enabled if there is source map information - for an address. It will open the corresponding source file at the - appropriate line in a source code viewer (currently Eclipse and VS Code - are supported). Options for configuring the viewer are described - below. If there are - multiple source map entries defined for an address, the user will be - prompted to select which one to send to the viewer. Performing - this action on a particular line of the Source Map Listing field will - open the corresponding file in the viewer even if there are multiple - entries defined at the current address. -

- -
- - -

Plugin Options

- -
-

Use Existing As Default

- -

If enabled, the SourcePathTransformer will just return a SourceFile's path if - no transform applies to the file.

- -

Viewer for Source Files

-

Selects the viewer to use for source files. The supported viewers are Eclipse - and Visual Studio Code. Your viewer of choice must be configured via the - appropriate option in the Front-End tool. - -

-

Related Topics: