0
Files
android_webview
apps
ash
base
blink
build
build_overrides
cc
chrome
chrome_elf
chromecast
chromeos
cloud_print
components
content
courgette
crypto
dbus
device
docs
accessibility
autofill
design
gpu
images
ios
media
memory
memory-infra
privacy
process
security
speed
sync
testing
ui
OWNERS
README.md
accessibility.md
adding_to_third_party.md
android_accessing_cpp_enums_in_java.md
android_build_instructions.md
android_cast_build_instructions.md
android_debugging_instructions.md
android_emulator.md
android_logging.md
android_native_libraries.md
android_studio.md
android_test_instructions.md
angle_in_chromium.md
atom.md
bitmap_pipeline.md
browser_view_resizer.md
building_old_revisions.md
callback.md
ccache_mac.md
chrome_os_logging.md
chrome_settings.md
chromedriver_status.md
chromeos_build_instructions.md
chromium_browser_vs_google_chrome.md
chromoting_android_hacking.md
cipd.md
cl_respect.md
clang.md
clang_format.md
clang_static_analyzer.md
clang_tidy.md
clang_tool_refactoring.md
clion_dev.md
closure_compilation.md
cocoa_tips_and_tricks.md
code_coverage.md
code_reviews.md
component_build.md
cr_respect.md
cr_user_manual.md
cygwin_dll_remapping_failure.md
debugging_with_crash_keys.md
documentation_best_practices.md
documentation_guidelines.md
eclipse.md
emacs.md
erc_irc.md
es6_chromium.md
fuchsia_build_instructions.md
fuchsia_sdk_updates.md
get_the_code.md
git_cookbook.md
git_tips.md
google_play_services.md
graphical_debugging_aid_chromium_views.md
gtk_vs_views_gtk.md
how_to_add_your_feature_flag.md
how_to_extend_layout_test_framework.md
installation_at_vmware.md
ios_build_instructions.md
ios_infra.md
ios_voiceover.md
ipc_fuzzer.md
jumbo.md
kiosk_mode.md
layout_tests_linux.md
linux_build_instructions.md
linux_build_instructions_prerequisites.md
linux_building_debug_gtk.md
linux_cast_build_instructions.md
linux_cert_management.md
linux_chromium_arm.md
linux_chromium_packages.md
linux_crash_dumping.md
linux_debugging.md
linux_debugging_gtk.md
linux_debugging_ssl.md
linux_dev_build_as_default_browser.md
linux_development.md
linux_eclipse_dev.md
linux_graphics_pipeline.md
linux_gtk_theme_integration.md
linux_hw_video_decode.md
linux_minidump_to_core.md
linux_password_storage.md
linux_pid_namespace_support.md
linux_plugins.md
linux_profiling.md
linux_proxy_config.md
linux_running_asan_tests.md
linux_sandbox_ipc.md
linux_sandboxing.md
linux_suid_sandbox.md
linux_suid_sandbox_development.md
linux_sysroot.md
linux_zygote.md
luci_migration_faq.md
mac_build_instructions.md
mojo_guide.md
network_traffic_annotations.md
new_port_policy.md
old_chromoting_build_instructions.md
optimizing_web_uis.md
optional.md
origin_trials_integration.md
ozone_drm_for_linux.md
ozone_overview.md
piranha_plant.md
profiling.md
profiling_content_shell_on_android.md
proxy_auto_config.md
qtcreator.md
release_branch_guidance.md
retrieving_code_analysis_warnings.md
seccomp_sandbox_crash_dumping.md
servicification.md
static_initializers.md
sublime_ide.md
system_hardening_features.md
tab_helpers.md
task_scheduler_migration.md
test_descriptions.md
threading_and_tasks.md
tour_of_luci_ui.md
tpm_quick_ref.md
translation_screenshots.md
updating_clang.md
updating_clang_format_binaries.md
useful_urls.md
user_data_dir.md
user_handle_mapping.md
using_a_linux_chroot.md
using_build_runner.md
vanilla_msysgit_workflow.md
vscode.md
webui_explainer.md
webui_in_components.md
webview_policies.md
win_cross.md
win_order_files.md
windows_build_instructions.md
windows_split_dll.md
working_remotely_with_android.md
writing_clang_plugins.md
extensions
gin
google_apis
google_update
gpu
headless
infra
ios
ipc
jingle
mash
media
mojo
native_client_sdk
net
pdf
ppapi
printing
remoting
rlz
sandbox
services
skia
sql
storage
styleguide
testing
third_party
tools
ui
url
webrunner
.clang-format
.eslintrc.js
.git-blame-ignore-revs
.gitattributes
.gitignore
.gn
.vpython
AUTHORS
BUILD.gn
CODE_OF_CONDUCT.md
DEPS
ENG_REVIEW_OWNERS
LICENSE
LICENSE.chromium_os
OWNERS
PRESUBMIT.py
PRESUBMIT_test.py
PRESUBMIT_test_mocks.py
README.md
WATCHLISTS
codereview.settings
src/docs/linux_debugging_gtk.md
nodir a6074d4c3d [Docs] fixes
Stylistic and other fixes

R=andybons@chromium.org
BUG=524256

Review URL: https://codereview.chromium.org/1318153003

Cr-Commit-Position: refs/heads/master@{#346569}
2015-09-01 04:27:19 +00:00

1.6 KiB

Linux Debugging GTK

Making warnings fatal

See Running GLib Applications for notes on how to make GTK warnings fatal.

Using GTK Debug packages

sudo apt-get install libgtk2.0-0-dbg

Make sure that you're building a binary that matches your architecture (e.g. 64-bit on a 64-bit machine), and there you go.

Source

You'll likely want to get the source for gtk too so that you can step through it. You can tell gdb that you've downloaded the source to your system's GTK by doing:

$ cd /my/dir
$ apt-get source libgtk2.0-0
$ gdb ...
(gdb) set substitute-path /build/buildd /my/dir

NOTE: I tried debugging pango in a similar manner, but for some reason gdb didn't pick up the symbols from the symbols from the -dbg package. I ended up building from source and setting my LD_LIBRARY_PATH.

See linux_building_debug_gtk.md for more on how to build your own debug version of GTK.

Parasite

http://chipx86.github.com/gtkparasite/ is great. Go check out the site for more about it.

Install it with

sudo apt-get install gtkparasite

And then run Chrome with

GTK_MODULES=gtkparasite ./out/Debug/chrome

ghardy

If you're within the Google network on ghardy, which is too old to include gtkparasite, you can do:

scp bunny.sfo:/usr/lib/gtk-2.0/modules/libgtkparasite.so /tmp
sudo cp /tmp/libgtkparasite.so /usr/lib/gtk-2.0/modules/libgtkparasite.so

GDK_DEBUG

Use GDK_DEBUG=nograbs to run GTK+ without grabs. This is useful for gdb sessions.