This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Don't memset non-POD types: struct btrace_insn
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Mon, 24 Apr 2017 22:49:45 -0400
- Subject: [binutils-gdb] Don't memset non-POD types: struct btrace_insn
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT b5c3668253b909fd1f5b011893a35bb8dfd3be9b ***
Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: b5c3668253b909fd1f5b011893a35bb8dfd3be9b
Don't memset non-POD types: struct btrace_insn
struct btrace_insn is not a POD [1] so we shouldn't be using memset to
initialize it [2].
Use list-initialization instead, wrapped in a "pt insn to btrace insn"
function, which looks like just begging to be added next to the
existing pt_reclassify_insn/pt_btrace_insn_flags functions.
[1] - because its field "flags" is not POD, because enum_flags has a
non-trivial default ctor.
gdb/ChangeLog:
2017-04-25 Pedro Alves <palves@redhat.com>
* btrace.c (pt_btrace_insn_flags): Change parameter type to
reference.
(pt_btrace_insn): New function.
(ftrace_add_pt): Remove memset call and use pt_btrace_insn.