diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2022-07-28 11:33:50 -0700 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2022-07-28 12:49:51 -0700 |
| commit | 71d65c149ea2812e70a0bb65c26cdc2d8160d50b (patch) | |
| tree | fa94e4c78109502a25812ddce310ad54504262e1 /meta-microblaze | |
| parent | 9c7ac2f2b0d4c03eff3be9afa641189125ef8375 (diff) | |
| download | meta-xilinx-71d65c149ea2812e70a0bb65c26cdc2d8160d50b.tar.gz | |
gdb: Fix error in inline_frame_sniffer
Depth: Total number of inline functions [refer inline-frame.c]
state->skipped_frames : Number of inline functions skipped.
the current unwind_pc is causing an issue when we try to step into inline functions[Depth is becoming 0].
It’s incrementing pc by 8 even with si instruction.
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-microblaze')
| -rw-r--r-- | meta-microblaze/recipes-devtools/gdb/gdb-microblaze.inc | 1 | ||||
| -rw-r--r-- | meta-microblaze/recipes-devtools/gdb/gdb/0011-Patch-Microblaze-Depth-Total-number.patch | 61 |
2 files changed, 62 insertions, 0 deletions
diff --git a/meta-microblaze/recipes-devtools/gdb/gdb-microblaze.inc b/meta-microblaze/recipes-devtools/gdb/gdb-microblaze.inc index da91a1b7..1df17062 100644 --- a/meta-microblaze/recipes-devtools/gdb/gdb-microblaze.inc +++ b/meta-microblaze/recipes-devtools/gdb/gdb-microblaze.inc | |||
| @@ -15,4 +15,5 @@ SRC_URI:append:microblaze = " \ | |||
| 15 | file://0008-Patch-MicroBlaze-these-changes-will-make-64-bit-vect.patch \ | 15 | file://0008-Patch-MicroBlaze-these-changes-will-make-64-bit-vect.patch \ |
| 16 | file://0009-Patch-MicroBlaze-Added-m64-abi-for-64-bit-target-des.patch \ | 16 | file://0009-Patch-MicroBlaze-Added-m64-abi-for-64-bit-target-des.patch \ |
| 17 | file://0010-Patch-MicroBlaze-Code-changes-for-gdbserver.patch \ | 17 | file://0010-Patch-MicroBlaze-Code-changes-for-gdbserver.patch \ |
| 18 | file://0011-Patch-Microblaze-Depth-Total-number.patch \ | ||
| 18 | " | 19 | " |
diff --git a/meta-microblaze/recipes-devtools/gdb/gdb/0011-Patch-Microblaze-Depth-Total-number.patch b/meta-microblaze/recipes-devtools/gdb/gdb/0011-Patch-Microblaze-Depth-Total-number.patch new file mode 100644 index 00000000..0e9c1a74 --- /dev/null +++ b/meta-microblaze/recipes-devtools/gdb/gdb/0011-Patch-Microblaze-Depth-Total-number.patch | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | From 1f6eef2eb2e6974ba9989977d1b1c8dfdeca94f4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mahesh Bodapati <mbodapat@xilinx.com> | ||
| 3 | Date: Thu, 21 Jul 2022 11:45:01 +0530 | ||
| 4 | Subject: [PATCH] =?UTF-8?q?[Patch,MicroBlaze]:=20Depth:=20=20Total=20numbe?= | ||
| 5 | =?UTF-8?q?r=20of=20inline=20functions=20[refer=20inline-frame.c]=20state-?= | ||
| 6 | =?UTF-8?q?>skipped=5Fframes=20:=20Number=20of=20inline=20functions=20skip?= | ||
| 7 | =?UTF-8?q?ped.=20the=20current=20unwind=5Fpc=20is=20causing=20an=20issue?= | ||
| 8 | =?UTF-8?q?=20when=20we=20try=20to=20step=20into=20inline=20functions[Dept?= | ||
| 9 | =?UTF-8?q?h=20is=20becoming=200].=20It=E2=80=99s=20incrementing=20pc=20by?= | ||
| 10 | =?UTF-8?q?=208=20even=20with=20si=20instruction.?= | ||
| 11 | MIME-Version: 1.0 | ||
| 12 | Content-Type: text/plain; charset=UTF-8 | ||
| 13 | Content-Transfer-Encoding: 8bit | ||
| 14 | |||
| 15 | --- | ||
| 16 | gdb/microblaze-tdep.c | 14 +++----------- | ||
| 17 | 1 file changed, 3 insertions(+), 11 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c | ||
| 20 | index aad6a9cae6e..41a2eb511d6 100644 | ||
| 21 | --- a/gdb/microblaze-tdep.c | ||
| 22 | +++ b/gdb/microblaze-tdep.c | ||
| 23 | @@ -524,16 +524,8 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, | ||
| 24 | static CORE_ADDR | ||
| 25 | microblaze_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) | ||
| 26 | { | ||
| 27 | - gdb_byte buf[4]; | ||
| 28 | CORE_ADDR pc; | ||
| 29 | - | ||
| 30 | - frame_unwind_register (next_frame, MICROBLAZE_PC_REGNUM, buf); | ||
| 31 | - pc = extract_typed_address (buf, builtin_type (gdbarch)->builtin_func_ptr); | ||
| 32 | - /* For sentinel frame, return address is actual PC. For other frames, | ||
| 33 | - return address is pc+8. This is a workaround because gcc does not | ||
| 34 | - generate correct return address in CIE. */ | ||
| 35 | - if (frame_relative_level (next_frame) >= 0) | ||
| 36 | - pc += 8; | ||
| 37 | + pc=frame_unwind_register_unsigned (next_frame, MICROBLAZE_PC_REGNUM); | ||
| 38 | return pc; | ||
| 39 | } | ||
| 40 | |||
| 41 | @@ -564,7 +556,6 @@ microblaze_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) | ||
| 42 | ostart_pc = microblaze_analyze_prologue (gdbarch, func_start, 0xffffffffUL, | ||
| 43 | &cache); | ||
| 44 | |||
| 45 | - | ||
| 46 | if (ostart_pc > start_pc) | ||
| 47 | return ostart_pc; | ||
| 48 | return start_pc; | ||
| 49 | @@ -670,7 +661,8 @@ static const struct frame_unwind microblaze_frame_unwind = | ||
| 50 | microblaze_frame_this_id, | ||
| 51 | microblaze_frame_prev_register, | ||
| 52 | NULL, | ||
| 53 | - default_frame_sniffer | ||
| 54 | + default_frame_sniffer, | ||
| 55 | + NULL, | ||
| 56 | }; | ||
| 57 | |||
| 58 | static CORE_ADDR | ||
| 59 | -- | ||
| 60 | 2.17.1 | ||
| 61 | |||
