From: Sergei Poselenov <sposelenov@emcraft.com>
To: gdb@sourceware.org
Subject: Re: [rfc / remote protocol] ELF segment based qOffsets
Date: Wed, 19 Dec 2007 16:20:00 -0000 [thread overview]
Message-ID: <476944A0.8060104@emcraft.com> (raw)
In-Reply-To: <47693C3F.40108@emcraft.com>
[-- Attachment #1: Type: text/plain, Size: 1660 bytes --]
Hello again,
Sorry, previous patch is wrong, please ignore.
Attached is the correct one.
Regards,
Sergei
Sergei Poselenov wrote:
> Hello Daniel,
>
> Daniel Jacobowitz wrote:
>> On Fri, Dec 14, 2007 at 01:27:33PM +0300, Sergei Poselenov wrote:
>>> You see, the warnings are caused by the fact that the segment 01 has
>>> address/size values which wraps to 0 in the following 'if' condition
>>> introduced by the $subj in elfread.c, elf_symfile_segments():
>>> ...
>>> && vma < segments[j]->p_vaddr + segments[j]->p_memsz)
>>
>> Drat. Yes, this just seems like a bug. I'll try to fix it later.
>>
>
> Please review attached.
>
>>> The place above is trivial to fix, but I wonder will be any
>>> other consequences to the remote debugging of such kind of
>>> images? (I can't try this at the moment)
>>
>> I don't think there should be any problems. There would be a little
>> trouble debugging code from those sections if the image was relocated
>> (qOffsets response), but yours shouldn't be; it goes at the address in
>> the ELF file.
>>
> OK, thanks.
>
> Regards,
> Sergei
>
>
> ------------------------------------------------------------------------
>
> --- gdb-6.7/gdb/elfread.c.orig 2007-12-19 16:27:32.000000000 +0100
> +++ gdb-6.7/gdb/elfread.c 2007-12-19 16:32:21.000000000 +0100
> @@ -107,7 +107,7 @@ elf_symfile_segments (bfd *abfd)
> for (j = 0; j < num_segments; j++)
> if (segments[j]->p_memsz > 0
> && vma >= segments[j]->p_vaddr
> - && vma < segments[j]->p_vaddr + segments[j]->p_memsz)
> + && (vma - segments[j]->p_vaddr) > segments[j]->p_memsz)
> {
> data->segment_info[i] = j + 1;
> break;
[-- Attachment #2: gdb-6.7-uboot-sections.patch --]
[-- Type: text/x-patch, Size: 470 bytes --]
--- gdb-6.7/gdb/elfread.c.orig 2007-12-19 16:27:32.000000000 +0100
+++ gdb-6.7/gdb/elfread.c 2007-12-19 16:32:21.000000000 +0100
@@ -107,7 +107,7 @@ elf_symfile_segments (bfd *abfd)
for (j = 0; j < num_segments; j++)
if (segments[j]->p_memsz > 0
&& vma >= segments[j]->p_vaddr
- && vma < segments[j]->p_vaddr + segments[j]->p_memsz)
+ && (vma - segments[j]->p_vaddr) < segments[j]->p_memsz)
{
data->segment_info[i] = j + 1;
break;
next prev parent reply other threads:[~2007-12-19 16:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-14 10:29 Sergei Poselenov
2007-12-17 22:55 ` Daniel Jacobowitz
2007-12-19 15:45 ` Sergei Poselenov
2007-12-19 16:20 ` Sergei Poselenov [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-05-09 19:12 Daniel Jacobowitz
2007-05-09 19:47 ` Eli Zaretskii
2007-05-19 17:38 ` Pedro Alves
2007-06-18 15:48 ` 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=476944A0.8060104@emcraft.com \
--to=sposelenov@emcraft.com \
--cc=gdb@sourceware.org \
/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