problem when debug glib source code with gdb
- From: "????" <losemyheaven qq com>
- To: "gtk-list" <gtk-list gnome org>
- Subject: problem when debug glib source code with gdb
- Date: Tue, 24 Nov 2015 00:41:58 +0800
Hi: Dear friend, Recently I am curious about how glib works, so I want to debug its source code with gdb. But I got stuck...These are steps I followed, after the source code is downloaded:1) ./configure --enable-debug=yes2) make3) sudo make install4)I created test.c in which I called glib API g_hash_table_new function#include <glib.h>int main(int argc, char** argv) { GHashTable* hash = g_hash_table_new(g_str_hash, g_str_equal); g_hash_table_insert(hash, "Virginia", "Richmond");g_hash_table_insert(hash, "Ohio", "Columbus"); return 0;}5)gcc test.c `pkg-config --cflags --libs glib-2.0` -g -o test6) I used gdb to debug the output test programgdb test7)use gdb's directiory command to specify the source code locationdirectory ~/Downloads/glib-2.46.2But when I use gdb to debug test step by stepI found that when I use gdb's step command, gdb cannot go inside the source code files which include glib APIs, such as g_hash_table_new and g_hash_table_insertWhat should I do? Where am I wrong?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]