How to get the "Program Counter"

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2009
Posts: 2
Reputation: svkers is an unknown quantity at this point 
Solved Threads: 0
svkers svkers is offline Offline
Newbie Poster

How to get the "Program Counter"

 
0
  #1
34 Days Ago
Hey *.*,

is it possible to get the current "Program Counter" of another running program? If it is, how can it be done?

Thanks for any hint!
svkers
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1,433
Reputation: William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of William Hemsworth has much to be proud of 
Solved Threads: 118
Sponsor
William Hemsworth William Hemsworth is offline Offline
Nearly a Posting Virtuoso
 
0
  #2
34 Days Ago
The only way I can think of, is to use some inline assembly and get the value of the PC register, look up the use of asm with C.
I need pageviews! most fun profile ever :)
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 2
Reputation: svkers is an unknown quantity at this point 
Solved Threads: 0
svkers svkers is offline Offline
Newbie Poster
 
0
  #3
34 Days Ago
Thanks for the reply. Yes, I know how to use assembler within C code. But the question is if it is possible to get the program counter of a another program of which the source code should not be altered!


MyProg --->get the program counter --> UnkownProg

Thanks in advance,
svkers
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 366
Reputation: gerard4143 is on a distinguished road 
Solved Threads: 47
gerard4143's Avatar
gerard4143 gerard4143 is offline Offline
Posting Whiz
 
0
  #4
33 Days Ago
Originally Posted by svkers View Post
Thanks for the reply. Yes, I know how to use assembler within C code. But the question is if it is possible to get the program counter of a another program of which the source code should not be altered!


MyProg --->get the program counter --> UnkownProg

Thanks in advance,
svkers
So what your after is - get the program counter of another current program running on a different core from the current calling program? Multi-core right? Because how could you have more than one current on a single core...

You'll probably have to consult the AMD/Intel manuals for this one...
Reply With Quote Quick reply to this message  
Reply

Message:



Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC