diff options
author | bde <bde@FreeBSD.org> | 1997-12-19 21:08:54 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1997-12-19 21:08:54 +0000 |
commit | 98ed8d085c9f70df6cb3cd8001ae788daaae3b41 (patch) | |
tree | 11792fafcbeb0e1ec868f895d9f53afb06b89741 | |
parent | 8f84818adad2b776c26d4a15a870a503e5ab0969 (diff) | |
download | FreeBSD-src-98ed8d085c9f70df6cb3cd8001ae788daaae3b41.zip FreeBSD-src-98ed8d085c9f70df6cb3cd8001ae788daaae3b41.tar.gz |
Override gdb's version of N_TXTADDR() with the (new) system version
so that gdb gets the text address right for kernels. Override some
other macros to get a consistent set.
Reviewed by: jdp
-rw-r--r-- | contrib/gdb/bfd/freebsd.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/contrib/gdb/bfd/freebsd.h b/contrib/gdb/bfd/freebsd.h index 7e1d69d..1c7d12d 100644 --- a/contrib/gdb/bfd/freebsd.h +++ b/contrib/gdb/bfd/freebsd.h @@ -21,9 +21,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* FreeBSD ZMAGIC files never have the header in the text. */ #define N_HEADER_IN_TEXT(x) 0 -/* ZMAGIC files start at offset 0. Does not apply to QMAGIC files. */ -#define TEXT_START_ADDR 0 - +/* A ZMAGIC file can start at almost any address if it is a kernel. */ +#define TEXT_START_ADDR dont use TEXT_START_ADDR + +/* The following definitions are essentially the same as the ones in + FreeBSD's <sys/imgact_aout.h>. They override gdb's versions, which + don't work for kernels. See ../include/aout/aout64.h. */ +#define N_TXTADDR(x) \ + (N_GETMAGIC(x) == OMAGIC || N_GETMAGIC(x) == NMAGIC \ + || N_GETMAGIC(x) == ZMAGIC \ + ? ((x).a_entry < (x).a_text ? 0 : (x).a_entry & ~TARGET_PAGE_SIZE) \ + : TARGET_PAGE_SIZE + sizeof(struct external_exec)) +#define N_TXTOFF(x) \ + (N_GETMAGIC(x) == ZMAGIC ? TARGET_PAGE_SIZE \ + : (N_GETMAGIC(x) == QMAGIC || N_GETMAGIC_NET(x) == ZMAGIC) ? 0 \ + : sizeof(struct external_exec)) +#define N_TXTSIZE(x) ((x).a_text) + +#define N_GETMAGIC(exec) \ + ((exec).a_info & 0xffff) #define N_GETMAGIC_NET(exec) \ (ntohl ((exec).a_info) & 0xffff) #define N_GETMID_NET(exec) \ |