Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to get a list of callers to a particular class?

Status
Not open for further replies.

hajimeml

Programmer
Apr 17, 2009
18
CN
Hello. In a complex Borland Builder C++ project with hundreds of classes, is there a way to find out the callers to a particular class? Thanks.
 
Actually I want to find out all the callers of a particular member function of a class. Sorry for the confusion.
 
You should be more explicit. Demonstrate your ask with an example. So many answer are possible.

But maybe next demo could help.

Start an new project.
On your Form place a Memo, RichEdit, ListBox and a PopupMenu.
Set the property PopupMenu of Memo, RichEdit and ListBox to PopupMenu1.
Open the menu designer of PopupMenu1.
Set the caption property of PopupItem1 to “Clear”
Double click the onClick-event of PopupItem1.

Place next code:
void __fastcall TForm1::Clear1Click(TObject *Sender)
{
TRichEdit *ri;
TMemo *me;
TListBox *li;

if ((ri = dynamic_cast<TRichEdit *> (PopupMenu1->PopupComponent)) != 0)
ri->Lines->Clear();
if ((me = dynamic_cast<TMemo *> (PopupMenu1->PopupComponent)) != 0)
me->Lines->Clear();
if ((li = dynamic_cast<TListBox *> (PopupMenu1->PopupComponent)) != 0)
li->Items->Clear();
}
 
Thanks for the sample but this is not exactly what I want. I am trying to understand and modify a very complex program written by others. There are many files, classes, member functions within each classes. I have found the member function of interest. Now, I want to know which other functions (i.e. callers) call it. Is there a way to do it? Perhaps other programs that can automatically figure out how the functions call each other?
 
Did you try the CPU view

View/Debug Window/Cpu Windows/Entire CPU

Where's the time that you got an address as error message :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top