+2009-07-21 Roland McGrath <roland@redhat.com>
+
+ * dwarf_getsrc_file.c: Ignore a CU that just has no DW_AT_stmt_list.
+ Fix loop iteration after skipping a bogus or useless CU.
+
+ * dwarf_entry_breakpoints.c: Handle 0 dwarf_errno () as harmless
+ absence, not DWARF_E_NO_DEBUG_LINE.
+
2009-07-20 Roland McGrath <roland@redhat.com>
* dwarf_getlocation.c (__libdw_intern_expression):
/* Find entry breakpoint locations for a function.
- Copyright (C) 2005, 2008 Red Hat, Inc.
+ Copyright (C) 2005-2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
if (INTUSE(dwarf_getsrclines) (&cudie, &lines, &nlines) < 0)
{
int error = INTUSE (dwarf_errno) ();
- if (error == DWARF_E_NO_DEBUG_LINE)
+ if (error == 0) /* CU has no DW_AT_stmt_list. */
return entrypc_bkpt ();
__libdw_seterrno (error);
return -1;
/* Find line information for given file/line/column triple.
- Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2005-2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2005.
size_t cur_match = 0;
Dwarf_Line **match = *nsrcs == 0 ? NULL : *srcsp;
- Dwarf_Off off = 0;
size_t cuhl;
Dwarf_Off noff;
-
- while (INTUSE(dwarf_nextcu) (dbg, off, &noff, &cuhl, NULL, NULL, NULL) == 0)
+ for (Dwarf_Off off = 0;
+ INTUSE(dwarf_nextcu) (dbg, off, &noff, &cuhl, NULL, NULL, NULL) == 0;
+ off = noff)
{
Dwarf_Die cudie_mem;
Dwarf_Die *cudie = INTUSE(dwarf_offdie) (dbg, off + cuhl, &cudie_mem);
Dwarf_Lines *lines;
size_t nlines;
if (INTUSE(dwarf_getsrclines) (cudie, &lines, &nlines) != 0)
- return -1;
+ {
+ /* Ignore a CU that just has no DW_AT_stmt_list at all. */
+ int error = INTUSE(dwarf_errno) ();
+ if (error == 0)
+ continue;
+ __libdw_seterrno (error);
+ return -1;
+ }
/* Search through all the line number records for a matching
file and line/column number. If any of the numbers is zero,
already, there is no need to go on to the next CU. */
if (cur_match == max_match)
break;
-
- off = noff;
}
if (cur_match > 0)