Skip to content

Add demangling and directive hiding for asm #228

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

Merged
merged 3 commits into from
Nov 16, 2017

Conversation

wfchandler
Copy link
Contributor

Implements symbol demangling and the option to hide assembler directives (e.g. ".loc 2 338 0 prologue_end") from the generated assembly. Both options default to on and are editable using the Config dialog.

New - Demangled with Directives Removed:

playground::main:
	sub	rsp, 56
	lea	rax, [rip + ref.2]

Existing - Mangled with Directives:

	.text
	.intel_syntax noprefix
	.file	"playground.cgu-0.rs"
	.section	.text._ZN10playground4main17hf4c1d0e5656172f7E,"ax",@progbits
	.p2align	4, 0x90
	.type	_ZN10playground4main17hf4c1d0e5656172f7E,@function
_ZN10playground4main17hf4c1d0e5656172f7E:
	.cfi_startproc
	sub	rsp, 56
.Lcfi0:
	.cfi_def_cfa_offset 64
	lea	rax, [rip + ref.2]

Copy link
Member

@shepmaster shepmaster left a comment

Choose a reason for hiding this comment

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

Wow! Thank you so much; I know this is a feature that people have been wanting!

Does this work equally for AT&T and Intel assembly syntax?

@@ -427,7 +427,7 @@ $PHI: 2.61803398875;
margin-top: 10em;

width: 600px;
height: 600px / $PHI;
height: 950px / $PHI;
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found that the background to the config popup would not fit the new rows, causing the "Done" button to be overlaid on top of the drop-downs as in issue #222. I should probably have removed the divide by $PHI as the golden ratio is pretty well shot by this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No issues with Intel vs AT&T, directives have the same format in both styles. The remove_assembler_directives function just searches for any lines that start with a period and excludes them from the updated string.

@@ -542,6 +567,7 @@ mod test {
fn basic_functionality() {
let req = ExecuteRequest {
channel: Channel::Stable,
crate_type: CrateType::Binary,
Copy link
Member

Choose a reason for hiding this comment

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

Oops, I guess I don't run these tests in CI at all! I should fix that...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On my local test sandbox::test::memory_usage_is_limited is failing with:

---- sandbox::test::memory_usage_is_limited stdout ----
thread 'sandbox::test::memory_usage_is_limited' panicked at 'assertion failed: resp.stderr.contains("Killed")', sandbox.rs:848:8

Not sure if that's a real issue, or just differences between the containers on my machine and production.

@shepmaster
Copy link
Member

/cc #15

@shepmaster shepmaster merged commit 9c495af into rust-lang:master Nov 16, 2017
@shepmaster
Copy link
Member

Wonderful, thank you very much!

@shepmaster shepmaster added the enhancement Something new the playground could do label Nov 16, 2017
@wfchandler wfchandler deleted the demangle branch November 17, 2017 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something new the playground could do
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants