.gdbinit 이라고 GDB가 실행될때 같이 로딩되는 파일이 있다.
이파일안애 아래와 같은 스크립트 함수를 만들어주고
문자열을 출력할때 p 대신 pp를 사용하면
한글 문자열을 화면에 출력할수 있다.
define pp
# echo '
set $i = 0
while (1 == 1)
set $c = (char)(($arg0)[$i++])
if ($c == '\0')
loop_break
end
printf "%c", $c
end
printf "%c", '\n'
end
document pp
pp <wstr>
print multi byte which is utf8, unicode
end
'C언어' 카테고리의 다른 글
bit masking ( about xor ) (0) | 2015.04.21 |
---|---|
clock_gettime (0) | 2015.04.16 |
c11 추가된 내용 (0) | 2015.03.20 |
tokyocabinet threading error (0) | 2015.03.18 |
thread deadlock debugging (0) | 2015.03.06 |