User forums > Help
Debugging into <vector> with GDB?
Urxae:
--- Quote from: MortenMacFly on November 07, 2005, 03:22:17 pm ---Could someone give me a simply step-by-step instruction how to obtain the values? I downloaded the >300 pages manual for GDB but couldn't find the command I am looking for... Help! :cry:
--- End quote ---
The best way to watch the contents of the vector is probably not to use memory addresses directly in the watches, but to put a watch on v._M_start, for one or more values of i. That way it'll also work after the vector reallocates to get more memory and the addresses change, plus you get the added benefit of retaining type information.
MortenMacFly:
--- Quote from: Urxae on November 07, 2005, 04:54:47 pm ---v._M_start, for one or more values of i.
--- End quote ---
Yeah! That did it. Not exactly, I had to use v._M_impl._M_start as watch but I missed to make use of _M_(...) in the first place. Thanks a lot!!!
Morten.
MortenMacFly:
--- Quote from: Urxae on November 07, 2005, 03:12:41 pm ---Sounds like a good feature request to me 8).
--- End quote ---
By the way: I have filed a feature request concernig "scripts". I think it could just be implemented as operating on a simple text file that states a GDB command in each line. We'll see...
Morten.
MortenMacFly:
I've done it. I've created a patch (attached) to the debugger plugin that allows to select a "debugger script file" to be run. Maybe if mandrav likes it it will be moved into CVS. Should I file a patch on SourceForge?
But: Although the commands are processed there is still an issue: Where does the output go to? I have enabled the "GDB Debugger (debug)" window as well but it's very strange: If I move the cursor e.g. over a variable I get the output directly into the "GDB Debugger (debug)" and the "Code::Blocks Debug" window. But neighter with "Send command to GDB" nor "Send script to GDB" I see any output... only the input
...mandrav???
Morten.
Edit: I've moved this topic to http://forums.codeblocks.org/index.php/topic,1317.0.html because I think is gets no attention in here due to the subject of the topic.
[attachment deleted by admin]
Navigation
[0] Message Index
[*] Previous page
Go to full version