DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Coding
  3. Frameworks
  4. Debugging Global Variables

Debugging Global Variables

Erich Styger user avatar by
Erich Styger
·
Jul. 15, 12 · Interview
Like (0)
Save
Tweet
Share
7.48K Views

Join the DZone community and get the full member experience.

Join For Free

if i’m debugging my application in eclipse or codewarrior, it shows in the variables view the local and global variables of the current thread and stack frame only:

debug view with variables view

debug view with variables view

this makes sense as this is usually where my focus is. and this is good from a performance point of view: the debugger does not need to read a lot of other variables from the target which i’m not interested in. but the question is: how to show the variables which are in other files if i really need to look at them?

add global variable

to see as other variables, i use the context menu ‘ add global variables… ‘ in the variables view. there is as well a toolbar icon which does the same:

add global variables

add global variables

this opens a dialog with a list of all global variables present in my application:

add globals dialog

add globals dialog

filtering and wildcards

i can enter a filter string to be applied. that helps to narrow down the list if i do not remember the exact name:

add globals with filter

add globals with filter

filter for files

a powerful trick is to filter for variables in files. for this the format <variablename> # <filename> is used:

add globals with file filter

add globals with file filter

summary

debugging and inspecting variables outside of the current thread or stackframe can be done with ‘add globals’ in the variables view. that dialog has powerful filtering including a way to filter for variables in files.

happy global debugging :-)

Filter (software) Context menu application Dialog (software) Debug (command) Strings Eclipse

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • ChatGPT: The Unexpected API Test Automation Help
  • Load Balancing Pattern
  • Stream Processing vs. Batch Processing: What to Know
  • An Introduction to Data Mesh

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: