Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
debugging vectors
oBFusCATed:
Can you tell me the output of the command "whatis v" at the cout line?
Update:
I've tested it and here is the output
--- Code: ---> whatis v
type = vstr
--- End code ---
This means that there is no way to make it work.
I'll try to fix the string problem, thought
Update2:
Here is the patch for the string parsing:
--- Code: ---Index: src/scripts/gdb_types.script
===================================================================
--- src/scripts/gdb_types.script (revision 5837)
+++ src/scripts/gdb_types.script (working copy)
@@ -24,7 +24,7 @@
// STL String
driver.RegisterType(
_T("STL String"),
- _T("^std::basic_string<.*>$"),
+ _T("(^std::basic_string<.*)|(^string$)|(^const string$)|(^string &$)|(^const string &$)"),
_T("Evaluate_StlString"),
_T("Parse_StlString")
);
@@ -32,7 +32,7 @@
// STL Vector
driver.RegisterType(
_T("STL Vector"),
- _T("^std::vector<(.*)>$"),
+ _T("^std::vector<.*"),
_T("Evaluate_StlVector"),
_T("Parse_StlVector")
);
@@ -109,16 +109,17 @@
function Evaluate_StlString(type, a_str, start, count)
{
+ local v_str = _T("(") + a_str + _T(")");
local oper = _T(".");
if (type.Find(_T("*"), false) > 0)
oper = _T("->");
- local result = _T("output ") + a_str + oper + _T("c_str()[") + start + _T("]@");
+ local result = _T("output ") + v_str + oper + _T("c_str()[") + start + _T("]@");
if (count != 0)
result = result + count;
else
- result = result + a_str + oper + _T("size()");
+ result = result + v_str + oper + _T("size()");
return result;
}
--- End code ---
If you find a case where it doesn't work, please report it and provide a simple example.
p.s. patch is in the debugger branch
Update3:
ptype command can help to solve the vector issue, but the output of it is quite big and complete
ollydbg:
I'm sorry, I failed apply this patch to the debugger_branch rev 5837. :(
TortoiseSVN said: The chunk size did not match the number of add/removed lines.
:(
Edit
I can manually apply this patch. :D
ollydbg:
Using this patch, the variable v still can't be shown correctly. See the screen shot.
Edit:
If I manually enter : pvector v command, the output is ok in the "Debuger(debug)" panel.
--- Code: ---> pvector v
elem[0]: $1 = {
static npos = 4294967295,
_M_dataplus = {
<std::allocator<char>> = {
<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
members of std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider:
_M_p = 0x324dc "bla bla"
}
}
Vector size = 1
Vector capacity = 1
Element type = std::basic_string<char, std::char_traits<char>, std::allocator<char> >
>>>>>>cb_gdb:
--- End code ---
[attachment deleted by admin]
oBFusCATed:
The patch is not mean to fix it.
Reread my post, to find out why...
killerbot:
I will try again later, but even showing a vector of int's does not work anymore.
I think this is something we best fix in trunk and the debug branch.
A few months we could do this : http://forums.codeblocks.org/index.php/topic,10667.msg73150.html#msg73150 (see the screenshot).
Also some other related info is in here :
http://forums.codeblocks.org/index.php/topic,10667.msg76693.html#msg76693
Can someone of the patchers tell me what to use to get it fixed.
And currently my primary concern is getting it fixed on trunk. We broke, so we should fix it ;-)
Paste your patches here, I will manually apply them to trunk.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version