gdb 실행 후 onjectdir 이나 directory 명령을 실행하면 현재 설정된 디렉토리를 볼 수 있다. 이 때 2개의 디렉토리가 보이는데 $cdir:$cwd 다.
(gdb) directory
Reinitialize source path to empty? (y or n)
Source directories searched: $cdir:$cwd
(gdb) directory /xxxdev/obj
Source directories searched: /xxxdev/obj:$cdir:$cwd
(gdb) objectdir /yyydev/obj
Object directories searched: /yyydev/obj:$cdir:$cwd
그런데 일일이 이렇게 지정해 주기 귀찮으면 gdb 를 실행하기 전에 object 파일을 모아놓은 곳으로 cd 해서 실행하며 $cwd 가 먹힌다.
$cwd : 현재디렉토리
$cdir : 컴파일디렉토리
objectdir 에 .o 파일이 없을 경우 다음과 같은 메시지를 보여준다.
ERROR: Use the "objectdir" command to specify the search path for objectfile sstd0304a.o.
If NOT specified will behave as a non -g compiled binary.

'컴퓨터활용 > 유닉스' 카테고리의 다른 글
U2L프로젝트 NULL 이슈 (0) | 2020.05.19 |
---|---|
쉘에서 date 사용 (0) | 2020.03.09 |
vi 에서 탭 문자 찾기 (0) | 2019.04.19 |
sprintf함수에서 포매팅 처리 방법 (0) | 2018.04.25 |
ipcs, ipcrm 으로 공유메모리 삭제 방법 (1) | 2018.04.25 |