It is shaping up as a cruel summer for debt investors wagering on a rebound in the oil-and-gas business. The investments may still hold advantages for the funds, despite the sharp declines in oil-related securities in July. The deals generally were struck at terms advantageous to the funds, including giving some preferred treatment in any restructuring, reflecting the intense cash squeeze on many oil producers late last year. The investments appeared well timed earlier this year, when oil prices rebounded as much as 30% after a deep decline in 2014. July’s commodity tumble—front-month crude futures fell 21% last month and another 4.1% Monday, to $45.17 a barrel—has extended the pain already felt around the sector. Exxon Mobil Corp. XOM -1.45 % and Chevron Corp. CVX -3.25 % said Friday they are both slashing stock-buyback programs, while Linn Energy LINE -18.81 % LLC said last week it planned to stop […]