blob: cd95b1161a892977acc6a5234b878fd9c48e408c [file] [log] [blame]
Daniel Dunbarba1da8a2009-06-23 23:39:15 +00001//===- lib/MC/MCContext.cpp - Machine Code Context ------------------------===//
Daniel Dunbarecc63f82009-06-23 22:01:43 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/MC/MCContext.h"
Chris Lattner7c5b0212009-10-19 22:49:00 +000011#include "llvm/ADT/SmallString.h"
12#include "llvm/ADT/Twine.h"
Chandler Carruthd04a8d42012-12-03 16:50:05 +000013#include "llvm/MC/MCAsmInfo.h"
14#include "llvm/MC/MCDwarf.h"
15#include "llvm/MC/MCLabel.h"
16#include "llvm/MC/MCObjectFileInfo.h"
17#include "llvm/MC/MCRegisterInfo.h"
18#include "llvm/MC/MCSectionCOFF.h"
19#include "llvm/MC/MCSectionELF.h"
20#include "llvm/MC/MCSectionMachO.h"
21#include "llvm/MC/MCSymbol.h"
Rafael Espindolac85dca62011-01-23 04:28:49 +000022#include "llvm/Support/ELF.h"
Jim Grosbach82f4ce52012-01-26 23:20:11 +000023#include "llvm/Support/ErrorHandling.h"
Jim Grosbach82f4ce52012-01-26 23:20:11 +000024#include "llvm/Support/Signals.h"
Chandler Carruthd04a8d42012-12-03 16:50:05 +000025#include "llvm/Support/SourceMgr.h"
Daniel Dunbarecc63f82009-06-23 22:01:43 +000026using namespace llvm;
27
Chris Lattnerf0559e42010-04-08 20:30:37 +000028typedef StringMap<const MCSectionMachO*> MachOUniqueMapTy;
Chris Lattner74aae472010-04-08 21:26:26 +000029typedef StringMap<const MCSectionELF*> ELFUniqueMapTy;
Chris Lattnereb40a0f2010-05-07 17:17:41 +000030typedef StringMap<const MCSectionCOFF*> COFFUniqueMapTy;
Chris Lattnerf0559e42010-04-08 20:30:37 +000031
32
Evan Cheng0e6a0522011-07-18 20:57:22 +000033MCContext::MCContext(const MCAsmInfo &mai, const MCRegisterInfo &mri,
Jim Grosbach3662e5c2012-01-26 23:20:05 +000034 const MCObjectFileInfo *mofi, const SourceMgr *mgr) :
35 SrcMgr(mgr), MAI(mai), MRI(mri), MOFI(mofi),
Eli Friedmanf4387d92011-04-18 05:02:31 +000036 Allocator(), Symbols(Allocator), UsedNames(Allocator),
37 NextUniqueID(0),
Daniel Dunbarc6cf43d2011-03-28 22:49:15 +000038 CurrentDwarfLoc(0,0,0,DWARF2_FLAG_IS_STMT,0,0),
39 AllowTemporaryLabels(true) {
Chris Lattnerf0559e42010-04-08 20:30:37 +000040 MachOUniquingMap = 0;
Chris Lattner74aae472010-04-08 21:26:26 +000041 ELFUniquingMap = 0;
Chris Lattnereb40a0f2010-05-07 17:17:41 +000042 COFFUniquingMap = 0;
Kevin Enderbyf187ac52010-06-28 21:45:58 +000043
44 SecureLogFile = getenv("AS_SECURE_LOG_FILE");
45 SecureLog = 0;
46 SecureLogUsed = false;
Daniel Dunbarecc63f82009-06-23 22:01:43 +000047}
48
49MCContext::~MCContext() {
Chris Lattnerf0559e42010-04-08 20:30:37 +000050 // NOTE: The symbols are all allocated out of a bump pointer allocator,
Chris Lattnerc9d31522009-08-13 00:21:53 +000051 // we don't need to free them here.
Pedro Artigas486a7ad2012-12-06 00:50:55 +000052
53 // If the stream for the .secure_log_unique directive was created free it.
54 delete (raw_ostream*)SecureLog;
55}
56
57//===----------------------------------------------------------------------===//
58// Module Lifetime Management
59//===----------------------------------------------------------------------===//
60
61void MCContext::doInitialization() {
62 NextUniqueID = 0;
63 AllowTemporaryLabels = true;
64 DwarfLocSeen = false;
65 GenDwarfForAssembly = false;
66 GenDwarfFileNumber = 0;
67}
68
69void MCContext::doFinalization() {
70 UsedNames.clear();
71 Symbols.clear();
72 Allocator.Reset();
73 Instances.clear();
74 MCDwarfFiles.clear();
75 MCDwarfDirs.clear();
76 MCGenDwarfLabelEntries.clear();
77 DwarfDebugFlags = StringRef();
78 MCLineSections.clear();
79 MCLineSectionOrder.clear();
80 CurrentDwarfLoc = MCDwarfLoc(0,0,0,DWARF2_FLAG_IS_STMT,0,0);
Michael J. Spencer326990f2010-11-26 04:16:08 +000081
Chris Lattnerf0559e42010-04-08 20:30:37 +000082 // If we have the MachO uniquing map, free it.
83 delete (MachOUniqueMapTy*)MachOUniquingMap;
Chris Lattner74aae472010-04-08 21:26:26 +000084 delete (ELFUniqueMapTy*)ELFUniquingMap;
Chris Lattnereb40a0f2010-05-07 17:17:41 +000085 delete (COFFUniqueMapTy*)COFFUniquingMap;
Pedro Artigas486a7ad2012-12-06 00:50:55 +000086 MachOUniquingMap = 0;
87 ELFUniquingMap = 0;
88 COFFUniquingMap = 0;
Daniel Dunbarecc63f82009-06-23 22:01:43 +000089}
90
Chris Lattnerf0559e42010-04-08 20:30:37 +000091//===----------------------------------------------------------------------===//
92// Symbol Manipulation
93//===----------------------------------------------------------------------===//
94
Chris Lattner9b97a732010-03-30 18:10:53 +000095MCSymbol *MCContext::GetOrCreateSymbol(StringRef Name) {
Chris Lattner00685bb2010-03-10 01:29:27 +000096 assert(!Name.empty() && "Normal symbols cannot be unnamed!");
Michael J. Spencer326990f2010-11-26 04:16:08 +000097
Chris Lattnerc28cc092010-03-15 06:15:35 +000098 // Do the lookup and get the entire StringMapEntry. We want access to the
99 // key if we are creating the entry.
100 StringMapEntry<MCSymbol*> &Entry = Symbols.GetOrCreateValue(Name);
Rafael Espindola9f447242010-12-01 20:46:11 +0000101 MCSymbol *Sym = Entry.getValue();
102
103 if (Sym)
104 return Sym;
105
106 Sym = CreateSymbol(Name);
107 Entry.setValue(Sym);
108 return Sym;
109}
110
111MCSymbol *MCContext::CreateSymbol(StringRef Name) {
Daniel Dunbarc6cf43d2011-03-28 22:49:15 +0000112 // Determine whether this is an assembler temporary or normal label, if used.
113 bool isTemporary = false;
114 if (AllowTemporaryLabels)
115 isTemporary = Name.startswith(MAI.getPrivateGlobalPrefix());
Rafael Espindola9f447242010-12-01 20:46:11 +0000116
117 StringMapEntry<bool> *NameEntry = &UsedNames.GetOrCreateValue(Name);
118 if (NameEntry->getValue()) {
119 assert(isTemporary && "Cannot rename non temporary symbols");
Benjamin Kramerc18214a2011-04-09 11:26:27 +0000120 SmallString<128> NewName = Name;
Rafael Espindola9f447242010-12-01 20:46:11 +0000121 do {
Benjamin Kramerc18214a2011-04-09 11:26:27 +0000122 NewName.resize(Name.size());
123 raw_svector_ostream(NewName) << NextUniqueID++;
124 NameEntry = &UsedNames.GetOrCreateValue(NewName);
Rafael Espindola9f447242010-12-01 20:46:11 +0000125 } while (NameEntry->getValue());
126 }
127 NameEntry->setValue(true);
Chris Lattnerc69485e2009-06-24 04:31:49 +0000128
Chris Lattnerc28cc092010-03-15 06:15:35 +0000129 // Ok, the entry doesn't already exist. Have the MCSymbol object itself refer
Rafael Espindola9f447242010-12-01 20:46:11 +0000130 // to the copy of the string that is embedded in the UsedNames entry.
131 MCSymbol *Result = new (*this) MCSymbol(NameEntry->getKey(), isTemporary);
132
133 return Result;
Chris Lattnerc69485e2009-06-24 04:31:49 +0000134}
135
Chris Lattner9b97a732010-03-30 18:10:53 +0000136MCSymbol *MCContext::GetOrCreateSymbol(const Twine &Name) {
Chris Lattner7c5b0212009-10-19 22:49:00 +0000137 SmallString<128> NameSV;
138 Name.toVector(NameSV);
Chris Lattner9b97a732010-03-30 18:10:53 +0000139 return GetOrCreateSymbol(NameSV.str());
Chris Lattner7c5b0212009-10-19 22:49:00 +0000140}
141
Chris Lattner1d72a762010-03-14 08:23:30 +0000142MCSymbol *MCContext::CreateTempSymbol() {
Rafael Espindola9f447242010-12-01 20:46:11 +0000143 SmallString<128> NameSV;
Benjamin Kramerc18214a2011-04-09 11:26:27 +0000144 raw_svector_ostream(NameSV)
145 << MAI.getPrivateGlobalPrefix() << "tmp" << NextUniqueID++;
Rafael Espindola9f447242010-12-01 20:46:11 +0000146 return CreateSymbol(NameSV);
Chris Lattner1d72a762010-03-14 08:23:30 +0000147}
148
Kevin Enderbyebe7fcd2010-05-17 23:08:19 +0000149unsigned MCContext::NextInstance(int64_t LocalLabelVal) {
Benjamin Kramer47f9a492010-05-18 12:15:34 +0000150 MCLabel *&Label = Instances[LocalLabelVal];
151 if (!Label)
152 Label = new (*this) MCLabel(0);
153 return Label->incInstance();
Kevin Enderbyebe7fcd2010-05-17 23:08:19 +0000154}
155
156unsigned MCContext::GetInstance(int64_t LocalLabelVal) {
Benjamin Kramer47f9a492010-05-18 12:15:34 +0000157 MCLabel *&Label = Instances[LocalLabelVal];
158 if (!Label)
159 Label = new (*this) MCLabel(0);
160 return Label->getInstance();
Kevin Enderbyebe7fcd2010-05-17 23:08:19 +0000161}
162
163MCSymbol *MCContext::CreateDirectionalLocalSymbol(int64_t LocalLabelVal) {
164 return GetOrCreateSymbol(Twine(MAI.getPrivateGlobalPrefix()) +
165 Twine(LocalLabelVal) +
166 "\2" +
Duncan Sands34727662010-07-12 08:16:59 +0000167 Twine(NextInstance(LocalLabelVal)));
Kevin Enderbyebe7fcd2010-05-17 23:08:19 +0000168}
169MCSymbol *MCContext::GetDirectionalLocalSymbol(int64_t LocalLabelVal,
170 int bORf) {
171 return GetOrCreateSymbol(Twine(MAI.getPrivateGlobalPrefix()) +
172 Twine(LocalLabelVal) +
173 "\2" +
Duncan Sands34727662010-07-12 08:16:59 +0000174 Twine(GetInstance(LocalLabelVal) + bORf));
Kevin Enderbyebe7fcd2010-05-17 23:08:19 +0000175}
176
Daniel Dunbar2928c832009-11-06 10:58:06 +0000177MCSymbol *MCContext::LookupSymbol(StringRef Name) const {
Daniel Dunbarecc63f82009-06-23 22:01:43 +0000178 return Symbols.lookup(Name);
179}
Chris Lattnerf0559e42010-04-08 20:30:37 +0000180
Roman Divackyf145c132012-09-18 17:10:37 +0000181MCSymbol *MCContext::LookupSymbol(const Twine &Name) const {
182 SmallString<128> NameSV;
183 Name.toVector(NameSV);
184 return LookupSymbol(NameSV.str());
185}
186
Chris Lattnerf0559e42010-04-08 20:30:37 +0000187//===----------------------------------------------------------------------===//
188// Section Management
189//===----------------------------------------------------------------------===//
190
191const MCSectionMachO *MCContext::
192getMachOSection(StringRef Segment, StringRef Section,
193 unsigned TypeAndAttributes,
194 unsigned Reserved2, SectionKind Kind) {
Michael J. Spencer326990f2010-11-26 04:16:08 +0000195
Chris Lattnerf0559e42010-04-08 20:30:37 +0000196 // We unique sections by their segment/section pair. The returned section
197 // may not have the same flags as the requested section, if so this should be
198 // diagnosed by the client as an error.
Michael J. Spencer326990f2010-11-26 04:16:08 +0000199
Chris Lattnerf0559e42010-04-08 20:30:37 +0000200 // Create the map if it doesn't already exist.
201 if (MachOUniquingMap == 0)
202 MachOUniquingMap = new MachOUniqueMapTy();
203 MachOUniqueMapTy &Map = *(MachOUniqueMapTy*)MachOUniquingMap;
Michael J. Spencer326990f2010-11-26 04:16:08 +0000204
Chris Lattnerf0559e42010-04-08 20:30:37 +0000205 // Form the name to look up.
206 SmallString<64> Name;
207 Name += Segment;
208 Name.push_back(',');
209 Name += Section;
Michael J. Spencer326990f2010-11-26 04:16:08 +0000210
Chris Lattnerf0559e42010-04-08 20:30:37 +0000211 // Do the lookup, if we have a hit, return it.
212 const MCSectionMachO *&Entry = Map[Name.str()];
213 if (Entry) return Entry;
Michael J. Spencer326990f2010-11-26 04:16:08 +0000214
Chris Lattnerf0559e42010-04-08 20:30:37 +0000215 // Otherwise, return a new section.
Chris Lattner74aae472010-04-08 21:26:26 +0000216 return Entry = new (*this) MCSectionMachO(Segment, Section, TypeAndAttributes,
217 Reserved2, Kind);
Chris Lattnerf0559e42010-04-08 20:30:37 +0000218}
Chris Lattner74aae472010-04-08 21:26:26 +0000219
Rafael Espindola4283f4b2010-11-10 19:05:07 +0000220const MCSectionELF *MCContext::
Chris Lattner74aae472010-04-08 21:26:26 +0000221getELFSection(StringRef Section, unsigned Type, unsigned Flags,
Rafael Espindola2ff9e832010-11-11 18:13:52 +0000222 SectionKind Kind) {
223 return getELFSection(Section, Type, Flags, Kind, 0, "");
224}
225
226const MCSectionELF *MCContext::
227getELFSection(StringRef Section, unsigned Type, unsigned Flags,
228 SectionKind Kind, unsigned EntrySize, StringRef Group) {
Chris Lattner74aae472010-04-08 21:26:26 +0000229 if (ELFUniquingMap == 0)
230 ELFUniquingMap = new ELFUniqueMapTy();
231 ELFUniqueMapTy &Map = *(ELFUniqueMapTy*)ELFUniquingMap;
Michael J. Spencer326990f2010-11-26 04:16:08 +0000232
Chris Lattner74aae472010-04-08 21:26:26 +0000233 // Do the lookup, if we have a hit, return it.
234 StringMapEntry<const MCSectionELF*> &Entry = Map.GetOrCreateValue(Section);
235 if (Entry.getValue()) return Entry.getValue();
Michael J. Spencer326990f2010-11-26 04:16:08 +0000236
Jan Wen Voung186e7a02010-09-30 05:59:22 +0000237 // Possibly refine the entry size first.
238 if (!EntrySize) {
239 EntrySize = MCSectionELF::DetermineEntrySize(Kind);
240 }
Rafael Espindola2ff9e832010-11-11 18:13:52 +0000241
242 MCSymbol *GroupSym = NULL;
243 if (!Group.empty())
244 GroupSym = GetOrCreateSymbol(Group);
245
Chris Lattner74aae472010-04-08 21:26:26 +0000246 MCSectionELF *Result = new (*this) MCSectionELF(Entry.getKey(), Type, Flags,
Rafael Espindola2ff9e832010-11-11 18:13:52 +0000247 Kind, EntrySize, GroupSym);
Chris Lattner74aae472010-04-08 21:26:26 +0000248 Entry.setValue(Result);
249 return Result;
250}
251
Rafael Espindola2ff9e832010-11-11 18:13:52 +0000252const MCSectionELF *MCContext::CreateELFGroupSection() {
253 MCSectionELF *Result =
Rafael Espindolac85dca62011-01-23 04:28:49 +0000254 new (*this) MCSectionELF(".group", ELF::SHT_GROUP, 0,
Rafael Espindola2ff9e832010-11-11 18:13:52 +0000255 SectionKind::getReadOnly(), 4, NULL);
256 return Result;
257}
258
Chris Lattner6e5ce282010-05-07 21:49:09 +0000259const MCSection *MCContext::getCOFFSection(StringRef Section,
260 unsigned Characteristics,
261 int Selection,
262 SectionKind Kind) {
Chris Lattnereb40a0f2010-05-07 17:17:41 +0000263 if (COFFUniquingMap == 0)
264 COFFUniquingMap = new COFFUniqueMapTy();
265 COFFUniqueMapTy &Map = *(COFFUniqueMapTy*)COFFUniquingMap;
Michael J. Spencer326990f2010-11-26 04:16:08 +0000266
Chris Lattnereb40a0f2010-05-07 17:17:41 +0000267 // Do the lookup, if we have a hit, return it.
268 StringMapEntry<const MCSectionCOFF*> &Entry = Map.GetOrCreateValue(Section);
269 if (Entry.getValue()) return Entry.getValue();
Michael J. Spencer326990f2010-11-26 04:16:08 +0000270
Chris Lattner6e5ce282010-05-07 21:49:09 +0000271 MCSectionCOFF *Result = new (*this) MCSectionCOFF(Entry.getKey(),
272 Characteristics,
273 Selection, Kind);
Michael J. Spencer326990f2010-11-26 04:16:08 +0000274
Chris Lattnereb40a0f2010-05-07 17:17:41 +0000275 Entry.setValue(Result);
276 return Result;
277}
Kevin Enderby7cbf73a2010-07-28 20:55:35 +0000278
279//===----------------------------------------------------------------------===//
280// Dwarf Management
281//===----------------------------------------------------------------------===//
282
283/// GetDwarfFile - takes a file name an number to place in the dwarf file and
284/// directory tables. If the file number has already been allocated it is an
285/// error and zero is returned and the client reports the error, else the
286/// allocated file number is returned. The file numbers may be in any order.
Nick Lewycky44d798d2011-10-17 23:05:28 +0000287unsigned MCContext::GetDwarfFile(StringRef Directory, StringRef FileName,
288 unsigned FileNumber) {
Kevin Enderby7cbf73a2010-07-28 20:55:35 +0000289 // TODO: a FileNumber of zero says to use the next available file number.
290 // Note: in GenericAsmParser::ParseDirectiveFile() FileNumber was checked
291 // to not be less than one. This needs to be change to be not less than zero.
292
293 // Make space for this FileNumber in the MCDwarfFiles vector if needed.
294 if (FileNumber >= MCDwarfFiles.size()) {
295 MCDwarfFiles.resize(FileNumber + 1);
296 } else {
297 MCDwarfFile *&ExistingFile = MCDwarfFiles[FileNumber];
298 if (ExistingFile)
299 // It is an error to use see the same number more than once.
300 return 0;
301 }
302
303 // Get the new MCDwarfFile slot for this FileNumber.
304 MCDwarfFile *&File = MCDwarfFiles[FileNumber];
305
Nick Lewycky44d798d2011-10-17 23:05:28 +0000306 if (Directory.empty()) {
307 // Separate the directory part from the basename of the FileName.
NAKAMURA Takumi4c215c02012-07-03 03:59:29 +0000308 StringRef tFileName = sys::path::filename(FileName);
309 if (!tFileName.empty()) {
310 Directory = sys::path::parent_path(FileName);
311 if (!Directory.empty())
NAKAMURA Takumia6f14532012-07-03 06:01:27 +0000312 FileName = tFileName;
Kevin Enderby064e48a2011-11-01 23:39:05 +0000313 }
Nick Lewycky44d798d2011-10-17 23:05:28 +0000314 }
Kevin Enderby7cbf73a2010-07-28 20:55:35 +0000315
316 // Find or make a entry in the MCDwarfDirs vector for this Directory.
Kevin Enderby7cbf73a2010-07-28 20:55:35 +0000317 // Capture directory name.
Nick Lewycky44d798d2011-10-17 23:05:28 +0000318 unsigned DirIndex;
319 if (Directory.empty()) {
320 // For FileNames with no directories a DirIndex of 0 is used.
321 DirIndex = 0;
Kevin Enderby7cbf73a2010-07-28 20:55:35 +0000322 } else {
Nick Lewycky18ad76b2011-10-12 20:20:48 +0000323 DirIndex = 0;
324 for (unsigned End = MCDwarfDirs.size(); DirIndex < End; DirIndex++) {
Benjamin Kramer3bce5ad2010-07-29 13:53:19 +0000325 if (Directory == MCDwarfDirs[DirIndex])
Kevin Enderby232ab942010-08-31 22:55:11 +0000326 break;
Kevin Enderby7cbf73a2010-07-28 20:55:35 +0000327 }
328 if (DirIndex >= MCDwarfDirs.size()) {
Benjamin Kramer3bce5ad2010-07-29 13:53:19 +0000329 char *Buf = static_cast<char *>(Allocate(Directory.size()));
330 memcpy(Buf, Directory.data(), Directory.size());
331 MCDwarfDirs.push_back(StringRef(Buf, Directory.size()));
Kevin Enderby7cbf73a2010-07-28 20:55:35 +0000332 }
Kevin Enderbyb07ce602010-08-09 22:52:14 +0000333 // The DirIndex is one based, as DirIndex of 0 is used for FileNames with
334 // no directories. MCDwarfDirs[] is unlike MCDwarfFiles[] in that the
Nick Lewycky44d798d2011-10-17 23:05:28 +0000335 // directory names are stored at MCDwarfDirs[DirIndex-1] where FileNames
336 // are stored at MCDwarfFiles[FileNumber].Name .
Kevin Enderbyb07ce602010-08-09 22:52:14 +0000337 DirIndex++;
Kevin Enderby7cbf73a2010-07-28 20:55:35 +0000338 }
Michael J. Spencer326990f2010-11-26 04:16:08 +0000339
Kevin Enderby7cbf73a2010-07-28 20:55:35 +0000340 // Now make the MCDwarfFile entry and place it in the slot in the MCDwarfFiles
341 // vector.
Nick Lewycky44d798d2011-10-17 23:05:28 +0000342 char *Buf = static_cast<char *>(Allocate(FileName.size()));
343 memcpy(Buf, FileName.data(), FileName.size());
344 File = new (*this) MCDwarfFile(StringRef(Buf, FileName.size()), DirIndex);
Kevin Enderby7cbf73a2010-07-28 20:55:35 +0000345
346 // return the allocated FileNumber.
347 return FileNumber;
348}
Kevin Enderbyc1840b32010-08-24 20:32:42 +0000349
Kevin Enderby3f55c242010-10-04 20:17:24 +0000350/// isValidDwarfFileNumber - takes a dwarf file number and returns true if it
Kevin Enderbyc1840b32010-08-24 20:32:42 +0000351/// currently is assigned and false otherwise.
Kevin Enderby3f55c242010-10-04 20:17:24 +0000352bool MCContext::isValidDwarfFileNumber(unsigned FileNumber) {
Kevin Enderbyc1840b32010-08-24 20:32:42 +0000353 if(FileNumber == 0 || FileNumber >= MCDwarfFiles.size())
354 return false;
355
Kevin Enderby3f55c242010-10-04 20:17:24 +0000356 return MCDwarfFiles[FileNumber] != 0;
Kevin Enderbyc1840b32010-08-24 20:32:42 +0000357}
Jim Grosbach82f4ce52012-01-26 23:20:11 +0000358
359void MCContext::FatalError(SMLoc Loc, const Twine &Msg) {
360 // If we have a source manager and a location, use it. Otherwise just
361 // use the generic report_fatal_error().
362 if (!SrcMgr || Loc == SMLoc())
363 report_fatal_error(Msg);
364
365 // Use the source manager to print the message.
366 SrcMgr->PrintMessage(Loc, SourceMgr::DK_Error, Msg);
367
368 // If we reached here, we are failing ungracefully. Run the interrupt handlers
369 // to make sure any special cleanups get done, in particular that we remove
370 // files registered with RemoveFileOnSignal.
371 sys::RunInterruptHandlers();
372 exit(1);
373}