[03/10] Fix two latent Rust bugs

Message ID 20200325200715.12947-4-tom@tromey.com
State New
Headers show
Series
  • Fix two name-related bugs in DWARF reader
Related show

Commit Message

Tom Tromey March 25, 2020, 8:07 p.m.
Two methods on general_symbol_info did not handle the language_rust
case.  I don't think these problems can be noticed with the current
code (which is why the bugs went unnoticed), but a future patch will
change this.

gdb/ChangeLog
2020-03-25  Tom Tromey  <tom@tromey.com>

	* symtab.c (general_symbol_info::natural_name)
	(general_symbol_info::demangled_name): Check for language_rust.
---
 gdb/ChangeLog | 5 +++++
 gdb/symtab.c  | 2 ++
 2 files changed, 7 insertions(+)

-- 
2.17.2

Patch

diff --git a/gdb/symtab.c b/gdb/symtab.c
index 84ad17ee50e..bdbfe8e60d3 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -975,6 +975,7 @@  general_symbol_info::natural_name () const
     case language_go:
     case language_objc:
     case language_fortran:
+    case language_rust:
       if (symbol_get_demangled_name (this) != NULL)
 	return symbol_get_demangled_name (this);
       break;
@@ -1000,6 +1001,7 @@  general_symbol_info::demangled_name () const
     case language_go:
     case language_objc:
     case language_fortran:
+    case language_rust:
       dem_name = symbol_get_demangled_name (this);
       break;
     case language_ada: