Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add module.GetSymbolByAddr / GetDemangleSymbolByAddr #232

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Update symbol.go
rm dup
weixingsun authored Feb 19, 2020
commit 647d2f8fa1eb5bff0bf4ce8dd191c058fae270dd
15 changes: 0 additions & 15 deletions bcc/symbol.go
Original file line number Diff line number Diff line change
@@ -60,21 +60,6 @@ type bccSymbolOption struct {
useSymbolType uint32
}
//return symbol assigned to the address
func bccSymbolByAddr(addr uint64, pid int) string{
pidC := C.int(pid)
so := &bccSymbolOption{}
soC := (*C.struct_bcc_symbol_option)(unsafe.Pointer(so))
cache := C.bcc_symcache_new(pidC, soC)
sym := &bccSymbol{}
symC := (*C.struct_bcc_symbol)(unsafe.Pointer(sym))
addrC := C.uint64_t(addr)
res := C.bcc_symcache_resolve(cache, addrC, symC) //bcc_symcache_resolve_no_demangle
if res < 0 {
return ""
}
defer C.bcc_symbol_free_demangle_name(symC)
return C.GoString(symC.demangle_name) //symC.name
}
func bccSymbolByAddr(addr uint64, pid int, demangle int) string{
pidC := C.int(pid)
so := &bccSymbolOption{}