NASA’s Opportunity rover trekking across Mars completed a marathon’s worth of driving Tuesday, extending its record-setting exploration of the red planet as engineers installed a software fix to overcome a problem with the aging robot’s flash memory.