Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Marchi <simark@simark.ca>,	Tom Tromey <tom@tromey.com>,
	Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCHv3 0/3] Remove some uses of VEC
Date: Thu, 26 Sep 2019 00:00:00 -0000	[thread overview]
Message-ID: <cover.1569455609.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <87lfucf2qs.fsf@tromey.com>

Tom raised some good points about patch #3, specifically that some of
the query functions like VEC_length and VEC_empty will return a sane
answer even when the vector pointer is NULL.  He also pointed out that
VEC_free resets theh vector pointer back to NULL.

This revision of the series is a little more defensive about checking
for the std::vector pointer being null before dereferencing it.  In
places where I'm reasonably sure the vector pointer won't be NULL I've
added an assert - then at least if I'm wrong we'll get a nice error
rather than a random crash.

Thanks,
Andrew

---

Andrew Burgess (3):
  gdb: Remove a VEC from gdbsupport/btrace-common.h
  gdb: Change a VEC to std::vector in btrace.{c,h}
  gdb: Remove a use of VEC from dwarf2read.{c,h}

 gdb/ChangeLog                  | 46 ++++++++++++++++++++
 gdb/btrace.c                   | 98 ++++++++++++++++++++----------------------
 gdb/btrace.h                   |  5 +--
 gdb/dwarf2read.c               | 17 ++++----
 gdb/dwarf2read.h               |  3 --
 gdb/gdbserver/ChangeLog        |  5 +++
 gdb/gdbserver/linux-low.c      |  8 +---
 gdb/gdbsupport/btrace-common.c | 20 ++++-----
 gdb/gdbsupport/btrace-common.h | 19 ++++----
 gdb/nat/linux-btrace.c         | 16 +++----
 10 files changed, 139 insertions(+), 98 deletions(-)

-- 
2.14.5


  reply	other threads:[~2019-09-26  0:00 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 15:54 [PATCHv2 " Andrew Burgess
2019-09-23 22:09 ` [PATCH 0/2] Remove 2 uses of VEC from gdb Andrew Burgess
2019-09-23 22:09   ` [PATCH 2/2] gdb: Change a VEC to std::vector in btrace.{c,h} Andrew Burgess
2019-09-24  2:19     ` Simon Marchi
2019-09-23 22:09   ` [PATCH 1/2] gdb: Remove a VEC from gdbsupport/btrace-common.h Andrew Burgess
2019-09-24  2:09     ` Simon Marchi
2019-09-24 19:54   ` [PATCH 0/2] Remove 2 uses of VEC from gdb Tom Tromey
2019-09-25 15:54   ` [PATCHv2 2/3] gdb: Change a VEC to std::vector in btrace.{c,h} Andrew Burgess
2019-09-26  2:35     ` Simon Marchi
2019-09-25 15:54   ` [PATCHv2 3/3] gdb: Remove a use of VEC from dwarf2read.{c,h} Andrew Burgess
2019-09-25 22:08     ` Tom Tromey
2019-09-26  0:00       ` Andrew Burgess [this message]
2019-09-26  2:52         ` [PATCHv3 0/3] Remove some uses of VEC Simon Marchi
2019-09-26 11:41         ` [PATCHv4 1/3] gdb: Remove a VEC from gdbsupport/btrace-common.h Andrew Burgess
2019-09-26 13:40           ` Metzger, Markus T
2019-09-26 11:41         ` [PATCHv4 3/3] gdb: Remove a use of VEC from dwarf2read.{c,h} Andrew Burgess
2019-09-26 11:41         ` [PATCHv4 2/3] gdb: Change a VEC to std::vector in btrace.{c,h} Andrew Burgess
2019-09-26 11:41         ` [PATCHv4 0/3] Remove some uses of VEC Andrew Burgess
2019-10-01 11:42           ` [PATCHv5 1/3] gdb: Remove a VEC from gdbsupport/btrace-common.h Andrew Burgess
2019-10-01 19:59             ` Tom Tromey
2019-10-01 11:42           ` [PATCHv5 3/3] gdb: Remove a use of VEC from dwarf2read.{c,h} Andrew Burgess
2019-10-02 15:51             ` Pedro Alves
2019-10-02 22:21               ` Andrew Burgess
2019-10-03  8:06                 ` Pedro Alves
2019-10-01 11:42           ` [PATCHv5 2/3] gdb: Change a VEC to std::vector in btrace.{c,h} Andrew Burgess
     [not found]           ` <cover.1569929785.git.andrew.burgess@embecosm.com>
2019-10-01 12:04             ` [PATCHv5 0/3] Remove some uses of VEC Metzger, Markus T
2019-09-26  0:00       ` [PATCHv3 3/3] gdb: Remove a use of VEC from dwarf2read.{c,h} Andrew Burgess
2019-09-26  0:00       ` [PATCHv3 2/3] gdb: Change a VEC to std::vector in btrace.{c,h} Andrew Burgess
2019-09-26  8:47         ` Metzger, Markus T
2019-09-26 11:33           ` Andrew Burgess
2019-09-26  0:00       ` [PATCHv3 1/3] gdb: Remove a VEC from gdbsupport/btrace-common.h Andrew Burgess
2019-09-26  8:47         ` Metzger, Markus T
2019-09-26 11:32           ` Andrew Burgess
2019-09-26 13:07             ` Metzger, Markus T
2019-09-25 15:54   ` [PATCHv2 " Andrew Burgess

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=cover.1569455609.git.andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=tom@tromey.com \
    /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