[Xcb] _Problems_ in GSoC, 2011

vikash agrawal vikashagrawal1990 at gmail.com
Mon Jul 4 03:31:28 PDT 2011

On Mon, Jul 4, 2011 at 3:42 AM, vikash agrawal
<vikashagrawal1990 at gmail.com>wrote:

> Hello Everyone,
> Finally, first month of my GSoC has been over and it was surely full of
> up's and down's. So far I have understood the complex code generation
> involving various cases, complex types etc over the past. And I guess this
> was the perfect way to start to my project as this gave me a fair idea of
> any hacks that I try to bring in the code. [ Thanks Josh for suggesting me
> this way start my work on the project ]
> Also it has been long I am trying to patch a bug, I had several discussion
> with pharris ( I apologise for pestering you so much ) over the same. I am
> still studying c_client.py and a quick glance of it reveals
> '_c_serialize_helper_insert_  function', with context being sizeof, is
> responsible for xcb_str_sizeof in xproto.c. So I believe this might need
> some hacks.
> Also, if I am not wrong there is a problem with xcb_str_next with respect
> master and 1.7, but for this I have a very n00b and basic idea like if
> self.c_next_name == 'xcb_str_next': # and then necessary conditions of
> _c('whatever'); might solve the purpose. If this feels a way then can we
> specifically do the same for other buggy issues.
> Along with this, can there be a way in which I can find if the type is a
> string and then explicitly handle the padding,
> Please help me on the bug :(
> Also many a time I felt this weird issue, if I try to print any variable in
> c_client.py,the output came only for a couple of files like xkb.xml and one
> or two more, also whenever I tried to have _c(printf('blah blah'); ) I
> recvied hell lot of warnings
> Finally, if I make some hacks, how do I finally test the code, if things
> went right or not.
> Expecting a reply very soon :)
> And wish me luck, 1st assessment a week away and I am damn scared, this
> being my first GSoC and a project at this scale
> Love
> Vikash Agrawal
Ah, I forgot to mention, I compiled the attached utility and found* no
difference* is the output is master and tag 1.7. so what this utility
signifies ?

Also, when I see the function

xcb_str_sizeof (const void  *_buffer  /**< */)
    char *xcb_tmp = (char *)_buffer;
    const xcb_str_t *_aux = (xcb_str_t *)_buffer;
    unsigned int xcb_buffer_len = 0;
    unsigned int xcb_block_len = 0;
    unsigned int xcb_pad = 0;

    xcb_block_len += sizeof(xcb_str_t);
    xcb_tmp += xcb_block_len;
    /* name */
    *xcb_block_len += _aux->name_len * sizeof(char);* *
// What is this?*

    xcb_tmp += xcb_block_len;
    /* insert padding */
   xcb_pad = -xcb_block_len & 3;
 // What is this?*

    xcb_buffer_len += xcb_block_len + xcb_pad;
    if (0 != xcb_pad) {
        xcb_tmp += xcb_pad;
        xcb_pad = 0;
    xcb_block_len = 0;

    return xcb_buffer_len;

I don't think there is a logical error here

and glancing on functions

1) In master

xcb_str_next (xcb_str_iterator_t *i  /**< */)
    xcb_str_t *R = i->data;
    xcb_generic_iterator_t child;
*    child.data = (xcb_str_t *)(((char *)R) + xcb_str_sizeof(R));*
*// here as I see, xcb_str_sizeof(R) is explicitly called so, this might be
the root cause of the issue, and using if else
// constructs if we try to get the code given belo (1.7 ) what are the
issues that are likely to faced?
// I feel, we dont call the xcb_str_sizeof() explicitly then I think there
will issue in findinf the next offset for the iterator. so
// instead, can there be a way, in which we can fint that if its a string*,
*we call a function say xcb_str_next_string () which
// would be similar to one given below and in rest cases it would call

 i->index = (char *) child.data - (char *) i->data;
    i->data = (xcb_str_t *) child.data;

2) in 1.7

xcb_str_next (xcb_str_iterator_t *i  /**< */)
    xcb_str_t *R = i->data;
    xcb_generic_iterator_t child = xcb_str_name_end(R);
    i->data = (xcb_str_t *) child.data;
    i->index = child.index;

Please reply to this and guide me if I going wrong or being just a n00b :(


Vikash Agrawal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20110704/6997c5fb/attachment.htm>

More information about the Xcb mailing list