Skip to content

Commit

Permalink
Merge pull request #2115 from ghaerr/hostdisasm
Browse files Browse the repository at this point in the history
[cmds] Get hostdisasm working again
  • Loading branch information
ghaerr authored Nov 24, 2024
2 parents 1d539e5 + a1018c2 commit cb18136
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion elkscmd/Applications
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,6 @@ basic/basic :basic :1200k
advent/advent :other :1440c
advent/advent.db ::lib/advent.db :other :1440c
debug/disasm :other :1440k
debug/nm :other :1440c
debug/nm86 :other :1440c
debug/system.sym ::lib/system.sym :other :1440c
debug/testsym :other :1440c
6 changes: 3 additions & 3 deletions elkscmd/debug/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.o
disasm
nm86
nm
opcodes
testsym
disasm
hostdisasm
opcodes
hostnm86
8 changes: 4 additions & 4 deletions elkscmd/debug/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ LDFLAGS += -maout-symtab

###############################################################################

PRGS = testsym disasm nm opcodes
PRGS = testsym disasm nm86 opcodes

HOSTPRGS = nm86 hostdisasm
HOSTPRGS = hostnm86 hostdisasm
HOSTCFLAGS += -I. -I$(TOPDIR)/elks/include
SYMS_C = $(TOPDIR)/libc/debug/syms.c

Expand All @@ -35,7 +35,7 @@ testsym: testsym.o
disasm: dis.o disasm.o
$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

nm: nm86.o
nm86: nm86.o
$(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)

system.sym:
Expand All @@ -54,7 +54,7 @@ dis.o: dis.c
nm86.o: nm86.c
$(CC) $(CFLAGS) $(NOINSTFLAGS) -c -o $*.o $<

nm86: nm86.c $(SYMS_C)
hostnm86: nm86.c $(SYMS_C)
$(HOSTCC) $(HOSTCFLAGS) -D__far= -o $@ $^

hostdisasm: dis.c disasm.c $(SYMS_C)
Expand Down
6 changes: 5 additions & 1 deletion elkscmd/debug/disasm.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/* ELKS disassembler header file */

#define noinstrument __attribute__((no_instrument_function))
#if defined(__ia16__) || defined(__WATCOMC__)
#include <sys/cdefs.h>
#else
#define noinstrument
#endif

/* to be defined by caller of disasm() */
char * noinstrument getsymbol(int seg, int offset);
Expand Down
3 changes: 2 additions & 1 deletion elkscmd/misc_utils/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
miniterm
compress
hostcompress
ed
float
tar
Expand All @@ -15,3 +14,5 @@ uncompress
uuencode
uudecode
zcat
hostcompress
hosthd
5 changes: 4 additions & 1 deletion elkscmd/misc_utils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(BASEDIR)/Makefile-rules
#TODO: fix uncompress zcat lpfilter disabled
PRGS = tar miniterm ed od hd time kilo mined sleep tty uuencode uudecode compress

HOSTPRGS = hostcompress
HOSTPRGS = hostcompress hosthd

all: $(PRGS)

Expand Down Expand Up @@ -54,6 +54,9 @@ uuencode: uuencode.o
uudecode: uudecode.o
$(LD) $(LDFLAGS) -o uudecode uudecode.o $(LDLIBS)

hosthd: hd.c
$(HOSTCC) $(HOSTCFLAGS) -D__far= hd.c -o $@

hostcompress: compress.c
$(HOSTCC) $(HOSTCFLAGS) compress.c -o $@

Expand Down
4 changes: 4 additions & 0 deletions libc/include/debug/instrument.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/* ELKS stack trace and instrumentation functions library */
/* Jan 2023 Greg Haerr */
#if defined(__ia16__) || defined(__WATCOMC__)
#include <sys/cdefs.h>
#else
#define noinstrument
#endif

/* calc_push_count returns */
#define BP_PUSHED 0x0100
Expand Down
4 changes: 4 additions & 0 deletions libc/include/debug/syms.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/* ELKS symbol table support */
#if defined(__ia16__) || defined(__WATCOMC__)
#include <sys/cdefs.h>
#else
#define noinstrument
#endif

/* symbol table format
* | byte type | word address | byte symbol length | symbol |
Expand Down

0 comments on commit cb18136

Please sign in to comment.