- int num = ++(TYPE_NFIELDS(*type));
-
- if(TYPE_NFIELDS(*type)-1)
- TYPE_FIELDS(*type) = (struct field *)
- (*current_objfile->xrealloc) ((char *)(TYPE_FIELDS(*type)),
- num*sizeof(struct field));
- else
- TYPE_FIELDS(*type) = (struct field *)
- (*current_objfile->xmalloc) (num*sizeof(struct field));
-
- TYPE_FIELD_BITPOS(*type,num-1) = num-1;
- TYPE_FIELD_BITSIZE(*type,num-1) = 0;
- TYPE_FIELD_TYPE(*type,num-1) = SYMBOL_TYPE(sym);
- TYPE_FIELD_NAME(*type,num-1) = SYMBOL_NAME(sym);
+ struct symtab_and_line sal;
+ CORE_ADDR func_addr, func_end;
+
+ if (!find_pc_partial_function (pc, NULL, &func_addr, &func_end))
+ goto nosyms; /* Might be in prologue */
+
+ sal = find_pc_line (func_addr, 0);
+
+ if (sal.line == 0)
+ goto nosyms;
+
+ if (sal.end > func_addr
+ && sal.end <= func_end) /* Is prologue in function? */
+ return pc < sal.end; /* Yes, is pc in prologue? */
+
+ /* The line after the prologue seems to be outside the function. In this
+ case, tell the caller to find the prologue the hard way. */
+
+ return 1;
+
+/* Come here when symtabs don't contain line # info. In this case, it is
+ likely that the user has stepped into a library function w/o symbols, or
+ is doing a stepi/nexti through code without symbols. */
+
+ nosyms:
+
+/* If func_start is zero (meaning unknown) then we don't know whether pc is
+ in the prologue or not. I.E. it might be. */
+
+ if (!func_start) return 1;
+
+/* We need to call the target-specific prologue skipping functions with the
+ function's start address because PC may be pointing at an instruction that
+ could be mistakenly considered part of the prologue. */
+
+ SKIP_PROLOGUE (func_start);
+
+ return pc < func_start;