It is narrated from Sayyiduna Jabir (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) used to forbid us "to face the qiblah or turn our backs to it with our private parts when we pour out water (that is, urinate)." Then I saw him (peace and blessings be upon him) a year before his death urinating while facing the qiblah.
(b) In the Sunan of Abu Dawud the wording is: I saw him a year before his soul was taken, sitting facing the qiblah.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 440