C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 01-18-2008, 04:54 PM   #1
Registered User
 
Join Date: Apr 2007
Posts: 282
Source code in on machine A, binary is on machine B, is there a way for GDB to refer

A gdb problem.

Source code in on machine A, its binary is on machine B. Binary was complied using -g option.
When I debug it using gdb, it only shows the line number, not the code content at the line. Is there a way for GDB to refer source code at machine B during debug?

Thank you!
meili100 is offline   Reply With Quote
Old 01-18-2008, 05:03 PM   #2
Registered User
 
Codeplug's Avatar
 
Join Date: Mar 2003
Posts: 3,898
http://sourceware.org/gdb/current/on...b_8.html#SEC56

gg
Codeplug is offline   Reply With Quote
Old 01-18-2008, 05:40 PM   #3
Registered User
 
Join Date: Apr 2007
Posts: 282
Quote:
Originally Posted by Codeplug View Post
I carefully read the webpage, it does not solve my problem:
Suppose code on A machine is at 129.1.1.1:/home/test/code/

I am debugging on B machine.
I launched gdb example_test
(gdb) set substitute-path /home/test/code/ 129.1.1.1:/home/test/code/

No symbol "substitute" in current context.

It seems "dir" or "set substitute-path" is just referring code on the same machine, but not between 2 machines?
meili100 is offline   Reply With Quote
Old 01-18-2008, 05:43 PM   #4
Kernel hacker
 
Join Date: Jul 2007
Location: Farncombe, Surrey, England
Posts: 15,686
Unless you can use NFS to mount a directory on machine A onto machine B, you have to copy the source from one to the other. It can be a real pain to do that, but it's unfortunately not possible to solve in any other way. [At least, I can't think of any other way].

--
Mats
__________________
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
matsp is offline   Reply With Quote
Old 01-18-2008, 07:05 PM   #5
Registered User
 
Join Date: Apr 2007
Posts: 282
Thank you!
One more question: why "set substitute-path" doesn't work in my gdb?

(gdb) set substitute-path
No symbol "substitute" in current context.
meili100 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search for patterns in source code MiamiCuse General Discussions 3 10-23-2005 11:28 PM
learning to work with SDKs & source code out there... psasidisrcum C++ Programming 3 05-14-2005 09:26 PM
Linux source code afreedboy Linux Programming 6 06-25-2004 10:12 AM
fopen(); GanglyLamb C Programming 8 11-03-2002 12:39 PM
C source code for int25 or code help Unregistered C Programming 0 09-26-2001 02:04 AM


All times are GMT -6. The time now is 08:12 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22