This is an archive of the discontinued LLVM Phabricator instance.

[libcxx][pretty printers] Check GDB Python scripting support
ClosedPublic

Authored by DavidSpickett on Sep 23 2021, 7:34 AM.

Details

Summary

I found this after upgrading from Ubuntu bionic (gdb 8.1.1) to
Focal (gdb 9.2). (where this test fails, but that's for a
different patch)

9.2 allows you to set breakpoint commands from
Python, which was added in 8.3.
(bintutils a913fffbdee21fdd50e8de0596358be425775678
"Allow breakpoint commands to be set from Python")

The reason this test never failed before was because it did so
silently. "source <python file>" doesn't fail even if that script
raises an Exception.

To fix this extend the gdb lit feature to check that:

  • gdb exists
  • has Python support
  • allows you to set breakpoint commands

Diff Detail

Event Timeline

DavidSpickett created this revision.Sep 23 2021, 7:34 AM
DavidSpickett requested review of this revision.Sep 23 2021, 7:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2021, 7:34 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

Explain why I use the gdb quit command.

Remove stray newline.

So IIUC, the test was being run before 8.3, but it would fail silently? That's pretty bad.

libcxx/utils/libcxx/test/features.py
13

Please just import subprocess and then qualify names below.

ldionne accepted this revision.Sep 23 2021, 7:53 AM

LGTM with my fixes and green CI.

This revision is now accepted and ready to land.Sep 23 2021, 7:53 AM

So IIUC, the test was being run before 8.3, but it would fail silently? That's pretty bad.

The good news is that on Focal at least, only two tests in the u32string section fail. I'm going to look into those.

Just import subprocess.