Re: DDD

Russell Shaw <[email protected]>
Newsgroups gmane.comp.gdb.devel,gmane.comp.debugging.ddd.general
Message-ID <[email protected]>
On 12/03/15 18:19, shaunak saha wrote:
> Hi,
>
> We are working on porting GTK port version of DDD. hopefully the first GTK
> official release will be done end of this year. Will make a last motif release
> before that with few fixes.

I found the bug is in XmTextXYToPos(), and is caused by three unicode copyright 
(c) chars in my file being displayed in DDD. Each (c) consists of two bytes: 
0xc2 0xa9 present in the text buffer of the text_w widget.

XmTextXYToPos() only counts the (c) as one char, even though it's displayed as 
two chars on the screen.

The same applies for any other non 7-bit-clean unicode bytes in the file.

ddd-3.3.12/ddd/SourceView.C" line 5071

void SourceView::startSelectWordAct (Widget text_w, XEvent* e,
                                      String *params, Cardinal *num_params)
{
#if XtSpecificationRelease < 6
     selection_event = *e;
#endif

     XtCallActionProc(text_w, "grab-focus", e, params, *num_params);

     if (e->type != ButtonPress && e->type != ButtonRelease)
         return;

     XButtonEvent *event = &e->xbutton;

     XmTextPosition pos = XmTextXYToPos (text_w, event->x, event->y);

     XmTextPosition startpos, endpos;

     if (app_data.source_editing)
	startpos = endpos = pos;
     else
	find_word_bounds(text_w, pos, startpos, endpos);

     ...


XmTextXYToPos() is in the debian source from:
   apt-get source libmotif-common

The deb source adds quite a few patches, which could have an effect on the 
problem, but i couldn't trace into XmTextXYToPos() because of debian library 
dependencies involved in installing more things from source.

The easy fix was to banish all chars not 7-bit clean from the source being debugged.
-- 
regards,
Russell Shaw, B.Eng, M.Eng(Research)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.