diff mbox

[v2,4/4] libcc1: 'set debug compile': Display absolute GCC driver filename

Message ID 20150423203849.23973.43273.stgit@host1.jankratochvil.net
State New
Headers show

Commit Message

Jan Kratochvil April 23, 2015, 8:38 p.m. UTC
Hi,

already approved, maybe it could be already checked in outside of the series:
	https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01298.html

With the patches so far after
        (gdb) set debug compile 1
one would get:
        searching for compiler matching regex ^(x86_64|i.86)(-[^-]*)?-linux(-gnu)?-gcc$
        found compiler x86_64-unknown-linux-gnu-gcc
But I believe it is more readable to see:
        searching for compiler matching regex ^(x86_64|i.86)(-[^-]*)?-linux(-gnu)?-gcc$
        found compiler /usr/bin/x86_64-unknown-linux-gnu-gcc

I do not think the change will have functionality impact, although the filename
gets used even for executing the command.


Jan


libcc1/ChangeLog
2015-04-21  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* findcomp.cc: Include system.h.
	(search_dir): Return absolute filename.
---
 libcc1/findcomp.cc |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jeff Law April 23, 2015, 9:57 p.m. UTC | #1
On 04/23/2015 02:38 PM, Jan Kratochvil wrote:
> Hi,
>
> already approved, maybe it could be already checked in outside of the series:
> 	https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01298.html
>
> With the patches so far after
>          (gdb) set debug compile 1
> one would get:
>          searching for compiler matching regex ^(x86_64|i.86)(-[^-]*)?-linux(-gnu)?-gcc$
>          found compiler x86_64-unknown-linux-gnu-gcc
> But I believe it is more readable to see:
>          searching for compiler matching regex ^(x86_64|i.86)(-[^-]*)?-linux(-gnu)?-gcc$
>          found compiler /usr/bin/x86_64-unknown-linux-gnu-gcc
>
> I do not think the change will have functionality impact, although the filename
> gets used even for executing the command.
>
>
> Jan
>
>
> libcc1/ChangeLog
> 2015-04-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
>
> 	* findcomp.cc: Include system.h.
> 	(search_dir): Return absolute filename.
Still OK :-)
jeff
diff mbox

Patch

diff --git a/libcc1/findcomp.cc b/libcc1/findcomp.cc
index f02b1df..5d49e29 100644
--- a/libcc1/findcomp.cc
+++ b/libcc1/findcomp.cc
@@ -25,6 +25,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "libiberty.h"
 #include "xregex.h"
 #include "findcomp.hh"
+#include "system.h"
 
 class scanner
 {
@@ -68,7 +69,7 @@  search_dir (const regex_t &regexp, const std::string &dir, std::string *result)
     {
       if (regexec (&regexp, filename, 0, NULL, 0) == 0)
 	{
-	  *result = filename;
+	  *result = dir + DIR_SEPARATOR + filename;
 	  return true;
 	}
     }