From: Waldek Hebisch <hebisch@math.uni.wroc.pl>
To: gdb-patches@sources.redhat.com
Subject: PATCH: Read Dwarf2 info from Pascal
Date: Thu, 12 May 2005 13:37:00 -0000 [thread overview]
Message-ID: <E1DWDhl-0003ag-00@hera.math.uni.wroc.pl> (raw)
The patch below adds Pascal support to `dwarf2read.c':
- reading Dwarf2 info about sets
- recognizing the language as Pascal
- allowing namespace declaration (modules) for Pascal
Without the patch gdb can not be used with new versions of Gnu Pascal
(at least in default mode): gpc based of gcc-3.x defaults to Dwarf2
debug info (and gdb stops working once a set is found).
The patch is against gdb-6.3, but applies to cvs version (from May 7):
I have tested it on Debian Woody and the patch coused no new test failures
(however, unpatched cvs version had 55 unexpected test failures).
The patch is an updated version of the patch I attached to PR 1477 (BTW,
is anybody looking at Pascal problems?).
If OK please apply, I have no CVS write access. The patch is small, so
I hope it can go in without legal problems, but if needed I will
fill the copyright assignment to FSF.
ChangeLog:
2005-05-04 Waldek Hebisch (hebisch@math.uni.wroc.pl)
* dwarf2read.c: Add Pascal support.
--- gdb-6.3.orig/gdb/dwarf2read.c 2004-10-16 02:41:00.000000000 +0200
+++ gdb-6.3/gdb/dwarf2read.c 2005-05-06 20:28:41.000000000 +0200
@@ -913,6 +913,8 @@
static void read_enumeration_type (struct die_info *, struct dwarf2_cu *);
+static void read_set_type (struct die_info *, struct dwarf2_cu *);
+
static void process_enumeration_scope (struct die_info *, struct dwarf2_cu *);
static struct type *dwarf_base_type (int, int, struct dwarf2_cu *);
@@ -2648,6 +2650,9 @@
read_enumeration_type (die, cu);
process_enumeration_scope (die, cu);
break;
+ case DW_TAG_set_type:
+ read_set_type (die, cu);
+ break;
/* FIXME drow/2004-03-14: These initialize die->type, but do not create
a symbol or process any children. Therefore it doesn't do anything
@@ -4009,6 +4014,24 @@
return new_prefix;
}
+static void
+read_set_type (struct die_info * die, struct dwarf2_cu *cu)
+{
+ struct type *domain_type;
+
+ /* Return if we've already decoded this type. */
+ if (die->type)
+ {
+ return;
+ }
+
+ domain_type = die_type (die, cu);
+
+ die->type = create_set_type (NULL, domain_type);
+
+}
+
+
/* Given a pointer to a die which begins an enumeration, process all
the dies that define the members of the enumeration, and create the
symbol for the enumeration type.
@@ -6096,9 +6119,11 @@
case DW_LANG_Ada95:
cu->language = language_ada;
break;
+ case DW_LANG_Pascal83:
+ cu->language = language_pascal;
+ break;
case DW_LANG_Cobol74:
case DW_LANG_Cobol85:
- case DW_LANG_Pascal83:
case DW_LANG_Modula2:
default:
cu->language = language_minimal;
@@ -6861,6 +6886,7 @@
case DW_TAG_structure_type:
case DW_TAG_union_type:
case DW_TAG_enumeration_type:
+ case DW_TAG_set_type:
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
@@ -7182,6 +7208,9 @@
case DW_TAG_enumeration_type:
read_enumeration_type (die, cu);
break;
+ case DW_TAG_set_type:
+ read_set_type (die, cu);
+ break;
case DW_TAG_subprogram:
case DW_TAG_subroutine_type:
read_subroutine_type (die, cu);
@@ -7239,7 +7268,8 @@
struct die_info *parent;
if (cu->language != language_cplus
- && cu->language != language_java)
+ && cu->language != language_java
+ && cu->language != language_pascal)
return NULL;
parent = die->parent;
--
Waldek Hebisch
hebisch@math.uni.wroc.pl
next reply other threads:[~2005-05-12 13:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-12 13:37 Waldek Hebisch [this message]
2005-05-12 13:44 ` Pierre Muller
2005-05-12 14:37 ` Waldek Hebisch
2005-05-18 2:23 ` 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=E1DWDhl-0003ag-00@hera.math.uni.wroc.pl \
--to=hebisch@math.uni.wroc.pl \
--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