summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2007-10-31 19:39:52 +0000
committerotto <otto@openbsd.org>2007-10-31 19:39:52 +0000
commitb2f11775e43d47c3f6bca352c5b6beddafaef541 (patch)
tree2bf699abc715fb73e97b25eea074245a335e0b62
parent"signal" is an argument, not a flag; (diff)
downloadwireguard-openbsd-b2f11775e43d47c3f6bca352c5b6beddafaef541.tar.xz
wireguard-openbsd-b2f11775e43d47c3f6bca352c5b6beddafaef541.zip
Pull from master repo, commit by gmcgarry:
Provide compile-time flag STAB_LINE_ASSOLUTE which creates N_SLINE stabs using absolute addresses instead of relative addresses. Fixes debugging on OSX (and probably other non-ELF targets).
-rw-r--r--usr.bin/pcc/ccom/stabs.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.bin/pcc/ccom/stabs.c b/usr.bin/pcc/ccom/stabs.c
index 8263add7129..71e3ba6f85d 100644
--- a/usr.bin/pcc/ccom/stabs.c
+++ b/usr.bin/pcc/ccom/stabs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stabs.c,v 1.2 2007/10/20 18:24:11 otto Exp $ */
+/* $OpenBSD: stabs.c,v 1.3 2007/10/31 19:39:52 otto Exp $ */
/*
* Copyright (c) 2004 Anders Magnusson (ragge@ludd.luth.se).
@@ -183,7 +183,11 @@ findtype(TWORD t, union dimfun *df, struct suedef *sue)
void
stabs_line(int line)
{
+#ifdef STAB_LINE_ABSOLUTE
+ cprint(savestabs, ".stabn %d,0,%d," STABLBL, N_SLINE, line, stablbl);
+#else
cprint(savestabs, ".stabn %d,0,%d," STABLBL "-%s", N_SLINE, line, stablbl, exname(curfun));
+#endif
cprint(1, STABLBL ":", stablbl++);
}
@@ -193,8 +197,12 @@ stabs_line(int line)
void
stabs_lbrac(int blklvl)
{
+#ifdef STAB_LINE_ABSOLUTE
+ cprint(savestabs, ".stabn %d,0,%d," STABLBL, N_LBRAC, blklvl, stablbl);
+#else
cprint(savestabs, ".stabn %d,0,%d," STABLBL "-%s",
N_LBRAC, blklvl, stablbl, exname(curfun));
+#endif
cprint(1, STABLBL ":", stablbl++);
}
@@ -204,8 +212,13 @@ stabs_lbrac(int blklvl)
void
stabs_rbrac(int blklvl)
{
+#ifdef STAB_LINE_ABSOLUTE
+ cprint(savestabs, ".stabn %d,0,%d," STABLBL "\n",
+ N_RBRAC, blklvl, stablbl);
+#else
cprint(savestabs, ".stabn %d,0,%d," STABLBL "-%s\n",
N_RBRAC, blklvl, stablbl, exname(curfun));
+#endif
cprint(1, STABLBL ":", stablbl++);
}