If they are already dead from the event that lead us to being stranded? Of course! It would be stupid not to.
If they are not dead, no. Never.
Even I was the one that died, I'd fully expect my remains to be made the absolute best of: that means cutting me up into various meals, cooking me, and surviving.
It depends on whether I know the situation that we're in when it happens. If I already knew that there was absolutely no food and no chance of rescue, then I would just chill and starve to death. There would be no need to ruin my friend's body. If I didn't know the situation, then I would keep searching for food until I nearly starved to death, then I would try to cook him, but I would probably be too weak from starvation. Either way, I guess his body doesn't get eaten when I'm around.