Proper food sanitation and storage may prevent further infestations. They require long canes instead of spurs to produce good crops. Remove the old fruiting canes and leave the new canes in place. You will need only three or four canes on each vine. You are looking at borer larvae that tend to attack injured or stressed trees.
Insecticides are of no use against larvae under the bark.
Remove and dispose of all dead or dying limbs. If your entire tree is dying, remove it so that other plantings are not affected. A Certified Arborist can evaluate the extent of the problem and recommend the appropriate action. Prevention is the best management. Keep trees vigorous and guard them from injury and sunburn.