프로그램 사용2010. 6. 1. 14:08
난 한RSS리더를 사용한다.
다르게 말하자면 항상 파이어폭스를 켜놓고 산다.
그러다 보면 이넘의 불여우가 간을 빼먹는게 아니라 메모리를 빼먹는다 ㄱ-

매너없는 메모리. 최고 350MB 까지 가봤음

그래서 부랴부랴 검색을 해서 부가기능에서 memory 키워드로 검색해서 별이 가장 많은 AFOM을 설치했다.
머.. 벤치마킹 이런건 모르겠지만, 체감적으로 상당히 부드러워졌고
메모리가 120MB를 넘어서면 정리를 해서 8MB 까지 떨어지고 다시 또 차오르고를 반복한다.
조금은 더 오래 써봐야 알겠지만, 생각보다 쓸만해 보인다.




2010.06.03 추가
주말에 집에서 사용해보니, 노트북에서는 조금 버벅대는 감이있다.
꾸준히 약간 버벅대냐, 한번 대박으로 버벅대냐의 차이일려나? ^^;
노트북은 센트리노 1.2Ghz / 1GB 이다.

Posted by 구차니
뜬금없는 이야기지만, 일단 iconv는 libc 를 이용한다.
그런데 이 넘은 실제로 /usr/lib/gconv/*.so 파일들을 사용한다.

아무튼, 이 넘들이 없으면 에러는 안나지만 변환이 안된다.
(임베디드에서 iconv 쓰는데 변환이 안되서 찾은 문제)


strace를 해보니
gconv-module은 /usr/lib/gconv-modules에서 잘 open 했는데 EUC-KR.so 를 open 한 후 libc.so.6ld-linux.so.2를 찾네요, 저는 shared library를 안쓰고 있는데 ㅠㅠ 그래서 위 두 파일을 ramdisk/usr/lib 에 복사해 넣은 후 TARGET에서 다시 iconv sample 프로그램을 돌려보니 이제는 정상 동작 합니다.

[링크 : http://kldp.org/node/76270]



음.. 그래서 일단은 libc*로 파일들을 검색해보니 "libc.so" 가 없다.
so 라길레 파일 용량을 보니 저렴한 238Byte. 그래서 cat으로 해보니 텍스트 파일이다.

>>> x86 리눅스의 libc.so 내용
# cat /usr/lib/libc.so
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf32-i386)
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a  AS_NEEDED ( /lib/ld-linux.so.2 ) )

>>> sh4 리눅스의 libc.so 내용
]# cat usr/lib/libc.so
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf32-sh-linux)
GROUP ( libc.so.6 libc_nonshared.a  AS_NEEDED ( /lib/ld-linux.so.2 ) )



수동으로 crt 코드와 libc를 링크시켜 줍니다. 여기까지 해서 동작을 잘 해야 하는데, 컴파일/링킹 워닝이나 에러가 안나지만 프로그램이 동작하지 않습니다.

$ readelf -l test
...
INTERP 0x000114 0x08048114 0x08048114 0x00013 0x00013 R 0x1
[Requesting program interpreter: /usr/lib/libc.so.1]
...

dynamic linker를 시스템 기본값인 /usr/lib/libc.so.1로 지정하는데, 문제는 시스템에는 해당 파일이 없습니다--; 마찬가지 방법으로 /bin/ls의 INTERP 섹션을 읽어보니까 INTERP는 /lib/ld-linux.so.2로 되어 있네요. 위에서 /usr/lib/libc.so.1 은 없고 /usr/lib/libc.so는 있는데, 이 파일의 내용은 다음과 같습니다.

$ cat /usr/lib/libc.so
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-i386)
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.2 ) )
출처:ld의 동작


[링크 : http://earthfall.egloos.com/1794074]

Posted by 구차니
libfreetype의 example1.c 컴파일 하려면 보기보다 빡시다
버그인지는 모르겠지만 /usr/include/ft2build.h 파일에 include 경로가
 #include <freetype/config/ftheader.h>
로 되어있지만 실제로 이 경로는 존재하지 않는다.

/usr/include/freetype2/freetype 에 각종 헤더들이 존재하는데, 이를 해결하기 위해서는
 ln -s /usr/include/freetype2/freetype /usr/include/freetype
이런식으로 심볼릭 링크를 생성해주어야 한다.

아무튼 이러한 헤더경로를 수정해주고 나면 모르면 어려운 에러가 발생한다.
freetype 을 사용하는 녀석들은 수학 라이브러리와 freetype 라이브러리를 사용하므로
 $ gcc -lm -lfreetype
을 넣고 컴파일을 돌려야 한다.
2010/05/30 - [Linux] - libm (math library)

그리고 example1.c 의 경우 폰트의 경로를 직접넣어 주어야 한다.
우분투에서 폰트의 기본 경로는 /usr/share/fonts 이므로 그 안에서 직접 폰트의 전체경로를 넣어주어야 한다.
2010/05/30 - [Linux/Ubuntu] - 우분투 기본 폰트 경로 - Default path of Ubuntu fonts

freetype-doc-2.3.12.tar.bz2 << 이녀석을 압축해제하면 docs/tutorial 에 example?.c 파일'들'이 있다.
그중에 example1.c 를 컴파일 하였으며
 $ gcc -lm -lfreetype example1.c
 $ ./a.out /usr/share/fonts/truetype/ttf-japanese-gothic.ttf test > tt.txt
위와 같은 명령줄로 실행하여 나온 결과는 아래와 같다.
이미지 처럼 나온 것은 메모장을 축소하여 일부분만 잘라낸 것이다.



Posted by 구차니
프로그램 사용/GIMP2010. 5. 27. 11:17
다음 뷰에서 HDR로 합성하는 내용이 있어서 봤더니
포토매틱스(photomatix) 라는 프로그램을 쓴다고 한다.
혹시나 해서 GIMP에서도 가능하지 않을까 해서 검색을 해봤는데 현재로서는.. 이미지도 없고 -ㅁ-
집에가서 확인해봐야겠다.

[링크 : http://www.instructables.com/id/HDR-photos-with-the-GIMP/]

[링크 : http://www.hdrsoft.com/] photomatix
    [링크 : http://toycamera.tistory.com/1174]
    [링크 : http://mindman.tistory.com/385]


Posted by 구차니
프로그램 사용2010. 5. 26. 21:57
웹초보님의 구글 크롬 5.0 공식 릴리즈 (맥 & 리눅스 정식 버전 포함) 글을 보고
집에와서 우분투 10.04에서 설치를 하려니...



일단 코리아 우분투 아카이브 폭발(?)로 인해 업데이트 불가.
그래서, 구글 홈페이지에서 deb로 받으니 설치완료


하.지.만
파이어폭스에서도 여전했던, 티스토리 이미지 업로드 시 '사진추가' '확인' 등의 버튼이 가출하는 문제가
크롬에서도 여전히 발생했다.


Posted by 구차니

[공식 : http://www.freetype.org/]
    [freetype 1 : http://freetype.sourceforge.net/freetype1/index.html] << freetype 2로 프로젝트 넘어감
    [freetype 2 : http://freetype.sourceforge.net/freetype2/index.html]


libfreetype은 freetype 프로젝트의 부산물(?)이며, 이녀석은 글꼴을 그려주는 라이브러리이다.
  • By default, FreeType 2 supports the following font formats.

    • TrueType fonts (and collections)
    • Type 1 fonts
    • CID-keyed Type 1 fonts
    • CFF fonts
    • OpenType fonts (both TrueType and CFF variants)
    • SFNT-based bitmap fonts
    • X11 PCF fonts
    • Windows FNT fonts
    • BDF fonts (including anti-aliased ones)
    • PFR fonts
    • Type 42 fonts (limited support)
보다시피 거의 모든 폰트를 지원하며, 벡터/TrueType 폰트/외곽선 폰트 및 비트맵 폰트를 지원한다.
말이 복잡하지만, 간단하게 말해서 확대해도 안깨지는 글꼴과 확대하면 깨지는 글꼴을 지원한다.

그리고 두가지 라이센스를 제공한다. 머 BSD-like 가 GPL보다는 숨통이 트이니 사용자 입장에서는 좋긴하다.
FreeType 2 is released under two open-source licenses: our own BSD-like FreeType License and the GPL.


아무튼, 애플에서 이러한 힌팅기술에 대한 특허를 가지고 있으므로
특허권에 의해서 patented bytecode를 무시하여 약간은 부드럽지 못하게 나온다고 한다.
(아래의 사진을 보면 K R W Z 가 약간 깨어져 보인다.)
What Is Patented

It is important to clarify that the patents only cover a small subset of the TrueType instructions (not the whole process of hinting glyphs with specific bytecode programs). Unfortunately, the patented bytecodes are relatively often used in high-quality glyph programs.

For example, here is a picture showing the ‘Arial’ font with a specific version of the FreeType bytecode interpreter that simply ignores the patented bytecodes.

As you can see, some rather unpleasant artifacts make the font unacceptable for normal reading use.

Is FreeType 2 Affected by the Patents?

The answer is no for any recent build of FreeType 2, since it comes with an ‘auto-hinting’ module that was specifically designed to completely ignore the TrueType bytecode instructions.

However, the source code for the bytecode interpreter is still available and can be toggled on at compile time, for those that want to use it anyway (because they purchased a license from Apple, or because they are in a country where the patents do not apply, etc.). For details please check the documentation that comes with your FreeType source package (it normally involves changing one configuration macro).

Note that some beta versions of FreeType 2 did use the bytecode interpreter (since the auto-hinter wasn't available yet).

Finally, many Linux distributions seem to distribute a patched version of FreeType 2 with the bytecode interpreter activated, unlike the sources we distribute. Of course, we can only deny any kind of responsibility in this case. It further means that in the event where you need to update the version of FreeType installed on your system from our sources, you should better manually activate the bytecode interpreter at compile time in order to prevent any loss of quality.

[링크 : http://freetype.sourceforge.net/patents.html]


트루타입(TrueType)은 외곽선 글꼴 표준으로, 1980년대 말에 애플 컴퓨터어도비포스트스크립트에 쓰이는 타입 1 글꼴에 대항하기 위해 개발하였다. 트루타입의 주된 이점은 글꼴 개발자들에게 글꼴이 다양한 글꼴 크기에서 어떻게 표시될 것인지에 대한 높은 수준의 제어를 할 수 있다는 것이며 이를 힌팅기술 혹은 힌팅 인스트럭션이라고 한다.

[링크 : http://ko.wikipedia.org /wiki/트루타입]
[링크 : http://en.wikipedia.org/wiki/TrueType]

Posted by 구차니
expat은 아래와 같은 기본 코드로 작동된다. (링크 참조)
2010/03/23 - [프로그램 사용/expat / XML] - expat-2.0.1 example

문제는 위의 main() 함수에서 fread()를 이용하여 버퍼 사이즈 만큼 읽어오기 때문에
최악의 경우 데이터나 elemet가 잘리는 경우가 발생할수 있다는 것이다.
예를 들어

<entry gd:etag="W/"CUQFRX47eCp7ImA9WxFXF0s."">
    <id>tag:youtube.com,2008:video:qlZjYvHWTo4</id>
    <published>2010-05-19T07:13:31.000Z</published>
    <updated>2010-05-25T04:55:14.000Z</updated>
</entry>

이러한 XML이 있고, "id" 태그의 데이터를 읽으려고 할때 최악의 경우
버퍼의 경계에 걸릴경우,
tag:youtube.com,2008:vide
o:qlZjYvHWTo4
이런식으로 두번을 읽어 오게 된다.

일단은 버퍼를 늘리는 것 외에는 딱히 다른 방법은 찾지 못했다.

'프로그램 사용 > expat & XML' 카테고리의 다른 글

GPX TCX 포맷  (0) 2013.06.22
Javascript DOM API / XML  (2) 2010.07.13
expat으로 smi 자막파일 파싱은 불가?  (0) 2010.05.03
SAX (Simple API for XML)  (0) 2010.04.23
xml 트리 탐색 - XML tree navigation  (0) 2010.04.17
Posted by 구차니
결론만 간단히 내자면, insight 컴파일시 환경설정에 따라서, target/TCP target/Serial이 추가된다.
그러니 신경쓰지 말고
GDBServer/TCP 나 Remote/TCP 둘중에 하나 골라서 쓰면된다.



Selecting a Target
Selecting a target involves choosing a target for debugging and setting connection interface options for the target.

Common targets include: "Exec" for native debuggers, "Remote/Serial" for establishing a connection to a target board via a serial line, "Remote/TCP" for TCP connections, and "Simulator" for connections to the simulator. There may be more depending on the configuration of the debugger being used.

In general, "remote" targets are always serial connections which require the user to specify the serial port and baud rate to be used for the connection and "remote/tcp" targets are always TCP connections which require specifying the hostname and port number of the machine to which to connect. Depending upon configuration, there may be numerous serial- and TCP-based connections. These always follow the naming convention target/Serial and target/TCP.

To select a target, choose one of the available targets from the dropdown menu in the Connection Frame. Then specify the interface options for this target: selecting the baudrate and serial port from the dropdown menus (serial targets only) or entering the hostname and port number (TCP targets only).

[출처 : insight - About GDB - target window]


Posted by 구차니
우분투에서 insight 소스를 받아서 컴파일 하는데 에러를 뱉어낸다 ㄱ-

WARNING: `makeinfo' is missing on your system.  You should only need it if
         you modified a `.texi' or `.texinfo' file, or any other file
         indirectly affecting the aspect of the manual.  The spurious
         call might also be the consequence of using a buggy `make' (AIX,
         DU, IRIX).  You might want to install the `Texinfo' package or
         the `GNU make' package.  Grab either from any GNU archive site.

$ makeinfo
'makeinfo' 프로그램은 현재 설치되어 있지 않습니다.  다음을 입력하여 이를 설치할 수 있습니다:
sudo apt-get install texinfo
머.. texinfo 패지키를 깔면 해결된다.

그리고, make distcelan 이후 다시 configure를 하고 해주니, 요런 에러가 발생한다.
configure: error: no termcap library found
이녀석은 libncurses5-dev 패키지를 설치하면 해결된다.
[링크 : http://leoric99.tistory.com/entry/Ubuntutermcap-라이브러리-해결-방법]

그런데.. 이 에러는 도대체 어떻게 잡아야 하나...
gcc -c -g -O2   -I. -I.././gdb -I.././gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I.././gdb/../include/opcode -I.././gdb/../readline/.. -I../bfd -I.././gdb/../bfd -I.././gdb/../include -I../libdecnumber -I.././gdb/../libdecnumber   -DMI_OUT=1 -DGDBTK -DTUI=1  -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wno-switch -Wno-char-subscripts -Werror linux-nat.c
cc1: warnings being treated as errors
linux-nat.c: In function ‘linux_nat_info_proc_cmd’:
linux-nat.c:2879: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
gdb/Makefile 에서 -Werror 부분을 주석처리 해준다.

WARNING: `bison' missing on your system.  You should only need it if
         you modified a `.y' file.  You may need the `Bison' package
         in order for those modifications to take effect.  You can get
         `Bison' from any GNU archive site.
머.. bison 패키지를 깔면 해결된다.

ada-lex.c missing and flex not available.
... 정말로 파일이 없다.
일단 flex 패키지를 설치해준다.
[링크 : http://kldp.org/node/55249]

그런데.. 또 클린하고 해도..
gcc -g -O2      \
                -o gdb gdb.o libgdb.a \
                   ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a  ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a    ../libgui/src/libgui.a -L/home/morpheuz/src/insight/itcl/itcl -litcl3.2 -L/home/morpheuz/src/insight/itcl/itk -litk3.2 -L/home/morpheuz/src/insight/tk/unix -ltk8.4 -Wl,-rpath,/usr/local/lib -L/home/morpheuz/src/insight/tcl/unix -ltcl8.4   -lX11 -ldl  -lieee -lm -lncurses -lm   ../libiberty/libiberty.a  -ldl -rdynamic
libgdb.a(ada-lang.o): In function `parse':
/home/morpheuz/src/insight/gdb/ada-lang.c:10972: undefined reference to `ada_parse'
libgdb.a(ada-lang.o):(.rodata+0xda0): undefined reference to `ada_error'

... ada 가 날 열받게 하는구나~ ㄱ-
아놔 안해안해 ㄱ-


+
2016.08.29
[링크 : http://decdream.tistory.com/370] 이분은 성공하셨네 ㅠㅠ


'프로그램 사용 > gdb & insight' 카테고리의 다른 글

gdb break  (0) 2021.04.09
gdb/insight target window  (0) 2010.05.19
gdb / gdbserver 접속명령어  (0) 2010.05.18
insight(gdb) 아키텍쳐별 차이점(?)  (0) 2010.05.18
gdb cross compile 관련  (0) 2010.05.18
Posted by 구차니
gdbserver는 gdb를 돌릴만한 사정이 안되는 시스템을 위한 프로그램으로
단순하게 gdb의 앞단에서 데이터를 TCP나 시리얼 등으로 전송해 주는 역활을 한다.
그런 이유로 gdbserver 만으로는 아무런 것도 할수 없으며

크로스 컴파일 환경이라면, 내부적으로 크로스 환경에 맞추어진 gdb가 별도로 존재해야 한다.
gdbserver는 아래와 같이 host:port 식으로 선언을 하는데 현재까지는 host는 무시를 하고 port만을 받아들인다고 한다.

To use a TCP connection instead of a serial line:

     target> gdbserver host:2345 emacs foo.txt

The only difference from the previous example is the first argument, specifying that you are communicating with the host gdb via TCP. The `host:2345' argument means that gdbserver is to expect a TCP connection from machine `host' to local TCP port 2345. (Currently, the `host' part is ignored.)

[링크 : http://sourceware.org/gdb/current/onlinedocs/gdb/Server.html#Server]

그리고 gdb 쪽에서는 target remote 라는 명령어를 통해 접속이 가능하며, 기본값으로는 TCP로 접속하도록 되어있다.

target remote host:port
target remote tcp:host:port
    Debug using a TCP connection to port on host. The host may be either a host name or a numeric IP address; port must be a decimal number. The host could be the target machine itself, if it is directly connected to the net, or it might be a terminal server which in turn has a serial line to the target.

target remote udp:host:port
    Debug using UDP packets to port on host. For example, to connect to UDP port 2828 on a terminal server named manyfarms:
              target remote udp:manyfarms:2828
    When using a UDP connection for remote debugging, you should keep in mind that the `U' stands for “Unreliable”. UDP can silently drop packets on busy or unreliable networks, which will cause havoc with your debugging session.

[링크 : http://sourceware.org/gdb/current/onlinedocs/gdb/Connecting.html#Connecting]


음.. 그런데 gdb/insight 에서 보이는
GDBserver/TCP , remote/TCP는 멀까?
Posted by 구차니