From: Jonas Maebe <jonas.maebe@elis.ugent.be>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Project Archer <archer@sourceware.org>,
Joost van der Sluis <joost@cnoc.nl>
Subject: Re: Patch for pascal-dynamic arrays
Date: Sun, 16 May 2010 12:04:00 -0000 [thread overview]
Message-ID: <4719101D-98D9-4000-9794-838695CDA95D@elis.ugent.be> (raw)
In-Reply-To: <20100515214421.GA9965@host0.dyn.jankratochvil.net>
[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]
On 15 May 2010, at 23:44, Jan Kratochvil wrote:
> But if the "allocation" is just an internal
> compiler issue which should be hidden by the same compiler at the DWARF level.
> Therefore I would guess to use some:
> drop DW_TAG_array_type -> DW_AT_allocated
> DW_TAG_subrange_type -> DW_AT_upper_bound:
> DW_OP_push_object_address
> DW_OP_deref
> DW_OP_dup
> DW_OP_bra allocated
> DW_OP_lit0
> DW_OP_skip end
> allocated:
> DW_OP_lit8
> DW_OP_minus
> DW_OP_deref
> end:
I agree. Joost, I've attached a patch for FPC's DWARF writer to fix it. I can't test whether it works (the dumped DWARF info looks ok though), because I can't get gdb/F-13 to build:
***
...
Patch #329 (gdb-6.8-bz254229-gcore-prpsinfo.patch):
+ patch -p1 -s
misordered hunks! output would be garbled
1 out of 3 hunks FAILED -- saving rejects to file bfd/elf.c.rej
error: Bad exit status from /var/tmp/rpm-tmp.88969 (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.88969 (%prep)
***
This is on a Scientific Linux 5.4 machine (which corresponds to RHEL 5.4). Maybe I need a newer version of the "patch" utility? (it has version 2.5.4)
Jonas
[-- Attachment #2: fpc-dwarf3-arrstrupperbound.patch --]
[-- Type: application/octet-stream, Size: 5270 bytes --]
Index: dbgdwarf.pas
===================================================================
--- dbgdwarf.pas (revision 15239)
+++ dbgdwarf.pas (working copy)
@@ -3558,9 +3558,6 @@
]);
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_push_object_address)));
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
- append_block1(DW_AT_allocated,2);
- current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_push_object_address)));
- current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
append_labelentry_ref(DW_AT_type,def_dwarf_lab(def.elementdef));
finish_entry;
@@ -3568,10 +3565,19 @@
append_entry(DW_TAG_subrange_type,false,[
DW_AT_byte_stride,DW_FORM_udata,def.elesize,
DW_AT_lower_bound,DW_FORM_udata,0,
- DW_AT_upper_bound,DW_FORM_block1,5
+ DW_AT_upper_bound,DW_FORM_block1,13
]);
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_push_object_address)));
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_dup)));
+ { pointer = nil? }
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_bra)));
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_16bit(4));
+ { yes -> length = 0 }
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit0)));
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_skip)));
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_16bit(3));
+ { no -> load length }
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit0)+sizeof(ptrint)));
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_minus)));
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
@@ -3607,13 +3613,6 @@
we point to address of the string
}
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
-
- { also add how to detect whether or not the string is allocated: if the pointer is 0
- then it isn't, otherwise it is
- }
- append_block1(DW_AT_allocated,2);
- current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_push_object_address)));
- current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
end
else
begin
@@ -3630,9 +3629,9 @@
if deref then
begin
if (chardef.size=1) then
- upperopcodes:=5
+ upperopcodes:=13
else
- upperopcodes:=7;
+ upperopcodes:=15;
{ lower bound is always 1, upper bound (length) needs to be calculated }
append_entry(DW_TAG_subrange_type,false,[
DW_AT_lower_bound,DW_FORM_udata,1,
@@ -3642,14 +3641,24 @@
{ high(string) is stored sizeof(ptrint) bytes before the string data }
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_push_object_address)));
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_dup)));
+ { pointer = nil? }
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_bra)));
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_16bit(4));
+ { yes -> length = 0 }
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit0)));
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_skip)));
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_16bit(3));
+ { no -> load length }
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit0)+sizeof(ptrint)));
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_minus)));
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref)));
+
{ for widestrings, the length is specified in bytes, so divide by two }
- if (upperopcodes=7) then
+ if (upperopcodes=15) then
begin
current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit1)));
- current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_shra)));
+ current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_shr)));
end;
end
else
next prev parent reply other threads:[~2010-05-16 12:04 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-14 14:45 Joost van der Sluis
2009-09-16 15:45 ` Jan Kratochvil
2009-09-16 18:18 ` Joost van der Sluis
2009-09-16 18:41 ` Jan Kratochvil
2009-09-16 19:09 ` Joost van der Sluis
2009-09-30 16:00 ` Joost van der Sluis
2009-10-04 14:17 ` Jan Kratochvil
2009-10-05 10:08 ` Joost van der Sluis
[not found] ` <1254737231.3257.20.camel@wsjoost.cnoc.lan>
2009-10-05 14:43 ` Jan Kratochvil
2009-10-28 17:35 ` Joost van der Sluis
2009-10-30 9:47 ` Jan Kratochvil
2009-11-07 21:49 ` Joost van der Sluis
2010-04-12 11:25 ` Joost van der Sluis
2010-04-12 19:51 ` Jan Kratochvil
2010-04-14 10:35 ` Joost van der Sluis
2010-05-06 23:05 ` Jan Kratochvil
2010-05-14 21:58 ` Joost van der Sluis
2010-05-14 22:46 ` Jan Kratochvil
2010-05-15 20:24 ` Joost van der Sluis
2010-05-15 21:44 ` Jan Kratochvil
2010-05-16 12:04 ` Jonas Maebe [this message]
2010-05-16 17:06 ` Joost van der Sluis
2010-05-16 17:31 ` Jan Kratochvil
2010-05-16 21:49 ` Jonas Maebe
2010-05-16 21:55 ` Jonas Maebe
2010-05-16 18:31 ` Jan Kratochvil
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=4719101D-98D9-4000-9794-838695CDA95D@elis.ugent.be \
--to=jonas.maebe@elis.ugent.be \
--cc=archer@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=joost@cnoc.nl \
/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).