From: "Andrew Burgess (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Sergio Durigan Junior <sergiodj@redhat.com>, gdb-patches@sourceware.org
Subject: [review] Make 'target_{short,long}name' inline functions and check if 'current...
Date: Fri, 01 Nov 2019 08:40:00 -0000 [thread overview]
Message-ID: <20191101084010.E1A0C20AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1572586994000.I8a9a4dd6edc3784dc089f37d56f2d020567b4aee@gnutoolchain-gerrit.osci.io>
Andrew Burgess has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/481
......................................................................
Patch Set 1:
(1 comment)
I haven't had time to play with this code yet, but I had one question...
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/481/1/gdb/target.h
File gdb/target.h:
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/481/1/gdb/target.h@1312
PS1, Line 1312:
1307 | target_ops *m_stack[(int) debug_stratum + 1] {};
1308 | };
1309 |
1310 | /* The ops structure for our "current" target process. This should
1311 | never be NULL. If there is no target, it points to the dummy_target. */
1312 >
1313 | extern target_ops *current_top_target ();
1314 |
1315 | /* Define easy words for doing these operations on our current target. */
1316 |
1317 | static inline const char *
If this is the correct way to resolve this issue - I defer to others with more knowledge in this area - then you should probably change or expand this comment as its clearly not correct, right. I mean this comment right here is the fundamental cause of your bug, it assumes current_top_target () can never return NULL, and you have found a case when it can.
That said, and I don't know the impact this would have - what if you "just" fixed current_top_target so that it really can never return NULL, but instead forces dummy_target to be returned?
--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I8a9a4dd6edc3784dc089f37d56f2d020567b4aee
Gerrit-Change-Number: 481
Gerrit-PatchSet: 1
Gerrit-Owner: Sergio Durigan Junior <sergiodj@redhat.com>
Gerrit-CC: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Comment-Date: Fri, 01 Nov 2019 08:40:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
next prev parent reply other threads:[~2019-11-01 8:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-01 5:43 Sergio Durigan Junior (Code Review)
2019-11-01 8:40 ` Andrew Burgess (Code Review) [this message]
2019-11-01 13:18 ` Tom Tromey (Code Review)
2019-11-01 14:50 ` Sergio Durigan Junior (Code Review)
2019-11-01 15:24 ` Sergio Durigan Junior (Code Review)
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=20191101084010.E1A0C20AF6@gnutoolchain-gerrit.osci.io \
--to=gerrit@gnutoolchain-gerrit.osci.io \
--cc=gdb-patches@sourceware.org \
--cc=gnutoolchain-gerrit@osci.io \
--cc=sergiodj@redhat.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