Hi Thomas,
Thomas Dickey <
address@hidden> ezt írta (időpont: 2020. ápr. 18., Szo, 22:22):
What I can see looks normal, but the problem is the "text" pointer,
which is null.
_line is a pointer to an array of line data
(which is where "line" comes from, above):
In gdb, you should be able to do
print win->_line[0]
print win->_line[1]
print win->_line[2] <---- the one that's bad
print win->_line[3]
Perhaps the whole array has some problem. I'd look at that first,
and try to see if it was actually initialized.
It looks more-or-less okay. Only the third line seems off with its null-pointer:
(gdb) define chtype_print
Type commands for definition of "chtype_print".
End with a line saying just "end".
>echo "
>set $c = (unsigned int *)$arg0
>set $d = (char) ( (*$c) & (A_CHARTEXT) )
>while ( $d )
> if ( $d > 0x7f )
> printf "[%x]", $d
> else
> printf "%c", $d
> end
> set $c++
> set $d = (char) ( (*$c) & (A_CHARTEXT) )
>end
>echo "\n
>end
...
(gdb) chtype_print (win->_line[0]->text)
"lqqqqqqqqqqqqqqqqqqqqqqqqqqk "
(gdb) chtype_print (win->_line[1]->text)
"xCh PRN Az El S/N Flag U x "
(gdb) chtype_print (win->_line[2]->text)
"Cannot access memory at address 0x0
(gdb) chtype_print (win->_line[3]->text)
"x x "
(gdb) print win->_line[0]
$22 = {text = 0x211bf8, firstchar = 0, lastchar = 27, oldindex = 0}
(gdb) print win->_line[1]
$23 = {text = 0x211d40, firstchar = 0, lastchar = 27, oldindex = 0}
(gdb) print win->_line[2]
$24 = {text = 0x0, firstchar = 0, lastchar = 27, oldindex = 0}
(gdb) print win->_line[3]
$25 = {text = 0x2127f8, firstchar = 0, lastchar = 27, oldindex = 0}
...and if you configured using "--with-trace", you could turn on the
trace feature, e.g.,
rm -f trace
NCURSES_TRACE=0x220 gpsmon
I have recompiled ncurses with your latest patches and the --with-trace flag enabled.
I have produced a traces as you requested, and fed it to tracemunch too. Please find the output attached.
> So it seems that for some reason line->text is empty string, and there is
line->text is a null pointer (not the same as an empty string)
Yes, I can see now I made a mistake, because .text would be non-null even if it pointed to an empty string. Moreover its a pointer to an array of chtype elements instead which under the hood translate to unsigned ints.
Best Regards,
János
--
LinkedIn: linkedin.com/in/janosszigetvari__@__˚V˚
Make the switch to open (source) applications, protocols, formats now:
- windows -> Linux, iexplore -> Firefox, msoffice -> LibreOffice
- msn -> jabber protocol (Pidgin, Google Talk)
- mp3 -> ogg, wmv -> ogg, jpg -> png, doc/xls/ppt -> odt/ods/odp