public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "J. Johnston" <jjohnstn@redhat.com>
To: Andrew Cagney <ac131313@redhat.com>
Cc: Elena Zannoni <ezannoni@redhat.com>, gdb@sources.redhat.com
Subject: Re: prev_pc problem on ia64
Date: Wed, 16 Apr 2003 00:04:00 -0000	[thread overview]
Message-ID: <3E9C9E1B.4040400@redhat.com> (raw)
In-Reply-To: <3E9C8262.8070401@redhat.com>

Andrew Cagney wrote:
> (I'll ignore the debug info :-)
> 
>>  > Same function compiled for i686:
>>  >  >    Special opcode 76: advance Address by 5 to 0x804839e and Line 
>> by 1 to 31
>>  >    Special opcode 230: advance Address by 16 to 0x80483ae and Line 
>> by 1 to 32
>>  >    Special opcode 146: advance Address by 10 to 0x80483b8 and Line 
>> by 1 to 33
>>  >    Special opcode 160: advance Address by 11 to 0x80483c3 and Line 
>> by 1 to 34
>>  >  > I have a patch whereby I reset prev_pc in 
>> infrun.c:init_execution_control_state():
>>  >  >    if (prev_pc != 0)
>>  >      prev_pc = read_pc ();
>>  >  > prior to setting the ecs->sal.  This works for me in both 
>> scenarios.  The check for
>>  > 0 was needed because I get a failure on the ia64 trying to read the 
>> pc too early when
>>  > the psr register was invalid.
>>  >
>> maybe read_pc should return an error code? Ah wait, it errors out, so
>> you should encapsulate that in a catch_errors().
> 
> 
> The `prev_pc != 0' test is definitly wrong - that will only work when 
> GDB first starts.  Provided the target_has_execution (?), there 
> shouldn't be an error (if there is, GDB's in bad shape :-), so the 
> change should always assign a value to prev_pc and, conditional on 
> target_has_execution, use the value of read_pc().
> 

I tried to use target_has_execution but that did not work.  The error
I get is that the process does not exist.  The read_pc() routine for the ia64 is doing
a read_register_pid() and it appears that the inferior_ptid is not set up
at a time when target_has_execution is set to true.

Does this observation seem reasonable?

> I'm also left wondering if the prev_func_name assignment in:
> 
>> static void
>> stop_stepping (struct execution_control_state *ecs)
>> {
>>   if (target_has_execution)
>>     {
>>       /* Assuming the inferior still exists, set these up for next
>>          time, just like we did above if we didn't break out of the
>>          loop.  */
>>       prev_pc = read_pc ();
>>       prev_func_name = ecs->stop_func_name;
>>     }
>>
>>   /* Let callers know we don't want to wait for the inferior anymore.  */
>>   ecs->wait_some_more = 0;
>> }
> 
> 
> should also be moved to init_execution_control_state, and both of those 
> assignments should be deleted.
> 
> Is it possible to move both of these into the ECS state?
> 
>> please post the patch to gdb-patches. It's hard to judge, like this.
> 
> 
> Yes.
> 
> Andrew
> 
> 


  reply	other threads:[~2003-04-16  0:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-11 22:21 J. Johnston
2003-04-14 20:17 ` Elena Zannoni
2003-04-14 20:42   ` J. Johnston
2003-04-15 22:06   ` Andrew Cagney
2003-04-16  0:04     ` J. Johnston [this message]
2003-04-16  1:35       ` Elena Zannoni
2003-04-16  1:56         ` Andrew Cagney
2003-04-16  3:17           ` Andrew Cagney
2003-04-16 15:14             ` J. Johnston
2003-05-05 19:57             ` J. Johnston

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=3E9C9E1B.4040400@redhat.com \
    --to=jjohnstn@redhat.com \
    --cc=ac131313@redhat.com \
    --cc=ezannoni@redhat.com \
    --cc=gdb@sources.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).