[11/12] gdb: make gdb_printing_disassembler::stream public

Message ID 20221206135729.3937767-12-simon.marchi@efficios.com
State Committed
Commit 8b588f42120f1a39d32116c2bf3e53981d906a02
Headers
Series Initial support for ROCm platform (AMDGPU) debugging |

Commit Message

Simon Marchi Dec. 6, 2022, 1:57 p.m. UTC
  In the ROCm port, we need to access the underlying stream of a
gdb_printing_disassembler, so make it public.  The reason we need to
access it is to know whether it supports style escape code.  We then
pass that information to a temporary string_file we use while
symbolizing addresses.

Change-Id: Ib95755a4a45b8f6478787993e9f904df60dd8dc1
---
 gdb/disasm.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Andrew Burgess Dec. 6, 2022, 5:38 p.m. UTC | #1
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

> In the ROCm port, we need to access the underlying stream of a
> gdb_printing_disassembler, so make it public.  The reason we need to
> access it is to know whether it supports style escape code.  We then
> pass that information to a temporary string_file we use while
> symbolizing addresses.

*sigh* I can't see a better way, so LGTM.

Thanks,
Andrew

>
> Change-Id: Ib95755a4a45b8f6478787993e9f904df60dd8dc1
> ---
>  gdb/disasm.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gdb/disasm.h b/gdb/disasm.h
> index d6aec9a4705..b78374dd63f 100644
> --- a/gdb/disasm.h
> +++ b/gdb/disasm.h
> @@ -123,12 +123,12 @@ struct gdb_printing_disassembler : public gdb_disassemble_info
>  {
>    DISABLE_COPY_AND_ASSIGN (gdb_printing_disassembler);
>  
> -protected:
> -
>    /* The stream that disassembler output is being written too.  */
>    struct ui_file *stream ()
>    { return m_stream; }
>  
> +protected:
> +
>    /* Constructor.  All the arguments are just passed to the parent class.
>       We also add the two print functions to the arguments passed to the
>       parent.  See gdb_disassemble_info for a description of how the
> -- 
> 2.38.1
  

Patch

diff --git a/gdb/disasm.h b/gdb/disasm.h
index d6aec9a4705..b78374dd63f 100644
--- a/gdb/disasm.h
+++ b/gdb/disasm.h
@@ -123,12 +123,12 @@  struct gdb_printing_disassembler : public gdb_disassemble_info
 {
   DISABLE_COPY_AND_ASSIGN (gdb_printing_disassembler);
 
-protected:
-
   /* The stream that disassembler output is being written too.  */
   struct ui_file *stream ()
   { return m_stream; }
 
+protected:
+
   /* Constructor.  All the arguments are just passed to the parent class.
      We also add the two print functions to the arguments passed to the
      parent.  See gdb_disassemble_info for a description of how the