How to change current working directory for dbx on UNIX?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to change current working directory for dbx on UNIX?
# 1  
Old 04-11-2007
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


Smilie
# 2  
Old 04-11-2007
dbx

U can try cd .. thats shud work
else try using USE
# 3  
Old 04-11-2007
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.
# 4  
Old 04-11-2007
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.
# 5  
Old 04-26-2007
Thanks a lot Swarna Smilie
# 6  
Old 04-26-2007
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.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Dbx not working on 64 bit Solaris machine

I have a 64 bit program called drivertest that crashed with the error message Illegal Instruction (core dumped) I tried to open the core file using dbx command bit it gives the below error message. psrux902b1% dbx - core.drivertest.28276 Corefile specified executable:... (1 Reply)
Discussion started by: old_as_a_fossil
1 Replies

2. UNIX for Dummies Questions & Answers

Current working directory

Hi all, How do I print the name of my current working directory only to screen? Not pwd! For example, if I was in /home/work I am looking for 'work' only (4 Replies)
Discussion started by: jimjam
4 Replies

3. Shell Programming and Scripting

FTP mget * not working after change directory -cd

Hi everyone, I have an Linux FTP script to get files from different AS400 mailboxes and store in different local directories. I had to use mget * option becuase there is no fixed destination file name means filename can change. The following FTP script is working fine if we have single file... (5 Replies)
Discussion started by: oravikiran
5 Replies

4. UNIX for Dummies Questions & Answers

Displaying the current working directory in prompt

Hi, I want that the prompt that is being displayed (i.e $ sign) should display always the current directory I am working in instead of that $ sign example: as we use PS1=patric and the prompt changes from $ to patric OR if we write the command PS1=`pwd` it will display the current... (5 Replies)
Discussion started by: premjotsingh
5 Replies

5. Programming

using dbx: I can't make it watch a variable change?! Help, please!

(I have mentioned about this situation and arisen problems in another thread: Is there a limit for a code line length in C?, but those questions are OffTop for that subject; so I open a new topic, here.) The main problem is that I have some situation in my program where memory has been changed... (2 Replies)
Discussion started by: alex_5161
2 Replies

6. Shell Programming and Scripting

Current working directory in prompt

Can someone tell me how do i set my current working directory in my prompt? Note: I dont want to use env variable PWD and using `pwd` gives me only my home directoy. suggest a different way ? I use /bin/sh thanks!! (3 Replies)
Discussion started by: yesmani
3 Replies

7. Shell Programming and Scripting

Finding files in current directory when 100,000's files in current directory

Hi All I was wondering what is the most efficient way to find files in the current directory(that may contain 100,000's files), that meets a certain specified file type and of a certain age. I have experimented with the find command in unix but it also searches all sub directories. I have... (2 Replies)
Discussion started by: kewong007
2 Replies

8. UNIX for Dummies Questions & Answers

Listing only directories in the current working directory using the "ls" command

Hello All, I am trying to list only directories in my current directory using the command "ls -d". But the output only contains the default directory "." and doesn't list the rest of the directories in the working directory. Can anyone explain why this is happening (2 Replies)
Discussion started by: igandu
2 Replies

9. UNIX for Dummies Questions & Answers

Change to a new working directory...

I need to CD to a particular directory to check log files and interface files. Instead of typing the path manually, is there a way of getting a script to change my working directory to the one I need? Currently I have a script that CD's to the directories I need but a soon as the script exits,... (5 Replies)
Discussion started by: jagannatha
5 Replies
Login or Register to Ask a Question