GDB显示文件名:没有cpp文件

时间:2017-10-01 09:10:31

标签: c++ linux gdb wxwidgets

我已使用标记

配置wxwidget

└─ $ ▶ ./configure --enable-unicode --enable-debug --enable-debug_gdb --disable-shared

make -j8上使用g ++标志构建control.cpp

/home/ashish/work/binReach/wxWidgets-3.1.0/bk-deps g++ -c -o corelib_gtk_control.o -I./.pch/wxprec_corelib -D__WXGTK__ -DWXBUILDING -I/home/ashish/work/binReach/wxWidgets-3.1.0/src/tiff/libtiff -I./src/tiff/libtiff -I./src/jpeg -I./src/regex -DwxUSE_BASE=0 -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wno-deprecated-declarations -D_FILE_OFFSET_BITS=64 -I/home/ashish/work/binReach/wxWidgets-3.1.0/lib/wx/include/gtk3-unicode-static-3.1 -I./include -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/mirclient -I/usr/include/mircore -I/usr/include/mircookie -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -DWX_PRECOMP -pthread -ggdb -O0 -pthread -I/usr/include/gtk-3.0/unix-print -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/mirclient -I/usr/include/mircore -I/usr/include/mircookie -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include ./src/gtk/control.cpp

它还使用标志构建button.cpp /home/ashish/work/binReach/wxWidgets-3.1.0/bk-deps g++ -c -o corelib_gtk_button.o -I./.pch/wxprec_corelib -D__WXGTK__ -DWXBUILDING -I/home/ashish/work/binReach/wxWidgets-3.1.0/src/tiff/libtiff -I./src/tiff/libtiff -I./src/jpeg -I./src/regex -DwxUSE_BASE=0 -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wno-deprecated-declarations -D_FILE_OFFSET_BITS=64 -I/home/ashish/work/binReach/wxWidgets-3.1.0/lib/wx/include/gtk3-unicode-static-3.1 -I./include -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/mirclient -I/usr/include/mircore -I/usr/include/mircookie -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -DWX_PRECOMP -pthread -ggdb -O0 -pthread -I/usr/include/gtk-3.0/unix-print -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/mirclient -I/usr/include/mircore -I/usr/include/mircookie -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include ./src/gtk/button.cpp

然而,在gdb program

我看到一些文件名而不是其他文件名。

wxButtonNameStr
(gdb) i line wxButton::Create(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxValidator const&, wxString const&)
No line number information available for address 0x4666a0 <_ZN8wxButton6CreateEP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelRK11wxValidatorS4_>
(gdb) i line wxControl::wxControl
No line number information available for address 0x4674c0 <_ZN9wxControlC2Ev>
(gdb) i line wxButton::wxButton(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxValidator const&, wxString const&) 
Line 20 of "/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/button.h"
   starts at address 0x433274 <wxButton::wxButton(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxValidator const&, wxString const&)>
   and ends at 0x433294 <wxButton::wxButton(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxValidator const&, wxString const&)+32>.
(gdb) i line wxButton::wxButton
Line 20 of "/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/button.h"
   starts at address 0x433274 <wxButton::wxButton(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxValidator const&, wxString const&)>
   and ends at 0x433294 <wxButton::wxButton(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxValidator const&, wxString const&)+32>.
(gdb) i line wxButton::SetLabel(wxString const&)
No line number information available for address 0x466e50 <_ZN8wxButton8SetLabelERK8wxString>
(gdb) i line wxButton::Create(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxValidator const&, wxString const&)
No line number information available for address 0x4666a0 <_ZN8wxButton6CreateEP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelRK11wxValidatorS4_>

为什么wsButton::CreatewxButton::SetLabel文件名不存在?

另外,当我在b /ho之后按Tab键自动完成并且该列表中没有cpp文件时:

(gdb) b /ho
Display all 104 possibilities? (y or n)
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/any.h                      /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/meta/convertible.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/anybutton.h                /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/meta/if.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/anystr.h                   /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/meta/implicitconversion.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/app.h                      /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/module.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/bitmap.h                   /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/msgdlg.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/brush.h                    /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/nonownedwnd.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/buffer.h                   /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/object.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/button.h                   /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/panel.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/chartype.h                 /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/pen.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/checkbox.h                 /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/radiobox.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/choice.h                   /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/radiobut.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/colour.h                   /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/rtti.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/combobox.h                 /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/scrolbar.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/containr.h                 /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/scrolwin.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/control.h                  /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/sizer.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/dataobj.h                  /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/slider.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/datetime.h                 /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/statbmp.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/debug.h                    /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/statbox.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/defs.h                     /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/stattext.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/dialog.h                   /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/statusbr.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/dirdlg.h                   /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/strconv.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/dynarray.h                 /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/stream.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/event.h                    /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/string.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/filectrl.h                 /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/stringimpl.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/filedlg.h                  /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/strvararg.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/filefn.h                   /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/tbarbase.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/fontenc.h                  /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/textctrl.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/frame.h                    /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/thread.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gauge.h                    /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/timer.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gdicmn.h                   /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/toplevel.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gdiobj.h                   /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/tracker.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/generic/accel.h            /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/typeinfo.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/generic/grid.h             /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/unichar.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/generic/panelg.h           /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/utils.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/generic/textdlgg.h         /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/validate.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/anybutton.h            /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/variant.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/app.h                  /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/window.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/bitmap.h               /home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/windowid.h
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/button.h               hol
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/control.h              hol_cluster
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/dataform.h             hol_entry
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/filectrl.h             hol_entry_qcmp
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/frame.h                hol_help_state
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/mdi.h                  hol_usage
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/toplevel.h             home_xpm
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/gtk/window.h               host
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/hash.h                     host2netname
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/image.h                    host_addr
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/list.h                     host_aliases
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/listbox.h                  hostbuf
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/longlong.h                 hostent
/home/ashish/work/binReach/wxWidgets-3.1.0/include/wx/mdi.h                      hostf

如何在g++ -g版本中引入cpp文件,以便gdb可以看到它们?

1 个答案:

答案 0 :(得分:0)

更新到gdb 8.0.1修复此问题。 从http://www.linuxfromscratch.org/blfs/view/cvs/general/gdb.html下载

./ configure --prefix = / usr --with-system-readline --without-guile&amp;&amp; make -j9

如果您看不到libreadline.solocate lbibreadline.so并在/lib/x86_64*/路径中创建软链接。或ld -lreadline --verbose给出的任何路径。