From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 0E4ED3858C2C; Fri, 15 Apr 2022 17:35:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E4ED3858C2C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Remove some dead code from the Rust value printer X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 7410508723bf20c29ea8d5888eee9c45e5fae0a2 X-Git-Newrev: 925ea601f1892c6eb344e2c916f0ef448b42b606 Message-Id: <20220415173552.0E4ED3858C2C@sourceware.org> Date: Fri, 15 Apr 2022 17:35:52 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2022 17:35:52 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D925ea601f189= 2c6eb344e2c916f0ef448b42b606 commit 925ea601f1892c6eb344e2c916f0ef448b42b606 Author: Tom Tromey Date: Fri Mar 25 13:43:27 2022 -0600 Remove some dead code from the Rust value printer =20 This removes a bit of dead code from the Rust value printer. This code wasn't always dead -- it fixed a real bug, and a test case was added for it. However, once val_print was removed, it became unnecessary. Diff: --- gdb/rust-lang.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index 836ea37f153..fdd6e3fbdbb 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -324,14 +324,6 @@ rust_language::val_print_struct =20 if (rust_slice_type_p (type) && strcmp (type->name (), "&str") =3D=3D 0) { - /* If what we are printing here is actually a string within a - structure then VAL will be the original parent value, while TYPE - will be the type of the structure representing the string we want - to print. - However, RUST_VAL_PRINT_STR looks up the fields of the string - inside VAL, assuming that VAL is the string. - So, recreate VAL as a value representing just the string. */ - val =3D value_at_lazy (type, value_address (val)); rust_val_print_str (stream, val, options); return; }