[FYI] Constify objfile::original_name

Message ID 20191017025330.15863-1-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey Oct. 17, 2019, 2:53 a.m. UTC
  I noticed that objfile::original_name could be a "const char *" rather
than a plain "char *".  This patch implements this change.  Tested by
rebuilding.

gdb/ChangeLog
2019-10-16  Tom Tromey  <tom@tromey.com>

	* objfiles.h (struct objfile) <original_name>: Now const.
---
 gdb/ChangeLog  | 4 ++++
 gdb/objfiles.h | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index dbd06c01e26..2d92120870d 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -483,7 +483,7 @@  struct objfile
      This pointer is never NULL.  This does not have to be freed; it is
      guaranteed to have a lifetime at least as long as the objfile.  */
 
-  char *original_name = nullptr;
+  const char *original_name = nullptr;
 
   CORE_ADDR addr_low = 0;