public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Remove error_stream
@ 2023-04-16 18:48 Tom Tromey
  2023-04-17 10:55 ` Alexandra Petlanova Hajkova
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2023-04-16 18:48 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

error_stream is trivial and only used in a couple of spots in
breakpoint.c.  This patch removes it in favor of just writing it out
at the spots where it was used.
---
 gdb/breakpoint.c | 4 ++--
 gdb/utils.c      | 6 ------
 gdb/utils.h      | 2 --
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 46287da5f87..baf49e4461f 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3137,7 +3137,7 @@ update_inserted_breakpoint_locations (void)
   if (error_flag)
     {
       target_terminal::ours_for_output ();
-      error_stream (tmp_error_stream);
+      error (("%s"), tmp_error_stream.c_str ());
     }
 }
 
@@ -3234,7 +3234,7 @@ insert_breakpoint_locations (void)
 You may have requested too many hardware breakpoints/watchpoints.\n");
 	}
       target_terminal::ours_for_output ();
-      error_stream (tmp_error_stream);
+      error (("%s"), tmp_error_stream.c_str ());
     }
 }
 
diff --git a/gdb/utils.c b/gdb/utils.c
index 6ec1cc0d48d..f82ee2481fd 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -165,12 +165,6 @@ verror (const char *string, va_list args)
   throw_verror (GENERIC_ERROR, string, args);
 }
 
-void
-error_stream (const string_file &stream)
-{
-  error (("%s"), stream.c_str ());
-}
-
 /* Emit a message and abort.  */
 
 static void ATTRIBUTE_NORETURN
diff --git a/gdb/utils.h b/gdb/utils.h
index a383036bcfe..39d1a3bdbff 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -285,8 +285,6 @@ extern void (*deprecated_error_begin_hook) (void);
 
 extern const char *warning_pre_print;
 
-extern void error_stream (const string_file &) ATTRIBUTE_NORETURN;
-
 extern void demangler_vwarning (const char *file, int line,
 			       const char *, va_list ap)
      ATTRIBUTE_PRINTF (3, 0);
-- 
2.39.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Remove error_stream
  2023-04-16 18:48 [PATCH] Remove error_stream Tom Tromey
@ 2023-04-17 10:55 ` Alexandra Petlanova Hajkova
  2023-05-02 15:15   ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandra Petlanova Hajkova @ 2023-04-17 10:55 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 950 bytes --]

On Sun, Apr 16, 2023 at 8:49 PM Tom Tromey <tom@tromey.com> wrote:

> error_stream is trivial and only used in a couple of spots in
> breakpoint.c.  This patch removes it in favor of just writing it out
> at the spots where it was used.
> ---
>  gdb/breakpoint.c | 4 ++--
>  gdb/utils.c      | 6 ------
>  gdb/utils.h      | 2 --
>  3 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
> index 46287da5f87..baf49e4461f 100644
> --- a/gdb/breakpoint.c
> +++ b/gdb/breakpoint.c
> @@ -3137,7 +3137,7 @@ update_inserted_breakpoint_locations (void)
>    if (error_flag)
>      {
>        target_terminal::ours_for_output ();
> -      error_stream (tmp_error_stream);
> +      error (("%s"), tmp_error_stream.c_str ());
>
> I was considering using it in my "defer warnings when loading separate
debug file" but it wasn't suitable, it seems it doesn't have many use cases
indeed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Remove error_stream
  2023-04-17 10:55 ` Alexandra Petlanova Hajkova
@ 2023-05-02 15:15   ` Tom Tromey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2023-05-02 15:15 UTC (permalink / raw)
  To: Alexandra Petlanova Hajkova via Gdb-patches
  Cc: Tom Tromey, Alexandra Petlanova Hajkova

>>>>> "Alexandra" == Alexandra Petlanova Hajkova via Gdb-patches <gdb-patches@sourceware.org> writes:

>> error_stream is trivial and only used in a couple of spots in
>> breakpoint.c.  This patch removes it in favor of just writing it out
>> at the spots where it was used.

Alexandra> I was considering using it in my "defer warnings when loading separate
Alexandra> debug file" but it wasn't suitable, it seems it doesn't have many use cases
Alexandra> indeed.

Thanks for the note.
I'm going to check this in now.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-02 15:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-16 18:48 [PATCH] Remove error_stream Tom Tromey
2023-04-17 10:55 ` Alexandra Petlanova Hajkova
2023-05-02 15:15   ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).