- length += operandlength( (struct modebyte *) (instructp+length) );
- mode = operandmode( (struct modebyte *) ( instructp + length ) );
-# ifdef DEBUG
- if ( debug & CALLDEBUG ) {
- printf( "\tfirst operand is %s", operandname( firstmode ) );
- printf( "\tsecond operand is %s\n" , operandname( mode ) );
- }
-# endif DEBUG
- switch ( mode ) {
- case regdef:
- case bytedispdef:
- case worddispdef:
- case longdispdef:
- case bytereldef:
- case wordreldef:
- case longreldef:
- /*
- * indirect call: call through pointer
- * either *d(r) as a parameter or local
- * (r) as a return value
- * *f as a global pointer
- * [are there others that we miss?,
- * e.g. arrays of pointers to functions???]
- */
- addarc( parentp , &indirectchild , (long) 0 );
- length += operandlength(
- (struct modebyte *) ( instructp + length ) );
- continue;
- case byterel:
- case wordrel:
- case longrel:
- /*
- * regular pc relative addressing
- * check that this is the address of
- * a function.
- */
- destpc = reladdr( (struct modebyte *) (instructp+length) )
- - (unsigned long) textspace;
- if ( destpc >= s_lowpc && destpc <= s_highpc ) {
- childp = nllookup( destpc );
-# ifdef DEBUG
- if ( debug & CALLDEBUG ) {
- printf( "[findcall]\tdestpc 0x%x" , destpc );
- printf( " childp->name %s" , childp -> name );
- printf( " childp->value 0x%x\n" ,
- childp -> value );
- }
-# endif DEBUG
- if ( childp -> value == destpc ) {
- /*
- * a hit
- */
- addarc( parentp , childp , (long) 0 );
- length += operandlength( (struct modebyte *)
- ( instructp + length ) );
- continue;
- }
- goto botched;
+ length += vax_operandlength (instructp + length);
+ mode = vax_operandmode (instructp + length);
+ DBG (CALLDEBUG,
+ printf ("\tfirst operand is %s", vax_operandname (firstmode));
+ printf ("\tsecond operand is %s\n", vax_operandname (mode)));
+ switch (mode)
+ {
+ case regdef:
+ case bytedispdef:
+ case worddispdef:
+ case longdispdef:
+ case bytereldef:
+ case wordreldef:
+ case longreldef:
+ /*
+ * indirect call: call through pointer
+ * either *d(r) as a parameter or local
+ * (r) as a return value
+ * *f as a global pointer
+ * [are there others that we miss?,
+ * e.g. arrays of pointers to functions???]
+ */
+ arc_add (parent, &indirectchild, (unsigned long) 0);
+ length += vax_operandlength (instructp + length);
+ continue;
+ case byterel:
+ case wordrel:
+ case longrel:
+ /*
+ * regular pc relative addressing
+ * check that this is the address of
+ * a function.
+ */
+ destpc = pc + vax_offset (instructp + length);
+ if (hist_check_address (destpc))
+ {
+ child = sym_lookup (&symtab, destpc);
+ if (child)
+ {
+ DBG (CALLDEBUG,
+ printf ("[findcall]\tdestpc 0x%lx",
+ (unsigned long) destpc);
+ printf (" child->name %s", child->name);
+ printf (" child->addr 0x%lx\n",
+ (unsigned long) child->addr);
+ );
+ if (child->addr == destpc)
+ {
+ /*
+ * a hit
+ */
+ arc_add (parent, child, (unsigned long) 0);
+ length += vax_operandlength (instructp + length);
+ continue;
+ }