Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] dwarf2cfi.c fix for shlibs
@ 2002-05-15  8:12 Michal Ludvig
  2002-05-20 19:05 ` Elena Zannoni
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Ludvig @ 2002-05-15  8:12 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

Hi all,
this patch fixed mapping of FDE entries from shared libraries.
OK to commit to mainline and branch?

2002-05-15  Michal Ludvig  <mludvig@suse.cz>

   * dwarf2cfi.c (dwarf2_build_frame_info): Add objfile->section_offset
   to fde->initial_location so that frames of shared libraries are mapped
   correctly.

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* +420 2 9654 5373   * http://www.suse.cz

[-- Attachment #2: cfi-so-simple.diff --]
[-- Type: text/plain, Size: 948 bytes --]

Index: dwarf2cfi.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2cfi.c,v
retrieving revision 1.1.2.2
diff -c -3 -p -r1.1.2.2 dwarf2cfi.c
*** dwarf2cfi.c	14 May 2002 09:50:39 -0000	1.1.2.2
--- dwarf2cfi.c	15 May 2002 15:03:06 -0000
*************** dwarf2_build_frame_info (struct objfile 
*** 1476,1482 ****
  	      fde = fde_unit_alloc ();
  
  	      fde_chunks.array[fde_chunks.elems++] = fde;
! 	      fde->initial_location = read_pointer (abfd, &start);
  	      fde->address_range = read_pointer (abfd, &start);
  
  	      for (cie = cie_chunks;
--- 1476,1483 ----
  	      fde = fde_unit_alloc ();
  
  	      fde_chunks.array[fde_chunks.elems++] = fde;
! 	      fde->initial_location = read_pointer (abfd, &start)
! 	        + objfile->section_offsets[objfile->sect_index_text].offsets[0];
  	      fde->address_range = read_pointer (abfd, &start);
  
  	      for (cie = cie_chunks;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] dwarf2cfi.c fix for shlibs
  2002-05-15  8:12 [RFA] dwarf2cfi.c fix for shlibs Michal Ludvig
@ 2002-05-20 19:05 ` Elena Zannoni
  2002-05-22  6:54   ` Michal Ludvig
  0 siblings, 1 reply; 3+ messages in thread
From: Elena Zannoni @ 2002-05-20 19:05 UTC (permalink / raw)
  To: Michal Ludvig; +Cc: gdb-patches

Michal Ludvig writes:
 > Hi all,
 > this patch fixed mapping of FDE entries from shared libraries.
 > OK to commit to mainline and branch?
 > 
 > 2002-05-15  Michal Ludvig  <mludvig@suse.cz>
 > 
 >    * dwarf2cfi.c (dwarf2_build_frame_info): Add objfile->section_offset
 >    to fde->initial_location so that frames of shared libraries are mapped
 >    correctly.
 > 
 > Michal Ludvig
 > -- 
 > * SuSE CR, s.r.o     * mludvig@suse.cz
 > * +420 2 9654 5373   * http://www.suse.cz
 > Index: dwarf2cfi.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/dwarf2cfi.c,v
 > retrieving revision 1.1.2.2
 > diff -c -3 -p -r1.1.2.2 dwarf2cfi.c
 > *** dwarf2cfi.c	14 May 2002 09:50:39 -0000	1.1.2.2
 > --- dwarf2cfi.c	15 May 2002 15:03:06 -0000
 > *************** dwarf2_build_frame_info (struct objfile 
 > *** 1476,1482 ****
 >   	      fde = fde_unit_alloc ();
 >   
 >   	      fde_chunks.array[fde_chunks.elems++] = fde;
 > ! 	      fde->initial_location = read_pointer (abfd, &start);
 >   	      fde->address_range = read_pointer (abfd, &start);
 >   
 >   	      for (cie = cie_chunks;
 > --- 1476,1483 ----
 >   	      fde = fde_unit_alloc ();
 >   
 >   	      fde_chunks.array[fde_chunks.elems++] = fde;
 > ! 	      fde->initial_location = read_pointer (abfd, &start)
 > ! 	        + objfile->section_offsets[objfile->sect_index_text].offsets[0];
 >   	      fde->address_range = read_pointer (abfd, &start);
 >   
 >   	      for (cie = cie_chunks;

You should use 

fde->initial_location = read_pointer (abfd, &start)
    + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));

instead.

Otherwise it's ok.

Elena

BTW: I get 2 warnings compiling dwarf2cfi.c on i386.
/home/ezannoni/sources/src/gdb/dwarf2cfi.c: In function `execute_stack_op':
/home/ezannoni/sources/src/gdb/dwarf2cfi.c:1079: warning: cast to pointer from integer of different size
/home/ezannoni/sources/src/gdb/dwarf2cfi.c:1086: warning: cast to pointer from integer of different size


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] dwarf2cfi.c fix for shlibs
  2002-05-20 19:05 ` Elena Zannoni
@ 2002-05-22  6:54   ` Michal Ludvig
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Ludvig @ 2002-05-22  6:54 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

Elena Zannoni wrote:

> You should use 
> 
> fde->initial_location = read_pointer (abfd, &start)
>     + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
> 
> instead.
> Otherwise it's ok.

Thanks, commited to both mainline and branch along with the eh_frame thing.

> BTW: I get 2 warnings compiling dwarf2cfi.c on i386.
> /home/ezannoni/sources/src/gdb/dwarf2cfi.c: In function `execute_stack_op':
> /home/ezannoni/sources/src/gdb/dwarf2cfi.c:1079: warning: cast to pointer from integer of different size
> /home/ezannoni/sources/src/gdb/dwarf2cfi.c:1086: warning: cast to pointer from integer of different size

Appended patch should fix these warnings. Commited as obvious.

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* +420 2 9654 5373   * http://www.suse.cz

[-- Attachment #2: cfi-ptrwarning.diff --]
[-- Type: text/plain, Size: 719 bytes --]

Index: dwarf2cfi.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2cfi.c,v
retrieving revision 1.1.2.3
diff -c -3 -p -r1.1.2.3 dwarf2cfi.c
*** dwarf2cfi.c	22 May 2002 12:55:38 -0000	1.1.2.3
--- dwarf2cfi.c	22 May 2002 13:15:28 -0000
*************** execute_stack_op (struct objfile *objfil
*** 875,881 ****
    while (op_ptr < op_end)
      {
        enum dwarf_location_atom op = *op_ptr++;
!       ULONGEST result, reg;
        LONGEST offset;
  
        switch (op)
--- 875,882 ----
    while (op_ptr < op_end)
      {
        enum dwarf_location_atom op = *op_ptr++;
!       CORE_ADDR result;
!       ULONGEST reg;
        LONGEST offset;
  
        switch (op)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-05-22 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-15  8:12 [RFA] dwarf2cfi.c fix for shlibs Michal Ludvig
2002-05-20 19:05 ` Elena Zannoni
2002-05-22  6:54   ` Michal Ludvig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox