This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Set canonical.addr_string for static tracepoint


I ran cross a gdb crash when setting static tracepoint,

(gdb) strace -m ust/bar

Program received signal SIGSEGV, Segmentation fault.
__strlen_sse2 () at ../sysdeps/i386/i686/multiarch/strlen.S:99
99	../sysdeps/i386/i686/multiarch/strlen.S: No such file or directory.
	in ../sysdeps/i386/i686/multiarch/strlen.S

(top-gdb) bt 5
[...]
#2  0x080ffce5 in create_breakpoint (gdbarch=0x8485200, arg=0x8404041
"", cond_string=0x0, thread=-1,
    parse_condition_and_thread=1, tempflag=0,
type_wanted=bp_static_tracepoint, ignore_count=0,
    pending_break_support=AUTO_BOOLEAN_AUTO, ops=0x8402460, from_tty=1,
enabled=1, internal=0)
    at /home/yao/SourceCode/gnu/gdb/git/gdb/gdb/breakpoint.c:7882
7882		      addr_string = xstrdup (canonical.addr_string);
(top-gdb) p canonical
$1 = {special_display = 0, pre_expanded = 0, addr_string = 0x0, sals =
0x847ce68}

This patch is simply setting canonical.addr_string with copy_arg.
Comments are welcome, because I don't think I understand that part of
code very well.

This change only affects path on static tracepoint, so I didn't run
regression test (because we don't have tests for static tracepoint, but
I am going to add one).  OK for mainline?

-- 
Yao (éå)
2011-12-12  Yao Qi  <yao@codesourcery.com>

	* breakpoint.c (create_breakpoint): Set canonical.addr_string
	for static tracepoint.
---
 gdb/breakpoint.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 0686587..783b797 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -7732,6 +7732,7 @@ create_breakpoint (struct gdbarch *gdbarch,
 
       copy_arg = savestring (addr_start, arg - addr_start);
 
+      canonical.addr_string = xstrdup (copy_arg);
       lsal.canonical = xstrdup (copy_arg);
       VEC_safe_push (linespec_sals, canonical.sals, &lsal);
 
-- 
1.7.0.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]