From: Andrew Cagney <ac131313@cygnus.com>
To: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa] mips heuristic_proc_start fix
Date: Thu, 12 Jul 2001 00:47:00 -0000 [thread overview]
Message-ID: <3B4D4FC6.6090003@cygnus.com> (raw)
In-Reply-To: <20010706114028.A6366@nevyn.them.org>
>>
>> Glarg. Yes, it's signed, of course! Let me peer at this for a moment
>> and see why the math was coming out wrong; the patch is correct, but
>> now it's not quite as obvious to me why :)
>
>
> No, I stand uncorrected:
Sorry, yes, my bad.
> + if (start_pc < fence)
> + {
> + warning ("Warning: GDB can't find the start of the function at 0x%s (wraparound).",
> + paddr_nz (pc));
> + return 0;
> + }
Hmm, with this patch UINT_MAX would give a fence of VM_MIN_ADDRESS yet
UINT_MAX-1 would give the above warning.
Could I suggest instead something like:
pc = ADDR_BITS_REMOVE (pc);
start_pc = pc;
if (start_pc >= heuristic_fence_post)
fence = start_pc - heuristic_fence_post;
else
fence = 0;
if (start_pc == 0)
return 0;
if (heuristic_fence_post == UINT_MAX
|| fence < VM_MIN_ADDRESS)
fence = VM_MIN_ADDRESS;
The test being moved to before the assignment to make what is happening
more transparent.
enjoy,
Andrew
next prev parent reply other threads:[~2001-07-12 0:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-06 11:20 Daniel Jacobowitz
2001-07-06 11:27 ` Andrew Cagney
2001-07-06 11:32 ` Daniel Jacobowitz
2001-07-06 11:40 ` Daniel Jacobowitz
2001-07-12 0:47 ` Andrew Cagney [this message]
2001-07-12 12:14 ` Daniel Jacobowitz
2001-07-12 14:11 ` Andrew Cagney
2001-07-12 14:19 ` Daniel Jacobowitz
2001-07-12 14:35 ` Andrew Cagney
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=3B4D4FC6.6090003@cygnus.com \
--to=ac131313@cygnus.com \
--cc=dmj+@andrew.cmu.edu \
--cc=gdb-patches@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