Solved

Debug Multithreaded programming

Posted on 2004-10-11
4
347 Views
Last Modified: 2010-04-01
Hi,

Can anyone explain how to debug a multithreaded programme in Windows, Unix and Linux.

Thanks,
Ravi.
0
Comment
Question by:Ravikumarv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
SteH earned 50 total points
ID: 12275616
You can set breakpoints as usual. When hit you can single step around that line. Thus you basically have the possiblity to debug each single thread, since other threads should not be affected from this breaking.

If you need to debug how th threads interact you are in trouble. I think to remember that there exist debugging tools for that purpose as well but don't expect them to be cheap or free.

Can you be a bit more specific on what you want to debug?
0
 
LVL 2

Expert Comment

by:guntherothk
ID: 12277395
A huge question, for 50 points. My 50 point answer is "use the debugger in Windows, Unix, and Linux.

In windows, when you set a breakpoint, the first thread that hits the breakpoint stops execution, and you can examine all the threads. The debug/threads menu pick lets you look at another thread. Typically you'll be in assembly language view, but you can use the stack window to pick the point of call, which will be a source view. The threads dialog will let you suspend all the threads but one if you want. Debugging on Unix and Limus is similar, but you will have to look up the commands.

I suspect you want to ask a more specific question, like how to debug some specific multithreaded problem you are having.

0
 

Author Comment

by:Ravikumarv
ID: 12283887
Hi,
  Thank you all for your answers.
  I am not able to understand this debug/thread menu.  Where can i find it. I mean in the VC++ compiler. What I want to see is the values of the thread specific varriables at a specific point of execution.

Thanks,
Ravi.
0
 
LVL 13

Expert Comment

by:SteH
ID: 12284504
The debug menu, where this funcionality resides is only visible when you are debugging code.

When a breakpoint was reached you can get a dialog to choose a thread via Debug->Threads
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Unable to start eclipse ? 17 171
C++ Code Issue 4 47
find Speed using GPS latitude & longitude 4 155
Winapi.Windows.hpp problem 7 40
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question