Commit Graph

5 Commits

Author SHA1 Message Date
Sigmund Cherem 4a42831e85 Use source-maps in test runner to expand JavaScript stack traces.
This works on all browsers, in d8, and supports both dartdevk and
dart2js. In the case of dart2js, this also expands minified names and
inlined data.

The result is presented to users as a separate section, so the original
JS stack trace is printed as is, and a second deobfuscated stack trace
is printed afterwards.

Change-Id: I10af5e0241a8c87ad8db48234ce52cfb51a27411
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132966
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-01-24 20:00:13 +00:00
Sigmund Cherem 935103fd0f Update lookup-name tool to use the dart2js_mapping implementation.
Note: the current implementation broke when we changed the encoding.
Change-Id: I48d9e5fedad3f3be85fc1e73dd5dd091bb7278b0
Reviewed-on: https://dart-review.googlesource.com/c/84881
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Auto-Submit: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-11-20 01:45:37 +00:00
Sigmund Cherem db2c9eeb76 dart2js_tools cleanups from the previous CL comments
TBR=johnniwinther@google.com

Change-Id: I252751d8163a056784b10dcb58633c4206a849a0
Reviewed-on: https://dart-review.googlesource.com/c/82883
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-11-05 19:35:16 +00:00
Sigmund Cherem 0e35e41121 Upstream recent changes to dart2js tools
Changes include:
  * Added a couple no-such-method decoders.
  * Apply deobfuscation rules more than once per line
  * Fixed pattern matched for minified names.
  * Added support for expanding the call signature from call selectors
  * Fix backward search to find the function declaration
  * Refactor trace deobfuscation logic:
    * add dependency on stack\_trace to parse frames
    * add library to expose trace deobfsucation and keep that separate from
      printing the results
  * Fix off-by-one error when extracting the name of a function whose index is 0.
  * Avoid crash if we can't get a function name.

Change-Id: I016a293efadbdd8ddf66a007b182d5485eb2311f
Reviewed-on: https://dart-review.googlesource.com/c/82711
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Sigmund Cherem <sigmund@google.com>
2018-11-05 18:24:33 +00:00
Sigmund Cherem 7c77ed04f4 Move deobfuscation tools to the SDK repo
This is an initial implementation of the dart deobfuscator tool.

Let me know your thoughts on the package name. I used to have this named as
`package:deobfuscate`, but it feels like we will want to add more tools that are
not about deobfuscation in the future, so I picked `package:dart2js_tools`
instead. That also gives us the opportunity to move over the dart2js_info code
here too.

Change-Id: I2ff948982969c9c76bc84cdc78cbe237abc87378
Reviewed-on: https://dart-review.googlesource.com/69243
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-08-09 22:55:04 +00:00