Is line number in DbgStopPointInst in LLVM accurate?

Dear developers,
     When I try to map line numbers in source code back to LLVM basicblocks, I meet some problems: there is a source file with 1500 lines of code, but when I use BasicBlockPass to collect all DbgStopPoint instructions in this file, I can only get 500 lines of code.
     The source code and the collected results are both attached.
     Is there any way to map line numbers in source code back to an LLVM basicblock precisely? Can LLVM-2.6 do this?

Thanks,
Heming

sql_insert.cc (42.6 KB)

output_sql_insert.cc (111 KB)

Quoting hc2428@columbia.edu:

The C or CXX flags are "-O0 -g". I am not using any optimization options.

Not all lines of the source code are executable, take blank lines, line
with only braces, comments, function prototypes as an example.

How many lines of source code are left after you remove those? More than
500?

Best regards,
--Edwin

Quoting Török Edwin <edwintorok@gmail.com>:

Hi Torok,
     There are some code lines that do not have dbgstoppoint. For example, the 1345 to 1355 (the function below). 1347, 1348, and 1349 do not exist in the result file.

void select_insert::send_error(uint errcode,const char *err)
{
   ::send_error(&thd->net,errcode,err);
   table->file->extra(HA_EXTRA_NO_CACHE);
   table->file->activate_all_index(thd);
   ha_rollback_stmt(thd);
   if (info.copied || info.deleted)
   {
     query_cache_invalidate3(thd, table, 1);
   }
}