This is an archive of the discontinued LLVM Phabricator instance.

[clang][AIX] Omitting Explicit Debugger Tuning Option
ClosedPublic

Authored by qiongsiwu1 on Oct 18 2022, 10:50 AM.

Details

Summary

On AIX, the default debugger is dbx so it is not necessary to explicitly set -debugger-tuning=dbx in the presence of -g.

Diff Detail

Event Timeline

qiongsiwu1 created this revision.Oct 18 2022, 10:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 18 2022, 10:50 AM
qiongsiwu1 requested review of this revision.Oct 18 2022, 10:50 AM

Adding one more test case.

qiongsiwu1 edited the summary of this revision. (Show Details)Oct 18 2022, 11:21 AM
qiongsiwu1 edited the summary of this revision. (Show Details)
shchenz added inline comments.Oct 18 2022, 5:55 PM
clang/lib/Driver/ToolChains/AIX.h
91 ↗(On Diff #468626)

This sounds not right. Omitting -debugger-tuning=dbx does not mean we will change the default tuning debugger on AIX, right? i.e. DBX is still the default debugger on AIX no matter in the clang fe or llvm be.

We should just be able to do some customization when we call RenderDebugEnablingArgs for AIX in https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Clang.cpp#L4367-L4368

Address the review comment.

shchenz accepted this revision.Oct 19 2022, 8:13 PM

LGTM except one minor in the testcase.

Thanks for adding this improvement.

clang/test/Driver/debug-options.c
121

nit: we can check that no -debugger-tuning= is emitted by check G_NOTUNING

This revision is now accepted and ready to land.Oct 19 2022, 8:13 PM
qiongsiwu1 removed a project: Restricted Project.

Adding two test cases to match G_NOTUNING.

Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 7:16 AM
qiongsiwu1 marked an inline comment as done.Oct 20 2022, 7:17 AM
qiongsiwu1 added inline comments.
clang/test/Driver/debug-options.c
121

Ah thanks for catching this! Fixed.

qiongsiwu1 marked an inline comment as done.Oct 20 2022, 7:17 AM
probinson added inline comments.
clang/lib/Driver/ToolChains/Clang.cpp
4374

Seems like you should be able to return DebuggerKind::Default from getDefaultDebuggerTuning then you wouldn't need this complication?

qiongsiwu1 added inline comments.Oct 20 2022, 9:40 AM
clang/lib/Driver/ToolChains/Clang.cpp
4374

Ah thanks for the suggestion!

We looked into an approach along this line in an earlier version (see https://reviews.llvm.org/D136187?id=468626), but it seemed that modifying the AIX default was not ideal. There are two drawbacks.

  1. It complicates setting gstrict-dwarf and setting gno-column-info. The earlier version had to revise those conditions.
  2. It may complicate future development that relies on the AIX tuning defaulting to DBX.

Therefore we ended up with this local change. That said, I am all ears for different ways to avoid the complication.