insight는 GDB를 위한 GUI 프로그램이다.

About 메뉴

웬만한 창은 다 띄워본 화면

insight의 툴바. 순서대로
실행(Run) - 함수안으로(Step) - 함수다음(Next) - 함수나오기(Finish) - 계속실행(Continue)
앞에 5개만 알아도 사용하는데 지장없을 듯 하다.

사용법은 생각보다 단순해서, Visual Studio 에서 디버깅하는 느낌이 들 정도이다.
일단 자세한 사용법은 조금 더 사용해본 뒤 +_+!

[공식 : http://sources.redhat.com/insight/index.php]
[링크 : http://vasudevkamath.blogspot.com/2008/10/gdbs-gui-insight-tutorial.html]


insight를 설치하니, insight의 도움말을 띄우는데 gdb가 나온다.
아무튼 gdb로 실행하기 보다는 그냥 insight로 실행하면 된다.(gdb -w로 하면 된다는데 안된다)
Posted by 구차니
프로그램 사용2009. 6. 24. 18:28
증상 : 편집할 파일을 여는데 symbol window가 자동으로 열리지 않는 경우

아무생각없이 메뉴를 클릭한 상태에서 소스작업을 하다가 키를 연타로 누르는 바람에
창이 사라져서 어느창에서 변경되었는지 알수도 없고, 근 일주일간 해결책을 찾다가 포기한 상태에서
우연히 다시 찾게된 해결책이다. OTL

교훈 : 마우스는 안전한 곳에!


Step 1.
Option - Document Options 를 연다.

Step 2.
우측 하단의 Symbol Window의 체크를 켜준다.


Posted by 구차니
프로그램 사용2009. 6. 22. 14:12
ZOC Terminal은 Shareware이다(탈락!!!)


[링크 : http://www.fileguru.com/ZOC-Terminal/info]



은근히 Freeware로 탭 지원되는 터미널 에뮬레이터가 없다는 사실에 놀랐다 -ㅁ-
음... CSerial도 여러개의 인스턴스를 사용할 수 있다면 간단하게 구현이 가능할텐데..
한번 공부할 겸 시간내서 만들어 볼까나?
Posted by 구차니

#include "stdio.h"
#include "elf.h"

void main() { Elf32_Ehdr elf_header; unsigned char magic[] = {0x7f,0x45,0x4c,0x46,0x01,0x01,0x01,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; int vma_addr = 0xA4000000; FILE *output = NULL;
memcpy(elf_header.e_ident, magic, sizeof(magic)); elf_header.e_type = ET_EXEC; elf_header.e_machine = EM_SH; elf_header.e_version = EV_CURRENT; elf_header.e_entry = vma_addr; elf_header.e_phoff = 0; elf_header.e_shoff = 0; elf_header.e_flags = EM_SH; elf_header.e_ehsize = sizeof(elf_header); elf_header.e_phentsize = 0; elf_header.e_phnum = 0; elf_header.e_shentsize = 0; elf_header.e_shnum = 0; elf_header.e_shstrndx = 0;
output = fopen("elfheader.bin","wb"); fwrite(&elf_header, sizeof(Elf32_Ehdr), 1, output); fclose(output);
}

혹시나 해서 꼼지락 대면서 gdb load 명령을 이용하여 프로그램 업로드 하기 위해
꽁수를 부려 봤는데.. 이정도 ELF 정도로는 속아주질 않는다 ㄱ-

아이디어 : load 시에 not an object file: File format not recognized 메시지는
               즉, ELF 포맷에 맞추어 제대로 된 헤더만 맞추어 주면
               원하는 메모리 번지로 임의의 파일을 올릴 수 있지 않을까?

결과 : 니미 ㄱ-

2009/02/16 - [회사일] - sh4-linux-gdb 의 load 명령어

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

GDB Insight FAQ - support target list  (0) 2009.06.26
insight - GDB GUI frontend  (0) 2009.06.26
gdb 한글 문서  (0) 2009.06.18
gdb 기동시 xterm 에러 - STLinux  (2) 2009.04.09
sh4-linux-gdb 의 load 명령어  (0) 2009.02.16
Posted by 구차니
Posted by 구차니
6. Proposal
-----------

Use a comment after the {tagaddress} field.  The format would be:

    {tagname}<Tab>{tagfile}<Tab>{tagaddress}[;"<Tab>{tagfield}..]

   {tagname}    Any identifier, not containing white space..
   <Tab>    Exactly one TAB character (although many versions of Vi can handle any amount of white space).
   {tagfile}    The name of the file where {tagname} is defined, relative to the current directory
                   (or location of the tags file?).
   {tagaddress}    Any Ex command.  When executed, it behaves like 'magic' was not set.
                         It may be restricted to a line number or a search pattern (Posix).

Optionally:
   ;"        semicolon + doublequote: Ends the tagaddress in way that looks like the start of a comment to Vi.
   {tagfield}    See below.

A tagfield has a name, a colon, and a value: "name:value".
- The name consist only out of alphabetical characters.  Upper and lower case are allowed.
   Lower case is recommended.  Case matters ("kind:" and "Kind: are different tagfields).
- The value may be empty.
  It cannot contain a <Tab>.
  When a value contains a "\t", this stands for a <Tab>.
  When a value contains a "\r", this stands for a <CR>.
  When a value contains a "\n", this stands for a <NL>.
  When a value contains a "\\", this stands for a single '\' character.
  Other use of the backslash character is reserved for future expansion.
  Warning: When a tagfield value holds an MS-DOS file name, the backslashes must be doubled!

Proposed tagfield names:

FIELD-NAME    DESCRIPTION

arity        Number of arguments for a function tag.
class        Name of the class for which this tag is a member or method.
enum        Name of the enumeration in which this tag is an enumerator.
file        Static (local) tag, with a scope of the specified file.  When the value is empty, {tagfile} is used.
function    Function in which this tag is defined.  Useful for local variables (and functions).
               When functions nest (e.g., in Pascal), the function names are concatenated, separated with
                '/', so it looks like a path.
kind        Kind of tag.  The value depends on the language.  For C and
        C++ these kinds are recommended:
        c    class name
        d    define (from #define XXX)
        e    enumerator
        f    function or method name
        F    File name
        g    enumeration name
        m    member (of structure or class data)
        p    function prototype
        s    structure name
        t    typedef
        u    union name
        v    variable
        When this field is omitted, the kind of tag is undefined.
struct        Name of the struct in which this tag is a member.
union        Name of the union in which this tag is a member.

Note that these are mostly for C and C++.  When tags programs are written for
other languages, this list should be extended to include the used field names.
This will help users to be independent of the tags program used.

Examples:

    asdf    sub.cc    /^asdf()$/;"    new_field:some\svalue    file:
    foo_t    sub.h    /^typedef foo_t$/;"    kind:t
    func3    sub.p    /^func3()$/;"    function:/func1/func2    file:
    getflag    sub.c    /^getflag(arg)$/;"    kind:f    file:
    inc    sub.cc    /^inc()$/;"    file: class:PipeBuf


The name of the "kind:" field can be omitted.  This is to reduce the size of
the tags file by about 15%.  A program reading the tags file can recognize the
"kind:" field by the missing ':'.  Examples:

    foo_t    sub.h    /^typedef foo_t$/;"    t
    getflag    sub.c    /^getflag(arg)$/;"    f    file:


Additional remarks:
- When a tagfield appears twice in a tag line, only the last one is used.

Note about line separators:

Vi traditionally runs on Unix systems, where the line separator is a single
linefeed character <NL>.  On MS-DOS and compatible systems <CR><NL> is the
standard line separator.  To increase portability, this line separator is also
supported.

On the Macintosh a single <CR> is used for line separator.  Supporting this on
Unix systems causes problems, because most fgets() implementation don't see
the <CR> as a line separator.  Therefore the support for a <CR> as line
separator is limited to the Macintosh.

Summary:
line separator    generated on        accepted on
<LF>        Unix            Unix, MS-DOS, Macintosh
<CR>        Macintosh        Macintosh
<CR><LF>    MS-DOS            Unix, MS-DOS, Macintosh

The characters <CR> and <LF> cannot be used inside a tag line.  This is not
mentioned elsewhere (because it's obvious).

Note about white space:

Vi allowed any white space to separate the tagname from the tagfile, and the
filename from the tagaddress.  This would need to be allowed for backwards
compatibility.  However, all known programs that generate tags use a single
<Tab> to separate fields.

There is a problem for using file names with embedded white space in the
tagfile field.  To work around this, the same special characters could be used
as in the new fields, for example "\s".  But, unfortunately, in MS-DOS the
backslash character is used to separate file names.  The file name
"c:\vim\sap" contains "\s", but this is not a <Space>.  The number of
backslashes could be doubled, but that will add a lot of characters, and make
parsing the tags file slower and clumsy.

To avoid these problems, we will only allow a <Tab> to separate fields, and
not support a file name or tagname that contains a <Tab> character.  This
means that we are not 100% Vi compatible.  However, there is no known tags
program that uses something else than a <Tab> to separate the fields.  Only
when a user typed the tags file himself, or made his own program to generate a
tags file, we could run into problems.  To solve this, the tags file should be
filtered, to replace the arbitrary white space with a single <Tab>.  This Vi
command can be used:

    :%s/^\([^ ^I]*\)[ ^I]*\([^ ^I]*\)[ ^I]*/\1^I\2^I/

(replace ^I with a real <Tab>).

TAG FILE INFORMATION:

Psuedo-tag lines can be used to encode information into the tag file regarding
details about its content (e.g. have the tags been sorted?, are the optional
tagfields present?), and regarding the program used to generate the tag file.
This information can be used both to optimize use of the tag file (e.g.
enable/disable binary searching) and provide general information (what version
of the generator was used).

The names of the tags used in these lines may be suitably chosen to ensure
that when sorted, they will always be located near the first lines of the tag
file.  The use of "!_TAG_" is recommended.  Note that a rare tag like "!"
can sort to before these lines.  The program reading the tags file should be
smart enough to skip over these tags.

The lines described below have been chosen to convey a select set of
information.

Tag lines providing information about the content of the tag file:

!_TAG_FILE_FORMAT    {version-number}    /optional comment/
!_TAG_FILE_SORTED    {0|1}            /0=unsorted, 1=sorted/

The {version-number} used in the tag file format line reserves the value of
"1" for tag files complying with the original UNIX vi/ctags format, and
reserves the value "2" for tag files complying with this proposal. This value
may be used to determine if the extended features described in this proposal
are present.

Tag lines providing information about the program used to generate the tag
file, and provided solely for documentation purposes:

!_TAG_PROGRAM_AUTHOR    {author-name}    /{email-address}/
!_TAG_PROGRAM_NAME    {program-name}    /optional comment/
!_TAG_PROGRAM_URL    {URL}    /optional comment/
!_TAG_PROGRAM_VERSION    {version-id}    /optional comment/

[링크 : http://ctags.sourceforge.net/FORMAT]



별다른 옵션을 주지 않고
 ctags [filename]
으로 실행하면 tags 라는 파일이 생성됨

$more test.c
#include <stdio.h>
#define VERSION 1.00

typedef struct _point_
{
    int x;
    int y;
} POINT;

void main()
{
    int a;
    char str[] = "Hello world";
    POINT pt;
   
    printf("%s\n",str);
}

$ more tags
!_TAG_FILE_FORMAT    2    /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED    1    /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR    Darren Hiebert    /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME    Exuberant Ctags    //
!_TAG_PROGRAM_URL    http://ctags.sourceforge.net    /official site/
!_TAG_PROGRAM_VERSION    5.4    //
POINT    test.c    /^} POINT;$/;"    t    file:
VERSION    test.c    2;"    d    file:
_point_    test.c    /^typedef struct _point_$/;"    s    file:
main    test.c    /^void main()$/;"    f
x    test.c    /^    int x;$/;"    m    struct:_point_    file:
y    test.c    /^   
int y;$/;"    m    struct:_point_    file:

{tagname}<Tab>{tagfile}<Tab>{tagaddress}[;"<Tab>{tagfield}..] 가 기본 포맷인데
POINT    test.c    /^} POINT;$/;"    t    file: 를 보면

tagname - POINT
tagfile - test.c
tagaddress - /^} POINT;$/
tagfield - t
tagfield - file:

라는 의미를 지니게 된다. 아래의 POINT 구조체의 x, y 변수는 m(member)로 표기된다.

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

ctags 제약사항  (0) 2011.10.28
kscope 에서 특정 확장자 추가하기  (0) 2009.11.04
kscope 프로젝트 생성하기  (0) 2009.08.20
ctags  (0) 2009.01.07
Posted by 구차니
프로그램 사용2009. 6. 5. 14:48
outlook을 주로 업무에 사용하는데, 나는 그녀석은 무겁고 싫어서 outlook express를 사용한다(winXP 기본 내장)
그런데! 같은 outlook 임에도 불구하고 하위버전인지라..
신버전의 아웃룩에서 보낸 메일중 일부는 winmail.dat로 날아온다.
혹은, 첨부 파일이 표시가 안된채로 말이다.
그냥 꾸시렁 대면서 첨부 다른걸로 보내 달라구 하긴하는데 귀찮기도 하다가
나야 자주 받는 편은 아니라 패~~~쓰 했는데 오늘은 피할 수 없는 일이 생겼다.

보내는 사람 outlook에서는 아래와 같이 설정해주고
이 문제를 해결하려면 일반 텍스트 형식을 사용하십시오. 이렇게 하려면 다음과 같이 하십시오.

   1. 도구 메뉴에서 옵션을 누른 다음 메일 형식을 누릅니다.
   2. 작성할 메시지 형식에서 일반 텍스트를 눌러 선택한 다음 확인을 누릅니다.

참고: RTF 형식을 사용하는 특정 받는 사람과 일반 텍스트 형식을 사용하는 다른 받는 사람에게 보내려면 개인 주소록이나 받는 사람의 연락처 레코드에서 받는 사람의 옵션을 설정해야 합니다.

다음 단계를 수행하여 개인 주소록에 있는 받는 사람 특성에서 RTF 형식을 제거하십시오.

   1. 도구 메뉴에서 주소록을 누릅니다.
   2. 주소록 선택에서 개인 주소록을 누릅니다.
   3. 일반 텍스트로 설정할 주소를 선택한 다음 파일 메뉴에서 등록 정보를 누릅니다.
   4. SMTP-일반 탭에서 이 받는 사람에게는 항상 Microsoft Exchange 서식 있는 텍스트로 보내기 확인란을 선택 취소한 다음 확인을 누릅니다.

다음 단계를 사용하여 받는 사람의 연락처 레코드에서 일반 텍스트로 설정합니다.

   1. 연락처 폴더에서 받는 사람의 레코드를 엽니다.
   2. 받는 사람의 전자 메일 주소를 두 번 누릅니다.
   3. 전자 메일 등록 정보 대화 상자의 인터넷 메일 형식에서 일반 텍스트만 보내기를 누릅니다.

[ms 고객지원 (outlook) winmail.dat로 안가게 하기 : http://support.microsoft.com/kb/278061]



ms 제품을 사용하지 않는 사용자(예를 들어 Thunderbird) 들은 winmail opener 프로그램을 추가로 사용한다.
[winmail opener : http://www.eolsoft.com/freeware/winmail_opener/]

아래는 mail exchanger 설정 바꾸는 건데.. exchage server 사용자가 아니라면 패스 해도 될 듯?
[ms 고객지원 (mail exchage) winmail.dat로 안가게 하기 : http://support.microsoft.com/kb/q138053/]

[발견 : http://lordmiss.com/journal/archives/53]

Posted by 구차니
ssh를 사용하면 sftp는 기본으로 사용할 수 있게 된다.
문득, sftp를 막을 수 있는 방법을 없을까? 라는 생각이 들었는데..
아래의 링크에서 사용하지 못하도록 하는 방법을 찾게 되었다.

$ vi /etc/ssh/sshd_config
 72 # Allow client to pass locale environment variables
 73 AcceptEnv LANG LC_*
 74
 75 Subsystem sftp /usr/lib/openssh/sftp-server
 76
 77 UsePAM yes



 75 #Subsystem sftp /usr/lib/openssh/sftp-server
로 해주면 된다고 한다.

※ ubuntu 9.04의 sshd_config파일 행번호임.

원본 내용은 RHEL(RedHat Enterprise Linux) 에 적용되지만
Ubuntu 9.04 역시 동일하게 존재한다.

[링크 : http://blog.seabow.pe.kr/513]


배포판마다 다르지만 sftp-server 라는 실행파일이 존재합니다
/usr/lib/sftp-server에 없다면 find로 검색해서 찾아보시기 바랍니다.
#find / -name sftp-server  (root권한으로 하는게 좋습니다.)
하면 경로가 나옵니다.
그 경로가 만약
/usr/lib/misc/sftp-server면 이 경로를

#echo "/usr/lib/misc/sftp-server" >> /etc/shells 로 허가 쉘 목록에 추가해줍니다.
그런후에
#usermod -s /usr/lib/misc/sftp-server  사용자id
해주면 그 사용자는 sftp만 허용됩니다.

[링크 : http://phpschool.com/gnuboard4/bbs/board.php?bo_table=qna_install&wr_id=82505]

Posted by 구차니
프로그램 사용2009. 6. 4. 19:24
JPEG 하면 EXIF가 먼저 떠오르는건 디카의 위력일려나..

[jhead : http://www.sentex.net/~mwandel/jhead/]
[libexif : http://sourceforge.net/projects/libexif]
[libjpeg exif patch : http://sylvana.net/jpegcrop/exifpatch.html]
Posted by 구차니
프로그램 사용/gcc2009. 5. 28. 23:06
오늘 희한한 switch - case문을 들었다

case 1 ... 10:

이런식으로 기존에는
case 1:
case 2:
...
case 9:
case 10:
이라고 쓰던것을 줄여 쓸수 있다고 한다.

검색을 해보니 c#과 gcc에서 지원하고 C99 등에는 검색이 걸려 나오지 않는다.
정체가 머냐?


[링크 : http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic62939.aspx]
[링크 : http://www.devhood.com/messages/message_view-2.aspx?thread_id=13708]
Posted by 구차니