[RFC,02/15] Fix internal error when saving fast tracepoint definitions

Message ID 56c885a8de03c9679e8fd2208e3b6c6f8df12dfa.1444820235.git.henrik.wallin@windriver.com
State New, archived
Headers

Commit Message

henrik.wallin@windriver.com Oct. 14, 2015, 11:14 a.m. UTC
  From: Par Olsson <par.olsson@windriver.com>

When trying to save fast tracepoints to file, gdb returns internal failure:

  gdb/breakpoint.c:13446: internal-error: unhandled tracepoint type 27
  A problem internal to GDB has been detected, further debugging may prove unreliable.

And no file including the fast tracepoints definition is created.

gdb/ChangeLog:

	* breakpoint.c (tracepoint_print_recreate): Fix logic error
	if -> else if.

Signed-off-by: Par Olsson <par.olsson@windriver.com>
Signed-off-by: Henrik Wallin <henrik.wallin@windriver.com>
---
 gdb/breakpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Pedro Alves Oct. 15, 2015, 5:19 p.m. UTC | #1
On 10/14/2015 12:14 PM, henrik.wallin@windriver.com wrote:
> From: Par Olsson <par.olsson@windriver.com>
> 
> When trying to save fast tracepoints to file, gdb returns internal failure:
> 
>   gdb/breakpoint.c:13446: internal-error: unhandled tracepoint type 27
>   A problem internal to GDB has been detected, further debugging may prove unreliable.
> 
> And no file including the fast tracepoints definition is created.
> 
> gdb/ChangeLog:
> 
> 	* breakpoint.c (tracepoint_print_recreate): Fix logic error
> 	if -> else if.

This looks good, but I think we have tests that save/restore breakpoints.
Can we extend them to cover this as well?

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 2c901ff5f2fe..106464888500 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -13423,7 +13423,7 @@  tracepoint_print_recreate (struct breakpoint *self, struct ui_file *fp)
 
   if (self->type == bp_fast_tracepoint)
     fprintf_unfiltered (fp, "ftrace");
-  if (self->type == bp_static_tracepoint)
+  else if (self->type == bp_static_tracepoint)
     fprintf_unfiltered (fp, "strace");
   else if (self->type == bp_tracepoint)
     fprintf_unfiltered (fp, "trace");