Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

DDD-like watches

<< < (6/10) > >>

m.29:
1) I didn't test it, but that condition is really weird. Why there is test for the same thing twice? Here is the test case:
--- Code: ---TEST(CDBSingleLineStructPointer)
{
    GDBWatch w(wxT("t"));
    CHECK(ParseCDBWatchValue(w, wxT("struct t * 0x123456"));
    CHECK_EQUAL(wxT("t*=0x123456"), w);
}

TEST(CDBSingleLineClassPointer)
{
    GDBWatch w(wxT("t"));
    CHECK(ParseCDBWatchValue(w, wxT("class t * 0x123456"));
    CHECK_EQUAL(wxT("t*=0x123456"), w);
}
--- End code ---

2) In my code there is functionality that dereferences pointer on double click on variable. There is array of structures
--- Code: ---struct s {
  payload_t payload;
  struct s* next;
} item1, item2, ...;

struct s array[] = {
  item1,
  item2,
  ...
};
--- End code ---
Then I try dereference pointer next in structure on index 0 I get (*array.[0].next) instead of (*array[0].next). This expression is not valid and gdb can't return right result.

3) I don't override user's choice because there is a condition that allows set parameters only 1st time. If my code overrides user's choice there is watch->SetArray(true); what also overrides user's choice. But no. As I tested if I change properties of watch everything stay set according to my new choice. Only if watch format is Undefined and it is array with size (int array[29];) but GDBWatch::IsArray returns false everything is set to default. I hope it is  understandable - my English and speech aren't good :-(
I changed GDBWatch::GetFullWatchString into test if parent is array - hope it's OK now.

4) For me it is good. Can you provide some example when it is not watchable? Or it is issue of any specific platform?

I graphical representation of watches programmer can see actual indexed item of array in bold. My idea is, if i know index and size of array I can check if index is not bigger than size of array. Then C::B warns programmer about it. There is some complications now and I want to do on automatic graph layout of oriented graphs so I return to this later, but I think is not good if size of array will be available anyway.

In my code, there is many changes, but these seem to be bugs and useful changes that affect functionality of C::B. But I want to find out if some of them is not intention (like "whatis &" issue) because there is no explanation in comments. That's why I put them here.

oBFusCATed:
Can you provide a complete patch of your progress?
Probably we can integrate some parts of it already.
The least we can do is to stop you from doing wrong things/designs at the beginning...

p.s. I'll answer to you questions in tonight, no time now.

m.29:
Hmm, I  don't want to provide my complete work, because it is my school project and I don't know if I won't violate some of school rules. But I'll ask my supervisor if it will be problem. I certainly want to provide my work after my project will be finished.

oBFusCATed:
Reply to the previous post:

1. Not a real test, run it through CDB or you should wait for me find time to run it myself.  :lol:
2. Looks good :) (except for the scrollbars), but auto dereferencing in current plugin is hard (many special cases will be broken)
3. If it works, OK, I'll give it a try...
4. Debugging C::B under linux. With older gdb's this was a problem. Probably I should remove the hack and see if it works correctly, with 7.2+ ...

This index out of bounds is pretty much uses, because most of the time (in real world code) you get bare pointers not arrays. If I were you I wouldn't bother with this feature too much, because it has very little value.

p.s. Please test you patch on a modern linux machine (64bit if possible). The sooner you do it the better :)
p.p.s. You can send me the patch on e-mail, so it will stay private, but you'll get some feedback on it.

m.29:
1) I don't like waiting and I did some test. Here is relevant screen. As you can see from log, structure type would be HWND__* and value 0x0000000. But it is wrong in the watches window. For similar class is everything fine.

2) Auto derefencing isn't my aim so far. Only user dereferences pointers by double click. I don't how to hide scrollbars and set size of wxTreeCtrl according to visible children :-( I want concentrate on functionality so I lay aside by now but I'm asking in the appropriate forum for it.

4) Yes, I try it on Linux with gdb 7.1 and it really doesn't work. But with some RE it would be correct on function and array. I try something.

But I plan to add functionality that allows assign variable to array. Variable that store the array size. If there is realloc in program, it would be good to assign variable storing the size of array and this array will have correct size whole time. Now I must every time change size in context menu according to new reallocated size. In my school C::B is used as additional teaching aid and this could be good for beginners but not only for them.

I tried my patch on Ubuntu 10.04 LTS (64bit) but it crashed down. Even clean svn checkout. I only open codeblocks-unix project, compile and after ./update run. Code::Blocks crashed immediately. I'll try find out why.

My supervisor allows me to publish sources so after some changes I can provide it. Thanks for your help :-)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version