go-vise

Constrained Size Output Virtual Machine
Info | Log | Files | Refs | README | LICENSE

commit 05504b3c7e83eb54a4387bfe2e379b77863daae2
parent 9dfab05a71797574fc9e318770700df7bf41d453
Author: lash <dev@holbrook.no>
Date:   Thu,  5 Sep 2024 03:14:33 +0100

Allow setting flagdebugger populate in flagparser

Diffstat:
Masm/flag.go | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/asm/flag.go b/asm/flag.go @@ -16,6 +16,7 @@ type FlagParser struct { flag map[string]string flagDescription map[uint32]string hi uint32 + debug bool } // NewFlagParser creates a new FlagParser @@ -26,6 +27,11 @@ func NewFlagParser() *FlagParser { } } +func(pp *FlagParser) WithDebug() *FlagParser { + pp.debug = true + return pp +} + // GetFlag returns the flag index value for a given flag string // as a numeric string. // @@ -117,6 +123,9 @@ func(pp *FlagParser) Load(fp string) (int, error) { } else { logg.Debugf("added flag translation", "from", v[1], "to", v[2]) } + if pp.debug { + state.FlagDebugger.Register(fl, v[2]) + } } }