public List<InstructionMetadata> doSearch(TaskMonitor taskMonitor) {

		// First get all the search ranges we have to search.  
		List<AddressRange> searchRanges =
			searchDialog.getControlPanel().getRangeWidget().getSearchRange();

		// Now set up a list to hold all the search results.  
		List<InstructionMetadata> retList = new ArrayList<InstructionMetadata>();

		// Loop over all ranges, performing a separate search on each of them.  We keep track of 
		// the range number so we can display it to the user in progress window.
		int rangeNum = 1;
		for (AddressRange range : searchRanges) {

			// First reset the progress bar for this range.
			taskMonitor.setProgress(0);
			taskMonitor.setMaximum(range.getLength());

			if (searchRanges.size() > 1) {
				taskMonitor.setMessage(
					"Searching range " + rangeNum + " of " + searchRanges.size());
			}
			else {
				taskMonitor.setMessage("Searching...");
			}

			// Now perform the search and add the results to our list.
			List<InstructionMetadata> meta = searchDialog.getSearchData().search(
				searchPlugin.getCurrentProgram(), range, taskMonitor);
			retList.addAll(meta);

			// Increment the range counter.
			rangeNum++;
		}

		return retList;
	}
Execute a memory search using the current settings in the dialog, returning the results.

@param taskMonitor the task monitor
@return list of instruction matches
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/SearchAllInstructionsTask.java