LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-03-2004, 10:35 PM   #1
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
gdb and multiple sources


Before yesterday, I always debug for one sources using gdb. It is easy. But I try to make program using gtkmm library and glade. Because of that, I got a lot of sources. My question is:

How can you debug in this case?

If I say gdb the_binary_that_I_want_to_debug: it will go to the main file which is just like this simple:

Code:
int main(int argc, char **argv)
{
                                                                                
   Gtk::Main m(&argc, &argv);
                                                                                
   window1 *window1 = new class window1();
   m.run(*window1); 
   delete window1;
   return 0;
}
What I want to watch is this function:

Code:
void window1::on_file_clicked()
{  
	const int mp3 = 1, ogg = 2, no = 0;
	Glib::ustring song = input->get_text(), outputsong( song, 0, song.length()-4 );
	Glib::ustring s1( song, song.length()-3, 3 );
	int j = 0, i = 0, type;

	//Check whether ogg files or mp3 files
	outputsong = outputsong + ".wav";
	if(s1=="mp3") {
		type = mp3;
	}
	else if(s1=="ogg") {
		type = ogg;
	}
	else {
		type = no;
	}
        char* in = new char[song.length()+1]; 
        char* out = new char[outputsong.length()+1];
	char* arg_list[10];

        switch(type) {
		case mp3: strcpy(arg_list[0],"mpg321");
			  strcpy(arg_list[1],in);
			  strcpy(arg_list[2],"-w");
			  strcpy(arg_list[3],out);
			  arg_list[4] = NULL;
			  spawn("mpg321", arg_list);
			  strcpy(arg_list[0],"oggenc");
			  strcpy(arg_list[1],outputsong.c_str());
			  arg_list[2] = NULL;
			  spawn("oggenc", arg_list);
			  strcpy(arg_list[0],"rm");
			  strcpy(arg_list[1],outputsong.c_str());
			  spawn("rm", arg_list);
			  break;
	        case ogg: strcpy(arg_list[0],"oggdec");
			  strcpy(arg_list[1],in);
                          arg_list[2] = NULL;
			  spawn("oggdec", arg_list);
			  strcpy(arg_list[0],"lame");
			  strcpy(arg_list[1],outputsong.c_str());
			  spawn("lame", arg_list);
			  strcpy(arg_list[0],"rm");
			  strcpy(arg_list[1],outputsong.c_str());
			  spawn("rm", arg_list);
			  break;
		default: 
			  break;
	}
}
That function is in window1.cc file. Ok, in main file, I put the breakpoint in this statement

Code:
 m.run(*window1);
After stop in that statement, I try to step but I got this error/warning:
Gtk::Main::run(Gtk::Window&) (window=@0x807d4d0) at main.cc:422
422 main.cc: No such file or directory.
in main.cc

Step again, got this error:
Gtk::Widget::show() (this=0x807d4d0) at widget.h:312
312 widget.h: No such file or directory.
in widget.h

And the error goes on.......

Help me, Guru and buddy!!!!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
normal gdb and spec gdb for kgdb Igor007 Programming 1 09-23-2005 05:15 PM
normal gdb and spec gdb for kgdb Igor007 Linux - Newbie 1 09-23-2005 02:41 PM
Sound from multiple sources Adrohak Linux - Software 5 05-01-2005 11:40 AM
Using same header file in multiple sources george_mercury Programming 2 02-25-2005 02:50 PM
NForce2 + 2.4.22 : Not able to play multiple sound sources muflon Linux - Hardware 0 09-21-2003 02:11 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration