Skip to content

Commit 9b95611

Browse files
committed
cmd/compile: add DWARF register mappings for ARM64.
Add DWARF register mappings for ARM64, so that that arch will become usable with "-dwarflocationlists". [NB: I've plugged in a set of numbers from the doc, but this will require additional manual testing.] Change-Id: Id9aa63857bc8b4f5c825f49274101cf372e9e856 Reviewed-on: https://go-review.googlesource.com/82515 Reviewed-by: Heschi Kreinick <[email protected]>
1 parent eca41af commit 9b95611

File tree

2 files changed

+110
-6
lines changed

2 files changed

+110
-6
lines changed

src/cmd/internal/obj/arm64/a.out.go

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,109 @@ const (
261261
FREGEXT = REG_F26 // first external register
262262
)
263263

264+
// http://infocenter.arm.com/help/topic/com.arm.doc.ecm0665627/abi_sve_aadwarf_100985_0000_00_en.pdf
265+
var ARM64DWARFRegisters = map[int16]int16{
266+
REG_R0: 0,
267+
REG_R1: 1,
268+
REG_R2: 2,
269+
REG_R3: 3,
270+
REG_R4: 4,
271+
REG_R5: 5,
272+
REG_R6: 6,
273+
REG_R7: 7,
274+
REG_R8: 8,
275+
REG_R9: 9,
276+
REG_R10: 10,
277+
REG_R11: 11,
278+
REG_R12: 12,
279+
REG_R13: 13,
280+
REG_R14: 14,
281+
REG_R15: 15,
282+
REG_R16: 16,
283+
REG_R17: 17,
284+
REG_R18: 18,
285+
REG_R19: 19,
286+
REG_R20: 20,
287+
REG_R21: 21,
288+
REG_R22: 22,
289+
REG_R23: 23,
290+
REG_R24: 24,
291+
REG_R25: 25,
292+
REG_R26: 26,
293+
REG_R27: 27,
294+
REG_R28: 28,
295+
REG_R29: 29,
296+
REG_R30: 30,
297+
298+
// floating point
299+
REG_F0: 64,
300+
REG_F1: 65,
301+
REG_F2: 66,
302+
REG_F3: 67,
303+
REG_F4: 68,
304+
REG_F5: 69,
305+
REG_F6: 70,
306+
REG_F7: 71,
307+
REG_F8: 72,
308+
REG_F9: 73,
309+
REG_F10: 74,
310+
REG_F11: 75,
311+
REG_F12: 76,
312+
REG_F13: 77,
313+
REG_F14: 78,
314+
REG_F15: 79,
315+
REG_F16: 80,
316+
REG_F17: 81,
317+
REG_F18: 82,
318+
REG_F19: 83,
319+
REG_F20: 84,
320+
REG_F21: 85,
321+
REG_F22: 86,
322+
REG_F23: 87,
323+
REG_F24: 88,
324+
REG_F25: 89,
325+
REG_F26: 90,
326+
REG_F27: 91,
327+
REG_F28: 92,
328+
REG_F29: 93,
329+
REG_F30: 94,
330+
REG_F31: 95,
331+
332+
// SIMD
333+
REG_V0: 64,
334+
REG_V1: 65,
335+
REG_V2: 66,
336+
REG_V3: 67,
337+
REG_V4: 68,
338+
REG_V5: 69,
339+
REG_V6: 70,
340+
REG_V7: 71,
341+
REG_V8: 72,
342+
REG_V9: 73,
343+
REG_V10: 74,
344+
REG_V11: 75,
345+
REG_V12: 76,
346+
REG_V13: 77,
347+
REG_V14: 78,
348+
REG_V15: 79,
349+
REG_V16: 80,
350+
REG_V17: 81,
351+
REG_V18: 82,
352+
REG_V19: 83,
353+
REG_V20: 84,
354+
REG_V21: 85,
355+
REG_V22: 86,
356+
REG_V23: 87,
357+
REG_V24: 88,
358+
REG_V25: 89,
359+
REG_V26: 90,
360+
REG_V27: 91,
361+
REG_V28: 92,
362+
REG_V29: 93,
363+
REG_V30: 94,
364+
REG_V31: 95,
365+
}
366+
264367
const (
265368
BIG = 2048 - 8
266369
)

src/cmd/internal/obj/arm64/obj7.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -838,10 +838,11 @@ var unaryDst = map[obj.As]bool{
838838
}
839839

840840
var Linkarm64 = obj.LinkArch{
841-
Arch: sys.ArchARM64,
842-
Init: buildop,
843-
Preprocess: preprocess,
844-
Assemble: span7,
845-
Progedit: progedit,
846-
UnaryDst: unaryDst,
841+
Arch: sys.ArchARM64,
842+
Init: buildop,
843+
Preprocess: preprocess,
844+
Assemble: span7,
845+
Progedit: progedit,
846+
UnaryDst: unaryDst,
847+
DWARFRegisters: ARM64DWARFRegisters,
847848
}

0 commit comments

Comments
 (0)