avidyalalala / sunpinyin

Automatically exported from code.google.com/p/sunpinyin
0 stars 0 forks source link

在 ibus wrapper 里 支持 --enable-debug,打印调试信息到终端 #21

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
以及对应的 log 支持,方便事后定位问题。

Original issue reported on code.google.com by find...@gmail.com on 28 Feb 2010 at 4:21

GoogleCodeExporter commented 9 years ago
Comment 1 by sd.Foolegg, Nov 11, 2009
我在打好patch后
./configure --enable-ibus --disable-documents --enable-debug --prefix=/usr
--libexecdir=/usr/lib/ibus-sunpinyin
结果编译出错
/bin/bash ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.
-I../../..    -D_USE_RAW_PROBABILITY
-DSUNPINYIN_DATA_DIR=\"/usr/share/sunpinyin/data\"
-DSUNPINYIN_USERDATA_DIR_PREFIX=\".ibus/sunpinyin\" -I../../..
-I../../../src/ime-core -I../../../src/lexicon -I../../../src/slm
-I../../../src/pinyin -I../../.. -I../../../src   -g -O2 -MT
libsunpinyin_la-imi_data.lo -MD -MP -MF .deps/libsunpinyin_la-imi_data.Tpo -c -o
libsunpinyin_la-imi_data.lo `test -f '../../../src/ime-core/imi_data.cpp' || 
echo
'./'`../../../src/ime-core/imi_data.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -D_USE_RAW_PROBABILITY
-DSUNPINYIN_DATA_DIR=\"/usr/share/sunpinyin/data\"
-DSUNPINYIN_USERDATA_DIR_PREFIX=\".ibus/sunpinyin\" -I../../..
-I../../../src/ime-core -I../../../src/lexicon -I../../../src/slm
-I../../../src/pinyin -I../../.. -I../../../src -g -O2 -MT
libsunpinyin_la-imi_data.lo -MD -MP -MF .deps/libsunpinyin_la-imi_data.Tpo -c
../../../src/ime-core/imi_data.cpp  -fPIC -DPIC -o 
.libs/libsunpinyin_la-imi_data.o
../../../src/ime-core/imi_data.cpp: In member function ‘bool
CIMIData::loadResource(const char*, const char*)’:
../../../src/ime-core/imi_data.cpp:84: error: cast from ‘CThreadSlm*’ to 
‘int’ loses
precision
../../../src/ime-core/imi_data.cpp:84: error: cast from ‘CPinyinTrie*’ to 
‘int’ loses
precision
../../../src/ime-core/imi_data.cpp:84: warning: format ‘%p’ expects type 
‘void*’, but
argument 2 has type ‘int’
make[4]: *** [libsunpinyin_la-imi_data.lo] Error 1
make[4]: Leaving directory
`/home/l11/Datebase/source/sunpinyin/hg-src/inputmethod/sunpinyin2/wrapper/ibus/
src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
`/home/l11/Datebase/source/sunpinyin/hg-src/inputmethod/sunpinyin2/wrapper/ibus'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/home/l11/Datebase/source/sunpinyin/hg-src/inputmethod/sunpinyin2/wrapper'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/home/l11/Datebase/source/sunpinyin/hg-src/inputmethod/sunpinyin2'
make: *** [all] Error 2
去掉--enable-debug后没有问题?
是不是./configure里还需要开启别的选项?
Comment 2 by tchaikov, Nov 11, 2009
hi foolegg,

谢谢你的热心,使用我的 debug patch 后 configure 不需要加上 
--enable-debug 选项。

对不起,可能我的 issue 描述有些误导。开这个 issue 
主要是因为我发现很多问题都无法在我
的环境里重现,所以需要让 --enable-debug 
支持写日志。现在只有 ime 内核里面才使用了这个
选项,但是我不经常测试它。现在要做的是就是在 
ibus-sunpinyin 里面也支持 --enable-
debug,而不是用这种临时加 patch 
的办法帮助调试。因此,这个 issue 主要是给我自己看的,
好让我不要忘记这个想法。并且能跟踪这个 bug。

所以,我们暂时能做的就是等一下,我晚上会另外发一个 
patch 到  issue#46  了,到时候再麻烦
你测试一下。

Original comment by find...@gmail.com on 28 Feb 2010 at 4:28

GoogleCodeExporter commented 9 years ago

Original comment by tchai...@gmail.com on 1 Mar 2010 at 5:44