-
Notifications
You must be signed in to change notification settings - Fork 67
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
go1.18 VA is wrong #3
Comments
What was the issue? |
diff --git a/debug/gosym/pclntab.go b/debug/gosym/pclntab.go
index c702d42..b3b3003 100644
--- a/debug/gosym/pclntab.go
+++ b/debug/gosym/pclntab.go
@@ -74,7 +74,7 @@ type LineTable struct {
Binary binary.ByteOrder
Quantum uint32
Ptrsize uint32
- textStart uint64 // address of runtime.text symbol (1.18+)
+ textStart uintptr // address of runtime.text symbol (1.18+)
funcnametab []byte
cutab []byte
funcdata []byte
@@ -269,7 +269,7 @@ func (t *LineTable) parsePclnTab() {
case ver118:
t.nfunctab = uint32(offset(0))
t.nfiletab = uint32(offset(1))
- t.textStart = t.PC // use the start PC instead of reading from the table, which may be unrelocated
+ t.textStart = uintptr(offset(2))
t.funcnametab = data(3)
t.cutab = data(4)
t.filetab = data(5)
@@ -422,7 +422,7 @@ func (f funcTab) Count() int {
func (f funcTab) pc(i int) uint64 {
u := f.uint(f.functab[2*i*f.sz:])
if f.Version >= ver118 {
- u += f.textStart
+ u += uint64(f.textStart)
}
return u
}
@@ -464,7 +464,7 @@ func (f *funcData) entryPC() uint64 {
if f.t.Version >= ver118 {
// TODO: support multiple text sections.
// See runtime/symtab.go:(*moduledata).textAddr.
- return uint64(f.t.Binary.Uint32(f.data)) + f.t.textStart
+ return uint64(f.t.Binary.Uint32(f.data)) + uint64(f.t.textStart)
}
return f.t.uintptr(f.data)
} |
stevemk14ebr
pushed a commit
that referenced
this issue
May 23, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
How to correctly modify the VA address?
Thank you so much.
The text was updated successfully, but these errors were encountered: