This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC, gdbserver] Avoid defining linux_read_offsets when the target does not need it
- From: Pedro Alves <palves at redhat dot com>
- To: lgustavo at codesourcery dot com
- Cc: "'gdb-patches at sourceware dot org'" <gdb-patches at sourceware dot org>, Mike Frysinger <vapier at gentoo dot org>
- Date: Wed, 15 May 2013 15:14:39 +0100
- Subject: Re: [RFC, gdbserver] Avoid defining linux_read_offsets when the target does not need it
- References: <519370AE dot 50908 at codesourcery dot com>
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