Link to home
Start Free TrialLog in
Avatar of learningunix
learningunix

asked on

gdb debug

I have a big application with 1000's of files which uses Producer/Consumer problem and has a shared buffer.  I am just going crazy just to find out which actually is the shared buffer as there are so many jumps in the C++ code.

Is there any specific way that I can use  in gdb to debug the code to find out the actual "shared buffer" which is being produced and consumed.
SOLUTION
Avatar of sweetfa2
sweetfa2
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of phoffric
phoffric

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of phoffric
phoffric

Maybe I misunderstood. I didn't think you knew where your shared buffer was, and if that is the case, I didn't know how to place a watch over the correct shared buffer location.
Avatar of learningunix

ASKER

I couldn't find shmat. I'll try the other 2 options and see:

1. Use watch
2. go through the different thread functions as metioned in
 http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html#SYNCHRONIZATION

This is going to be very painful and time-consuming  :(
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I would also scan the source code filenames for matches on some of these tokens. For example:   $  find . -name "*[Rr]ead*" -print