Finding register set being used in program


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Finding register set being used in program
# 1  
Old 09-22-2009
Question Finding register set being used in program

How can i find( or list) contents of all registers being used by my program?
Is there any system call or library available for this?Smilie

At runtime in my c/c++ program. At runtime using may be some assembly hack!!!!!!!!!!!

Last edited by amit gangarade; 10-05-2009 at 02:40 PM..
# 2  
Old 09-22-2009
Disassemble it and find all the registers referenced in the binary machine code.
# 3  
Old 09-28-2009
how about gdb ? (and 'info registers' of course)

- if you want the contents of the registers, you'll have to use gdb (the gnu debugger) , and after running your program (for a hitherto uncertain time) ,
use the 'info registers' command to examine the registers' contents ;

- exactly at which point in time the register snapshot will have to be taken,
only you (the author) can tell ;

good luck, and success !

alexandre botao
Alexandre V. R. Botao | Unix, C/C++, Shell, LDAP, SSL/TLS, SSH, Perl, Java, Python, Security, ...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Cash Register Change Program

I just need some suggestions on how to start this program I wanted to work on for practice. I want to make a cash register program that gives change and only works with $1's, $5's, $10's, and $20's (I might add cents in later for more practice). Change should always be made with the largest... (9 Replies)
Discussion started by: totoro125
9 Replies

2. Shell Programming and Scripting

Finding a script/program on $PATH

I am trying to put together a script to find a requested script or program on the user's search path. Am trying to replace the colons separating the parts of a path with a newline to let xargs pass the directories to a list command, but I haven't gotten that far. This is my progress: echo... (7 Replies)
Discussion started by: wbport
7 Replies

3. Shell Programming and Scripting

Set variable to program message

I have a TCSH script that calls a program. This program generates a file and outputs a message to the terminal window. Is there a way to store the message it outputs to a variable...so I can use it in my script? (3 Replies)
Discussion started by: thibodc
3 Replies

4. Shell Programming and Scripting

Finding compound words from a set of files from another set of files

Hi All, I am completely stuck here. I have a set of files (with names A.txt, B.txt until L.txt) which contain words like these: computer random access memory computer networking mouse terminal windows All the files from A.txt to L.txt have the same format i.e. complete words in... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

5. Shell Programming and Scripting

Finding indices in an array nearest to a set of values

I have an two arrays. One array BINDIST consists of fences. I have another array XOFFS. Eg BINDIST = 0 10 20 30 40 50 60 XOFFS = 2 3 4 23 25 28 55 58 I want to find to find the indices of values in XOFFS that are closest to each BINDIST. My idea is to do as follows I create array... (7 Replies)
Discussion started by: kristinu
7 Replies

6. Programming

Finding the path of the C program

Hi All, I have a c program called findPath.c in a path /home/harsh/c-Programs/. How can i find the path where the program is stored at runtime?? I have given the following #include<stdio.h> int main() { system("dirname $0"); return 0; } This is resulting in the output as . <single dot... (6 Replies)
Discussion started by: sreeharshasn
6 Replies

7. SCO

Help finding where certain environment variables are set

i have two machines that should be identical but on one system there are some oracle environment (ORACLE_SID, ORACLE_HOME, etc...) variables that are not being set for the users. I am trying to find where those environment variables are being set on the system which is working properly. All... (5 Replies)
Discussion started by: kuliksco
5 Replies

8. Shell Programming and Scripting

Finding the most frequently occurring set of words

Hi guys, I have a file with a list of phoneme for words, it looks like this: AILS EY1 L Z AIMLESSLY EY1 M L AH0 S L IY0 AIMONE EY1 M OW2 N AIMS EY1 M Z AINGE EY1 NG AINGE(2) EY1 N JH AINLEY EY1 N L IY0 AINSLIE EY1 N Z L IY0 AIR EH1 R AIRBAGS EH1 R B AE2 G Z and I need to... (5 Replies)
Discussion started by: Andrew9191
5 Replies

9. Fedora

set path using a shell program

Hello sir, I am using a fedora 9 system. I wanted to update the path to include the $HOME into the path. So what we do is : This will update the path. I want to do the same thing by writing it in a shell prgram. I wrote the above code in an "a.sh" file and executed it using "bash a.sh".BUt... (1 Reply)
Discussion started by: nsharath
1 Replies

10. Programming

finding stack location in C using program

Is there a way to find the address of stack memory writing a program? Please guide me (12 Replies)
Discussion started by: jacques83
12 Replies
Login or Register to Ask a Question