[PATCH] D66425: [llvm-readobj] Prepend argv[0] to error messages

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 01:35:03 PDT 2019


MaskRay marked 3 inline comments as done.
MaskRay added inline comments.


================
Comment at: test/tools/llvm-readobj/error-format.test:7
+# READELF: llvm-readelf: error: '{{.*}}':
+# READOBJ: llvm-readobj: error: '{{.*}}':
----------------
grimar wrote:
> grimar wrote:
> > It fails under windows for me. Because of `.exe` suffix:
> > 
> > ```
> > D:\Work2\llvm\llvm\test\tools\llvm-readobj\error-format.test:6:12: error: READELF: expected string not found in input
> > # READELF: llvm-readelf: error: '{{.*}}':
> >            ^
> > <stdin>:2:1: note: scanning from here
> > d:\work2\llvm\llvm_build\debug\bin\llvm-readelf.exe: error: 'D:\Work2\llvm\llvm\
> > test\tools\llvm-readobj/non-existent': no such file or directory
> > ^
> > ```
> The following helps:
> 
> ```
> # READELF: llvm-readelf{{(.exe)?}}: error: '{{.*}}':
> # READOBJ: llvm-readobj{{(.exe)?}}: error: '{{.*}}':
> ```
> 
> (no more other readelf tests are failing for me, btw).
> 
> I see that out other tests sometimes using something like: `llvm-ar{{(.exe|.EXE)?}}`,
> but I am not sure why handling the uppercase `.EXE` is useful/important.
Thanks for testing! I was indeed thinking what Windows would do...

So the error message is ineed OS dependent. On Linux:

```
% errno 2
ENOENT 2 No such file or directory
```

On Windows it is not capitalized: `no such file or directory`

I think `.EXE` is probably 8.3 filename remnant from DOS or Windows 95... I think it is not useful unless the basename also follows 8.3, i.e. `LLVM-R~1.EXE` `LLVM-R~2.EXE`


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66425/new/

https://reviews.llvm.org/D66425





More information about the llvm-commits mailing list