Waldek Hebisch a écrit:
Maurice Lombardi wrote:
I have tried for the first time to use dwarf-2 debugging with the last gpc version (20030507 / gcc 3.2.2) and DJGPP (it is the default now). I use either gdb 5.3 (last djgpp distribution) or rhide 1.5.0.1 (last snapshot, said to incorporate the same gdb version). In any case when I try to set a breakpoint, I obtain an error message:
internal error - unimplemented function unk_lang_create_fundamental_type called.
Any other experience on other systems / version ?
Everything is correct with stabs debugging, and also when debugging C programs.
Appearently gdb cannot recognise Pascal when using Dwarf-2. The following _very experimental_ patch make gdb treat unknown language as C -- it allows to debug at least some Pascal programs
diff -ru gdb-5.2.1.orig/gdb/language.c gdb-5.2.1/gdb/language.c --- gdb-5.2.1.orig/gdb/language.c Wed Feb 13 19:49:30 2002 +++ gdb-5.2.1/gdb/language.c Wed Dec 4 20:38:12 2002 @@ -99,7 +99,7 @@ static int unk_lang_value_print (struct value *, struct ui_file *, int, enum val_prettyprint);
/* Forward declaration */ -extern const struct language_defn unknown_language_defn; +extern struct language_defn unknown_language_defn;
/* The current (default at startup) state of type and range checking. (If the modes are set to "auto", though, these are changed based @@ -1453,6 +1453,10 @@ {NULL, OP_NULL, PREC_NULL, 0} };
+#if 1 +extern const struct language_defn asm_language_defn; +struct language_defn unknown_language_defn; +#else const struct language_defn unknown_language_defn = { "unknown", @@ -1481,6 +1485,7 @@ &builtin_type_char, /* Type of string elements */ LANG_MAGIC }; +#endif
/* These two structs define fake entries for the "local" and "auto" options. */ const struct language_defn auto_language_defn = @@ -1594,7 +1599,10 @@ show = add_show_from_set (set, &showlist); set_cmd_cfunc (set, set_case_command); set_cmd_cfunc (show, show_case_command);
- unknown_language_defn = asm_language_defn;
- unknown_language_defn.la_name = "unknown";
- unknown_language_defn.la_language = language_unknown; add_language (&unknown_language_defn); add_language (&local_language_defn); add_language (&auto_language_defn);
Works approximately indeed. Pascal is recognized:
(gdb) show language The current source language is "auto; currently pascal".
but casing of identifiers is no more correct: when you ask to print some identifier, it was tested in turn casing as typed in gdb First Letter only capitalized, ALL LETTERS capitalized This was quite handy and is broken: casing as typed gives the correct answer First Letter capitalized gives 0 ALL LETTERS capitalized gived an error message: no symbol "LETTERS" in current context.
Better to still use stabs debugging, for which all this works, until we hear from Pierre Muller, the gdb / pascal maintainer
Maurice