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

Bad debug symbol codestart for struct variables #308

Closed
peace-maker opened this issue Jan 28, 2019 · 0 comments · Fixed by #309
Closed

Bad debug symbol codestart for struct variables #308

peace-maker opened this issue Jan 28, 2019 · 0 comments · Fixed by #309

Comments

@peace-maker
Copy link
Member

Compiling a plugin using e.g. the Plugin struct leads to an invalid codestart entry in the .dbg.globals debug section for the myinfo global variable.

public Plugin myinfo = 
{
	name = "Test",
	author = "Me",
	description = "Tests",
	version = "1.0",
	url = "www.example.com",
};

int main(){

}
Field Value
address 0x08d4
codestart 0x6c04
codeend 0x0b78

The codestart is bigger than the codeend - and even bigger than the whole size of the .code section.

SourcePawn Compiler 1.10.0.6371

peace-maker added a commit to peace-maker/sourcepawn that referenced this issue Jan 30, 2019
The compiler rewrites the definition address of all variables in the write phase. That second phase uses previous usage knowledge to exclude unused functions, making the binary smaller.

Struct variables are handled in a seperate `declstructvar` function which missed that write pass fixup.

Set the definition address of struct variables in the write pass es well.

Fixes alliedmodders#308
dvander pushed a commit that referenced this issue Jan 30, 2019
The compiler rewrites the definition address of all variables in the write phase. That second phase uses previous usage knowledge to exclude unused functions, making the binary smaller.

Struct variables are handled in a seperate `declstructvar` function which missed that write pass fixup.

Set the definition address of struct variables in the write pass es well.

Fixes #308
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant