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

Dart_DebugName and Dart_DetectNullSafety symbols in my executable #59612

Open
ClementBeal opened this issue Nov 26, 2024 · 1 comment
Open

Dart_DebugName and Dart_DetectNullSafety symbols in my executable #59612

ClementBeal opened this issue Nov 26, 2024 · 1 comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-question A question about expected behavior or functionality

Comments

@ClementBeal
Copy link

Info

Problem

Hi!

Yesterday, I was trying for the first time to benchmark my code by reading the final assembly code.

That's the program I have (coming from a Twitter post) :

import 'dart:typed_data';

void main(List<String> args) {
  final u = int.parse(args[0]); 
  final r = 8372;

  final List<int> a = Uint32List(10000);

  for (int i = 0; i < 10000; i++) {
    for (int j = 0; j < 100000; j++) {
      a[i] = a[i] + j % u;
    }
    a[i] += r;
  }
  print(a[r]);
}

I compiled that code with dart compile exe my_program.dart then run objdump -d my_program.dart > output.asm to get the assembly code.

I can see a lot of Dart_DebugName and Dart_DetectNullSafety. I thought it would be compile without the debug info so I checked the available flag and with the flag -save-debugging-info, I should remove them and save them in an external file.

I run the new command dart compile exe --save-debugging-info debug.txt my_program.dart. I don't know which extension should be the debugging info file. I can already see my file getting smaller! From 5.4MB to 5.2MB!

I checked again the assembly and I still find the previous symbols Dart_DebugName and Dart_DetectNullSafety that I thought would be stripped from the final executable.

Is it a normal behavior?

@dart-github-bot
Copy link
Collaborator

Summary: User observes Dart_DebugName and Dart_DetectNullSafety symbols in their compiled Dart executable even after attempting to remove debug info using --save-debugging-info. They expect these symbols to be absent from the release build.

@dart-github-bot dart-github-bot added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-question A question about expected behavior or functionality labels Nov 26, 2024
@lrhn lrhn removed the triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-question A question about expected behavior or functionality
Projects
None yet
Development

No branches or pull requests

3 participants