* [PATCH] Add CTF support to GDB [2/4] Fix a bug of function dwarf_expr_frame_base
@ 2012-11-21 1:45 Hui Zhu
2012-11-29 19:15 ` Tom Tromey
0 siblings, 1 reply; 7+ messages in thread
From: Hui Zhu @ 2012-11-21 1:45 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 459 bytes --]
After I add prev patch to GDB, the GDB got crash when a trace frame didn't include all the variables that it should include.
I think this issue should be handle because the trace frame didn't include all the variables will be always happen (What I use is GDB and gdbserver).
So I post this patch to handle it.
Thanks,
Hui
2012-11-20 Hui Zhu <hui_zhu@mentor.com>
* dwarf2loc.c (dwarf_expr_frame_base): Add check for the return
value of get_frame_block.
[-- Attachment #2: check-get_frame_block-return.txt --]
[-- Type: text/plain, Size: 801 bytes --]
--- a/dwarf2loc.c
+++ b/dwarf2loc.c
@@ -332,11 +332,15 @@ dwarf_expr_frame_base (void *baton, cons
this_base method. */
struct symbol *framefunc;
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
+ struct block *bl = get_frame_block (debaton->frame, NULL);
+
+ if (bl == NULL)
+ error (_("No symbol table info available.\n"));
/* Use block_linkage_function, which returns a real (not inlined)
function, instead of get_frame_function, which may return an
inlined function. */
- framefunc = block_linkage_function (get_frame_block (debaton->frame, NULL));
+ framefunc = block_linkage_function (bl);
/* If we found a frame-relative symbol then it was certainly within
some function associated with a frame. If we can't find the frame,
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Add CTF support to GDB [2/4] Fix a bug of function dwarf_expr_frame_base
2012-11-21 1:45 [PATCH] Add CTF support to GDB [2/4] Fix a bug of function dwarf_expr_frame_base Hui Zhu
@ 2012-11-29 19:15 ` Tom Tromey
2012-12-01 16:34 ` Hui Zhu
0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2012-11-29 19:15 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches
>>>>> "Hui" == Hui Zhu <hui_zhu@mentor.com> writes:
Hui> 2012-11-20 Hui Zhu <hui_zhu@mentor.com>
Hui> * dwarf2loc.c (dwarf_expr_frame_base): Add check for the return
Hui> value of get_frame_block.
I think this is reasonable even without the rest of your patches.
One nit:
Hui> + if (bl == NULL)
Hui> + error (_("No symbol table info available.\n"));
I don't think this is a very clear error message.
I'm not sure what else to suggest though.
Also, no \n at the end of the error message.
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Add CTF support to GDB [2/4] Fix a bug of function dwarf_expr_frame_base
2012-11-29 19:15 ` Tom Tromey
@ 2012-12-01 16:34 ` Hui Zhu
2012-12-03 19:11 ` Tom Tromey
0 siblings, 1 reply; 7+ messages in thread
From: Hui Zhu @ 2012-12-01 16:34 UTC (permalink / raw)
To: Tom Tromey; +Cc: Hui Zhu, gdb-patches
On Fri, Nov 30, 2012 at 3:14 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Hui" == Hui Zhu <hui_zhu@mentor.com> writes:
>
> Hui> 2012-11-20 Hui Zhu <hui_zhu@mentor.com>
> Hui> * dwarf2loc.c (dwarf_expr_frame_base): Add check for the return
> Hui> value of get_frame_block.
>
> I think this is reasonable even without the rest of your patches.
OK.
>
> One nit:
>
> Hui> + if (bl == NULL)
> Hui> + error (_("No symbol table info available.\n"));
>
> I don't think this is a very clear error message.
> I'm not sure what else to suggest though.
>
> Also, no \n at the end of the error message.
>
> Tom
What about I change it to "frame address is not available." because in
get_frame_block:
if (!get_frame_address_in_block_if_available (frame, &pc))
return NULL;
Post a new version.
Thanks,
Hui
2012-11-01 Hui Zhu <hui_zhu@mentor.com>
* dwarf2loc.c (dwarf_expr_frame_base): Add check for the return
value of get_frame_block.
--- a/dwarf2loc.c
+++ b/dwarf2loc.c
@@ -332,11 +332,15 @@ dwarf_expr_frame_base (void *baton, cons
this_base method. */
struct symbol *framefunc;
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
+ struct block *bl = get_frame_block (debaton->frame, NULL);
+
+ if (bl == NULL)
+ error (_("frame address is not available."));
/* Use block_linkage_function, which returns a real (not inlined)
function, instead of get_frame_function, which may return an
inlined function. */
- framefunc = block_linkage_function (get_frame_block (debaton->frame, NULL));
+ framefunc = block_linkage_function (bl);
/* If we found a frame-relative symbol then it was certainly within
some function associated with a frame. If we can't find the frame,
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Add CTF support to GDB [2/4] Fix a bug of function dwarf_expr_frame_base
2012-12-01 16:34 ` Hui Zhu
@ 2012-12-03 19:11 ` Tom Tromey
2012-12-04 3:03 ` Hui Zhu
0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2012-12-03 19:11 UTC (permalink / raw)
To: Hui Zhu; +Cc: Hui Zhu, gdb-patches
>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
Hui> What about I change it to "frame address is not available." because in
Hui> get_frame_block:
Hui> if (!get_frame_address_in_block_if_available (frame, &pc))
Hui> return NULL;
Seems reasonable to me.
This is ok.
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Add CTF support to GDB [2/4] Fix a bug of function dwarf_expr_frame_base
2012-12-03 19:11 ` Tom Tromey
@ 2012-12-04 3:03 ` Hui Zhu
2012-12-05 16:27 ` Tom Tromey
0 siblings, 1 reply; 7+ messages in thread
From: Hui Zhu @ 2012-12-04 3:03 UTC (permalink / raw)
To: Tom Tromey; +Cc: Hui Zhu, gdb-patches
On Tue, Dec 4, 2012 at 3:11 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
>
> Hui> What about I change it to "frame address is not available." because in
> Hui> get_frame_block:
> Hui> if (!get_frame_address_in_block_if_available (frame, &pc))
> Hui> return NULL;
>
> Seems reasonable to me.
> This is ok.
>
> Tom
Should I commit this patch?
Thanks,
Hui
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-12-06 1:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-21 1:45 [PATCH] Add CTF support to GDB [2/4] Fix a bug of function dwarf_expr_frame_base Hui Zhu
2012-11-29 19:15 ` Tom Tromey
2012-12-01 16:34 ` Hui Zhu
2012-12-03 19:11 ` Tom Tromey
2012-12-04 3:03 ` Hui Zhu
2012-12-05 16:27 ` Tom Tromey
2012-12-06 1:17 ` Hui Zhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox