diff mbox series

[v4,15/53] semihosting: Remove GDB_O_BINARY

Message ID 20220607204557.658541-16-richard.henderson@linaro.org
State Superseded
Headers show
Series semihosting cleanup | expand

Commit Message

Richard Henderson June 7, 2022, 8:45 p.m. UTC
The value is zero, and gdb always opens files in binary mode.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 semihosting/arm-compat-semi.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Alex Bennée June 9, 2022, 3:49 p.m. UTC | #1
Richard Henderson <richard.henderson@linaro.org> writes:

> The value is zero, and gdb always opens files in binary mode.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

It might be worth mentioning these are the FILEIO_ flags in
include/gdb/fileio.h to make future referencing easier.

Anyway:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


> ---
>  semihosting/arm-compat-semi.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c
> index cebbad2355..92c1375b15 100644
> --- a/semihosting/arm-compat-semi.c
> +++ b/semihosting/arm-compat-semi.c
> @@ -92,21 +92,20 @@
>  #define GDB_O_APPEND  0x008
>  #define GDB_O_CREAT   0x200
>  #define GDB_O_TRUNC   0x400
> -#define GDB_O_BINARY  0
>  
>  static int gdb_open_modeflags[12] = {
>      GDB_O_RDONLY,
> -    GDB_O_RDONLY | GDB_O_BINARY,
> +    GDB_O_RDONLY,
> +    GDB_O_RDWR,
>      GDB_O_RDWR,
> -    GDB_O_RDWR | GDB_O_BINARY,
>      GDB_O_WRONLY | GDB_O_CREAT | GDB_O_TRUNC,
> -    GDB_O_WRONLY | GDB_O_CREAT | GDB_O_TRUNC | GDB_O_BINARY,
> +    GDB_O_WRONLY | GDB_O_CREAT | GDB_O_TRUNC,
> +    GDB_O_RDWR | GDB_O_CREAT | GDB_O_TRUNC,
>      GDB_O_RDWR | GDB_O_CREAT | GDB_O_TRUNC,
> -    GDB_O_RDWR | GDB_O_CREAT | GDB_O_TRUNC | GDB_O_BINARY,
>      GDB_O_WRONLY | GDB_O_CREAT | GDB_O_APPEND,
> -    GDB_O_WRONLY | GDB_O_CREAT | GDB_O_APPEND | GDB_O_BINARY,
> +    GDB_O_WRONLY | GDB_O_CREAT | GDB_O_APPEND,
> +    GDB_O_RDWR | GDB_O_CREAT | GDB_O_APPEND,
>      GDB_O_RDWR | GDB_O_CREAT | GDB_O_APPEND,
> -    GDB_O_RDWR | GDB_O_CREAT | GDB_O_APPEND | GDB_O_BINARY
>  };
>  
>  static int open_modeflags[12] = {
Richard Henderson June 9, 2022, 3:59 p.m. UTC | #2
On 6/9/22 08:49, Alex Bennée wrote:
> 
> Richard Henderson <richard.henderson@linaro.org> writes:
> 
>> The value is zero, and gdb always opens files in binary mode.
>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> 
> It might be worth mentioning these are the FILEIO_ flags in
> include/gdb/fileio.h to make future referencing easier.

Comment added in the next patch, when they get moved to include/exec/gdbstub.h, though it 
doesn't reference a gdb source file.


r~
diff mbox series

Patch

diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c
index cebbad2355..92c1375b15 100644
--- a/semihosting/arm-compat-semi.c
+++ b/semihosting/arm-compat-semi.c
@@ -92,21 +92,20 @@ 
 #define GDB_O_APPEND  0x008
 #define GDB_O_CREAT   0x200
 #define GDB_O_TRUNC   0x400
-#define GDB_O_BINARY  0
 
 static int gdb_open_modeflags[12] = {
     GDB_O_RDONLY,
-    GDB_O_RDONLY | GDB_O_BINARY,
+    GDB_O_RDONLY,
+    GDB_O_RDWR,
     GDB_O_RDWR,
-    GDB_O_RDWR | GDB_O_BINARY,
     GDB_O_WRONLY | GDB_O_CREAT | GDB_O_TRUNC,
-    GDB_O_WRONLY | GDB_O_CREAT | GDB_O_TRUNC | GDB_O_BINARY,
+    GDB_O_WRONLY | GDB_O_CREAT | GDB_O_TRUNC,
+    GDB_O_RDWR | GDB_O_CREAT | GDB_O_TRUNC,
     GDB_O_RDWR | GDB_O_CREAT | GDB_O_TRUNC,
-    GDB_O_RDWR | GDB_O_CREAT | GDB_O_TRUNC | GDB_O_BINARY,
     GDB_O_WRONLY | GDB_O_CREAT | GDB_O_APPEND,
-    GDB_O_WRONLY | GDB_O_CREAT | GDB_O_APPEND | GDB_O_BINARY,
+    GDB_O_WRONLY | GDB_O_CREAT | GDB_O_APPEND,
+    GDB_O_RDWR | GDB_O_CREAT | GDB_O_APPEND,
     GDB_O_RDWR | GDB_O_CREAT | GDB_O_APPEND,
-    GDB_O_RDWR | GDB_O_CREAT | GDB_O_APPEND | GDB_O_BINARY
 };
 
 static int open_modeflags[12] = {