* [RFA] Fix a compilation failure in rs6000-nat.c
@ 2003-07-01 0:37 Joel Brobecker
2003-07-01 0:40 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2003-07-01 0:37 UTC (permalink / raw)
To: gdb-patches
A leftover of the SIZEOF_SECTION_OFFSETS removal saga... Not sure how
I missed it the last time I tryed building GDB on AiX, but I lack the
time to investigate further...
2003-06-30 Joel Brobecker <brobecker@gnat.com>
* rs6000-nat.c (vmap_symtab): Fix compilation error.
tested on ppc-aix 4.3.2.0.
Ok to apply?
I think the gdb6 branch has the same problem :-(. I will double-check.
If I get the approval for this patch, and it turns out that we need it
on gdb6, can I apply it there too?
Thanks,
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA] Fix a compilation failure in rs6000-nat.c
2003-07-01 0:37 [RFA] Fix a compilation failure in rs6000-nat.c Joel Brobecker
@ 2003-07-01 0:40 ` Joel Brobecker
2003-07-02 18:02 ` Kevin Buettner
0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2003-07-01 0:40 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 568 bytes --]
[sigh, resending with the patch this time...]
A leftover of the SIZEOF_SECTION_OFFSETS removal saga... Not sure how
I missed it the last time I tryed building GDB on AiX, but I lack the
time to investigate further...
2003-06-30 Joel Brobecker <brobecker@gnat.com>
* rs6000-nat.c (vmap_symtab): Fix compilation error.
tested on ppc-aix 4.3.2.0.
Ok to apply?
I think the gdb6 branch has the same problem :-(. I will double-check.
If I get the approval for this patch, and it turns out that we need it
on gdb6, can I apply it there too?
Thanks,
--
Joel
[-- Attachment #2: rs6000-nat.c.diff --]
[-- Type: text/plain, Size: 764 bytes --]
Index: rs6000-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
retrieving revision 1.31
diff -u -p -r1.31 rs6000-nat.c
--- rs6000-nat.c 10 Jun 2003 20:34:09 -0000 1.31
+++ rs6000-nat.c 1 Jul 2003 00:31:09 -0000
@@ -664,7 +664,9 @@ vmap_symtab (struct vmap *vp)
/* If symbols are not yet loaded, offsets are not yet valid. */
return;
- new_offsets = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
+ new_offsets =
+ (struct section_offsets *) alloca (objfile->num_sections *
+ sizeof (struct section_offsets));
for (i = 0; i < objfile->num_sections; ++i)
new_offsets->offsets[i] = ANOFFSET (objfile->section_offsets, i);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA] Fix a compilation failure in rs6000-nat.c
2003-07-01 0:40 ` Joel Brobecker
@ 2003-07-02 18:02 ` Kevin Buettner
2003-07-04 16:49 ` Joel Brobecker
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Buettner @ 2003-07-02 18:02 UTC (permalink / raw)
To: Joel Brobecker, gdb-patches
On Jun 30, 5:40pm, Joel Brobecker wrote:
> A leftover of the SIZEOF_SECTION_OFFSETS removal saga... Not sure how
> I missed it the last time I tryed building GDB on AiX, but I lack the
> time to investigate further...
>
> 2003-06-30 Joel Brobecker <brobecker@gnat.com>
>
> * rs6000-nat.c (vmap_symtab): Fix compilation error.
>
> tested on ppc-aix 4.3.2.0.
>
> Ok to apply?
Almost...
> I think the gdb6 branch has the same problem :-(. I will double-check.
> If I get the approval for this patch, and it turns out that we need it
> on gdb6, can I apply it there too?
>
> Index: rs6000-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
> retrieving revision 1.31
> diff -u -p -r1.31 rs6000-nat.c
> --- rs6000-nat.c 10 Jun 2003 20:34:09 -0000 1.31
> +++ rs6000-nat.c 1 Jul 2003 00:31:09 -0000
> @@ -664,7 +664,9 @@ vmap_symtab (struct vmap *vp)
> /* If symbols are not yet loaded, offsets are not yet valid. */
> return;
>
> - new_offsets = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
> + new_offsets =
> + (struct section_offsets *) alloca (objfile->num_sections *
> + sizeof (struct section_offsets));
I don't think this is quite right. After looking at the other
substitutions that were done along these lines[1], I think this should be:
new_offsets = (struct section_offsets *)
alloca (SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
Feel free to adjust the formatting.
If you agree that this is the correct fix, please apply this change
to both the mainline and gdb 6.0 branch. (But please post an updated
patch showing what you committed.)
Thanks!
Kevin
[1] http://sources.redhat.com/ml/gdb-patches/2003-05/msg00237.html
P.S. I just noticed that remote-vx.c also still uses
SIZEOF_SECTION_OFFSETS. You're preapproved to fix this one too if you
want...
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFA] Fix a compilation failure in rs6000-nat.c
2003-07-02 18:02 ` Kevin Buettner
@ 2003-07-04 16:49 ` Joel Brobecker
0 siblings, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2003-07-04 16:49 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 952 bytes --]
Hi Kevin,
Sorry it took me so long to get back to you. Our AiX machine suffered
a severe breakdown, and had to be completely reinstalled :(.
> I don't think this is quite right. After looking at the other
> substitutions that were done along these lines[1], I think this should be:
>
> new_offsets = (struct section_offsets *)
> alloca (SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
>
> Feel free to adjust the formatting.
>
> If you agree that this is the correct fix, please apply this change
> to both the mainline and gdb 6.0 branch. (But please post an updated
> patch showing what you committed.)
Good catch!
Here is the patch I ended up committing, on mainline and branch.
That leaves only one more problem before GDB is able to build on
AiX again (xcoffread.c).
2003-07-04 Joel Brobecker <brobecker@gnat.com>
* rs6000-nat.c (vmap_symtab): Fix compilation error.
(note: I used gdb_indent's formatting)
--
Joel
[-- Attachment #2: rs6000-nat.c.diff --]
[-- Type: text/plain, Size: 722 bytes --]
Index: rs6000-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
retrieving revision 1.31
diff -u -p -r1.31 rs6000-nat.c
--- rs6000-nat.c 10 Jun 2003 20:34:09 -0000 1.31
+++ rs6000-nat.c 4 Jul 2003 16:33:53 -0000
@@ -664,7 +664,9 @@ vmap_symtab (struct vmap *vp)
/* If symbols are not yet loaded, offsets are not yet valid. */
return;
- new_offsets = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
+ new_offsets =
+ (struct section_offsets *)
+ alloca (SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
for (i = 0; i < objfile->num_sections; ++i)
new_offsets->offsets[i] = ANOFFSET (objfile->section_offsets, i);
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-07-04 16:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-01 0:37 [RFA] Fix a compilation failure in rs6000-nat.c Joel Brobecker
2003-07-01 0:40 ` Joel Brobecker
2003-07-02 18:02 ` Kevin Buettner
2003-07-04 16:49 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox