Hello,
I've look at scripts but it's too complex for me sorry. It seem complex to just modify the value of a watch :(
After managing to get debuggergdb compiling :D, i try to modify On edit watch that way to allow modification of a watch
void DebuggerTree::OnEditWatch(wxCommandEvent& event)
{
wxString cmd;
wxString item = m_pTree->GetItemText(m_pTree->GetSelection());
wxString w = wxGetTextFromUser(_("Edit watch"), _("Enter New Value:"), item);
cmd << _T("set var ") << item << _T("=") << w;
SendCommand(cmd);
return;
if (!w.IsEmpty())
{
DeleteWatch(item);
AddWatch(w);
}
}
BUT my c++ courses are far away now, the sendcommand belong to debuggergdb class, is there a simple way to call it from an other class.
I think it's possible, but don't remember how.
Looking forward at the code it seem's that comunication between debuggergdb an other class are uniderectionnal. To modifiy watch i'll to make them working from debuggergdb to debugger tree and backward, is it right ?
Have a nice day
Ouille
Here is it.
haven't found here Headers -> plugins -> debuggergdb -> gdb_commands.h :(
:) :) Here is the function: :) :)
void DebuggerTree::OnEditWatch(wxCommandEvent& event)
{
wxString cmd,varname;
wxString item = m_pTree->GetItemText(m_pTree->GetSelection());
varname = item.BeforeFirst('=');
item = item.AfterFirst('=');
wxString w = wxGetTextFromUser(_("Edit watch value"), _("Enter New Value:"), item);
if ((item.Contains("\"")) && (!w.Contains("\"")))
w = _T("\"") + w + _T("\"");
cmd << _T("set var ") << varname << _T("=") << w;
m_pDebugger->SendCommand(cmd);
wxPostEvent(m_pDebugger, event);
return;
}
This allow watches modification using edit submenus
To add edit submenu on each watches:
void DebuggerTree::ShowMenu(wxTreeItemId id, const wxPoint& pt)
{
wxString caption;
wxMenu menu(wxEmptyString);
// add watch always visible
menu.Append(idEditWatch, _("&Edit watch"));
// we have to have a valid id for the following to be enabled
if (id.IsOk() && m_pTree->GetItemParent(id) == m_pTree->GetRootItem())
{
menu.Append(idAddWatch, _("&Add watch"));
menu.Append(idDeleteWatch, _("&Delete watch"));
}
PopupMenu(&menu, pt);
}
Seem more usefull than add on each element and edit only on root nodes
The rest is not really clean, but i've done what i can
the class definition need's to be modified to have a pointer on the debuggerGDB classe
DebuggerGDB* m_pDebugger;
Copying this from backtrace class
At last
SendCommand need's to be public in debuggerGDB class.
and class debuggerGDB in debuggertree.h
When done you can edit watches values either numerical and strings during debug session.
If someone interested ...
Any feedback welcome !
Have a nice day
Ouille
Here we go
First of all
Game_ender
Here is my directory
ocks-1.0rc2\src\plugins\debuggergdb
26/01/2006 09:13 <REP> .
26/01/2006 09:13 <REP> ..
25/10/2005 08:59 4 381 backtracedlg.cpp
11/05/2005 11:02 608 backtracedlg.h
25/10/2005 08:59 51 482 debuggergdb.cpp
26/01/2006 23:16 4 340 debuggergdb.h
25/10/2005 08:59 3 108 debuggeroptionsdlg.cpp
18/03/2005 23:23 564 debuggeroptionsdlg.h
27/01/2006 00:01 9 667 debuggertree.cpp
26/01/2006 23:13 1 395 debuggertree.h
25/10/2005 08:59 4 997 disassemblydlg.cpp
28/09/2005 14:56 869 disassemblydlg.h
04/10/2005 20:59 674 Makefile.am
26/01/2006 09:13 <REP> resources
11 fichier(s) 82 085 octets
3 Rép(s) 121 221 120 octets libres
Bah no gdb_commands.h,
This directory is from source code of code block, perhaps i miss something, but codeblock compile.
Sorry if i bother you, but i'll try to find this file, using a search in windows, and dir gdb*.* /s didn't find anything.
So there is a problem in my source tree, sorry, you can understand that looking at debugger:gdb i saw:
cmd << _T("break ") << filename << _T(":") << bp->line + 1;
SendCommand(cmd);
break is a true gdb command ...
So i am perhaps a bit stupid, but source are not sync with your response.
Last but not least, it is not really pleasent when i try to add my to cents to a project to be treated like this.
Mandrav:
i work on debuggergdb so the command needs to be gdb compiant only ?
I've try to expand debuggergdb plungins to add these fonctionnality
I'll try to find gdb_commands.h
Thank's
Have a nice day