mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
Page:
Debugging and editing tools
Pages
Adding a new WebIDL binding
Alternative Logo Proposals and Related Swag
Asynchronous WebAssembly compilation project
Austin Oxidation
Autogeneration of style structs
Basic SVG support project
Beginner's guide to rebasing and squashing
Benchmarking
Benchmarks
Bots
Browser Engine Research
Build Errors FAQ
Buildbot administration
Building for Android
Building for Magic Leap
Building for UWP
Building on ARM desktop Linux
Building
CI Services we use
CSS parse error reporting
CSSOM student project
Canvas rendering project
Cargo upgrade service project
Code rust concurrency
Code Review
Code of Conduct
Coding standards
Compiler upgrade recipes
Compositor Layer Design
Contributing
Control Servo using WebDriver
Creating and viewing WARC web archives in Servo
Creating new OpenSSL Windows binary distributions
Cross compiling from linux to mac
Crowbot
Css selector matching meeting 2013 07 19
DOM Design
DOM documentation
DOM missing pieces
Debugging JS web compat issues
Debugging and editing tools
Debugging
Design
Developer tools student project
Devtools CSS errors
Devtools plans
Devtools
Diagnosing SpiderMonkey JIT issues
Eric Atkinson visit 2013 09 10
Events and sundry
Expand HTTP request response monitoring
Fetch improvement project
Firefox Reality release notes
FirefoxReality build
Firewall setup for servo master1
Focus student project
Form validation student project
GSoC project brainstorming
Garbage collected DOM
Getting started with layout
GitHub Labels
Github & Critic PR handling 101
Github workflow
Glossary
Governance
Graphics toolkit integration
HTML parser improvement project
HTMLElement binding conversion
HTTP archive support project
HTTP library requirements
Hawaii Rooting
High priority content for layout
Highfive
HoloLens 2 test plan
Home
How to generate GStreamer binaries for CI
Image load conformance student project
Image maps project
Implement HTML charset parsing project
Implement ImageBitmap project
Implement missing WebAudio automation student project
Implement support for missing XMLHttpRequest APIs
Implement worker modules
Implementing a web standard (RGSoC)
Improve specification conformance of unicode bidi library
Incremental flow tree construction
Infrastructure
Integrate xml5ever
Intern project brainstorming
Intern projects
JS objects, wrappers, and cross origin concerns 2013 08 07
Layout 2020
Layout Overview
Layout resources
Layout revamp ideas
Leo meyerovich visit 2013 07 22
Linux sandboxing
London Oxidation
London Security
Meeting 2014 10 27
Meeting 2014 12 08
Meeting 2012 02 08
Meeting 2012 02 16
Meeting 2012 07 20
Meeting 2013 04 01
Meeting 2013 04 15
Meeting 2013 04 22
Meeting 2013 04 29
Meeting 2013 05 06
Meeting 2013 05 13
Meeting 2013 05 20
Meeting 2013 06 03
Meeting 2013 06 10
Meeting 2013 06 14
Meeting 2013 06 17
Meeting 2013 06 24
Meeting 2013 07 01
Meeting 2013 07 15
Meeting 2013 07 22
Meeting 2013 07 29
Meeting 2013 08 05
Meeting 2013 08 12
Meeting 2013 08 19
Meeting 2013 09 09
Meeting 2013 09 16
Meeting 2013 09 23
Meeting 2013 09 30
Meeting 2013 10 14
Meeting 2013 10 21
Meeting 2013 10 28
Meeting 2013 11 04
Meeting 2013 11 18
Meeting 2013 11 25
Meeting 2013 12 02
Meeting 2013 12 09
Meeting 2013 12 16
Meeting 2014 01 06
Meeting 2014 01 13
Meeting 2014 01 21
Meeting 2014 01 27
Meeting 2014 02 03
Meeting 2014 02 10
Meeting 2014 02 24
Meeting 2014 03 10
Meeting 2014 03 17
Meeting 2014 03 24
Meeting 2014 03 31
Meeting 2014 04 07
Meeting 2014 04 14
Meeting 2014 04 21
Meeting 2014 04 28
Meeting 2014 05 05
Meeting 2014 05 13
Meeting 2014 05 19
Meeting 2014 06 09
Meeting 2014 06 17
Meeting 2014 06 23
Meeting 2014 06 30
Meeting 2014 07 07
Meeting 2014 07 14
Meeting 2014 07 21
Meeting 2014 07 29
Meeting 2014 08 04
Meeting 2014 08 11
Meeting 2014 08 12
Meeting 2014 08 18
Meeting 2014 08 25
Meeting 2014 09 08
Meeting 2014 09 15
Meeting 2014 09 22
Meeting 2014 09 29
Meeting 2014 10 06
Meeting 2014 10 13
Meeting 2014 10 20
Meeting 2014 11 10
Meeting 2014 11 17
Meeting 2014 11 24
Meeting 2014 12 15
Meeting 2015 01 05
Meeting 2015 01 12
Meeting 2015 01 26
Meeting 2015 02 09
Meeting 2015 02 23
Meeting 2015 03 02
Meeting 2015 03 16
Meeting 2015 03 30
Meeting 2015 04 06
Meeting 2015 04 13
Meeting 2015 04 27
Meeting 2015 05 04
Meeting 2015 05 11
Meeting 2015 05 18
Meeting 2015 06 01
Meeting 2015 06 08
Meeting 2015 06 15
Meeting 2015 07 06
Meeting 2015 07 13
Meeting 2015 07 27
Meeting 2015 08 10
Meeting 2015 08 17
Meeting 2015 08 24
Meeting 2015 08 31
Meeting 2015 09 14
Meeting 2015 09 21
Meeting 2015 09 28
Meeting 2015 10 05
Meeting 2015 10 12
Meeting 2015 10 19
Meeting 2015 10 26
Meeting 2015 11 02
Meeting 2015 11 09
Meeting 2015 11 16
Meeting 2015 11 30
Meeting 2016 01 04
Meeting 2016 01 11
Meeting 2016 01 25
Meeting 2016 02 01
Meeting 2016 02 08
Meeting 2016 02 22
Meeting 2016 03 07
Meeting 2016 03 21
Meeting Devtools Servo 2
Meetings
Microdata project
Minutes Hackathon 2012 03 27
Missing DOM features project
More ServiceWorker support project
More developer tools student project
Mozlandia Automation
Mozlandia B2S
Mozlandia JS
Mozlandia Rust In Gecko
Mozlandia WPT
Mozlandia gfx
Mozlando Devtools Servo
Mozlando Oxidation
Mozlando SM Servo
Mozlando Servo Bluetooth
Mozlando Servo MagicDOM
Mozlando Servo SMStrings
Mutation observer project
Mutation testing project
NCSU student projects
Network security project
Off main thread HTML parsing project
Offscreen canvas improvements project
Offscreen canvas project
Orlando Oxidation 2018
Oxidation 2015 11 05
Persistent sessions student project
Preparing ARM libraries for CI
Priority of CSS properties
Priority of DOM implementation
Priority of dom bindings
Private browsing student project
Profiling
Project proposal deadlines
Prototype JS form controls student project
Prototype ways of splitting the script crate
Publishing a new ANGLE NuGet version
Publishing a new app store release
Push vs Pull for caching
Random web content project
Refactor GLES2 student project
Refactor bluetooth support student project
Remaining work
Removing push notifications from IRC hooks
Replace C libraries student project
Report new contributors project
Representation of computed style
Research
Reviewer
Roadmap
Running Web Platform Tests on Servo
Rust HTML parser
Rust SpiderMonkey debugger API
Rust cssparser code walk 2013 08 02
SaltStack Administration
San Francisco Oxidation
Servo Benchmarking Report (December 2024)
Servo Benchmarking Report (November 2024)
Servo Benchmarking Report (October 2024)
Servo Layout Engines Report
Servo and SpiderMonkey Report
Servo for Gecko Developers
Specification Links
SpiderMonkey related tasks
SpiderMonkey infodump
SpiderMonkey upgrade details
Storage student project
Streaming webassembly student project
Strings
Student project brainstorm
Student projects
Styling overview
Stylo hacking guide
Summer of Code 2014: Implement XMLHttpRequest
Summer of Code 2016: Fetch API
Summer of Code 2016: File support
Summer of Code 2016: ServiceWorker infrastructure
Summer of Code projects
Summit meeting 2013 09 09
Support WebDriver based tests project
Syncing web platform tests (WPT)
TaskCluster
Testing
Tools
Tracking intermittent failures over time project
Transcription Notes from Servo Architecture talk in Suwon
Transcription notes from rust patterns talk in suwon
Transcription parallelism
Transcription rust concurrency
Transcription rust runtime
Transription layout and acid2
Trinity College Dublin student projects
UPenn student projects
Updating the Rust compiler used by Servo
Upgrading non taskcluster linux CI machines
Upgrading the UWP gstreamer binaries
Upgrading the windows LLVM binaries
Upgrading wptrunner
Using DOM types
Using Rust Spidermonkey Prototype
Using WebWorker Prototype
Version 0.1
Videos and presentations
WebAudio JS interfaces student project
WebAudio nodes student project
WebCompatBug
WebSocket student project
Webdriver student project
Webdriver tests student project
Webrender Overview
Whistler 2019 notes
Whistler Bugzilla
Whistler FFOS
Whistler GFX
Whistler Houdini1
Whistler Houdini2
Whistler Necko
Whistler Oxidation 2019
Work items for new contributors
Workweek COW DOM
Workweek alt js
Workweek android arm
Workweek boot 2 servo
Workweek compiler lints
Workweek displaylist
Workweek dogfooding
Workweek encoding
Workweek generated content
Workweek governance
Workweek graphics stack
Workweek graphics toolkit
Workweek incremental layout
Workweek js bindings status
Workweek layers
Workweek layers2
Workweek pixels
Workweek rasterization
Workweek reftests
Workweek roadmap
Workweek script crate
Workweek security
Workweek string interning
Workweek tables
Workweek writing modes
XML parser student project
infra triage notes
jQuery status
webxr.today support
Clone
4
Debugging and editing tools
Pradeep Kumar edited this page 2013-12-10 23:05:53 -08:00
Table of Contents
Transcript of the Debugging and Tools talk given at Samsung
- lars: we want to talk about github, the tools we use on servo, and how to debug and profile servo. one of the things we want to talk about first is not being shy on github. we are always hapy to respond; to request review, use "r? @username" which is short for review. please ask again if we don't respond within 24 hours, we want to help but sometimes get overwhelmed. on IRC you can always ask if someone is available to talk with "username: ping"; if they are available, respond with "pong", but it's not necessary if they're already active. if you want feedback on your changes before you create a pull request, you can commit to your local repository and put a link in the corresponding issue. we are happy to provide feedback while you're waiting for approval.
- lars: moving on to build issues - if not profiling, we recommend passing these flags to the configure script: "../configure --disable-optimize --enable-debug". Servo will build ~4x faster with optimizations off, and you can use gdb to get useful information while debugging. You can perform individual builds without optimizations with "make CFG_DISABLE_OPTIMIZE=1".
- lars: about configure: if you have changes in submodules and reconfigure, it will throw away your changes. *pcwalton: if you run configure with --disable-mange-submodules this does not happen.
- kmc: if you have a local commit in a submodule, configure will lose it, but you can find it again with "git reflog". feel free to ask questions about git; the way we use it is complicated.
- pcwalton: we want to move from submodules to rustpkg, but that won't be for several months.
- lars: sometimes builds fail in unexpected ways. run "make VERBOSE=1", which will print the actual command lines for rustc. "make clean" deletes everything except for rust and llvm, "make clean-servo" will delete the servo crates, but not the submodules, so rebuilding is much faster.
- jack: there are make targets for "clean-[submodule]" like "clean-rust-layers".
- lars: multiple build directories are possible, since there is nothing special about the servo/build directory.
- kmc: run "gdb --args ./servo ../src/test/html"; --args passes are subsequent arguments to servo instead of gdb. gdb does not catch rust task failure by default, but you can break on rust_begin_unwind, which is called on every task failure. shows the failure message and the line number of failure, and can see a full backtrace with "bt" or "backtrace". the first frames are in the runtime, but eventually can see frames starting with servo crates. use "frame #" to visit the failing stack frame. this should be the line containing the fail! call, but there is a rust bug that makes this show the wrong line number and file right now. the "task failed" message shows the correct information. "list" shows the surrounding code for any frame, and "up" and "down" move up and down the stack backtrace.
- kmc: note that gdb information works best with the "-Z extra-debug-info" argument to rustc.
- kmc: a segfault is nice to debug, since no breakpoints are necessary, and it shows the faulting line. we can look at local variables with "info locals", but enum types can be confusing (they look like unions when debugging C/C++ code).
- pradeep: do we need a recent gdb?
- kmc: should not, but need to build servo with --enable-debug. can also configure with --disable-optimize-cxx, which disables optimizations in C code (useful for debugging C code).
- kmc: valgrind is useful for debugging memory corruption. no demo, since it's a bit complex, but there is information on the wiki at https://github.com/mozilla/servo/wiki/Debugging . please ask questions if you want to know more.
- kmc: git has the reflog feature, which is history of every change you make. every checkout, every commit, every rebase. if I amend a commit, it looks like it changes the original one. it really adds a new one, so you can go into the reflog and interact with the old, un-amended commit (for example, git show old-sha). if you are developing on a mac (especially on 10.9) you need a particular version of gdb, and we can help you set that up.
- ryanc: if I have several commits and want to merge them, how can I do that?
- kmc: "git log" shows that I have multiple commits (two in this case). if I use "git rebase -i origin/master" or "git rebase -i HEAD~~" to rebase starting from a named commit (HEAD refers to commit that is checked out, and ~~ means "two revisions behind"; "man git-rev-parse" explains ways of naming commits). this opens my editor, showing one line for every commit. if I reorder them, it changes the order in the history (from top to bottom).
- jack: sometimes when I work on a project I make commits fixing unrelated bugs. I like to move them to the top before making a pull request.
- kmc: if I change "pick" to "fixup", it merges the commit with its parent and uses the parent's commit message. if I make a mistake, I can look in the reflog for the commit before the rebase, then go back in time with "git reset --hard sha" which destroys all other commits since then. if I want to merge the commits and change the commit message this time, using "squash" instead of "fixup".
- jack: if there are commits you don't want to include, you can just delete the line.
- kmc: rebase is powerful; if you reorder commits, you can have merge failures. "git status" shows the files with conflicts, and "git diff" shows the conflicts. resolve them like normal merge failures. there are emacs and vim modes for fixing conflicts, but you can just use a regular editor as well. when you resolve the conflict, use "git add path/to/file", and then you continue the rebase with "git rebase --continue". repeat the process for each conflict until the rebase is complete.
- kmc: if you have pushed a commit, and then you rebase it, you can cause "non-fast-forward" commits that can break anyone who is using your branch. if it's just your own personal branch for review, it's not a problem, but you should not rebase and push to official mozilla repositories that everyone uses.
- kmc: if you make multiple changes to a file, "git add path/to/file" stages (prepares to commii) all of them. if you use "git add path/to/file -p", it shows a prompt where you can select which changes to stage. if you commit one change and not the other, git diff will show the change that was not staged.
- kmc: I made a wrapper script around gdb call rust-backtrace (see wiki: https://github.com/mozilla/servo/wiki/Debugging ) which sets the rust_begin_unwind breakpoint automatically, and prints the backtrace automatically before quitting.
- hyunjune: I could not find the main function in servo, why?
- kmc: the code that sets up glfw for servo has to run on the OS main thread, so instead of "fn main" we define "fn start" and tell the compiler to call start before setting up the rust runtime. in servo.rc, it does some process, then calls "rt::run_on_main_thread" to set up a runtime that is associated with the main thread.
- pradeep: "perf record -g fp ./servo ../src/test/html/about-mozilla.html". not working for demo, though.
- pradeep: here is an on-the-fly syntax checker for emacs. building can be slow, so this runs rustc in syntax check mode so it is very fast. It underlines the thing that is wrong, and the minibuffer shows the precise error when the cursor is over the text with an error. This mode is called "flycheck" mode, need to set it up with the servo rustc build. Can install it from the emacs package manager - flymake and flymake-rust.
- kmc: please add the instructions for using flymake and autocompletion (and tags) to the wiki!
- jack: how do you keep the tags up to date?
- pradeep: manually.