forked from Imagelibrary/binutils-gdb
Compare commits
7 Commits
gdb-7.10-b
...
users/ARM/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23c16316b1 | ||
|
|
1be8e6826a | ||
|
|
0986596ce7 | ||
|
|
b311672cf5 | ||
|
|
39e1183fea | ||
|
|
439ccc8bd5 | ||
|
|
24ad6cefb1 |
@@ -1,4 +1,4 @@
|
||||
#define BFD_VERSION_DATE 20160210
|
||||
#define BFD_VERSION_DATE 20160923
|
||||
#define BFD_VERSION @bfd_version@
|
||||
#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@
|
||||
#define REPORT_BUGS_TO @report_bugs_to@
|
||||
|
||||
30
gdb/ChangeLog.arm
Normal file
30
gdb/ChangeLog.arm
Normal file
@@ -0,0 +1,30 @@
|
||||
2016-06-20 Thomas Preud'homme <thomas.preudhomme@arm.com>
|
||||
|
||||
Backport from mainline
|
||||
2016-05-23 Yao Qi <yao.qi@arm.com>
|
||||
|
||||
* arch-utils.c (default_code_of_frame_writable): New function.
|
||||
* arch-utils.h (default_code_of_frame_writable): Declare.
|
||||
* arm-tdep.c (arm_code_of_frame_writable): New function.
|
||||
(arm_gdbarch_init): Install gdbarch method
|
||||
code_of_frame_writable if the target is M-profile.
|
||||
* frame.c (skip_unwritable_frames): New function.
|
||||
* frame.h (skip_unwritable_frames): Declare.
|
||||
* gdbarch.sh (code_of_frame_writable): New.
|
||||
* gdbarch.c, gdbarch.h: Re-generated.
|
||||
* infcmd.c (finish_command): Call skip_unwritable_frames.
|
||||
|
||||
2016-03-29 Andre Vieira <andre.simoesdiasvieira@arm.com>
|
||||
|
||||
Backport from mainline
|
||||
2015-07-17 Yao Qi <yao.qi@linaro.org>
|
||||
* remote.c (get_current_thread): Initialise ptid to null_ptid.
|
||||
(add_current_inferior_and_thread): Don't initialise ptid.
|
||||
|
||||
2016-02-16 Andre Vieira <andre.simoesdiasvieira@arm.com>
|
||||
|
||||
Backport from mainline
|
||||
2016-02-04 Yao Qi <yao.qi@linaro.org>
|
||||
|
||||
* remote.c (remote_wait_as): Set rs->waiting_for_stop_reply to
|
||||
0 before handling 'F' and set it back afterwards.
|
||||
@@ -132,6 +132,13 @@ generic_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
default_code_of_frame_writable (struct gdbarch *gdbarch,
|
||||
struct frame_info *frame)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Helper functions for gdbarch_inner_than */
|
||||
|
||||
int
|
||||
|
||||
@@ -107,6 +107,9 @@ extern int generic_in_solib_return_trampoline (struct gdbarch *gdbarch,
|
||||
extern int generic_stack_frame_destroyed_p (struct gdbarch *gdbarch,
|
||||
CORE_ADDR pc);
|
||||
|
||||
extern int default_code_of_frame_writable (struct gdbarch *gdbarch,
|
||||
struct frame_info *frame);
|
||||
|
||||
/* By default, registers are not convertible. */
|
||||
extern int generic_convert_register_p (struct gdbarch *gdbarch, int regnum,
|
||||
struct type *type);
|
||||
|
||||
@@ -9903,6 +9903,22 @@ arm_register_g_packet_guesses (struct gdbarch *gdbarch)
|
||||
/* Otherwise we don't have a useful guess. */
|
||||
}
|
||||
|
||||
/* Implement the code_of_frame_writable gdbarch method. */
|
||||
|
||||
static int
|
||||
arm_code_of_frame_writable (struct gdbarch *gdbarch, struct frame_info *frame)
|
||||
{
|
||||
if (gdbarch_tdep (gdbarch)->is_m
|
||||
&& get_frame_type (frame) == SIGTRAMP_FRAME)
|
||||
{
|
||||
/* M-profile exception frames return to some magic PCs, where
|
||||
isn't writable at all. */
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* Initialize the current architecture based on INFO. If possible,
|
||||
re-use an architecture from ARCHES, which is a list of
|
||||
@@ -10353,6 +10369,9 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call);
|
||||
set_gdbarch_frame_align (gdbarch, arm_frame_align);
|
||||
|
||||
if (is_m)
|
||||
set_gdbarch_code_of_frame_writable (gdbarch, arm_code_of_frame_writable);
|
||||
|
||||
set_gdbarch_write_pc (gdbarch, arm_write_pc);
|
||||
|
||||
/* Frame handling. */
|
||||
|
||||
13
gdb/frame.c
13
gdb/frame.c
@@ -438,6 +438,19 @@ skip_artificial_frames (struct frame_info *frame)
|
||||
return frame;
|
||||
}
|
||||
|
||||
struct frame_info *
|
||||
skip_unwritable_frames (struct frame_info *frame)
|
||||
{
|
||||
while (gdbarch_code_of_frame_writable (get_frame_arch (frame), frame) == 0)
|
||||
{
|
||||
frame = get_prev_frame (frame);
|
||||
if (frame == NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
/* Compute the frame's uniq ID that can be used to, later, re-find the
|
||||
frame. */
|
||||
|
||||
|
||||
@@ -814,4 +814,9 @@ extern struct frame_info *create_new_frame (CORE_ADDR base, CORE_ADDR pc);
|
||||
extern int frame_unwinder_is (struct frame_info *fi,
|
||||
const struct frame_unwind *unwinder);
|
||||
|
||||
/* Return the first frame above FRAME or FRAME of which the code is
|
||||
writable. */
|
||||
|
||||
extern struct frame_info *skip_unwritable_frames (struct frame_info *frame);
|
||||
|
||||
#endif /* !defined (FRAME_H) */
|
||||
|
||||
@@ -204,6 +204,7 @@ struct gdbarch
|
||||
gdbarch_push_dummy_call_ftype *push_dummy_call;
|
||||
int call_dummy_location;
|
||||
gdbarch_push_dummy_code_ftype *push_dummy_code;
|
||||
gdbarch_code_of_frame_writable_ftype *code_of_frame_writable;
|
||||
gdbarch_print_registers_info_ftype *print_registers_info;
|
||||
gdbarch_print_float_info_ftype *print_float_info;
|
||||
gdbarch_print_vector_info_ftype *print_vector_info;
|
||||
@@ -384,6 +385,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
|
||||
gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
|
||||
gdbarch->deprecated_fp_regnum = -1;
|
||||
gdbarch->call_dummy_location = AT_ENTRY_POINT;
|
||||
gdbarch->code_of_frame_writable = default_code_of_frame_writable;
|
||||
gdbarch->print_registers_info = default_print_registers_info;
|
||||
gdbarch->print_float_info = default_print_float_info;
|
||||
gdbarch->register_sim_regno = legacy_register_sim_regno;
|
||||
@@ -539,6 +541,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
||||
/* Skip verify of push_dummy_call, has predicate. */
|
||||
/* Skip verify of call_dummy_location, invalid_p == 0 */
|
||||
/* Skip verify of push_dummy_code, has predicate. */
|
||||
/* Skip verify of code_of_frame_writable, invalid_p == 0 */
|
||||
/* Skip verify of print_registers_info, invalid_p == 0 */
|
||||
/* Skip verify of print_float_info, invalid_p == 0 */
|
||||
/* Skip verify of print_vector_info, has predicate. */
|
||||
@@ -788,6 +791,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: char_signed = %s\n",
|
||||
plongest (gdbarch->char_signed));
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: code_of_frame_writable = <%s>\n",
|
||||
host_address_to_string (gdbarch->code_of_frame_writable));
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: coff_make_msymbol_special = <%s>\n",
|
||||
host_address_to_string (gdbarch->coff_make_msymbol_special));
|
||||
@@ -2260,6 +2266,23 @@ set_gdbarch_push_dummy_code (struct gdbarch *gdbarch,
|
||||
gdbarch->push_dummy_code = push_dummy_code;
|
||||
}
|
||||
|
||||
int
|
||||
gdbarch_code_of_frame_writable (struct gdbarch *gdbarch, struct frame_info *frame)
|
||||
{
|
||||
gdb_assert (gdbarch != NULL);
|
||||
gdb_assert (gdbarch->code_of_frame_writable != NULL);
|
||||
if (gdbarch_debug >= 2)
|
||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_code_of_frame_writable called\n");
|
||||
return gdbarch->code_of_frame_writable (gdbarch, frame);
|
||||
}
|
||||
|
||||
void
|
||||
set_gdbarch_code_of_frame_writable (struct gdbarch *gdbarch,
|
||||
gdbarch_code_of_frame_writable_ftype code_of_frame_writable)
|
||||
{
|
||||
gdbarch->code_of_frame_writable = code_of_frame_writable;
|
||||
}
|
||||
|
||||
void
|
||||
gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all)
|
||||
{
|
||||
|
||||
@@ -382,6 +382,12 @@ typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (struct gdbarch *gdbarch, CORE
|
||||
extern CORE_ADDR gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache);
|
||||
extern void set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype *push_dummy_code);
|
||||
|
||||
/* Return true if the code of FRAME is writable. */
|
||||
|
||||
typedef int (gdbarch_code_of_frame_writable_ftype) (struct gdbarch *gdbarch, struct frame_info *frame);
|
||||
extern int gdbarch_code_of_frame_writable (struct gdbarch *gdbarch, struct frame_info *frame);
|
||||
extern void set_gdbarch_code_of_frame_writable (struct gdbarch *gdbarch, gdbarch_code_of_frame_writable_ftype *code_of_frame_writable);
|
||||
|
||||
typedef void (gdbarch_print_registers_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
|
||||
extern void gdbarch_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all);
|
||||
extern void set_gdbarch_print_registers_info (struct gdbarch *gdbarch, gdbarch_print_registers_info_ftype *print_registers_info);
|
||||
|
||||
@@ -478,6 +478,9 @@ M:CORE_ADDR:push_dummy_call:struct value *function, struct regcache *regcache, C
|
||||
v:int:call_dummy_location::::AT_ENTRY_POINT::0
|
||||
M:CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache:sp, funaddr, args, nargs, value_type, real_pc, bp_addr, regcache
|
||||
|
||||
# Return true if the code of FRAME is writable.
|
||||
m:int:code_of_frame_writable:struct frame_info *frame:frame::default_code_of_frame_writable::0
|
||||
|
||||
m:void:print_registers_info:struct ui_file *file, struct frame_info *frame, int regnum, int all:file, frame, regnum, all::default_print_registers_info::0
|
||||
m:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args::default_print_float_info::0
|
||||
M:void:print_vector_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
|
||||
|
||||
@@ -1902,7 +1902,14 @@ finish_command (char *arg, int from_tty)
|
||||
if (execution_direction == EXEC_REVERSE)
|
||||
finish_backward (function);
|
||||
else
|
||||
finish_forward (function, frame);
|
||||
{
|
||||
frame = skip_unwritable_frames (frame);
|
||||
|
||||
if (frame == NULL)
|
||||
error (_("Cannot find the caller frame."));
|
||||
|
||||
finish_forward (function, frame);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
12
gdb/remote.c
12
gdb/remote.c
@@ -3507,7 +3507,7 @@ stop_reply_extract_thread (char *stop_reply)
|
||||
static ptid_t
|
||||
get_current_thread (char *wait_status)
|
||||
{
|
||||
ptid_t ptid;
|
||||
ptid_t ptid = null_ptid;
|
||||
|
||||
/* Note we don't use remote_parse_stop_reply as that makes use of
|
||||
the target architecture, which we haven't yet fully determined at
|
||||
@@ -3536,7 +3536,7 @@ add_current_inferior_and_thread (char *wait_status)
|
||||
{
|
||||
struct remote_state *rs = get_remote_state ();
|
||||
int fake_pid_p = 0;
|
||||
ptid_t ptid = null_ptid;
|
||||
ptid_t ptid;
|
||||
|
||||
inferior_ptid = null_ptid;
|
||||
|
||||
@@ -6359,8 +6359,16 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options)
|
||||
status->value.sig = GDB_SIGNAL_0;
|
||||
break;
|
||||
case 'F': /* File-I/O request. */
|
||||
/* GDB may access the inferior memory while handling the File-I/O
|
||||
request, but we don't want GDB accessing memory while waiting
|
||||
for a stop reply. See the comments in putpkt_binary. Set
|
||||
waiting_for_stop_reply to 0 temporarily. */
|
||||
rs->waiting_for_stop_reply = 0;
|
||||
remote_fileio_request (buf, rs->ctrlc_pending_p);
|
||||
rs->ctrlc_pending_p = 0;
|
||||
/* GDB handled the File-I/O request, and the target is running
|
||||
again. Keep waiting for events. */
|
||||
rs->waiting_for_stop_reply = 1;
|
||||
break;
|
||||
case 'T': case 'S': case 'X': case 'W':
|
||||
{
|
||||
|
||||
7
gdb/testsuite/ChangeLog.arm
Normal file
7
gdb/testsuite/ChangeLog.arm
Normal file
@@ -0,0 +1,7 @@
|
||||
2016-04-05 Thomas Preud'homme <thomas.preudhomme@arm.com>
|
||||
|
||||
Backport from master
|
||||
2015-12-22 Thomas Preud'homme <thomas.preudhomme@arm.com>
|
||||
|
||||
* lib/mi-support.exp (mi_run_cmd_full): Add an expect for the CLI jump
|
||||
case.
|
||||
@@ -900,6 +900,9 @@ proc mi_run_cmd_full {use_mi_command args} {
|
||||
# to better handle RUN.
|
||||
send_gdb "jump *$start\n"
|
||||
warning "Using CLI jump command, expect run-to-main FAIL"
|
||||
gdb_expect {
|
||||
-re "${run_match}&\"jump \\*${start}\\n\"\[\r\n\]+~\"Continuing at 0x\[0-9A-Fa-f\]+\\n.\"\[\r\n\]+\^running\[\r\n\]+\\*running,thread-id=\"\[^\"\]+\"\r\n${mi_gdb_prompt}" {}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user