Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _demo/cjsondemo/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"github.com/goplus/llgo/c"
cjson "github.com/goplus/llpkg/cjson"
"github.com/goplus/llpkg/cjson"
)

func main() {
Expand Down
12 changes: 11 additions & 1 deletion _llcppgtest/cjson/conf/linux/llcppg.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,15 @@
},
"trimPrefixes": ["cJSON_", "cJSONUtils_"],
"cplusplus": false,
"mix":true
"mix":true,
"symMap": {
"cJSON_PrintUnformatted":".CStr",
"cJSON_CreateObject":"Object",
"cJSON_CreateArray":"Array",
"cJSON_CreateString":"String",
"cJSON_free":"FreeCStr",
"cJSON_AddItemToArray":".AddItem",
"cJSON_AddItemToObject":".SetItem",
"cJSON_free":"FreeCStr"
}
}
3 changes: 2 additions & 1 deletion _llcppgtest/cjson/demo/hello/hello.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package main

import (
"cjson"
"unsafe"

"cjson"

"github.com/goplus/llgo/c"
)

Comment on lines 1 to 10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

与当前Pr无关的风格问题,需要去除~

Expand Down
3 changes: 2 additions & 1 deletion _llcppgtest/cjson/demo/readobj/readobj.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package main

import (
"cjson"
"fmt"

"cjson"

"github.com/goplus/llgo/c"
)

Expand Down
12 changes: 11 additions & 1 deletion _llcppgtest/cjson/llcppg.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,15 @@
"cJSON": "JSON"
},
"trimPrefixes": ["cJSON_", "cJSONUtils_"],
"cplusplus": false
"cplusplus": false,
"symMap": {
"cJSON_PrintUnformatted":".CStr",
"cJSON_CreateObject":"Object",
"cJSON_CreateArray":"Array",
"cJSON_CreateString":"String",
"cJSON_free":"FreeCStr",
"cJSON_AddItemToArray":".AddItem",
"cJSON_AddItemToObject":".SetItem",
"cJSON_free":"FreeCStr"
}
}
42 changes: 0 additions & 42 deletions _llcppgtest/cjson/llcppg.symb.json

This file was deleted.

7 changes: 0 additions & 7 deletions _llcppgtest/raylib/llcppg.symb.json

This file was deleted.

5 changes: 4 additions & 1 deletion _llcppgtest/sqlite/conf/linux/llcppg.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
],
"trimPrefixes": ["sqlite3_","SQLITE_"],
"cplusplus": false,
"mix":true
"mix":true,
"symMap":{
"sqlite3_finalize":".Close"
}
}
5 changes: 4 additions & 1 deletion _llcppgtest/sqlite/llcppg.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
"sqlite3.h"
],
"trimPrefixes": ["sqlite3_","SQLITE_"],
"cplusplus": false
"cplusplus": false,
"symMap":{
"sqlite3_finalize":".Close"
}
}
7 changes: 0 additions & 7 deletions _llcppgtest/sqlite/llcppg.symb.json

This file was deleted.

9 changes: 8 additions & 1 deletion _llcppgtest/zlib/conf/linux/llcppg.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,12 @@
"trimPrefixes": ["Z_"],
"cplusplus": false,
"mix":true,
"deps":["c/os"]
"deps":["c/os"],
"symMap":{
"compress":"Compress",
"compress2":"Compress2",
"uncompress":"Uncompress",
"uncompress2":"Uncompress2",
"compressBound":"CompressBound"
}
}
9 changes: 8 additions & 1 deletion _llcppgtest/zlib/llcppg.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@
],
"trimPrefixes": ["Z_"],
"cplusplus": false,
"deps":["c/os"]
"deps":["c/os"],
"symMap":{
"compress":"Compress",
"compress2":"Compress2",
"uncompress":"Uncompress",
"uncompress2":"Uncompress2",
"compressBound":"CompressBound"
}
}
27 changes: 0 additions & 27 deletions _llcppgtest/zlib/llcppg.symb.json

This file was deleted.

49 changes: 47 additions & 2 deletions _xtool/llcppsigfetch/dbg/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ type dbgFlags = int
var flags dbgFlags

const (
DbgParse dbgFlags = 1 << iota
DbgFlagAll = DbgParse
DbgParse dbgFlags = 1 << iota
DbgVisitTop
DbgProcess
DbgGetCurFile
DbgMacro
DbgFileType
DbgFlagAll = DbgParse
)

func SetDebugParse() {
Expand All @@ -20,3 +25,43 @@ func GetDebugParse() bool {
func SetDebugAll() {
flags = DbgFlagAll
}

func SetDebugVisitTop() {
flags |= DbgVisitTop
}

func GetDebugVisitTop() bool {
return flags&DbgVisitTop != 0
}

func SetDebugProcess() {
flags |= DbgProcess
}

func GetDebugProcess() bool {
return flags&DbgProcess != 0
}

func SetDebugGetCurFile() {
flags |= DbgGetCurFile
}

func GetDebugGetCurFile() bool {
return flags&DbgGetCurFile != 0
}

func SetDebugMacro() {
flags |= DbgMacro
}

func GetDebugMacro() bool {
return flags&DbgMacro != 0
}

func SetDebugFileType() {
flags |= DbgFileType
}

func GetDebugFileType() bool {
return flags&DbgFileType != 0
}
129 changes: 129 additions & 0 deletions _xtool/llcppsigfetch/dbg/debug_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
package dbg

import "testing"

func TestSetDebugParse(t *testing.T) {
tests := []struct {
name string
}{
{
name: "TestSetDebugParse",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
SetDebugParse()
if !GetDebugParse() {
t.Errorf("GetDebugParse() = %v, want %v", false, true)
}
})
}
}

func TestSetDebugAll(t *testing.T) {
tests := []struct {
name string
}{
{
name: "TestSetDebugAll",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
SetDebugAll()
if flags != DbgFlagAll {
t.Errorf("flags = %v, want %v", flags, DbgFlagAll)
}
})
}
}

func TestSetDebugVisitTop(t *testing.T) {
tests := []struct {
name string
}{
{
name: "TestSetDebugVisitTop",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
SetDebugVisitTop()
if !GetDebugVisitTop() {
t.Errorf("GetDebugVisitTop() = %v, want %v", false, true)
}
})
}
}

func TestSetDebugProcess(t *testing.T) {
tests := []struct {
name string
}{
{
name: "TestSetDebugProcess",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
SetDebugProcess()
if !GetDebugProcess() {
t.Errorf("GetDebugProcess() = %v, want %v", false, true)
}
})
}
}

func TestSetDebugGetCurFile(t *testing.T) {
tests := []struct {
name string
}{
{
name: "TestSetDebugGetCurFile",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
SetDebugGetCurFile()
if !GetDebugGetCurFile() {
t.Errorf("GetDebugGetCurFile() = %v, want %v", false, true)
}
})
}
}

func TestSetDebugMacro(t *testing.T) {
tests := []struct {
name string
}{
{
name: "TestSetDebugMacro",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
SetDebugMacro()
if !GetDebugMacro() {
t.Errorf("GetDebugMacro() = %v, want %v", false, true)
}
})
}
}

func TestSetDebugFileType(t *testing.T) {
tests := []struct {
name string
}{
{
name: "TestSetDebugFileType",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
SetDebugFileType()
if !GetDebugFileType() {
t.Errorf("GetDebugFileType() = %v, want %v", false, true)
}
})
}
}
Loading
Loading