Skip to content

Commit

Permalink
implement STEPDEBUG and small fix to diself (#24)
Browse files Browse the repository at this point in the history
* implement STEPDEBUG option to insert NOPs (when targetting 68k) to allow EDBG to work
added STEPDEBUG50 option to insert 3 NOPs which can allow EDBG to work under OS v50+

* fix diself to reference eecelf instead of ecxelf
fix dishunk so that dis command line parameter correctly defaults to off
  • Loading branch information
dmcoles authored Sep 25, 2022
1 parent e31e0cb commit a55728b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
12 changes: 10 additions & 2 deletions codegen.e
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ DEF g_sizeofptr
DEF g_linelist:PTR TO linedef, g_codelablist:PTR TO codelab, g_multireturn:PTR TO multireturn
DEF g_optpowerpc, g_optmodule
DEF g_globalsize, g_rwreflist:PTR TO rwref, g_databufsize
DEF g_nilcheck, g_linedebug
DEF g_nilcheck, g_linedebug, g_stepdebug,g_stepdebug50
DEF link_reloc32list, link_nrofreloc32s
DEF g_linenum, g_numregalloc, g_numfregalloc
DEF g_stacksize, g_modulelist:PTR TO mlh
Expand Down Expand Up @@ -449,6 +449,14 @@ PROC def_line(l)
IF g_linelist.offset = (currentOffset()) THEN RETURN
ENDIF
g_linelist := NEW [g_linelist, l, currentOffset()]:linedef
IF g_stepdebug AND (g_optpowerpc=CPU_M68)
nop()
ENDIF
IF g_stepdebug50 AND (g_optpowerpc=CPU_M68)
nop()
nop()
nop()
ENDIF
ENDPROC


Expand Down Expand Up @@ -658,7 +666,7 @@ PROC compileCode(n:PTR TO item, oneliner=FALSE) OF codegen
#endif

IF FreeStack() < 4000 THEN Raise("STCK") -> 2.0


WHILE (t := n.data)
as := NIL
Expand Down
2 changes: 1 addition & 1 deletion diself.e
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

OPT PREPROCESS

MODULE '*ecxelf'
MODULE '*eecelf'
MODULE '*ppcdisasm'

-> Jan, Apr, Jul 2003
Expand Down
5 changes: 3 additions & 2 deletions dishunk.e
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ ENDPROC x SHR v
PROC main() HANDLE
DEF fh=NIL, ptr:PTR TO LONG, str[24]:STRING, rdargs=NIL, args[2]:ARRAY OF LONG

args[]:=0
args[1]:=0

/* read agrs */
rdargs := ReadArgs('FILE/A,'+
'DIS/S',
Expand All @@ -41,8 +44,6 @@ PROC main() HANDLE

disasm := args[1]



WHILE (ptr := dohunk(ptr))
ENDWHILE

Expand Down
16 changes: 16 additions & 0 deletions eecmain.e
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ DEF g_optimize=FALSE -> OPTI/S
DEF g_nowarn=FALSE -> OPT NOWARN, NOWARN/S
DEF g_vardebug=FALSE -> VARDEBUG/S
DEF g_linedebug=FALSE -> LINEDEBUG/S
DEF g_stepdebug=FALSE -> STEPDEBUG/S
DEF g_stepdebug50=FALSE -> STEPDEBUG50/S
DEF g_symbolhunk=FALSE -> SYMBOLHUNK/S
DEF g_quiet=FALSE -> v49
DEF g_showbuf=FALSE
Expand Down Expand Up @@ -291,6 +293,7 @@ ENUM ARG_SOURCE,
ARG_EXENAME, -> v49
ARG_MODNAME, -> 1.5.6
ARG_STEPDEBUG, -> 1.6.0
ARG_STEPDEBUG50, -> 2.3.1
ARG_POWERPC, -> v52
ARG_MORPHOS, -> v52
ARG_AMIGAOS, -> 1.10.0
Expand Down Expand Up @@ -346,6 +349,7 @@ PROC main() HANDLE
'EXENAME/K,'+
'MODNAME/K,'+
'STEP=STEPDEBUG/S,'+
'STEP50=STEPDEBUG50/S,'+
'POWERPC/S,'+
'MORPHOS/S,'+
'AMIGAOS/S,'+
Expand Down Expand Up @@ -400,6 +404,18 @@ PROC main() HANDLE
g_symbolhunk := TRUE
ENDIF
IF args[ARG_LINEDEBUG] THEN g_linedebug := TRUE
IF args[ARG_STEPDEBUG]
g_stepdebug := TRUE
g_symbolhunk := TRUE
g_linedebug := TRUE
g_vardebug := TRUE
ENDIF
IF args[ARG_STEPDEBUG50]
g_stepdebug50 := TRUE
g_symbolhunk := TRUE
g_linedebug := TRUE
g_vardebug := TRUE
ENDIF
IF args[ARG_VARDEBUG] THEN g_vardebug := TRUE
IF args[ARG_SHOWBUF] THEN g_showbuf := TRUE
IF args[ARG_WBTOFRONT] THEN wbtofront := TRUE
Expand Down

0 comments on commit a55728b

Please sign in to comment.