Skip to content

Draft: WIP: d/s390fw.mak: retain boot rom debuginfo

DISCLAIMER - this isn't ready yet, the paths like debian/qemu-system-data/usr/lib/debug/.build-id/7a/342fc649a9de0e27e3d53bb8ff5c47277bb268.debug aren't picked up into the final packages yet. But you can see how it would be prestripped+stripped. And after our IRC discussion I thought I'll show you that for evaluation before messing with the path fixes too much.


Currently we have stripped roms which can be non-useful in some debugging cases: s390-ccw.img: ELF 64-bit MSB pie executable, IBM S/390, version 1 (SYSV), dynamically linked, interpreter /lib/ld64.so.1, BuildID[sha1]=13d565dd0aaed9c6b14f1c406a7d069c19013bce, stripped s390-netboot.img: ELF 64-bit MSB pie executable, IBM S/390, version 1 (SYSV), dynamically linked, interpreter /lib/ld64.so.1, BuildID[sha1]=7f9b1ec0a9343bc907335ba7978881354a843a30, stripped

They appear as linked objects with a build-id (strange right).

I've learned that for bootloader debugging you'd ant to load that debug data. If you had debuginfo example steps are:

  1. use qemu with gdbserver https://wiki.qemu.org/Features/gdbstub
  2. attach to gdbserver gdb /usr/bin/qemu-system-s390x -ex "target remote localhost:1234"
  3. add-symbol-file "path-to-bios" -o 0x7fe00000

    because this is the guest address the bios is loaded to

Note: in the s390x case as a bonus some of it is EBSDIC encoded. So you might also want to use set target-charset ...

Developers are used to debuginfo being stored by buildid as it is done in dh_strip. Also the FHS kind of implies this path, therefore this fillows those usual paths.

In dh_strip the path is split and due to that Build ID: e65a23729d5a540c689b725703e095c961ff72c1 Becomes /usr/lib/debug/.build-id/e6/5a23729d5a540c689b725703e095c961ff72c1.debug

The calls it uses are: objcopy --only-keep-debug --compress-debug-sections infile outfile strip --remove-section=.comment --remove-section=.note" --strip-unneeded infile

This implements the same in debian/s390fw.mak for our s390x FW builds. In regard to size we talk about 14k+18k, so IMHO an extra qemu-system-data-dbgsym isn't needed, but could be created if preferred.

A test build with that is in the Ubuntu PPA here

Merge request reports

Loading