-/* This function exists to work around a bug in certain compilers
- (particularly GCC 2.95), in which the first line number marker of a
- function does not show up until after the prologue, right before
- the second line number marker. This function shifts ADDRESS down
- to the beginning of the function if necessary, and is called on
- addresses passed to record_line. */
-
-static CORE_ADDR
-check_cu_functions (CORE_ADDR address, struct dwarf2_cu *cu)
-{
- struct function_range *fn;
-
- /* Find the function_range containing address. */
- if (!cu->first_fn)
- return address;
-
- if (!cu->cached_fn)
- cu->cached_fn = cu->first_fn;
-
- fn = cu->cached_fn;
- while (fn)
- if (fn->lowpc <= address && fn->highpc > address)
- goto found;
- else
- fn = fn->next;
-
- fn = cu->first_fn;
- while (fn && fn != cu->cached_fn)
- if (fn->lowpc <= address && fn->highpc > address)
- goto found;
- else
- fn = fn->next;
-
- return address;
-
- found:
- if (fn->seen_line)
- return address;
- if (address != fn->lowpc)
- complaint (&symfile_complaints,
- _("misplaced first line number at 0x%lx for '%s'"),
- (unsigned long) address, fn->name);
- fn->seen_line = 1;
- return fn->lowpc;
-}
-