This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Deprecate FUNCTION_START_OFFSET, subset of CONVERT_FUNC_PTR_ADDR


Hello,

Looking over the Randolph's PA descriptor problem drew my attention to FUNCTION_START_OFFSET. The VAX uses this to ``adjust'' a function pointer so that it instead points to the function's code address (the first few bytes of a vax function are not executible and need to be skipped over).

Thing is, this conversion is exactly what CONVERT_FUNC_PTR_ADDR is for. Given a function pointer return the function's code address. Given this overlap, I think FUNCTION_START_OFFSET should be deprecated - it is redundant.

The only got-ya is with GDB's lack of dicipline when it comes to correctly differentiating between function pointers and code addresses. This is clearly illustrated by the current 64-bit GNU/Linux PPC code: for that OSABI, instead of having function pointers address the function's descriptor, GDB has function pointers addressing the function's code address - definitly wrong(1). Eliminating FUNCTION_START_OFFSET will result in other code being ``fixed''.

comments,
Andrew

(1) This is why function parameters don't work for that OSABI - GDB passes the incorrect value to push dummy call.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]