# Debugger: Modules and Sections

The concept of a module may vary from platform to platform, but in most cases, it refers to a binary image which is loaded or mapped into memory comprising some portion of the target's executable code. Likely, these are the same files that Ghidra can import for static analysis. Similarly, the concept of a section may vary, but in most cases, it refers to a portion of a module, possibly backed by its binary image. This window displays information about modules, and sometimes their sections, known to the connected debugger. Information in this window reflects what has been recorded into the current trace, which in turn comes from a target. The top table displays module information, while the bottom table displays section information.

## Table Columns

The top table, which lists modules, has the following columns:

- Base Address - if available, the minimum address where the module is mapped in the target's memory. Double-clicking this field navigates to the address.
- Max Address - if available, the maximum address where the module is mapped in the target's memory. Double-clicking this field navigates to the address.
- Name - a short name for the module, typically its file name.
- Module Name - the name of the module, ideally its full path on the target's filesystem.
- Lifespan - denotes the recorded load and unload times of the module, i.e., the span of time for which the module record is applicable.
- Length - the length from base address to max address, inclusive. Note that not every page in the range is necessarily mapped.

The bottom table, which lists sections, has the following columns:

- Start Address - the minimum virtual memory address of the section. Double-clicking this field navigates to the address.
- End Address - the maximum virtual memory address of the section. Double-clicking this field navigates to the address.
- Section Name - the name of the section given by the debugger, usually the same as the name given in the module's header.
- Module Name - the name of the module containing this section.
- Length - the number of bytes in the section.

## Actions

This window provides several actions, some of which are only accessible via pop-up menus.

### Import From File System

This action is available from a module's or section's pop-up menu. It prompts the user to import the module from the local file system into Ghidra as a static image.

### Capture Symbols

This action is available when the current trace is associated with a live target and "at the present," and at least one module is selected. It commands the recorder to copy all symbols (that the debugger knows about) for the selected modules into the trace. These are often the same symbols that Ghidra imports from the static image, anyway.

### Capture Types

This action is available when the current trace is associated with a live target and "at the present," the target presents type information, and at least one module is selected. It commands the recorder to copy and convert all types (that the debugger knows about) for the selected modules to Ghidra data types in the trace. These are often the same types that Ghidra imports from the static image, anyway.

### Map Identically

This action is available when both a trace and a program are opened. It maps the current trace to the current program using identical addresses. This action ignores the module list. It is a suitable mapping when the current program is loaded in the trace without relocation. It is also a fallback worth trying in the absence of a module list.

### Map Manually

This action is always available. It simply displays the Static Mappings window. From there, it is possible to construct the map from trace memory to static images entirely by hand.

### Map Modules

This action is available from the modules' or sections' pop-up menu. It searches the tool's open programs for the selected modules and proposes new mappings. The user can examine and tweak the proposal before confirming or canceling it. Typically, this is done automatically by the Map Modules debugger bot. By selecting "Memorize" and confirming the dialog, the user can cause the mapper to re-use the memorized mapping in future sessions. The memorized module name is saved to the program database.

### Map Module to Current Program

This action is available from a single module's pop-up menu, when there is an open program. It behaves like Map Modules, except that it will propose the selected module be mapped to the current program. This action with the "Memorize" toggle is a good way to override or specify a module mapping once and for all.

### Map Sections

This action is analogous to the Map Modules action. It searches the tool's open programs for blocks matching the selected sections and proposes new mappings. Users who prefer this to Map Modules should also consider using the Map Sections debugger bot.

### Map Sections to Current Program

This action is available from the pop-up menu, when the current selection indicates a single module and there is an open program. It behaves like Map Sections, except that it will attempt to map sections from the indicated module to blocks in the current program.

### Map Section to Current Block

This action is available from a single section's pop-up menu, when there is an open program. It behaves like Map Sections, except that it will propose the selected section be mapped to the block containing the cursor in the static listing.

### Import Missing Module

This action is offered to resolve a "missing module" console message. It is equivalent to Import From File System on the missing module.

### Map Missing Module

This action is offered to resolve a "missing module" console message. It is equivalent to Map Module To on the missing module.

### Filter Sections by Module

This action is always available. By default the bottom table displays all sections in the current trace. When this toggle is enabled, and at least one module is selected, the bottom table will only include sections contained by a selected module.

### Select Addresses

This action is available when at least one module or section is selected. It selects all addresses in the dynamic listing contained by the selected modules or sections.

### Select Rows

This action is available when the dynamic listing's cursor is at a valid location. It selects the module and section, if applicable, containing that cursor. If the dynamic listing has a selection, it selects all modules and sections intersecting that selection.