Answer
Baidicheng served as Liu Bei's final residence until his death. After his defeat at the Battle of Xiaoting against Sun Quan's forces, Liu Bei retreated to Baidicheng, a strategically significant city located in present-day Fengjie County, Chongqing, China. It was during his stay in Baidicheng that Liu Bei famously uttered his "Baidi Testament," expressing his last wishes and entrusting the future of Shu to his trusted advisor, Zhuge Liang.