aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@netbsd.org>2002-04-21 17:30:09 +0000
committerJason Thorpe <thorpej@netbsd.org>2002-04-21 17:30:09 +0000
commitd9b023ccd41c119362f440ab9dabc61613beb577 (patch)
tree9614ea542b0f20e63ca3ae6e80edd62a9e951edc /gdb
parentdc129d82386b3ae4a511f9f60a76ac481d33d304 (diff)
downloadgdb-d9b023ccd41c119362f440ab9dabc61613beb577.zip
gdb-d9b023ccd41c119362f440ab9dabc61613beb577.tar.gz
gdb-d9b023ccd41c119362f440ab9dabc61613beb577.tar.bz2
* alpha-tdep.h (gdbarch_tdep): Add vm_min_address member.
* alpha-tdep.c (heuristic_proc_start): Use vm_min_address from gdbarch_tdep rather than a constant. (alpha_gdbarch_init): Initialize tdep->vm_min_address to the default text address for all Alpha Unix ABIs. (alpha_dump_tdep): Report the value of tdep->vm_min_address. * config/alpha/tm-alpha.h (VM_MIN_ADDRESS): Delete.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/alpha-tdep.c15
-rw-r--r--gdb/alpha-tdep.h2
-rw-r--r--gdb/config/alpha/tm-alpha.h5
4 files changed, 24 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1909f75..4e6b926 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,15 @@
2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
+ * alpha-tdep.h (gdbarch_tdep): Add vm_min_address member.
+ * alpha-tdep.c (heuristic_proc_start): Use vm_min_address
+ from gdbarch_tdep rather than a constant.
+ (alpha_gdbarch_init): Initialize tdep->vm_min_address to
+ the default text address for all Alpha Unix ABIs.
+ (alpha_dump_tdep): Report the value of tdep->vm_min_address.
+ * config/alpha/tm-alpha.h (VM_MIN_ADDRESS): Delete.
+
+2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
+
* alpha-tdep.h: New file. Includes several Alpha target constants
taken from...
* config/alpha/tm-alpha.h: ...here. Remove macros that we now
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 7d99cf5..dfefa46 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -617,6 +617,7 @@ alpha_about_to_return (CORE_ADDR pc)
static CORE_ADDR
heuristic_proc_start (CORE_ADDR pc)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
CORE_ADDR start_pc = pc;
CORE_ADDR fence = start_pc - heuristic_fence_post;
@@ -624,8 +625,8 @@ heuristic_proc_start (CORE_ADDR pc)
return 0;
if (heuristic_fence_post == UINT_MAX
- || fence < VM_MIN_ADDRESS)
- fence = VM_MIN_ADDRESS;
+ || fence < tdep->vm_min_address)
+ fence = tdep->vm_min_address;
/* search back for previous return */
for (start_pc -= 4;; start_pc -= 4)
@@ -639,7 +640,7 @@ heuristic_proc_start (CORE_ADDR pc)
{
static int blurb_printed = 0;
- if (fence == VM_MIN_ADDRESS)
+ if (fence == tdep->vm_min_address)
warning ("Hit beginning of text section without finding");
else
warning ("Hit heuristic-fence-post without finding");
@@ -1960,6 +1961,10 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->abi_name = "<invalid>";
}
+ /* Lowest text address. This is used by heuristic_proc_start() to
+ decide when to stop looking. */
+ tdep->vm_min_address = (CORE_ADDR) 0x120000000;
+
/* Type sizes */
set_gdbarch_short_bit (gdbarch, 16);
set_gdbarch_int_bit (gdbarch, 32);
@@ -2073,6 +2078,10 @@ alpha_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
internal_error (__FILE__, __LINE__,
"alpha_dump_tdep: illegal setting of tdep->alpha_abi (%d)",
(int) tdep->alpha_abi);
+
+ fprintf_unfiltered (file,
+ "alpha_dump_tdep: vm_min_address = 0x%lx\n",
+ (long) tdep->vm_min_address);
}
void
diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h
index fe2716e..b5e7218 100644
--- a/gdb/alpha-tdep.h
+++ b/gdb/alpha-tdep.h
@@ -94,6 +94,8 @@ struct gdbarch_tdep
{
enum alpha_abi alpha_abi; /* OS/ABI of inferior. */
const char *abi_name; /* Name of the above. */
+
+ CORE_ADDR vm_min_address; /* used by heuristic_proc_start */
};
#endif /* ALPHA_TDEP_H */
diff --git a/gdb/config/alpha/tm-alpha.h b/gdb/config/alpha/tm-alpha.h
index 286f672..450b2ec 100644
--- a/gdb/config/alpha/tm-alpha.h
+++ b/gdb/config/alpha/tm-alpha.h
@@ -99,11 +99,6 @@ extern void alpha_print_extra_frame_info (struct frame_info *);
alpha_setup_arbitrary_frame (argc, argv)
extern struct frame_info *alpha_setup_arbitrary_frame (int, CORE_ADDR *);
-/* This is used by heuristic_proc_start. It should be shot it the head. */
-#ifndef VM_MIN_ADDRESS
-#define VM_MIN_ADDRESS (CORE_ADDR)0x120000000
-#endif
-
/* If PC is in a shared library trampoline code, return the PC
where the function itself actually starts. If not, return 0. */
#define SKIP_TRAMPOLINE_CODE(pc) find_solib_trampoline_target (pc)