aboutsummaryrefslogtreecommitdiff
path: root/contrib/gdb
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1997-12-19 21:08:54 +0000
committerBruce Evans <bde@FreeBSD.org>1997-12-19 21:08:54 +0000
commit243d233f9f07a899aa9a6eb400b73301fc0c8380 (patch)
treeef87e9251975b5d8c314616b24a89357a2a256ed /contrib/gdb
parentea35435137b1b140cdec6896e39334dfba32dd3c (diff)
downloadsrc-243d233f9f07a899aa9a6eb400b73301fc0c8380.tar.gz
src-243d233f9f07a899aa9a6eb400b73301fc0c8380.zip
Notes
Diffstat (limited to 'contrib/gdb')
-rw-r--r--contrib/gdb/bfd/freebsd.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/contrib/gdb/bfd/freebsd.h b/contrib/gdb/bfd/freebsd.h
index 7e1d69d0df74..1c7d12d926a1 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) \