Index: linespec.c =================================================================== RCS file: /cvs/src/src/gdb/linespec.c,v retrieving revision 1.21 diff -c -3 -p -r1.21 linespec.c *** linespec.c 11 May 2002 22:46:19 -0000 1.21 --- linespec.c 29 Aug 2002 18:03:02 -0000 *************** decode_line_1 (char **argptr, int funfir *** 1067,1073 **** --- 1067,1097 ---- if (val.symtab == 0) val.symtab = s; + /* If funfirstline is set, we need to look up the function + containing the line, and move past the prologue. */ + val.pc = 0; + if (funfirstline) + { + CORE_ADDR pc = 0; + + if (find_line_pc (val.symtab, val.line, &pc)) + { + struct symbol *func_sym; + struct symtab_and_line sal; + + func_sym = find_pc_function (pc); + if (func_sym) + { + sal = find_function_start_sal (func_sym, 1); + /* Don't move the line, just set the pc + to the right place. */ + if (val.line <= sal.line) + val.pc = sal.pc; + } + } + } + values.sals = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line)); values.sals[0] = val;