Simon Marchi
3dc9dde26d
gdb: add prepare_reinflate/reinflate around print_frame_args in info_frame_command_core
...
I noticed this crash:
$ ./gdb --data-directory=data-directory -nx -q \
testsuite/outputs/gdb.python/pretty-print-call-by-hand/pretty-print-call-by-hand \
-x testsuite/outputs/gdb.python/pretty-print-call-by-hand/pretty-print-call-by-hand.py \
-ex "b g" -ex r
(gdb) info frame
Stack level 0, frame at 0x7fffffffdd80:
rip = 0x555555555160 in g
(/home/simark/src/binutils-gdb/gdb/testsuite/gdb.python/pretty-print-call-by-hand.c:41); saved rip = 0x5555555551a3
called by frame at 0x7fffffffdda0
source language c.
Arglist at 0x7fffffffdd70, args: mt=mytype is 0x555555556004 "hello world",
depth=10
Fatal signal: Segmentation fault
This is another case of frame_info being invalidated under a function's
feet. The stack trace when the frame_info get invalidated looks like:
... many frames to pretty print the arg, that eventually invalidate the frame_infos ...
#35 0x00005568d0a8ab24 in print_frame_arg (fp_opts=..., arg=0x7ffc3216bcb0) at /home/simark/src/binutils-gdb/gdb/stack.c:489
#36 0x00005568d0a8cc75 in print_frame_args (fp_opts=..., func=0x621000233210, frame=..., num=-1, stream=0x60b000000300)
at /home/simark/src/binutils-gdb/gdb/stack.c:898
#37 0x00005568d0a9536d in info_frame_command_core (fi=..., selected_frame_p=true) at /home/simark/src/binutils-gdb/gdb/stack.c:1682
print_frame_args knows that print_frame_arg can invalidate frame_info
objects, and therefore calls prepare_reinflate/reinflate. However,
info_frame_command_core has a separate frame_info_ptr instance (it is
passed by value / copy). So info_frame_command_core needs to know that
print_frame_args can invalidate frame_info objects, and therefore needs
to prepare_reinflate/reinflate as well. Add those calls, and enhance
the gdb.python/pretty-print-call-by-hand.exp test to test that command.
Reviewed-By: Bruno Larsen <blarsen@redhat.com>
Change-Id: I9edaae06d62e97ffdb30938d364437737238a960
2022-11-10 11:33:02 -05:00
..
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-10-10 11:57:10 +02:00
2022-11-10 11:33:02 -05:00
2022-10-11 11:22:37 +02:00
2022-10-10 10:23:59 +01:00
2022-10-10 10:23:59 +01:00
2022-01-01 19:13:23 +04:00
2022-07-08 14:14:58 -06:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-07-28 11:20:46 -06:00
2022-07-28 11:20:46 -06:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-10-19 09:04:12 +02:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-12 16:00:07 +00:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-05-17 13:03:07 +01:00
2022-07-25 19:26:24 +01:00
2022-07-25 19:26:24 +01:00
2022-07-25 19:26:24 +01:00
2022-06-06 12:34:24 +01:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-07-18 11:25:34 -06:00
2022-07-18 11:25:34 -06:00
2022-07-18 11:25:34 -06:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-07-05 10:28:39 -06:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-10-07 16:17:34 +02:00
2022-01-01 19:13:23 +04:00
2022-03-22 10:05:05 +00:00
2022-03-29 13:55:48 +01:00
2022-01-01 19:13:23 +04:00
2022-07-15 09:42:39 -06:00
2022-07-15 09:26:54 -06:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-08-21 08:03:42 -06:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-05-16 10:07:43 -03:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-05-16 10:07:43 -03:00
2022-01-01 19:13:23 +04:00
2022-03-23 07:41:19 -04:00
2022-02-28 17:01:31 +00:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-26 06:49:51 -07:00
2022-06-14 19:50:44 +02:00
2022-03-14 14:09:09 +00:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-05-16 10:07:43 -03:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-05-16 10:07:43 -03:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-03-23 07:41:19 -04:00
2022-05-16 10:07:43 -03:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-10-21 08:54:18 +01:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-07-08 14:14:58 -06:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-03-23 07:41:19 -04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-07-15 07:55:32 -06:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-07-08 14:14:58 -06:00
2022-01-26 23:12:52 +00:00
2022-01-26 23:12:52 +00:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-03-07 19:42:07 +00:00
2022-06-24 15:07:29 +01:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-08-21 08:03:42 -06:00
2022-08-21 08:03:42 -06:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-04-06 16:11:13 -04:00
2022-01-01 19:13:23 +04:00
2022-05-17 10:31:36 +01:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-08-30 11:49:48 -06:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00
2022-10-24 08:36:42 +02:00
2022-01-01 19:13:23 +04:00
2022-01-01 19:13:23 +04:00