aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorMark Heffernan <meheff@google.com>2009-05-07 19:58:10 +0000
committerMark Heffernan <meheff@gcc.gnu.org>2009-05-07 19:58:10 +0000
commite71da632ea31fbff035556f044b11333840e2a97 (patch)
tree554ed3af3200f247b0a5c9153ef5d9f73d0d7b58 /gcc/opts.c
parentfe4c7bc6ac34f7a6c1066eda24675f2898e4576e (diff)
downloadgcc-e71da632ea31fbff035556f044b11333840e2a97.zip
gcc-e71da632ea31fbff035556f044b11333840e2a97.tar.gz
gcc-e71da632ea31fbff035556f044b11333840e2a97.tar.bz2
invoke.texi (Debugging Options): Document change of debugging dump location.
2009-05-07 Mark Heffernan <meheff@google.com> * doc/invoke.texi (Debugging Options): Document change of debugging dump location. * opts.c (decode_options): Make dump_base_name relative to aux_base_name directory. From-SVN: r147249
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 1170967..aab540c 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -961,6 +961,27 @@ decode_options (unsigned int argc, const char **argv)
handle_options (argc, argv, lang_mask);
+ /* Make DUMP_BASE_NAME relative to the AUX_BASE_NAME directory,
+ typically the directory to contain the object file. */
+ if (aux_base_name && ! IS_ABSOLUTE_PATH (dump_base_name))
+ {
+ const char *aux_base;
+
+ base_of_path (aux_base_name, &aux_base);
+ if (aux_base_name != aux_base)
+ {
+ int dir_len = aux_base - aux_base_name;
+ char *new_dump_base_name =
+ XNEWVEC (char, strlen(dump_base_name) + dir_len + 1);
+
+ /* Copy directory component from AUX_BASE_NAME. */
+ memcpy (new_dump_base_name, aux_base_name, dir_len);
+ /* Append existing DUMP_BASE_NAME. */
+ strcpy (new_dump_base_name + dir_len, dump_base_name);
+ dump_base_name = new_dump_base_name;
+ }
+ }
+
/* Handle related options for unit-at-a-time, toplevel-reorder, and
section-anchors. */
if (!flag_unit_at_a_time)