summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/debug-options.c
Commit message (Collapse)AuthorAgeFilesLines
* [Remarks][Driver] Ask for line tables when remarks are enabledFrancis Visoiu Mistrih2019-12-111-0/+6
| | | | | | | | | | | | | | | | Serialized remarks contain debug locations for each remark, by storing a file path, a line, and a column. Also, remarks support being embedded in a .dSYM bundle using a separate section in object files, that is found by `dsymutil` through the debug map. In order for tools to map addresses to source and display remarks in the source, we need line tables, and in order for `dsymutil` to find the object files containing the remark section, we need to keep the debug map around. Differential Revision: https://reviews.llvm.org/D71325
* Don't emit .gnu_pubnames when tuning for LLDB.Adrian Prantl2019-09-101-1/+1
| | | | | | | | | | | | | | | | LLDB reads the various .apple* accelerator tables (and in the near future: the DWARF 5 accelerator tables) which should make .gnu_pubnames redundant. This changes the Clang driver to no longer pass -ggnu-pubnames when tuning for LLDB. Thanks to David Blaikie for pointing this out! http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190422/thread.html#646062 rdar://problem/50142073 Differential Revision: https://reviews.llvm.org/D67373 llvm-svn: 371530
* clang: default to DWARF 4 for FreeBSD 12.0 and laterEd Maste2019-09-031-2/+6
| | | | | | | | | | | | Older FreeBSD versions included GDB 6.1 and had other tools that were unable to handle debug information newer than DWARF 2. Those tools have since been updated. (An old version of GDB is still kept for kernel crash handling, but the kernel is compiled with an explicit -gdwarf2.) Reviewed by: dim Differential Revision: https://reviews.llvm.org/D66760 llvm-svn: 370779
* DebugInfo: Default to standalone debug when tuning for LLDBDavid Blaikie2019-04-161-11/+10
| | | | | | | | | | | | | | | | | LLDB can't currently handle Clang's default (limit/no-standalone) DWARF, so platforms that default to LLDB (Darwin) or anyone else manually requesting LLDB tuning, should also get standalone DWARF. That doesn't mean a user can't explicitly enable (because they have other reasons to prefer standalone DWARF (such as that they're only building half their application with debug info enabled, and half without - or because they're tuning for GDB, but want to be able to use it under LLDB too (this is the default on FreeBSD))) or disable (testing LLDB fixes/improvements that handle no-standalone mode, building C code, perhaps, which wouldn't have the LLDB<>no-standalone conflict, etc) the feature regardless of the tuning. llvm-svn: 358464
* [test] Specify an explicit darwin version in a triple inAlex Lorenz2019-04-051-1/+1
| | | | | | | | | | `test/Driver/debug-options.c` to ensure that the driver selects the DWARF 2 version as intended by the test. Fixes the `test/Driver/debug-options.c` test regression on GreenDragon on macOS that started failing after r357713. llvm-svn: 357740
* Verify that Android targets generate DWARF 4 by default.Stephen Hines2019-04-041-1/+7
| | | | | | | | | | | | | | | | | | | | | Summary: In the future, Android releases will support DWARF 5, but we need to ensure that older targets only have DWARF 4 generated for them. This patch inserts that verification for all Android releases now. The patch also fixes 2 minor mistakes (a mistakenly moved RUN line, and the missing G_DWARF2 check label). Reviewers: aprantl Reviewed By: aprantl Subscribers: chh, pirama, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60238 llvm-svn: 357713
* Implement -frecord-command-line (-frecord-gcc-switches)Scott Linder2018-12-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Implement options in clang to enable recording the driver command-line in an ELF section. Implement a new special named metadata, llvm.commandline, to support frontends embedding their command-line options in IR/ASM/ELF. This differs from the GCC implementation in some key ways: * In GCC there is only one command-line possible per compilation-unit, in LLVM it mirrors llvm.ident and multiple are allowed. * In GCC individual options are separated by NULL bytes, in LLVM entire command-lines are separated by NULL bytes. The advantage of the GCC approach is to clearly delineate options in the face of embedded spaces. The advantage of the LLVM approach is to support merging multiple command-lines unambiguously, while handling embedded spaces with escaping. Differential Revision: https://reviews.llvm.org/D54487 Clang Differential Revision: https://reviews.llvm.org/D54489 llvm-svn: 349155
* [codeview] Make "clang -g" emit codeview by default when targetting MSVCReid Kleckner2018-11-141-2/+14
| | | | | | | | | | | | | | | | | | | | Summary: If you're using the Microsoft ABI, chances are that you want PDBs and codeview debug info. Currently, everyone has to remember to specific -gcodeview by default, when it would be nice if the standard -g option did the right thing by default. Also, do some related cleanup of -cc1 options. When targetting the MS C++ ABI, we probably shouldn't pass -debugger-tuning=gdb. We were also passing -gcodeview twice, which is silly. Reviewers: smeenai, zturner Subscribers: aprantl, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D54499 llvm-svn: 346907
* DebugInfo: Add a driver flag for DWARF debug_ranges base address specifier use.David Blaikie2018-11-131-0/+7
| | | | | | | | | | | | | | | Summary: This saves a lot of relocations in optimized object files (at the cost of some cost/increase in linked executable bytes), but gold's 32 bit gdb-index support has a bug ( https://sourceware.org/bugzilla/show_bug.cgi?id=21894 ) so we can't switch to this unconditionally. (& even if it weren't for that bug, one might argue that some users would want to optimize in one direction or the other - prioritizing object size or linked executable size) Differential Revision: https://reviews.llvm.org/D54243 llvm-svn: 346789
* Re-commit "Enable DWARF accelerator tables by default when tuning for lldb ↵Pavel Labath2018-09-061-2/+5
| | | | | | | | | | | | | | | | | (-glldb => -gpubnames)"" This recommits r341472, which was reverted due to test failures on macos bots. The issue was that a macos target implies -glldb which, together with this patch added a -gpubnames switch where there previously wasn't one. The intentions of those checks was to check that -gpubnames is not emitted by default so I add an explicit -ggdb arg to those command lines to get same behavior on all platforms (the fact that -glldb *does* set -gpubnames is tested by a separate test). Differential Revision: https://reviews.llvm.org/D51576 llvm-svn: 341564
* Revert "Enable DWARF accelerator tables by default when tuning for lldb ↵Pavel Labath2018-09-051-3/+0
| | | | | | | | (-glldb => -gpubnames)" This reverts commit r341472 due to breakage in green dragon bots. llvm-svn: 341492
* Enable DWARF accelerator tables by default when tuning for lldb (-glldb => ↵Pavel Labath2018-09-051-0/+3
| | | | | | | | | | | | | | | | | | -gpubnames) Summary: DWARF v5 accelerator tables provide a considerable performance improvement for lldb and will make the default -glldb behavior same on all targets (right now we emit apple tables on apple targets, but these are not controlled by -gpubnames, only by -glldb). Reviewers: dblaikie Subscribers: probinson, clayborg, JDevlieghere, aprantl, cfe-commits Differential Revision: https://reviews.llvm.org/D51576 llvm-svn: 341472
* [DEBUGINFO] Add support for emission of the debug directives only.Alexey Bataev2018-08-311-0/+35
| | | | | | | | | | | | | | | | Summary: Added option -gline-directives-only to support emission of the debug directives only. It behaves very similar to -gline-tables-only, except that it sets llvm debug info emission kind to llvm::DICompileUnit::DebugDirectivesOnly. Reviewers: echristo Subscribers: aprantl, fedor.sergeev, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D51177 llvm-svn: 341212
* DebugInfo: Add the ability to disable DWARF name tables entirelyDavid Blaikie2018-08-201-5/+17
| | | | | | | | | | | | | | | | | | This changes the current default behavior (from emitting pubnames by default, to not emitting them by default) & moves to matching GCC's behavior* with one significant difference: -gno(-gnu)-pubnames disables pubnames even in the presence of -gsplit-dwarf (though -gsplit-dwarf still by default enables -ggnu-pubnames). This allows users to disable pubnames (& the new DWARF5 accelerated access tables) when they might not be worth the size overhead. * GCC's behavior is that -ggnu-pubnames and -gpubnames override each other, and that -gno-gnu-pubnames and -gno-pubnames act as synonyms and disable either kind of pubnames if they come last. (eg: -gpubnames -gno-gnu-pubnames causes no pubnames (neither gnu or standard) to be emitted) llvm-svn: 340206
* [DebugInfo] Error out when enabling -fdebug-types-section on non-ELF target.Jonas Devlieghere2018-07-231-2/+10
| | | | | | | | | | | Currently, support for debug_types is only present for ELF and trying to pass -fdebug-types-section for other targets results in a crash in the backend. Until this is fixed, we should emit a diagnostic in the front end when the option is passed for non-linux targets. Differential revision: https://reviews.llvm.org/D49594 llvm-svn: 337717
* DebugInfo: Add -gno-gnu-pubnames to allow disabling gnu-pubnames later in ↵David Blaikie2018-06-281-0/+3
| | | | | | the command line llvm-svn: 335938
* Remove -cc1 option "-backend-option".Eli Friedman2018-04-121-2/+2
| | | | | | | | | It means the same thing as -mllvm; there isn't any reason to have two options which do the same thing. Differential Revision: https://reviews.llvm.org/D45109 llvm-svn: 329965
* [DebugInfo] Support DWARF v5 source code embedding extensionScott Linder2018-02-261-0/+10
| | | | | | | | | | | | | In DWARF v5 the Line Number Program Header is extensible, allowing values with new content types. This vendor extension to DWARF v5 allows source text to be embedded directly in the line tables of the debug line section. Add new flag (-g[no-]embed-source) to Driver and CC1 which indicates that source should be passed through to LLVM during CodeGen. Differential Revision: https://reviews.llvm.org/D42766 llvm-svn: 326102
* [PS4] Tidy up some debug-tuning v. triple decision-making.Paul Robinson2017-09-291-0/+2
| | | | llvm-svn: 314558
* IR: Represent -ggnu-pubnames with a flag on the DICompileUnit.Peter Collingbourne2017-09-121-1/+1
| | | | | | | | This allows the flag to be persisted through to LTO. Differential Revision: https://reviews.llvm.org/D37655 llvm-svn: 313078
* Driver must return non-zero code on errors in command lineSerge Pavlov2017-05-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is recommit of r302775, reverted in r302777 due to a fail in clang-tidy. Original mesage is below. Now if clang driver is given wrong arguments, in some cases it continues execution and returns zero code. This change fixes this behavior. The fix revealed some errors in clang test set. File test/Driver/gfortran.f90 added in r118203 checks forwarding gfortran flags to GCC. Now driver reports error on this file, because the option -working-directory implemented in clang differs from the option with the same name implemented in gfortran, in clang the option requires argument, in gfortran does not. In the file test/Driver/arm-darwin-builtin.c clang is called with options -fbuiltin-strcat and -fbuiltin-strcpy. These option were removed in r191435 and now clang reports error on this test. File arm-default-build-attributes.s uses option -verify, which is not supported by driver, it is cc1 option. Similarly, the file split-debug.h uses options -fmodules-embed-all-files and -fmodule-format=obj, which are not supported by driver. Other revealed errors are mainly mistypes. Differential Revision: https://reviews.llvm.org/D33013 llvm-svn: 303756
* Reverted r302775Serge Pavlov2017-05-111-3/+1
| | | | llvm-svn: 302777
* Driver must return non-zero code on errors in command lineSerge Pavlov2017-05-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now if clang driver is given wrong arguments, in some cases it continues execution and returns zero code. This change fixes this behavior. The fix revealed some errors in clang test set. File test/Driver/gfortran.f90 added in r118203 checks forwarding gfortran flags to GCC. Now driver reports error on this file, because the option -working-directory implemented in clang differs from the option with the same name implemented in gfortran, in clang the option requires argument, in gfortran does not. In the file test/Driver/arm-darwin-builtin.c clang is called with options -fbuiltin-strcat and -fbuiltin-strcpy. These option were removed in r191435 and now clang reports error on this test. File arm-default-build-attributes.s uses option -verify, which is not supported by driver, it is cc1 option. Similarly, the file split-debug.h uses options -fmodules-embed-all-files and -fmodule-format=obj, which are not supported by driver. Other revealed errors are mainly mistypes. Differential Revision: https://reviews.llvm.org/D33013 llvm-svn: 302775
* Add the -grecord-gcc-switches option and pass the flags down on the compile ↵Eric Christopher2017-03-291-2/+23
| | | | | | | | unit. Patch by Zhizhou Yang llvm-svn: 299037
* [DebugInfo] Added support to Clang FE for generating debug info for ↵Amjad Aboud2017-02-091-0/+6
| | | | | | | | | | | preprocessor macros. Added "-fdebug-macro" flag (and "-fno-debug-macro" flag) to enable (and to disable) emitting macro debug info. Added CC1 "-debug-info-macro" flag that enables emitting macro debug info. Differential Revision: https://reviews.llvm.org/D16135 llvm-svn: 294637
* Improve the CHECK lines in debug-options.c by separating out the checkAdrian Prantl2016-10-171-19/+33
| | | | | | for debug info kind and dwarf version. llvm-svn: 284420
* Driver/Darwin: Set the DWARF version based on the deployment target.Adrian Prantl2016-10-171-18/+29
| | | | | | | | | | | System utilities such as atos only support DWARF 4 on OS X 10.11+ and iOS 9+. We thus want to enable DWARF 4 only if the deployment target has a recent enough operating system version and use DWARF 2 for older systems. <rdar://problem/28766743> llvm-svn: 284416
* [Driver] Let -gline-tables-only win when it comes after -gmodules.Adrian Prantl2016-10-101-0/+11
| | | | | | | | | | | | The -gmodules option is all about putting debug type info into clang modules and for line tables the type information is irrelevant, so combining these two options makes no sense. This commmit fixes the behavior to match the one documented on the clang man page: the last -g... option wins. <rdar://problem/27059770> llvm-svn: 283810
* Debug info: Bump the default DWARF version on Darwin to 4.Adrian Prantl2016-09-091-4/+8
| | | | | | | This is a spiritual re-commit of r201375 with only a brief delay for upgrading the green dragon builders. llvm-svn: 281094
* Turn off lldb debug tuning by default for FreeBSDDimitry Andric2016-01-071-1/+1
| | | | | | | | | | | | | | | Summary: This is the clang part of D15966. In rL256104, debugger tuning was added to the clang driver, and again the default for FreeBSD was set to lldb. The default needs to be gdb instead. Reviewers: emaste, probinson Subscribers: cfe-commits, emaste Differential Revision: http://reviews.llvm.org/D15967 llvm-svn: 257104
* Avoid assert failure on some invalid cc1 options.Douglas Katzman2016-01-061-0/+5
| | | | | | | | Addressing review comment in D13221. Differential Revision: http://reviews.llvm.org/D15882 llvm-svn: 256897
* Driver part of debugger tuning.Paul Robinson2015-12-191-5/+26
| | | | | | | | | | | | | | | | Adds driver options named -glldb and -gsce to mean -g plus tuning for lldb and SCE debuggers respectively; the existing -ggdb option does the same for gdb. Existing options -ggdb0, -ggdb1 etc. unpack into -ggdb -g<N>. (There will not be -glldb<N> or -gsce<N> options.) The tuning gets a target-specific default in the driver, and is passed into cc1 with the new -debugger-tuning option. As fallout, fixes where '-gsplit-dwarf -g0' would ignore the -g0 part on Linux. Differential Revision: http://reviews.llvm.org/D15651 llvm-svn: 256104
* Tweak a -g related test for the PS4Filipe Cabecinhas2015-10-141-1/+7
| | | | | | | | Make sure we're matching what we want: - Always have -generate-arange-section (independent of -g) - Emit a -dwarf-version=... when -g is there. llvm-svn: 250298
* Bring back r250262: PS4 toolchainFilipe Cabecinhas2015-10-141-1/+16
| | | | | | | | | | | | | | There was a minor problem with a test. Sorry for the noise yesterday. This patch adds missing pieces to clang, including the PS4 toolchain definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D13482 llvm-svn: 250293
* Revert-to-green r250262 (PS4 toolchain patch)Sean Silva2015-10-141-14/+0
| | | | | | | It is breaking llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast e.g. http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/1362 llvm-svn: 250273
* I took care of the build problem in the commit 250252.Ekaterina Romanova2015-10-141-0/+14
| | | | | | | | | | | | | | Resubmitting the patch. This patch adds missing pieces to clang, including the PS4 toolchain definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D13482 llvm-svn: 250262
* reverting my patch, cause build problemsEkaterina Romanova2015-10-141-14/+0
| | | | llvm-svn: 250257
* This patch adds missing pieces to clang, including the PS4 toolchainEkaterina Romanova2015-10-131-0/+14
| | | | | | | | | | | definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D13482 llvm-svn: 250252
* Unbreak 'debug-options' test when builder is DarwinDouglas Katzman2015-10-081-1/+1
| | | | llvm-svn: 249657
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-081-19/+15
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
* Alias "-ggdbN" to "-gN" options, fixing some incompatibilities.Douglas Katzman2015-09-301-2/+2
| | | | | | | * assembling from a .s file mistook -ggdb0 for -g * -ggdb1 is supposed to mean basically -g1, not -gN for N>1 llvm-svn: 248912
* Revert "This patch adds missing pieces to clang, including the PS4 toolchain ↵Greg Bedwell2015-09-251-14/+0
| | | | | | | | definition, added warnings, PS4 defaults, and Driver changes needed for our compiler." This reverts commit r248546 to get our bot green again while we discuss the best way forward. llvm-svn: 248578
* This patch adds missing pieces to clang, including the PS4 toolchainEkaterina Romanova2015-09-241-0/+14
| | | | | | | | | | | definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D11279 llvm-svn: 248546
* Add a -gmodules option to the driver and a -dwarf-ext-refs to cc1Adrian Prantl2015-08-271-0/+5
| | | | | | | | | | | | | to enable the use of external type references in the debug info (a.k.a. module debugging). The driver expands -gmodules to "-g -fmodule-format=obj -dwarf-ext-refs" and passes that to cc1. All this does at the moment is set a flag codegenopts. http://reviews.llvm.org/D11958 llvm-svn: 246192
* Actually "RUN:" the tests...Filipe Cabecinhas2015-07-161-12/+12
| | | | llvm-svn: 242383
* Treat -g1 as -gline-tables-onlyHal Finkel2014-10-211-0/+2
| | | | | | | | | | | | | -g1 on gcc (and also IBM's xlc) are documented to be very similar to -gline-tables-only. Our -gline-tables-only might still be more verbose than -g1 on other compilers, but currently we treat -g1 as -g, and so we're producing much more debug info at -g1 than everybody else. Treating -g1 as -gline-tables-only brings us much closer to what everyone else is doing. For more information, see the discussion on http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039649.html llvm-svn: 220311
* specify dwarf version for SolarisAlexander Eremin2014-10-161-0/+2
| | | | llvm-svn: 219901
* Enable -gcolumn-info by default.Diego Novillo2014-07-101-0/+8
| | | | | | | | | | | | | | | This patch flips the default value for -gcolumn-info to be on by default. I discussed the rationale and provided compile/size data in: http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/074290.html This also updates the documentation and some tests that relied on the lack of column information. Some tests had column information in the expected output, but it was wrong (the tsan tests). Others were using the driver to execute. llvm-svn: 212781
* Use dwarf-2 by default on OpenBSD and FreeBSD.Brad Smith2014-06-131-11/+19
| | | | | | | The Tools.cpp part of the patch partially based on a patch from FreeBSD's LLVM tree. llvm-svn: 210883
* Driver: Support -gmlt as an alias for -gline-tables-onlyDavid Blaikie2014-03-111-0/+2
| | | | llvm-svn: 203603
OpenPOWER on IntegriCloud