Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/3] Constify get_disassembler_options
Date: Thu, 21 Mar 2024 12:10:32 -0600	[thread overview]
Message-ID: <20240321-disassemble-cleanup-v1-1-77448506f4ab@adacore.com> (raw)
In-Reply-To: <20240321-disassemble-cleanup-v1-0-77448506f4ab@adacore.com>

This changes get_disassembler_options to return a const char *.
---
 gdb/arm-tdep.c | 2 +-
 gdb/disasm.c   | 2 +-
 gdb/disasm.h   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 3b4ae15df07..82b06f63fcb 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -9640,7 +9640,7 @@ show_disassembly_style_sfunc (struct ui_file *file, int from_tty,
 			      struct cmd_list_element *c, const char *value)
 {
   struct gdbarch *gdbarch = get_current_arch ();
-  char *options = get_disassembler_options (gdbarch);
+  const char *options = get_disassembler_options (gdbarch);
   const char *style = "";
   int len = 0;
   const char *opt;
diff --git a/gdb/disasm.c b/gdb/disasm.c
index 15d641cfc1f..5bab5cf6199 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -1291,7 +1291,7 @@ gdb_buffered_insn_length (struct gdbarch *gdbarch,
   return result;
 }
 
-char *
+const char *
 get_disassembler_options (struct gdbarch *gdbarch)
 {
   char **disassembler_options = gdbarch_disassembler_options (gdbarch);
diff --git a/gdb/disasm.h b/gdb/disasm.h
index a2251445707..9282632b270 100644
--- a/gdb/disasm.h
+++ b/gdb/disasm.h
@@ -385,7 +385,7 @@ extern int gdb_buffered_insn_length (struct gdbarch *gdbarch,
 
 /* Returns GDBARCH's disassembler options.  */
 
-extern char *get_disassembler_options (struct gdbarch *gdbarch);
+extern const char *get_disassembler_options (struct gdbarch *gdbarch);
 
 /* Sets the active gdbarch's disassembler options to OPTIONS.  */
 

-- 
2.43.0


  reply	other threads:[~2024-03-21 18:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 18:10 [PATCH 0/3] Minor cleanups in disassemble code Tom Tromey
2024-03-21 18:10 ` Tom Tromey [this message]
2024-03-21 18:10 ` [PATCH 2/3] Remove some unnecessary casts Tom Tromey
2024-03-21 18:10 ` [PATCH 3/3] Use std::string for disassembler options Tom Tromey
2024-03-22 17:59 ` [PATCH 0/3] Minor cleanups in disassemble code John Baldwin
2024-03-22 19:12   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240321-disassemble-cleanup-v1-1-77448506f4ab@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox