mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
wasm: add basic debuginfo through name
section (#18130)
This commit is contained in:
@ -1,34 +1,46 @@
|
||||
// Copyright (c) 2023 l-m.dev. All rights reserved.
|
||||
// Use of this source code is governed by an MIT license
|
||||
// that can be found in the LICENSE file.
|
||||
module wasm
|
||||
|
||||
struct ImportCallPatch {
|
||||
mod string
|
||||
name string
|
||||
pos int
|
||||
mut:
|
||||
pos int
|
||||
}
|
||||
|
||||
struct FunctionCallPatch {
|
||||
name string
|
||||
pos int
|
||||
mut:
|
||||
pos int
|
||||
}
|
||||
|
||||
type CallPatch = FunctionCallPatch | ImportCallPatch
|
||||
|
||||
struct FunctionGlobalPatch {
|
||||
idx GlobalIndex
|
||||
mut:
|
||||
pos int
|
||||
}
|
||||
|
||||
type FunctionPatch = CallPatch | FunctionGlobalPatch
|
||||
|
||||
struct FunctionLocal {
|
||||
typ ValType
|
||||
name ?string
|
||||
}
|
||||
|
||||
pub struct Function {
|
||||
tidx int
|
||||
idx int
|
||||
mut:
|
||||
call_patches []CallPatch
|
||||
global_patches []FunctionGlobalPatch
|
||||
label int
|
||||
export bool
|
||||
mod &Module = unsafe { nil }
|
||||
code []u8
|
||||
locals []ValType
|
||||
patches []FunctionPatch // sorted
|
||||
label int
|
||||
export bool
|
||||
mod &Module = unsafe { nil }
|
||||
code []u8
|
||||
locals []FunctionLocal
|
||||
pub:
|
||||
name string
|
||||
}
|
||||
|
Reference in New Issue
Block a user