aboutsummaryrefslogtreecommitdiff
path: root/gdb/avr-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/avr-tdep.c')
-rw-r--r--gdb/avr-tdep.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 71c7796..b245332 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -31,6 +31,7 @@
#include "symfile.h"
#include "arch-utils.h"
#include "regcache.h"
+#include "gdb_string.h"
/* AVR Background:
@@ -158,7 +159,7 @@ struct gdbarch_tdep
/* Lookup the name of a register given it's number. */
-static char *
+static const char *
avr_register_name (int regnum)
{
static char *register_names[] = {
@@ -995,7 +996,14 @@ avr_skip_prologue (CORE_ADDR pc)
{
sal = find_pc_line (func_addr, 0);
- if (sal.line != 0 && sal.end < func_end)
+ /* troth/2002-08-05: For some very simple functions, gcc doesn't
+ generate a prologue and the sal.end ends up being the 2-byte ``ret''
+ instruction at the end of the function, but func_end ends up being
+ the address of the first instruction of the _next_ function. By
+ adjusting func_end by 2 bytes, we can catch these functions and not
+ return sal.end if it is the ``ret'' instruction. */
+
+ if (sal.line != 0 && sal.end < (func_end-2))
return sal.end;
}
@@ -1230,18 +1238,18 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_address_to_pointer (gdbarch, avr_address_to_pointer);
set_gdbarch_pointer_to_address (gdbarch, avr_pointer_to_address);
- set_gdbarch_extract_return_value (gdbarch, avr_extract_return_value);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, avr_extract_return_value);
set_gdbarch_push_arguments (gdbarch, avr_push_arguments);
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
/* set_gdbarch_push_return_address (gdbarch, avr_push_return_address); */
set_gdbarch_pop_frame (gdbarch, avr_pop_frame);
- set_gdbarch_store_return_value (gdbarch, avr_store_return_value);
+ set_gdbarch_deprecated_store_return_value (gdbarch, avr_store_return_value);
set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention);
set_gdbarch_store_struct_return (gdbarch, avr_store_struct_return);
- set_gdbarch_extract_struct_value_address (gdbarch,
- avr_extract_struct_value_address);
+ set_gdbarch_deprecated_extract_struct_value_address
+ (gdbarch, avr_extract_struct_value_address);
set_gdbarch_frame_init_saved_regs (gdbarch, avr_scan_prologue);
set_gdbarch_init_extra_frame_info (gdbarch, avr_init_extra_frame_info);