be dead on (one's) feet
1. To be near to the point of collapse or losing consciousness (as due to exhaustion or injury) while still remaining on one's feet; to be just short of being asleep or unconscious. It seems dangerous to force sleep-deprived doctors to attend to their patients while they're dead on their feet.
2. To be all but or as good as defeated; to be still functioning, but past the point of usefulness or productivity. The company has managed to remain open, but, truth be told, it's really been dead on its feet for the last year.