Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6774311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:46:18+00:00 2026-05-26T15:46:18+00:00

gdb manual says the following. Warning: In multi-threaded programs, software watchpoints have only limited

  • 0

gdb manual says the following.

Warning: In multi-threaded programs, software watchpoints have only limited usefulness. If gdb creates a software watchpoint, it can only watch the value of an expression in a single thread. If you are confident that the expression can only change due to the current thread’s activity (and if you are also confident that no other thread can become current), then you can use software watchpoints as usual. However, gdb may not notice when a non-current thread’s activity changes the expression. (Hardware watchpoints, in contrast, watch an expression in all threads.)

So, how can I use watchpoint with multiple threads using gdb, such that change to the watched variable from any thread is seen by gdb?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:46:19+00:00Added an answer on May 26, 2026 at 3:46 pm

    In general, software watchpoints are really costly. You could use a hardware watchpoint, if you are watching a scalar data whose address is well defined, something like

      p &myvar
      $1 = (int*) 0x1234556
      watch *(int*) 0x1234556
    

    This is relevant only for simple scalar data (single pointer, single integer, single byte…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed GDB 7.0 and python per the following instructions . In the
when I start GDB, I get the following error message in debugger: input:--- token
I'm outside gdb's target executable and I don't even have a stack that corresponds
Can GDB be used to debug programs in languages other than C or C++,
GDB seems to always just work for C programs, but for C++ I often
GDB gives me the above error WRT my C++ program. Nowhere I have used
I have looked through GDB documentation, but haven't found anything that works or shows
GDB has a new version out that supports reverse debug (see http://www.gnu.org/software/gdb/news/reversible.html ). I
Through GDB I have determined that the segfault is occuring somewhere in this block
I have this gdb macro, which is used to print meaningful stacktraces when debugging

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.