[all-commits] [llvm/llvm-project] a5bd75: [MSP430] Enable some basic support for debug infor...

Anatoly Trosinenko via All-commits all-commits at lists.llvm.org
Mon Jun 22 03:17:06 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a5bd75aab861df8cea8d1c6b88e764ad4a2c09ea
      https://github.com/llvm/llvm-project/commit/a5bd75aab861df8cea8d1c6b88e764ad4a2c09ea
  Author: Anatoly Trosinenko <atrosinenko at accesssoftek.com>
  Date:   2020-06-22 (Mon, 22 Jun 2020)

  Changed paths:
    M llvm/lib/Object/RelocationResolver.cpp
    M llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.cpp
    M llvm/lib/Target/MSP430/MSP430RegisterInfo.td
    A llvm/test/DebugInfo/MSP430/dwarf-basics.ll

  Log Message:
  -----------
  [MSP430] Enable some basic support for debug information

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




More information about the All-commits mailing list