
This commit technically permits LLVM to emit the debug information for ELF files for MSP430 architecture. Aside from this, it only defines the register numbers as defined by part 10.1 of MSP430 EABI specification (assuming the 1-byte subregisters share the register numbers with corresponding full-size registers). This commit was basically tested by me with TI-provided GCC 8.3.1 toolchain by compiling an example program with `clang` (please note manual linking may be required due to upstream `clang` not yet handling the `-msim` option necessary to run binaries on the GDB-provided simulator) and then running it and single-stepping with `msp430-elf-gdb` like this: ``` $sysroot/bin/msp430-elf-gdb ./test -ex "target sim" -ex "load ./test" (gdb) ... traditional GDB commands follow ... ``` While this implementation is most probably far from completeness and is considered experimental, it can already help with debugging MSP430 programs as well as finding issues in LLVM debug info support for MSP430 itself. One of the use cases includes trying to find a point where UBSan check in a trap-on-error mode was triggered. The expected debug information format is described in the [MSP430 Embedded Application Binary Interface](http://www.ti.com/lit/an/slaa534/slaa534.pdf) specification, part 10. Differential Revision: https://reviews.llvm.org/D81488
30 lines
944 B
C++
30 lines
944 B
C++
//===-- MSP430MCAsmInfo.cpp - MSP430 asm properties -----------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file contains the declarations of the MSP430MCAsmInfo properties.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "MSP430MCAsmInfo.h"
|
|
using namespace llvm;
|
|
|
|
void MSP430MCAsmInfo::anchor() { }
|
|
|
|
MSP430MCAsmInfo::MSP430MCAsmInfo(const Triple &TT,
|
|
const MCTargetOptions &Options) {
|
|
CodePointerSize = CalleeSaveStackSlotSize = 2;
|
|
|
|
CommentString = ";";
|
|
SeparatorString = "{";
|
|
|
|
AlignmentIsInBytes = false;
|
|
UsesELFSectionDirectiveForBSS = true;
|
|
|
|
SupportsDebugInformation = true;
|
|
}
|