Re: [RFC, gdbserver] Avoid defining linux_read_offsets when the target does not need it

Pedro Alves
2013-05-15T14:14:46Z

On 05/15/2013 12:25 PM, Luis Machado wrote:

> * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
> PT_DATA_ADDR and PT_TEXT_END_ADDR. Update comments.
> (linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
> PT_TEXT_END_ADDR guards. Update comments.
> (linux_target_op) <read_offsets): Conditionally define to
> linux_read_offsets if the target is UCLIBC and if it defines
> PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.

This is OK.

> +#if defined(__mcoldfire__)
> +/* These are still undefined in recent (3.10) kernels. */
> +#define PT_TEXT_ADDR 49*4
> +#define PT_DATA_ADDR 50*4
> +#define PT_TEXT_END_ADDR 51*4
> +/* BFIN already defines these constants in recent (3.10) kernels. */
> +#elif defined(BFIN)
> +#define PT_TEXT_ADDR 220
> +#define PT_TEXT_END_ADDR 224
> +#define PT_DATA_ADDR 228
> +/* These are still undefined in recent (3.10) kernels. */

But please avoid "recent" "new", etc. in code. Those get old fast.

Thanks,
--
Pedro Alves