Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkwork committed Dec 1, 2024
1 parent 9fe8def commit eba1a73
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 19 deletions.
8 changes: 3 additions & 5 deletions sdk/bindgen/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"testing"
"unicode"

"github.com/goradd/maps"

"github.com/ddkwork/app/bindgen/clang"
"github.com/ddkwork/app/bindgen/gengo"
"github.com/ddkwork/golibrary/mylog"
Expand Down Expand Up @@ -118,8 +116,8 @@ func TestBindMacros(t *testing.T) {
mylog.Trace("number of macros", macros.Len())

var (
enumDebuggers = new(maps.SafeSliceMap[string, string])
enumIoctls = new(maps.SafeSliceMap[string, string])
enumDebuggers = new(safemap.SafeMap[string, string])
enumIoctls = new(safemap.SafeMap[string, string])
)
macros.Range(func(key string, value string) bool {
if !m.Has(key) {
Expand Down Expand Up @@ -331,7 +329,7 @@ typedef struct _LIST_ENTRY {
#endif
`

var m = new(maps.SafeSliceMap[string, string])
var m = new(safemap.SafeMap[string, string])

func init() {
m.Set("PAGE_SIZE", "4096")
Expand Down
6 changes: 2 additions & 4 deletions sdk/bindgen/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"strings"
"testing"

"github.com/goradd/maps"

"github.com/ddkwork/HyperDbg/sdk"

"github.com/ddkwork/golibrary/mylog"
Expand Down Expand Up @@ -73,7 +71,7 @@ func TestUnmarshalCommandJson(t *testing.T) {

func TestCommandGenerate(t *testing.T) {
t.Skip("not well")
m := new(maps.SafeSliceMap[string, string])
m := safemap.NewOrdered[string, string]()
m.Set("debugging", "debugging")
m.Set("extension", "extension")
m.Set("hwdbg", "hwdbg")
Expand Down Expand Up @@ -110,7 +108,7 @@ func commandGenerate(kindName, path string) {
return err
})

m := new(maps.SafeSliceMap[string, string])
m := safemap.NewOrdered[string, string]()
for _, command := range commands {
m.Set(command.FullName, command.FullName) // todo this must be use Cmd,then it will return the right command
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/bindgen/constants/constants_gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestGenConstants(t *testing.T) {
}

func genConstants(fileName string) {
m := new(maps.SafeSliceMap[string, string])
m := safemap.NewOrdered[string, string]()
for i, s := range stream.NewBuffer(fileName).ToLines() {
if i == 4 {
// break // test
Expand Down
6 changes: 2 additions & 4 deletions sdk/bindgen/macros_decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package bindgen

import (
"strings"

"github.com/goradd/maps"
)

func extractMacros(lines []string) *maps.SafeSliceMap[string, string] {
macros := new(maps.SafeSliceMap[string, string])
func extractMacros(lines []string) *safemap.SafeMap[string, string] {
macros := new(safemap.SafeMap[string, string])
macros.Set("PAGE_SIZE", "4096")
var macroName string
var macroValue strings.Builder
Expand Down
3 changes: 1 addition & 2 deletions ux/ark/ark.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/ddkwork/golibrary/mylog"
"github.com/ddkwork/golibrary/stream"
"github.com/ddkwork/unison"
"github.com/goradd/maps"
)

func main() {
Expand Down Expand Up @@ -66,7 +65,7 @@ func Layout() *unison.Panel {
widget.SetScrollLayout(splitPanel, 2)

left := widget.NewTableScrollPanel(table, header)
layouts := new(maps.SafeSliceMap[ArksType, func() unison.Paneler])
layouts := new(safemap.SafeMap[ArksType, func() unison.Paneler])
layouts.Set(KernelTablesType, func() unison.Paneler {
table, header := widget.NewTable(ms.NtApi{}, widget.TableContext[ms.NtApi]{
ContextMenuItems: nil,
Expand Down
4 changes: 1 addition & 3 deletions ux/ark/ark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ package ark
import (
"testing"

"github.com/goradd/maps"

"github.com/ddkwork/golibrary/stream"
)

func TestName(t *testing.T) {
g := stream.NewGeneratedFile()
m := new(maps.SafeSliceMap[string, string])
m := safemap.NewOrdered[string, string]()
m.Set("kernelTables", "kernelTables")
m.Set("explorer", "explorer")
m.Set("taskManager", "taskManager")
Expand Down

0 comments on commit eba1a73

Please sign in to comment.