From: Randolph Chung <randolph@tausq.org>
To: John David Anglin <dave@hiauly1.hia.nrc.ca>,
Joel Brobecker <brobecker@adacore.com>,
gdb@sources.redhat.com
Subject: [hpux] interesting but difficult to unwind code
Date: Fri, 09 Dec 2005 00:08:00 -0000 [thread overview]
Message-ID: <4398CAEE.8030409@tausq.org> (raw)
Here's a case that gdb cannot handle. This is from a piece of code that
is probably compiled by the HP compiler -- it is HP's wdb.
Interestingly, neither wdb or gdb can unwind through execute_command().
The code seems to include a few interesting features:
1) it has a branch right in the middle of the prologue at +16. This is a
call to strlen()
2) It contains a stack adjustment beyond what is marked in the unwind
info. This is probably due to alloca(). Note that there is nothing in
the unwind data that indicates this. The line of code in wdb that
generates this is probably:
save_line = (char *) alloca (strlen (p) + 1);
(gdb) disassemble 0xcb52f
Dump of assembler code for function execute_command:
0x000cb44c <execute_command+0>: stw rp,-14(sp)
0x000cb450 <execute_command+4>: stw,ma r3,80(sp)
0x000cb454 <execute_command+8>: ldo 0(sp),r3
0x000cb458 <execute_command+12>: stw r26,-a4(r3)
0x000cb45c <execute_command+16>: b,l 0xcb41c <execute_command+24>,rp
0x000cb460 <execute_command+20>: stw r25,-a8(r3)
0x000cb464 <execute_command+24>: stw r4,-7c(r3)
0x000cb468 <execute_command+28>: ldo 1(ret0),ret1
0x000cb46c <execute_command+32>: stw r5,-78(r3)
0x000cb470 <execute_command+36>: stw r6,-74(r3)
0x000cb474 <execute_command+40>: ldw -10(sp),r26
0x000cb478 <execute_command+44>: ldw -4(sp),r19
0x000cb47c <execute_command+48>: addi 3f,ret1,r1
0x000cb480 <execute_command+52>: depwi 0,31,6,r1
0x000cb484 <execute_command+56>: ldi 38,rp
0x000cb488 <execute_command+60>: sub sp,rp,ret1
0x000cb48c <execute_command+64>: add sp,r1,sp
0x000cb490 <execute_command+68>: stw r19,-4(sp)
0x000cb494 <execute_command+72>: stw r26,-10(sp)
0x000cb498 <execute_command+76>: ldw -a4(r3),r25
0x000cb49c <execute_command+80>: ldo 0(ret1),r26
0x000cb4a0 <execute_command+84>: b,l 0xcb424 <execute_command+32>,rp
(gdb) maintenance print unwind execute_command
unwind_table_entry (0x40286424):
region_start = 0xcb44c <execute_command>
region_end = 0xcb798 <execute_command+844>
flags = Args_stored Save_RP
Region_description = 0x0
Entry_FR = 0x0
Entry_GR = 0x4
Total_frame_size = 0x10
I'm not sure if this is really ABI compliant.....
Any suggestions on what we can do here?
randolph
next reply other threads:[~2005-12-09 0:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-09 0:08 Randolph Chung [this message]
2005-12-09 0:44 ` John David Anglin
2005-12-09 3:33 ` Randolph Chung
2005-12-09 4:55 ` John David Anglin
2005-12-09 18:47 Carl Burch
2005-12-10 0:43 ` John David Anglin
2005-12-11 14:45 ` Randolph Chung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4398CAEE.8030409@tausq.org \
--to=randolph@tausq.org \
--cc=brobecker@adacore.com \
--cc=dave@hiauly1.hia.nrc.ca \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox