1 /* Copyright (C) 2021-2024 Free Software Foundation, Inc.
4 This file is part of GNU Binutils.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
27 template <typename Key_t
, typename Value_t
> class Map
;
29 #define SOURCE_FLAG_UNKNOWN 0x01
31 class SourceFile
: public HistableFile
43 SourceFile (const char *file_name
);
44 virtual ~SourceFile ();
45 virtual void set_name (char *);
46 virtual char *get_name (NameFormat
= NA
);
49 Vector
<Function
*> *get_functions ();
50 DbeLine
*find_dbeline (Function
*func
, int lineno
);
51 char *getLine (int lineno
);
56 return srcLines
? srcLines
->size () : 0;
96 find_dbeline (int lineno
)
98 return find_dbeline (NULL
, lineno
);
104 static int curId
; // object id
106 ino64_t srcInode
; // Inode number of source file
107 time_t srcMTime
; // Creating time for source
108 Vector
<char *> *srcLines
; // array of pointers to lines in source
109 bool isTmpFile
; // Temporary src file to be deleted
111 Vector
<DbeLine
*> *lines
;
112 Map
<int, DbeLine
*> *dbeLines
;
113 Map
<Function
*, Function
*> *functions
;