gdb не любит полные пути?

a10063


#include <iostream>
int main
{
std::cout << "HW!";
}

/mnt/data/temp/test $ g++ -g -c src/main.cpp -o build/main.o
/mnt/data/temp/test $ g++ -g build/main.o -o build/exe
/mnt/data/temp/test $ gdb build/exe
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) info sources
Source files for which symbols have been read in:

<<C++-namespaces>>

Source files for which symbols will be read in on demand:

/var/tmp/portage/glibc-2.3.6-r4/work/build-default-i686-pc-linux-gnu-linuxthreads/csu/crtn.S,
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include/g++-v3/iostream, /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include/g++-v3/cmath,
/mnt/data/temp/test/src/main.cpp, /var/tmp/portage/glibc-2.3.6-r4/work/build-default-i686-pc-linux-gnu-linuxthreads/csu/crti.S
(gdb) list /mnt/data/temp/test/src/main.cpp:5
1 #include <iostream>
2
3 int main
4 {
5 std::cout << "HW!";
6 }
(gdb) break /mnt/data/temp/test/src/main.cpp:5
No line 5 in file "src/main.cpp".
(gdb) break main.cpp:5
Breakpoint 1 at 0x8048674: file main.cpp, line 5.

или я что-то делаю не так? вы могли бы у себя это проверить?
сменой рабочих директорий и путей у меня не получилось выкрутиться...
собственно, в этом случае не ясно как поступать, если в проекте много файлов с одинаковым именем

otets-mihail


(gdb) list /home//test.cpp:5
1 #include <iostream>
2
3 int main
4 {
5 std::cerr << "hw" << std::endl;
6 }
(gdb) break /home//test.cpp:5
Breakpoint 1 at 0x4008fc: file test.cpp, line 5.


GNU gdb 6.3-debian

a10063

нет, тут фишка в том, что в мы находимся в директории test, сорцы в ./src/, а бинарные в ./build/
с единым каталогом все работает, конечно...

/mnt/data/temp/test $ g++ -g -c src/main.cpp -o build/main.o
/mnt/data/temp/test $ g++ -g build/main.o -o build/exe
/mnt/data/temp/test $ gdb build/exe

otets-mihail

тоже работает

a10063

спасибо!
попробую продаунгрейдиться...

otets-mihail

а пробовал

list src/main.cpp:5
break /mnt/data/temp/test/src/main.cpp:1

?

a10063

 (gdb) list src/main.cpp:5
1 #include <iostream>
2
3 int main
4 {
5 std::cout << "HW!";
6 }
(gdb) break /mnt/data/temp/test/src/main.cpp:1
No line 1 in file "src/main.cpp".

все, я разобрался, в чем было дело - gentoo-шный билд портит gdb своими патчами
решение в том, чтобы использовать USE='vanilla'
теперь все работает

a10063

спасибо за помощь!
Оставить комментарий
Имя или ник:
Комментарий: