1 /* Fetch source line info for CU.
2 Copyright (C) 2005 Red Hat, Inc.
4 This program is Open Source software; you can redistribute it and/or
5 modify it under the terms of the Open Software License version 1.0 as
6 published by the Open Source Initiative.
8 You should have received a copy of the Open Software License along
9 with this program; if not, you may obtain a copy of the Open Software
10 License version 1.0 from http://www.opensource.org/licenses/osl.php or
11 by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
12 3001 King Ranch Road, Ukiah, CA 95482. */
15 #include "../libdw/libdwP.h"
19 __libdwfl_cu_getsrclines (struct dwfl_cu *cu)
21 if (cu->lines == NULL)
25 if (INTUSE(dwarf_getsrclines) (&cu->die, &lines, &nlines) != 0)
28 cu->lines = malloc (offsetof (struct Dwfl_Lines, idx[nlines]));
29 if (cu->lines == NULL)
32 for (unsigned int i = 0; i < nlines; ++i)
33 cu->lines->idx[i].idx = i;
36 return DWFL_E_NOERROR;