From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Kettenis To: gdb-patches@sources.redhat.com Subject: [PATCH]: Convert SAVED_PC_AFTER_CALL into a function for i386 Date: Tue, 17 Apr 2001 16:21:00 -0000 Message-id: <200104172321.f3HNL9N03381@delius.kettenis.local> X-SW-Source: 2001-04/msg00182.html Yet anothet one. Mark Index: ChangeLog from Mark Kettenis * i386-tdep.c (i386_saved_pc_after_call): New function. * config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Redefine in terms of i386_saved_pc_after_call. (i386_saved_pc_after_call): New prototype. Index: i386-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-tdep.c,v retrieving revision 1.27 diff -u -p -r1.27 i386-tdep.c --- i386-tdep.c 2001/04/16 13:03:15 1.27 +++ i386-tdep.c 2001/04/17 23:18:55 @@ -365,6 +365,14 @@ i386_frame_chain (struct frame_info *fra return 0; } +/* Immediately after a function call, return the saved pc. */ + +CORE_ADDR +i386_saved_pc_after_call (struct frame_info *frame) +{ + return read_memory_unsigned_integer (read_register (SP_REGNUM), 4); +} + /* Return number of args passed to a frame. Can return -1, meaning no way to tell. */ Index: config/i386/tm-i386.h =================================================================== RCS file: /cvs/src/src/gdb/config/i386/tm-i386.h,v retrieving revision 1.15 diff -u -p -r1.15 tm-i386.h --- config/i386/tm-i386.h 2001/04/16 13:03:15 1.15 +++ config/i386/tm-i386.h 2001/04/17 23:18:55 @@ -68,12 +68,10 @@ struct type; extern int i386_skip_prologue (int); -/* Immediately after a function call, return the saved pc. Can't always go - through the frames for this because on some machines the new frame is not - set up until the new function executes some instructions. */ +/* Immediately after a function call, return the saved pc. */ -#define SAVED_PC_AFTER_CALL(frame) \ - (read_memory_unsigned_integer (read_register (SP_REGNUM), 4)) +#define SAVED_PC_AFTER_CALL(frame) i386_saved_pc_after_call (frame) +extern CORE_ADDR i386_saved_pc_after_call (struct frame_info *frame); /* Stack grows downward. */