The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
calling current working dir from script chandra004 Shell Programming and Scripting 3 07-31-2006 05:11 PM
Listing only directories in the current working directory using the "ls" command igandu UNIX for Dummies Questions & Answers 2 05-12-2006 01:47 AM
Change to a new working directory... jagannatha UNIX for Dummies Questions & Answers 5 06-29-2005 07:38 PM
change my current IP address tamemi IP Networking 4 03-10-2004 01:58 AM
Finding current working dir path liteyear18 UNIX for Dummies Questions & Answers 6 09-10-2001 04:43 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 04-11-2007
Registered User
 

Join Date: Mar 2007
Posts: 4
Question How to change current working directory for dbx on UNIX?

How to change current working directory for dbx on UNIX?
means I'll run pgm from one directory , but getcwd() should return path which I want to be, which is not d current dir


Reply With Quote
Forum Sponsor
  #2  
Old 04-11-2007
Registered User
 

Join Date: Apr 2007
Posts: 5
dbx

U can try cd .. thats shud work
else try using USE
Reply With Quote
  #3  
Old 04-11-2007
Registered User
 

Join Date: Mar 2007
Posts: 4
Question working directory.

In VC++ we can set the path in project =>swttings=>working directory.


What if we want 2 do same in UNIX.
i.e.
our source files are at diff location.
We have to copy executable to required diff location and run it.
Reply With Quote
  #4  
Old 04-11-2007
Registered User
 

Join Date: Apr 2007
Posts: 5
make file

if u r trying to execute the file, u can use makefiles where u can define the paths of different files and corresponding executables to be formed.
Reply With Quote
  #5  
Old 04-25-2007
Registered User
 

Join Date: Mar 2007
Posts: 4
Thanks a lot Swarna
Reply With Quote
  #6  
Old 04-26-2007
Registered User
 

Join Date: Mar 2007
Location: Chennai
Posts: 222
Adding to Swarna's comment,

I guess your application is built in some location and your are trying to run the
same binary in dbx in a different directory.

As the actual binary is built in some other location,the references to your source
files will be that of the build location.

Assume i have a build machine,with source,include,make,bin directory,

/user/builds/src
/user/builds/inlcude
/user/builds/make
/user/builds/bin

The binary so built will have references the /user/builds/src & /user/builds/inlcude directories.


In case u want to debug the actual binary in some other location say by copying it to /home/test/bin

As the actual binary still has references to the /user/builds/src and /user/builds/include

You require the pathmapping,

In the dbx initialization file ie ~/.dbxrc

Add the below lines,

Code:
pathmap /user/builds/src /path/to/yourlocal/src
For more on pathmap,
help pathmap

Using "use" in dbx is deprecated.You may have to use pathmap instead.

Hope this helps,

Thanks
Nagarajan Ganesan.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:16 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0