1 extern int mprprint(int, char *, ...); 2 3 #if __GNUC__ < 2 4 #error you need gcc >= 2 to use this abomination 5 #endif 6 7 struct frame 8 { 9 void *lreg[8]; /* local registers */ 10 void *ireg[8]; /* in registers */ 11 }; 12 13 void 14 mprbt(int fd) 15 { 16 struct frame *sp = __builtin_frame_address(1); 17 18 while (sp && sp->ireg[7]) { 19 mprprint(fd, "%U:", sp->ireg[7]); 20 sp = sp->ireg[6]; 21 } 22 }