简体   繁体   中英

Compiling in Linux&Eclipse when I can compile from terminal

So I was finally able to download an old version of webkit and compile it (after fixing 100 errors) in the terminal using the classic:

./configure
make

Now since I have the source of the program, my goal is to debug it (setting breakpoints on the C++ code and stuff). Since I'm using Linux for the first time here I downloaded eclipse to have an intuitive GUI. However, when I import the project I can't seem to be able to compile it. Include errors are everywhere and I cannot solve them no matter how much I try.

How can I compile it in eclipse when I can do it in the terminal? Also, is there another approach to debug the program?

Thanks a lot!

Ok so I managed to compile and link the code so that it could be loaded into gdb with symbolic debugging info as follows :

  1. I downloaded and extracted http://webkitgtk.org/releases/webkitgtk-2.0.4.tar.xz
  2. I ran ./configure and manually did apt-get install (or in the case of ICU downloaded and compiled) all required dependencies.
  3. I then made the following modifications to the GNUmakefile adding -ggdb to each of the vairable global_cppflags global_cflags and global_cxxflags (In an effort to speed up the build I removed all warning flags from the cppflags, not sure it made a difference. You should probably reinstate these if you are to do development against this build)

GNUmakefile

global_cppflags := -ggdb -fno-exceptions -DBUILDING_CAIRO__ -DBUILDING_GTK__ \
         $(am__append_1) $(am__append_2)
#global_cppflags := -Wall -W -Wcast-align -Wchar-subscripts \
#       -Wreturn-type -Wformat -Wformat-security -Wno-format-y2k \
#       -Wundef -Wmissing-format-attribute -Wpointer-arith \
#       -Wwrite-strings -Wno-unused-parameter -Wno-parentheses \
#       -fno-exceptions -DBUILDING_CAIRO__ -DBUILDING_GTK__ \
#       $(am__append_1) $(am__append_2)
global_cflags := -ggdb
global_cxxflags := -ggdb -fno-rtti

Then to test that debugging symbols were include in the compiler and linker output I ran gdb as follows

~/dev/webkitgtk-2.0.4$ gdb ./Programs/MiniBrowser -d ./Tools/MiniBrowser/gtk/ 
GNU gdb (Ubuntu 7.8-1ubuntu4) 7.8.0.20141001-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./Programs/MiniBrowser...done.
(gdb) l
188                                                         "WebKitSettings writable properties for default WebKitWebView",
189                                                         "WebKitSettings properties",
190                                                         webkitSettings,
191                                                         NULL);
192     g_option_group_add_entries(webSettingsGroup, optionEntries);
193     g_free(optionEntries);
194 
195     /* Option context takes ownership of the group. */
196     g_option_context_add_group(context, webSettingsGroup);
197 
(gdb) l
198     return TRUE;
199 }
200 
201 int main(int argc, char *argv[])
202 {
203     gtk_init(&argc, &argv);
204 
205     GOptionContext *context = g_option_context_new(NULL);
206     g_option_context_add_main_entries(context, commandLineOptions, 0);
207     g_option_context_add_group(context, gtk_get_option_group(TRUE));
(gdb) 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM