From: Andrew Cagney <ac131313@redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-patches@sources.redhat.com, amichelotti@ipitec.it,
Michael Snyder <msnyder@redhat.com>
Subject: Re: patch for info threads problem with target arm-elf (PR 1199).
Date: Sat, 26 Jul 2003 01:26:00 -0000 [thread overview]
Message-ID: <3F21D8BE.8050401@redhat.com> (raw)
In-Reply-To: <20030726002921.GA5573@nevyn.them.org>
> On Fri, Jul 25, 2003 at 05:26:12PM -0700, Michael Snyder wrote:
>
>> Andrea Michelotti wrote:
>>
>
>> >-----------------------
>> >Andrea Michelotti
>> >HW/SW Co-Design Manager
>> >IPITEC (ATMEL)
>
>>
>>
>> I think it can be approved. Do you have an FSF copyright assignment?
>
>
> I'd want to ping Andrew about this first before scattering NULL pointer
> checks - Andrew, does "there is always a frame" include when the
> inferior does not exist yet?
Kind of :-) If the inferior doesn't exist, GDB should never get to find
out the answer. See get_current_frame and all those error() checks.
> Also, I think a better solution to this actual crash is for info
> threads to bail out early if we don't have an inferior. Probably
> target_has_registers ().
Yes, looking at the start of info_threads_command:
> static void
> info_threads_command (char *arg, int from_tty)
> {
> struct thread_info *tp;
> ptid_t current_ptid;
> struct frame_info *cur_frame;
> int saved_frame_level = frame_relative_level (deprecated_selected_frame);
> int counter;
> char *extra_info;
>
> /* Avoid coredumps which would happen if we tried to access a NULL
> deprecated_selected_frame. */
> if (!target_has_stack)
> error ("No stack.");
The references to:
deprecated_selected_frame
should have set off alarm bells!
A quick fix would be to call get_selected_frame() (and delete that error
check).
The correct fix involves per-thread frames ...
Andrew
next prev parent reply other threads:[~2003-07-26 1:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-24 16:43 Andrea Michelotti
2003-07-26 0:26 ` Michael Snyder
2003-07-26 0:29 ` Daniel Jacobowitz
2003-07-26 1:26 ` Andrew Cagney [this message]
2003-07-26 1:48 ` Daniel Jacobowitz
2003-07-26 2:10 ` Andrew Cagney
2003-07-26 2:15 ` Daniel Jacobowitz
2003-07-28 10:17 ` Andrea Michelotti
2003-07-28 13:03 ` Daniel Jacobowitz
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=3F21D8BE.8050401@redhat.com \
--to=ac131313@redhat.com \
--cc=amichelotti@ipitec.it \
--cc=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=msnyder@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