• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisionb084d499897043f621ec43c38594957e859ee884 (tree)
Time2008-10-01 01:57:37
AuthorJoel Brobecker <brobecker@gnat...>
CommiterJoel Brobecker

Log Message

        • dwarf2read.c (dwarf2_get_subprogram_pc_bounds): New function.
          (get_scope_pc_bounds): Use it.

Change Summary

Incremental Difference

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
1+2008-09-30 Joel Brobecker <brobecker@adacore.com>
2+
3+ * dwarf2read.c (dwarf2_get_subprogram_pc_bounds): New function.
4+ (get_scope_pc_bounds): Use it.
5+
16 2008-09-27 Tom Tromey <tromey@redhat.com>
27
38 * NEWS: Update.
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3324,6 +3324,43 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
33243324 return ret;
33253325 }
33263326
3327+/* Assuming that DIE represents a subprogram DIE or a lexical block, get
3328+ its low and high PC addresses. Do nothing if these addresses could not
3329+ be determined. Otherwise, set LOWPC to the low address if it is smaller,
3330+ and HIGHPC to the high address if greater than HIGHPC. */
3331+
3332+static void
3333+dwarf2_get_subprogram_pc_bounds (struct die_info *die,
3334+ CORE_ADDR *lowpc, CORE_ADDR *highpc,
3335+ struct dwarf2_cu *cu)
3336+{
3337+ CORE_ADDR low, high;
3338+ struct die_info *child = die->child;
3339+
3340+ if (dwarf2_get_pc_bounds (die, &low, &high, cu))
3341+ {
3342+ *lowpc = min (*lowpc, low);
3343+ *highpc = max (*highpc, high);
3344+ }
3345+
3346+ /* If the language does not allow nested subprograms (either inside
3347+ subprograms or lexical blocks), we're done. */
3348+ if (cu->language != language_ada)
3349+ return;
3350+
3351+ /* Check all the children of the given DIE. If it contains nested
3352+ subprograms, then check their pc bounds. Likewise, we need to
3353+ check lexical blocks as well, as they may also contain subprogram
3354+ definitions. */
3355+ while (child && child->tag)
3356+ {
3357+ if (child->tag == DW_TAG_subprogram
3358+ || child->tag == DW_TAG_lexical_block)
3359+ dwarf2_get_subprogram_pc_bounds (child, lowpc, highpc, cu);
3360+ child = sibling_die (child);
3361+ }
3362+}
3363+
33273364 /* Get the low and high pc's represented by the scope DIE, and store
33283365 them in *LOWPC and *HIGHPC. If the correct values can't be
33293366 determined, set *LOWPC to -1 and *HIGHPC to 0. */
@@ -3350,11 +3387,7 @@ get_scope_pc_bounds (struct die_info *die,
33503387 {
33513388 switch (child->tag) {
33523389 case DW_TAG_subprogram:
3353- if (dwarf2_get_pc_bounds (child, &current_low, &current_high, cu))
3354- {
3355- best_low = min (best_low, current_low);
3356- best_high = max (best_high, current_high);
3357- }
3390+ dwarf2_get_subprogram_pc_bounds (child, &best_low, &best_high, cu);
33583391 break;
33593392 case DW_TAG_namespace:
33603393 /* FIXME: carlton/2004-01-16: Should we do this for