Merge lp:~christophe-lyon/gdb-linaro/merge-from-gdb-7.5.1 into lp:gdb-linaro/7.5

Proposed by Christophe Lyon
Status: Merged
Merged at revision: 39070
Proposed branch: lp:~christophe-lyon/gdb-linaro/merge-from-gdb-7.5.1
Merge into: lp:gdb-linaro/7.5
Diff against target: 1454 lines (+607/-141)
35 files modified
ChangeLog.linaro (+12/-0)
gdb/ChangeLog (+111/-0)
gdb/amd64-tdep.c (+0/-3)
gdb/auto-load.c (+100/-17)
gdb/cli/cli-decode.c (+4/-1)
gdb/common/linux-ptrace.c (+88/-17)
gdb/defs.h (+1/-0)
gdb/doc/ChangeLog (+4/-0)
gdb/doc/gdb.texinfo (+7/-0)
gdb/dwarf2read.c (+7/-8)
gdb/frame.c (+7/-1)
gdb/gdbserver/ChangeLog (+9/-0)
gdb/gdbserver/gdbreplay.c (+2/-0)
gdb/gdbserver/linux-crisv32-low.c (+11/-12)
gdb/gdbserver/server.h (+1/-0)
gdb/i386-tdep.c (+0/-11)
gdb/i386-tdep.h (+0/-8)
gdb/infcmd.c (+5/-0)
gdb/infrun.c (+31/-15)
gdb/linespec.c (+20/-2)
gdb/main.c (+0/-4)
gdb/ppc-linux-tdep.c (+3/-2)
gdb/python/py-auto-load.c (+0/-4)
gdb/python/python.h (+4/-0)
gdb/symfile.c (+2/-2)
gdb/testsuite/ChangeLog (+60/-0)
gdb/testsuite/gdb.base/valgrind-infcall.exp (+0/-1)
gdb/testsuite/gdb.java/jmisc.exp (+2/-2)
gdb/testsuite/gdb.java/jprint.exp (+2/-2)
gdb/testsuite/gdb.linespec/ls-errs.exp (+1/-1)
gdb/testsuite/lib/gdb.exp (+94/-22)
gdb/value.c (+5/-1)
gdb/version.in (+1/-1)
libiberty/ChangeLog (+5/-0)
libiberty/md5.c (+8/-4)
To merge this branch: bzr merge lp:~christophe-lyon/gdb-linaro/merge-from-gdb-7.5.1
Reviewer Review Type Date Requested Status
Linaro Toolchain Developers Pending
Review via email: mp+138723@code.launchpad.net

Description of the change

Update to gdb-7.5.1, merge request to exercise the validation on ARM.

To post a comment you must log in.
Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild has taken a snapshot of this branch at r39070 and queued it for build.

The diff against the ancestor r39069 is available at:
 http://builds.linaro.org/toolchain/snapshots/gdb-linaro-7.4+bzr39070~christophe-lyon~merge-from-gdb-7.5.1.diff

and will be built on the following builders:
 a9hf-builder i686 x86_64

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gdb-linaro-7.4+bzr39070~christophe-lyon~merge-from-gdb-7.5.1
cbuild-ancestor: lp:gdb-linaro+bzr39069
cbuild-state: check

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog.linaro'
2--- ChangeLog.linaro 2012-09-13 14:19:38 +0000
3+++ ChangeLog.linaro 2012-12-13 13:30:32 +0000
4@@ -1,3 +1,15 @@
5+2012-12-07 Christophe Lyon <christophe.lyon@linaro.org>
6+
7+ gdb/
8+ * version.in: Bump version.
9+
10+2012-12-07 Christophe Lyon <christophe.lyon@linaro.org>
11+
12+ GDB Linaro 7.5-2012.12 released.
13+
14+ gdb/
15+ * version.in: Update.
16+
17 2012-09-13 Ulrich Weigand <ulrich.weigand@linaro.org>
18
19 gdb/
20
21=== modified file 'gdb/ChangeLog'
22--- gdb/ChangeLog 2012-08-17 18:42:07 +0000
23+++ gdb/ChangeLog 2012-12-13 13:30:32 +0000
24@@ -1,3 +1,114 @@
25+2012-11-29 Joel Brobecker <brobecker@adacore.com>
26+
27+ * version.in: Set version to 7.5.1.20121129-cvs.
28+
29+2012-11-29 Joel Brobecker <brobecker@adacore.com>
30+
31+ * version.in: Update GDB version number to 7.5.1.
32+
33+2012-11-15 Luis Machado <lgustavo@codesourcery.com>
34+
35+ * value.c (value_actual_type): Check for TYPE_CODE_STRUCT
36+ target types.
37+
38+2012-11-10 H.J. Lu <hongjiu.lu@intel.com>
39+
40+ PR backtrace/14646
41+ PR gdb/14647
42+ * i386-tdep.h (gdbarch_tdep): Remove sp_regnum_from_eax and
43+ pc_regnum_from_eax.
44+ * i386-tdep.c (i386_gdbarch_init): Don't use sp_regnum_from_eax
45+ nor pc_regnum_from_eax.
46+ * amd64-tdep.c (amd64_x32_init_abi): Don't set sp_regnum_from_eax
47+ nor pc_regnum_from_eax.
48+
49+2012-10-11 Doug Evans <dje@google.com>
50+
51+ PR breakpoints/14643.
52+ * linespec.c (struct ls_parser): New member keyword_ok.
53+ (linespec_lexer_lex_string): Add comment.
54+ (linespec_lexer_lex_one): Ignore keywords if it's the wrong place
55+ for one.
56+ (parse_linespec): Set keyword_ok.
57+
58+2012-10-06 Jan Kratochvil <jan.kratochvil@redhat.com>
59+
60+ Fix crash during stepping on ppc32.
61+ * ppc-linux-tdep.c (powerpc_linux_in_dynsym_resolve_code): Test NULL
62+ SYM.
63+
64+2012-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
65+
66+ * common/linux-ptrace.c: Change __i386__ to __i386__ || __x86_64__.
67+ (linux_ptrace_test_ret_to_nx): Extend comment for x86_64. Change
68+ __i386__ to __i386__ || __x86_64__. Extend code also for __x86_64__.
69+ Extend code also for PaX support. Convert all gdb_assert to warning
70+ calls.
71+
72+2012-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
73+
74+ Implement auto-load user conveniences suggested by Doug Evans.
75+ * auto-load.c: Include top.h.
76+ (file_is_auto_load_safe): New variable advice_printed. Print advice.
77+ (_initialize_auto_load): New variable scripts_directory_help. Mention
78+ GDBPY_AUTO_FILE_NAME and GDB_AUTO_FILE_NAME for set auto-load
79+ scripts-directory. Document in online help one can use also files for
80+ set auto-load safe-path.
81+ * python/py-auto-load.c: (GDBPY_AUTO_FILE_NAME): Move it from here ...
82+ * python/python.h (GDBPY_AUTO_FILE_NAME): ... to here.
83+
84+2012-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
85+
86+ PR 14119
87+ * frame.c (skip_inlined_frames): Skip also TAILCALL_FRAME frames.
88+ (frame_pop): Drop also TAILCALL_FRAME frames.
89+ * infcmd.c (finish_command): Ignore also TAILCALL_FRAME frames.
90+
91+2012-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
92+ Pedro Alves <palves@redhat.com>
93+
94+ PR 14548
95+ * infrun.c (handle_inferior_event): Do not reverse-continue back to the
96+ function start if we are already at function start. Both for
97+ reverse-next and for reverse-step into function without line number
98+ info.
99+
100+2012-08-29 Doug Evans <dje@google.com>
101+
102+ * main.c (print_gdb_help): Remove reference to
103+ --use-deprecated-index-sections.
104+
105+2012-08-27 Eli Zaretskii <eliz@gnu.org>
106+ Jan Kratochvil <jan.kratochvil@redhat.com>
107+
108+ * auto-load.c (auto_load_objfile_script): Rename to ...
109+ (auto_load_objfile_script_1): ... here, change variable realname to
110+ parameter realname, document it, add return value, add variable retval.
111+ (auto_load_objfile_script): New function.
112+
113+2012-08-27 Jan Kratochvil <jan.kratochvil@redhat.com>
114+
115+ * cli/cli-decode.c (print_doc_line): Keep skipping '.' and ',' not
116+ followed by a whitespace.
117+
118+2012-08-27 Jan Kratochvil <jan.kratochvil@redhat.com>
119+
120+ PR gdb/14494.
121+ * dwarf2read.c (dwarf2_locate_sections): Move variable aflag here.
122+ Move the SEC_HAS_CONTENTS check here - for any NAMES use.
123+ (dwarf2_locate_sections) <eh_frame>: Move the variable and check from
124+ here.
125+
126+2012-08-22 Keith Seitz <keiths@redhat.com>
127+
128+ * defs.h: Include build-gnulib/config.h
129+
130+2012-08-21 Pierre Muller <muller@ics.u-strasbg.fr>
131+
132+ * symfile.c (allocate_symtab): Use host_address_to_string
133+ function instead of cast of pointer to long which is not
134+ compatible with x86_64-w64-mingw32 build.
135+
136 2012-08-17 Joel Brobecker <brobecker@adacore.com>
137
138 * version.in: Set version to 7.5.0.20120817-cvs.
139
140=== modified file 'gdb/amd64-tdep.c'
141--- gdb/amd64-tdep.c 2012-07-04 20:46:18 +0000
142+++ gdb/amd64-tdep.c 2012-12-13 13:30:32 +0000
143@@ -2946,9 +2946,6 @@
144 tdesc = tdesc_x32;
145 tdep->tdesc = tdesc;
146
147- tdep->sp_regnum_from_eax = AMD64_RSP_REGNUM;
148- tdep->pc_regnum_from_eax = AMD64_RIP_REGNUM;
149-
150 tdep->num_dword_regs = 17;
151 set_tdesc_pseudo_register_type (gdbarch, amd64_x32_pseudo_register_type);
152
153
154=== modified file 'gdb/auto-load.c'
155--- gdb/auto-load.c 2012-07-02 10:57:31 +0000
156+++ gdb/auto-load.c 2012-12-13 13:30:32 +0000
157@@ -37,6 +37,7 @@
158 #include "completer.h"
159 #include "observer.h"
160 #include "fnmatch.h"
161+#include "top.h"
162
163 /* The suffix of per-objfile scripts to auto-load as non-Python command files.
164 E.g. When the program loads libfoo.so, look for libfoo-gdb.gdb. */
165@@ -441,6 +442,7 @@
166 {
167 char *filename_real = NULL;
168 struct cleanup *back_to;
169+ static int advice_printed = 0;
170
171 if (debug_auto_load)
172 {
173@@ -470,6 +472,30 @@
174 "`auto-load safe-path' set to \"%s\"."),
175 filename_real, auto_load_safe_path);
176
177+ if (!advice_printed)
178+ {
179+ const char *homedir = getenv ("HOME");
180+ char *homeinit;
181+
182+ if (homedir == NULL)
183+ homedir = "$HOME";
184+ homeinit = xstrprintf ("%s/%s", homedir, gdbinit);
185+ make_cleanup (xfree, homeinit);
186+
187+ printf_filtered (_("\
188+To enable execution of this file add\n\
189+\tadd-auto-load-safe-path %s\n\
190+line to your configuration file \"%s\".\n\
191+To completely disable this security protection add\n\
192+\tset auto-load safe-path /\n\
193+line to your configuration file \"%s\".\n\
194+For more information about this security protection see the\n\
195+\"Auto-loading safe path\" section in the GDB manual. E.g., run from the shell:\n\
196+\tinfo \"(gdb)Auto-loading safe path\"\n"),
197+ filename_real, homeinit, homeinit);
198+ advice_printed = 1;
199+ }
200+
201 do_cleanups (back_to);
202 return 0;
203 }
204@@ -693,27 +719,25 @@
205 }
206 }
207
208-/* Look for the auto-load script in LANGUAGE associated with OBJFILE and load
209- it. */
210+/* Look for the auto-load script in LANGUAGE associated with OBJFILE where
211+ OBJFILE's gdb_realpath is REALNAME and load it. Return 1 if we found any
212+ matching script, return 0 otherwise. */
213
214-void
215-auto_load_objfile_script (struct objfile *objfile,
216- const struct script_language *language)
217+static int
218+auto_load_objfile_script_1 (struct objfile *objfile, const char *realname,
219+ const struct script_language *language)
220 {
221- char *realname;
222 char *filename, *debugfile;
223- int len;
224+ int len, retval;
225 FILE *input;
226 struct cleanup *cleanups;
227
228- realname = gdb_realpath (objfile->name);
229 len = strlen (realname);
230 filename = xmalloc (len + strlen (language->suffix) + 1);
231 memcpy (filename, realname, len);
232 strcpy (filename + len, language->suffix);
233
234 cleanups = make_cleanup (xfree, filename);
235- make_cleanup (xfree, realname);
236
237 input = fopen (filename, "r");
238 debugfile = filename;
239@@ -768,6 +792,44 @@
240 and these scripts are required to be idempotent under multiple
241 loads anyway. */
242 language->source_script_for_objfile (objfile, input, debugfile);
243+
244+ retval = 1;
245+ }
246+ else
247+ retval = 0;
248+
249+ do_cleanups (cleanups);
250+ return retval;
251+}
252+
253+/* Look for the auto-load script in LANGUAGE associated with OBJFILE and load
254+ it. */
255+
256+void
257+auto_load_objfile_script (struct objfile *objfile,
258+ const struct script_language *language)
259+{
260+ char *realname = gdb_realpath (objfile->name);
261+ struct cleanup *cleanups = make_cleanup (xfree, realname);
262+
263+ if (!auto_load_objfile_script_1 (objfile, realname, language))
264+ {
265+ /* For Windows/DOS .exe executables, strip the .exe suffix, so that
266+ FOO-gdb.gdb could be used for FOO.exe, and try again. */
267+
268+ size_t len = strlen (realname);
269+ const size_t lexe = sizeof (".exe") - 1;
270+
271+ if (len > lexe && strcasecmp (realname + len - lexe, ".exe") == 0)
272+ {
273+ len -= lexe;
274+ realname[len] = '\0';
275+ if (debug_auto_load)
276+ fprintf_unfiltered (gdb_stdlog, _("auto-load: Stripped .exe suffix, "
277+ "retrying with \"%s\".\n"),
278+ realname);
279+ auto_load_objfile_script_1 (objfile, realname, language);
280+ }
281 }
282
283 do_cleanups (cleanups);
284@@ -1130,6 +1192,7 @@
285 _initialize_auto_load (void)
286 {
287 struct cmd_list_element *cmd;
288+ char *scripts_directory_help;
289
290 auto_load_pspace_data
291 = register_program_space_data_with_cleanup (auto_load_pspace_data_cleanup);
292@@ -1172,30 +1235,50 @@
293 auto_load_info_cmdlist_get ());
294
295 auto_load_dir = xstrdup (AUTO_LOAD_DIR);
296+ scripts_directory_help = xstrprintf (
297+#ifdef HAVE_PYTHON
298+ _("\
299+Automatically loaded Python scripts (named OBJFILE%s) and GDB scripts\n\
300+(named OBJFILE%s) are located in one of the directories listed by this\n\
301+option.\n\
302+%s"),
303+ GDBPY_AUTO_FILE_NAME,
304+#else
305+ _("\
306+Automatically loaded GDB scripts (named OBJFILE%s) are located in one\n\
307+of the directories listed by this option.\n\
308+%s"),
309+#endif
310+ GDB_AUTO_FILE_NAME,
311+ _("\
312+This option is ignored for the kinds of scripts \
313+having 'set auto-load ... off'.\n\
314+Directories listed here need to be present also \
315+in the 'set auto-load safe-path'\n\
316+option."));
317 add_setshow_optional_filename_cmd ("scripts-directory", class_support,
318 &auto_load_dir, _("\
319 Set the list of directories from which to load auto-loaded scripts."), _("\
320-Show the list of directories from which to load auto-loaded scripts."), _("\
321-Automatically loaded Python scripts and GDB scripts are located in one of the\n\
322-directories listed by this option. This option is ignored for the kinds of\n\
323-scripts having 'set auto-load ... off'. Directories listed here need to be\n\
324-present also in the 'set auto-load safe-path' option."),
325+Show the list of directories from which to load auto-loaded scripts."),
326+ scripts_directory_help,
327 set_auto_load_dir, show_auto_load_dir,
328 auto_load_set_cmdlist_get (),
329 auto_load_show_cmdlist_get ());
330+ xfree (scripts_directory_help);
331
332 auto_load_safe_path = xstrdup (AUTO_LOAD_SAFE_PATH);
333 auto_load_safe_path_vec_update ();
334 add_setshow_optional_filename_cmd ("safe-path", class_support,
335 &auto_load_safe_path, _("\
336-Set the list of directories from which it is safe to auto-load files."), _("\
337-Show the list of directories from which it is safe to auto-load files."), _("\
338+Set the list of files and directories that are safe for auto-loading."), _("\
339+Show the list of files and directories that are safe for auto-loading."), _("\
340 Various files loaded automatically for the 'set auto-load ...' options must\n\
341 be located in one of the directories listed by this option. Warning will be\n\
342 printed and file will not be used otherwise.\n\
343+You can mix both directory and filename entries.\n\
344 Setting this parameter to an empty list resets it to its default value.\n\
345 Setting this parameter to '/' (without the quotes) allows any file\n\
346-for the 'set auto-load ...' options. Each directory can be also shell\n\
347+for the 'set auto-load ...' options. Each path entry can be also shell\n\
348 wildcard pattern; '*' does not match directory separator.\n\
349 This option is ignored for the kinds of files having 'set auto-load ... off'.\n\
350 This options has security implications for untrusted inferiors."),
351
352=== modified file 'gdb/cli/cli-decode.c'
353--- gdb/cli/cli-decode.c 2012-06-13 15:47:13 +0000
354+++ gdb/cli/cli-decode.c 2012-12-13 13:30:32 +0000
355@@ -1003,8 +1003,11 @@
356 line_buffer = (char *) xmalloc (line_size);
357 }
358
359+ /* Keep printing '.' or ',' not followed by a whitespace for embedded strings
360+ like '.gdbinit'. */
361 p = str;
362- while (*p && *p != '\n' && *p != '.' && *p != ',')
363+ while (*p && *p != '\n'
364+ && ((*p != '.' && *p != ',') || (p[1] && !isspace (p[1]))))
365 p++;
366 if (p - str > line_size - 1)
367 {
368
369=== modified file 'gdb/common/linux-ptrace.c'
370--- gdb/common/linux-ptrace.c 2012-07-07 12:13:56 +0000
371+++ gdb/common/linux-ptrace.c 2012-12-13 13:30:32 +0000
372@@ -49,7 +49,7 @@
373 (int) pid);
374 }
375
376-#ifdef __i386__
377+#if defined __i386__ || defined __x86_64__
378
379 /* Address of the 'ret' instruction in asm code block below. */
380 extern void (linux_ptrace_test_ret_to_nx_instr) (void);
381@@ -60,15 +60,17 @@
382 #include <sys/wait.h>
383 #include <stdint.h>
384
385-#endif /* __i386__ */
386+#endif /* defined __i386__ || defined __x86_64__ */
387
388 /* Test broken off-trunk Linux kernel patchset for NX support on i386. It was
389- removed in Fedora kernel 88fa1f0332d188795ed73d7ac2b1564e11a0b4cd. */
390+ removed in Fedora kernel 88fa1f0332d188795ed73d7ac2b1564e11a0b4cd.
391+
392+ Test also x86_64 arch for PaX support. */
393
394 static void
395 linux_ptrace_test_ret_to_nx (void)
396 {
397-#ifdef __i386__
398+#if defined __i386__ || defined __x86_64__
399 pid_t child, got_pid;
400 gdb_byte *return_address, *pc;
401 long l;
402@@ -101,39 +103,105 @@
403 strerror (errno));
404 else
405 {
406+#if defined __i386__
407 asm volatile ("pushl %0;"
408 ".globl linux_ptrace_test_ret_to_nx_instr;"
409 "linux_ptrace_test_ret_to_nx_instr:"
410 "ret"
411 : : "r" (return_address) : "%esp", "memory");
412+#elif defined __x86_64__
413+ asm volatile ("pushq %0;"
414+ ".globl linux_ptrace_test_ret_to_nx_instr;"
415+ "linux_ptrace_test_ret_to_nx_instr:"
416+ "ret"
417+ : : "r" (return_address) : "%rsp", "memory");
418+#else
419+# error "!__i386__ && !__x86_64__"
420+#endif
421 gdb_assert_not_reached ("asm block did not terminate");
422 }
423
424 _exit (1);
425 }
426
427+ errno = 0;
428 got_pid = waitpid (child, &status, 0);
429- gdb_assert (got_pid == child);
430- gdb_assert (WIFSTOPPED (status));
431+ if (got_pid != child)
432+ {
433+ warning (_("linux_ptrace_test_ret_to_nx: waitpid returned %ld: %s"),
434+ (long) got_pid, strerror (errno));
435+ return;
436+ }
437+
438+ if (WIFSIGNALED (status))
439+ {
440+ if (WTERMSIG (status) != SIGKILL)
441+ warning (_("linux_ptrace_test_ret_to_nx: WTERMSIG %d is not SIGKILL!"),
442+ (int) WTERMSIG (status));
443+ else
444+ warning (_("Cannot call inferior functions, Linux kernel PaX "
445+ "protection forbids return to non-executable pages!"));
446+ return;
447+ }
448+
449+ if (!WIFSTOPPED (status))
450+ {
451+ warning (_("linux_ptrace_test_ret_to_nx: status %d is not WIFSTOPPED!"),
452+ status);
453+ return;
454+ }
455
456 /* We may get SIGSEGV due to missing PROT_EXEC of the return_address. */
457- gdb_assert (WSTOPSIG (status) == SIGTRAP || WSTOPSIG (status) == SIGSEGV);
458+ if (WSTOPSIG (status) != SIGTRAP && WSTOPSIG (status) != SIGSEGV)
459+ {
460+ warning (_("linux_ptrace_test_ret_to_nx: "
461+ "WSTOPSIG %d is neither SIGTRAP nor SIGSEGV!"),
462+ (int) WSTOPSIG (status));
463+ return;
464+ }
465
466 errno = 0;
467+#if defined __i386__
468 l = ptrace (PTRACE_PEEKUSER, child, (void *) (uintptr_t) (EIP * 4), NULL);
469- gdb_assert (errno == 0);
470+#elif defined __x86_64__
471+ l = ptrace (PTRACE_PEEKUSER, child, (void *) (uintptr_t) (RIP * 8), NULL);
472+#else
473+# error "!__i386__ && !__x86_64__"
474+#endif
475+ if (errno != 0)
476+ {
477+ warning (_("linux_ptrace_test_ret_to_nx: Cannot PTRACE_PEEKUSER: %s"),
478+ strerror (errno));
479+ return;
480+ }
481 pc = (void *) (uintptr_t) l;
482
483 if (ptrace (PTRACE_KILL, child, NULL, NULL) != 0)
484- warning (_("linux_ptrace_test_ret_to_nx: Cannot PTRACE_KILL: %s"),
485- strerror (errno));
486+ {
487+ warning (_("linux_ptrace_test_ret_to_nx: Cannot PTRACE_KILL: %s"),
488+ strerror (errno));
489+ return;
490+ }
491 else
492 {
493 int kill_status;
494
495+ errno = 0;
496 got_pid = waitpid (child, &kill_status, 0);
497- gdb_assert (got_pid == child);
498- gdb_assert (WIFSIGNALED (kill_status));
499+ if (got_pid != child)
500+ {
501+ warning (_("linux_ptrace_test_ret_to_nx: "
502+ "PTRACE_KILL waitpid returned %ld: %s"),
503+ (long) got_pid, strerror (errno));
504+ return;
505+ }
506+ if (!WIFSIGNALED (kill_status))
507+ {
508+ warning (_("linux_ptrace_test_ret_to_nx: "
509+ "PTRACE_KILL status %d is not WIFSIGNALED!"),
510+ status);
511+ return;
512+ }
513 }
514
515 /* + 1 is there as x86* stops after the 'int3' instruction. */
516@@ -150,11 +218,14 @@
517 return;
518 }
519
520- gdb_assert ((void (*) (void)) pc == &linux_ptrace_test_ret_to_nx_instr);
521-
522- warning (_("Cannot call inferior functions, you have broken "
523- "Linux kernel i386 NX (non-executable pages) support!"));
524-#endif /* __i386__ */
525+ if ((void (*) (void)) pc != &linux_ptrace_test_ret_to_nx_instr)
526+ warning (_("linux_ptrace_test_ret_to_nx: PC %p is neither near return "
527+ "address %p nor is the return instruction %p!"),
528+ pc, return_address, &linux_ptrace_test_ret_to_nx_instr);
529+ else
530+ warning (_("Cannot call inferior functions, you have broken "
531+ "Linux kernel i386 NX (non-executable pages) support!"));
532+#endif /* defined __i386__ || defined __x86_64__ */
533 }
534
535 /* Display possible problems on this system. Display them only once per GDB
536
537=== modified file 'gdb/defs.h'
538--- gdb/defs.h 2012-07-02 10:57:31 +0000
539+++ gdb/defs.h 2012-12-13 13:30:32 +0000
540@@ -27,6 +27,7 @@
541 #endif
542
543 #include "config.h" /* Generated by configure. */
544+#include "build-gnulib/config.h"
545
546 #include <sys/types.h>
547 #include <stdio.h>
548
549=== modified file 'gdb/doc/ChangeLog'
550--- gdb/doc/ChangeLog 2012-08-07 16:51:51 +0000
551+++ gdb/doc/ChangeLog 2012-12-13 13:30:32 +0000
552@@ -1,3 +1,7 @@
553+2012-08-27 Jan Kratochvil <jan.kratochvil@redhat.com>
554+
555+ * gdb.texinfo (objfile-gdb.py file): New paragraph for .exe stripping.
556+
557 2012-08-07 Jan Kratochvil <jan.kratochvil@redhat.com>
558
559 * gdbint.texinfo (Debugging GDB): In section
560
561=== modified file 'gdb/doc/gdb.texinfo'
562--- gdb/doc/gdb.texinfo 2012-07-20 17:59:04 +0000
563+++ gdb/doc/gdb.texinfo 2012-12-13 13:30:32 +0000
564@@ -25785,6 +25785,13 @@
565 Note that loading of this script file also requires accordingly configured
566 @code{auto-load safe-path} (@pxref{Auto-loading safe path}).
567
568+For object files using @file{.exe} suffix @value{GDBN} tries to load first the
569+scripts normally according to its @file{.exe} filename. But if no scripts are
570+found @value{GDBN} also tries script filenames matching the object file without
571+its @file{.exe} suffix. This @file{.exe} stripping is case insensitive and it
572+is attempted on any platform. This makes the script filenames compatible
573+between Unix and MS-Windows hosts.
574+
575 @table @code
576 @anchor{set auto-load scripts-directory}
577 @kindex set auto-load scripts-directory
578
579=== modified file 'gdb/dwarf2read.c'
580--- gdb/dwarf2read.c 2012-07-20 17:59:04 +0000
581+++ gdb/dwarf2read.c 2012-12-13 13:30:32 +0000
582@@ -1691,13 +1691,17 @@
583 dwarf2_locate_sections (bfd *abfd, asection *sectp, void *vnames)
584 {
585 const struct dwarf2_debug_sections *names;
586+ flagword aflag = bfd_get_section_flags (abfd, sectp);
587
588 if (vnames == NULL)
589 names = &dwarf2_elf_names;
590 else
591 names = (const struct dwarf2_debug_sections *) vnames;
592
593- if (section_is_p (sectp->name, &names->info))
594+ if ((aflag & SEC_HAS_CONTENTS) == 0)
595+ {
596+ }
597+ else if (section_is_p (sectp->name, &names->info))
598 {
599 dwarf2_per_objfile->info.asection = sectp;
600 dwarf2_per_objfile->info.size = bfd_get_section_size (sectp);
601@@ -1744,13 +1748,8 @@
602 }
603 else if (section_is_p (sectp->name, &names->eh_frame))
604 {
605- flagword aflag = bfd_get_section_flags (abfd, sectp);
606-
607- if (aflag & SEC_HAS_CONTENTS)
608- {
609- dwarf2_per_objfile->eh_frame.asection = sectp;
610- dwarf2_per_objfile->eh_frame.size = bfd_get_section_size (sectp);
611- }
612+ dwarf2_per_objfile->eh_frame.asection = sectp;
613+ dwarf2_per_objfile->eh_frame.size = bfd_get_section_size (sectp);
614 }
615 else if (section_is_p (sectp->name, &names->ranges))
616 {
617
618=== modified file 'gdb/frame.c'
619--- gdb/frame.c 2012-03-01 20:48:50 +0000
620+++ gdb/frame.c 2012-12-13 13:30:32 +0000
621@@ -309,7 +309,8 @@
622 static struct frame_info *
623 skip_inlined_frames (struct frame_info *frame)
624 {
625- while (get_frame_type (frame) == INLINE_FRAME)
626+ while (get_frame_type (frame) == INLINE_FRAME
627+ || get_frame_type (frame) == TAILCALL_FRAME)
628 frame = get_prev_frame (frame);
629
630 return frame;
631@@ -814,6 +815,11 @@
632 if (!prev_frame)
633 error (_("Cannot pop the initial frame."));
634
635+ /* Ignore TAILCALL_FRAME type frames, they were executed already before
636+ entering THISFRAME. */
637+ while (get_frame_type (prev_frame) == TAILCALL_FRAME)
638+ prev_frame = get_prev_frame (prev_frame);
639+
640 /* Make a copy of all the register values unwound from this frame.
641 Save them in a scratch buffer so that there isn't a race between
642 trying to extract the old values from the current regcache while
643
644=== modified file 'gdb/gdbserver/ChangeLog'
645--- gdb/gdbserver/ChangeLog 2012-08-02 15:53:42 +0000
646+++ gdb/gdbserver/ChangeLog 2012-12-13 13:30:32 +0000
647@@ -1,3 +1,12 @@
648+2012-09-05 Michael Brandt <michael.brandt@axis.com>
649+
650+ * linux-crisv32-low.c: Fix compile errors.
651+
652+2012-08-22 Keith Seitz <keiths@redhat.com>
653+
654+ * server.h: Include build-gnulib-gbserver/config.h.
655+ * gdbreplay.c: Likewise.
656+
657 2012-08-02 Ulrich Weigand <ulrich.weigand@linaro.org>
658
659 * hostio.c (handle_pread): If pread fails, fall back to attempting
660
661=== modified file 'gdb/gdbserver/gdbreplay.c'
662--- gdb/gdbserver/gdbreplay.c 2012-01-04 08:16:51 +0000
663+++ gdb/gdbserver/gdbreplay.c 2012-12-13 13:30:32 +0000
664@@ -19,6 +19,8 @@
665 along with this program. If not, see <http://www.gnu.org/licenses/>. */
666
667 #include "config.h"
668+#include "build-gnulib-gdbserver/config.h"
669+
670 #include <stdio.h>
671 #if HAVE_SYS_FILE_H
672 #include <sys/file.h>
673
674=== modified file 'gdb/gdbserver/linux-crisv32-low.c'
675--- gdb/gdbserver/linux-crisv32-low.c 2012-03-28 18:30:01 +0000
676+++ gdb/gdbserver/linux-crisv32-low.c 2012-12-13 13:30:32 +0000
677@@ -231,6 +231,7 @@
678 unsigned long bp_ctrl;
679 unsigned long start, end;
680 struct regcache *regcache;
681+ unsigned long bp_d_regs[12];
682
683 /* Breakpoint/watchpoint types:
684 0 = memory breakpoint for instructions
685@@ -259,8 +260,6 @@
686 single switch (addr) as there may be several watchpoints with
687 the same start address for example. */
688
689- unsigned long bp_d_regs[12];
690-
691 /* Get all range registers to simplify search. */
692 collect_register_by_name (regcache, "s3", &bp_d_regs[0]);
693 collect_register_by_name (regcache, "s4", &bp_d_regs[1]);
694@@ -321,8 +320,9 @@
695 cris_stopped_by_watchpoint (void)
696 {
697 unsigned long exs;
698+ struct regcache *regcache = get_thread_regcache (current_inferior, 1);
699
700- collect_register_by_name ("exs", &exs);
701+ collect_register_by_name (regcache, "exs", &exs);
702
703 return (((exs & 0xff00) >> 8) == 0xc);
704 }
705@@ -331,47 +331,46 @@
706 cris_stopped_data_address (void)
707 {
708 unsigned long eda;
709+ struct regcache *regcache = get_thread_regcache (current_inferior, 1);
710
711- collect_register_by_name ("eda", &eda);
712+ collect_register_by_name (regcache, "eda", &eda);
713
714 /* FIXME: Possibly adjust to match watched range. */
715 return eda;
716 }
717
718 static void
719-cris_fill_gregset (void *buf)
720+cris_fill_gregset (struct regcache *regcache, void *buf)
721 {
722 int i;
723
724 for (i = 0; i < cris_num_regs; i++)
725 {
726 if (cris_regmap[i] != -1)
727- collect_register (i, ((char *) buf) + cris_regmap[i]);
728+ collect_register (regcache, i, ((char *) buf) + cris_regmap[i]);
729 }
730 }
731
732 static void
733-cris_store_gregset (const void *buf)
734+cris_store_gregset (struct regcache *regcache, const void *buf)
735 {
736 int i;
737
738 for (i = 0; i < cris_num_regs; i++)
739 {
740 if (cris_regmap[i] != -1)
741- supply_register (i, ((char *) buf) + cris_regmap[i]);
742+ supply_register (regcache, i, ((char *) buf) + cris_regmap[i]);
743 }
744 }
745
746-typedef unsigned long elf_gregset_t[cris_num_regs];
747-
748 struct regset_info target_regsets[] = {
749- { PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t),
750+ { PTRACE_GETREGS, PTRACE_SETREGS, 0, cris_num_regs * 4,
751 GENERAL_REGS, cris_fill_gregset, cris_store_gregset },
752 { 0, 0, 0, -1, -1, NULL, NULL }
753 };
754
755 struct linux_target_ops the_low_target = {
756- init_register_crisv32,
757+ init_registers_crisv32,
758 -1,
759 NULL,
760 NULL,
761
762=== modified file 'gdb/gdbserver/server.h'
763--- gdb/gdbserver/server.h 2012-04-29 06:28:30 +0000
764+++ gdb/gdbserver/server.h 2012-12-13 13:30:32 +0000
765@@ -21,6 +21,7 @@
766 #define SERVER_H
767
768 #include "config.h"
769+#include "build-gnulib-gdbserver/config.h"
770
771 #ifdef __MINGW32CE__
772 #include "wincecompat.h"
773
774=== modified file 'gdb/i386-tdep.c'
775--- gdb/i386-tdep.c 2012-07-04 20:46:18 +0000
776+++ gdb/i386-tdep.c 2012-12-13 13:30:32 +0000
777@@ -7805,9 +7805,6 @@
778 tdep->num_mmx_regs = 8;
779 tdep->num_ymm_regs = 0;
780
781- tdep->sp_regnum_from_eax = -1;
782- tdep->pc_regnum_from_eax = -1;
783-
784 tdesc_data = tdesc_data_alloc ();
785
786 set_gdbarch_relocate_instruction (gdbarch, i386_relocate_instruction);
787@@ -7852,14 +7849,6 @@
788 /* Support dword pseudo-register if it hasn't been disabled. */
789 tdep->eax_regnum = ymm0_regnum;
790 ymm0_regnum += tdep->num_dword_regs;
791- if (tdep->sp_regnum_from_eax != -1)
792- set_gdbarch_sp_regnum (gdbarch,
793- (tdep->eax_regnum
794- + tdep->sp_regnum_from_eax));
795- if (tdep->pc_regnum_from_eax != -1)
796- set_gdbarch_pc_regnum (gdbarch,
797- (tdep->eax_regnum
798- + tdep->pc_regnum_from_eax));
799 }
800 else
801 tdep->eax_regnum = -1;
802
803=== modified file 'gdb/i386-tdep.h'
804--- gdb/i386-tdep.h 2012-07-04 20:46:18 +0000
805+++ gdb/i386-tdep.h 2012-12-13 13:30:32 +0000
806@@ -149,14 +149,6 @@
807 of pseudo dword register support. */
808 int eax_regnum;
809
810- /* Register number for SP, relative to %eax. Set this to -1 to
811- indicate the absence of pseudo SP register support. */
812- int sp_regnum_from_eax;
813-
814- /* Register number for PC, relative to %eax. Set this to -1 to
815- indicate the absence of pseudo PC register support. */
816- int pc_regnum_from_eax;
817-
818 /* Number of core registers. */
819 int num_core_regs;
820
821
822=== modified file 'gdb/infcmd.c'
823--- gdb/infcmd.c 2012-06-29 22:46:42 +0000
824+++ gdb/infcmd.c 2012-12-13 13:30:32 +0000
825@@ -1777,6 +1777,11 @@
826 return;
827 }
828
829+ /* Ignore TAILCALL_FRAME type frames, they were executed already before
830+ entering THISFRAME. */
831+ while (get_frame_type (frame) == TAILCALL_FRAME)
832+ frame = get_prev_frame (frame);
833+
834 /* Find the function we will return from. */
835
836 function = find_pc_function (get_frame_pc (get_selected_frame (NULL)));
837
838=== modified file 'gdb/infrun.c'
839--- gdb/infrun.c 2012-07-01 10:37:02 +0000
840+++ gdb/infrun.c 2012-12-13 13:30:32 +0000
841@@ -4896,14 +4896,22 @@
842
843 if (execution_direction == EXEC_REVERSE)
844 {
845- struct symtab_and_line sr_sal;
846+ /* If we're already at the start of the function, we've either
847+ just stepped backward into a single instruction function,
848+ or stepped back out of a signal handler to the first instruction
849+ of the function. Just keep going, which will single-step back
850+ to the caller. */
851+ if (ecs->stop_func_start != stop_pc)
852+ {
853+ struct symtab_and_line sr_sal;
854
855- /* Normal function call return (static or dynamic). */
856- init_sal (&sr_sal);
857- sr_sal.pc = ecs->stop_func_start;
858- sr_sal.pspace = get_frame_program_space (frame);
859- insert_step_resume_breakpoint_at_sal (gdbarch,
860- sr_sal, null_frame_id);
861+ /* Normal function call return (static or dynamic). */
862+ init_sal (&sr_sal);
863+ sr_sal.pc = ecs->stop_func_start;
864+ sr_sal.pspace = get_frame_program_space (frame);
865+ insert_step_resume_breakpoint_at_sal (gdbarch,
866+ sr_sal, null_frame_id);
867+ }
868 }
869 else
870 insert_step_resume_breakpoint_at_caller (frame);
871@@ -4973,15 +4981,23 @@
872
873 if (execution_direction == EXEC_REVERSE)
874 {
875- /* Set a breakpoint at callee's start address.
876- From there we can step once and be back in the caller. */
877- struct symtab_and_line sr_sal;
878+ /* If we're already at the start of the function, we've either just
879+ stepped backward into a single instruction function without line
880+ number info, or stepped back out of a signal handler to the first
881+ instruction of the function without line number info. Just keep
882+ going, which will single-step back to the caller. */
883+ if (ecs->stop_func_start != stop_pc)
884+ {
885+ /* Set a breakpoint at callee's start address.
886+ From there we can step once and be back in the caller. */
887+ struct symtab_and_line sr_sal;
888
889- init_sal (&sr_sal);
890- sr_sal.pc = ecs->stop_func_start;
891- sr_sal.pspace = get_frame_program_space (frame);
892- insert_step_resume_breakpoint_at_sal (gdbarch,
893- sr_sal, null_frame_id);
894+ init_sal (&sr_sal);
895+ sr_sal.pc = ecs->stop_func_start;
896+ sr_sal.pspace = get_frame_program_space (frame);
897+ insert_step_resume_breakpoint_at_sal (gdbarch,
898+ sr_sal, null_frame_id);
899+ }
900 }
901 else
902 /* Set a breakpoint at callee's return address (the address
903
904=== modified file 'gdb/linespec.c'
905--- gdb/linespec.c 2012-07-30 18:03:53 +0000
906+++ gdb/linespec.c 2012-12-13 13:30:32 +0000
907@@ -286,6 +286,11 @@
908 /* Is the entire linespec quote-enclosed? */
909 int is_quote_enclosed;
910
911+ /* Is a keyword syntactically valid at this point?
912+ In, e.g., "break thread thread 1", the leading "keyword" must not
913+ be interpreted as such. */
914+ int keyword_ok;
915+
916 /* The state of the parse. */
917 struct linespec_state state;
918 #define PARSER_STATE(PPTR) (&(PPTR)->state)
919@@ -607,6 +612,10 @@
920 if (isspace (*PARSER_STREAM (parser)))
921 {
922 p = skip_spaces (PARSER_STREAM (parser));
923+ /* When we get here we know we've found something followed by
924+ a space (we skip over parens and templates below).
925+ So if we find a keyword now, we know it is a keyword and not,
926+ say, a function name. */
927 if (linespec_lexer_lex_keyword (p) != NULL)
928 {
929 LS_TOKEN_STOKEN (token).ptr = start;
930@@ -716,8 +725,10 @@
931 /* Skip any whitespace. */
932 PARSER_STREAM (parser) = skip_spaces (PARSER_STREAM (parser));
933
934- /* Check for a keyword. */
935- keyword = linespec_lexer_lex_keyword (PARSER_STREAM (parser));
936+ /* Check for a keyword, they end the linespec. */
937+ keyword = NULL;
938+ if (parser->keyword_ok)
939+ keyword = linespec_lexer_lex_keyword (PARSER_STREAM (parser));
940 if (keyword != NULL)
941 {
942 parser->lexer.current.type = LSTOKEN_KEYWORD;
943@@ -2018,6 +2029,10 @@
944 }
945 }
946
947+ /* A keyword at the start cannot be interpreted as such.
948+ Consider "b thread thread 42". */
949+ parser->keyword_ok = 0;
950+
951 parser->lexer.saved_arg = *argptr;
952 parser->lexer.stream = argptr;
953 file_exception.reason = 0;
954@@ -2092,6 +2107,9 @@
955 else if (token.type != LSTOKEN_STRING && token.type != LSTOKEN_NUMBER)
956 unexpected_linespec_error (parser);
957
958+ /* Now we can recognize keywords. */
959+ parser->keyword_ok = 1;
960+
961 /* Shortcut: If the next token is not LSTOKEN_COLON, we know that
962 this token cannot represent a filename. */
963 token = linespec_lexer_peek_token (parser);
964
965=== modified file 'gdb/main.c'
966--- gdb/main.c 2012-07-20 17:59:04 +0000
967+++ gdb/main.c 2012-12-13 13:30:32 +0000
968@@ -1083,10 +1083,6 @@
969 "), stream);
970 #endif
971 fputs_unfiltered (_("\
972- --use-deprecated-index-sections\n\
973- Do not reject deprecated .gdb_index sections.\n\
974-"), stream);
975- fputs_unfiltered (_("\
976 --version Print version information and then exit.\n\
977 -w Use a window interface.\n\
978 --write Set writing into executable and core files.\n\
979
980=== modified file 'gdb/ppc-linux-tdep.c'
981--- gdb/ppc-linux-tdep.c 2012-07-31 19:51:02 +0000
982+++ gdb/ppc-linux-tdep.c 2012-12-13 13:30:32 +0000
983@@ -648,8 +648,9 @@
984
985 /* Check if we are in the resolver. */
986 sym = lookup_minimal_symbol_by_pc (pc);
987- if ((strcmp (SYMBOL_LINKAGE_NAME (sym), "__glink") == 0)
988- || (strcmp (SYMBOL_LINKAGE_NAME (sym), "__glink_PLTresolve") == 0))
989+ if (sym != NULL
990+ && (strcmp (SYMBOL_LINKAGE_NAME (sym), "__glink") == 0
991+ || strcmp (SYMBOL_LINKAGE_NAME (sym), "__glink_PLTresolve") == 0))
992 return 1;
993
994 return 0;
995
996=== modified file 'gdb/python/py-auto-load.c'
997--- gdb/python/py-auto-load.c 2012-04-17 15:56:20 +0000
998+++ gdb/python/py-auto-load.c 2012-12-13 13:30:32 +0000
999@@ -31,10 +31,6 @@
1000
1001 #include "python-internal.h"
1002
1003-/* The suffix of per-objfile scripts to auto-load.
1004- E.g. When the program loads libfoo.so, look for libfoo-gdb.py. */
1005-#define GDBPY_AUTO_FILE_NAME "-gdb.py"
1006-
1007 /* The section to look for Python auto-loaded scripts (in file formats that
1008 support sections).
1009 Each entry in this section is a byte of value 1, and then the nul-terminated
1010
1011=== modified file 'gdb/python/python.h'
1012--- gdb/python/python.h 2012-04-17 15:51:41 +0000
1013+++ gdb/python/python.h 2012-12-13 13:30:32 +0000
1014@@ -24,6 +24,10 @@
1015
1016 struct breakpoint_object;
1017
1018+/* The suffix of per-objfile scripts to auto-load.
1019+ E.g. When the program loads libfoo.so, look for libfoo-gdb.py. */
1020+#define GDBPY_AUTO_FILE_NAME "-gdb.py"
1021+
1022 extern void finish_python_initialization (void);
1023
1024 void eval_python_from_control_command (struct command_line *);
1025
1026=== modified file 'gdb/symfile.c'
1027--- gdb/symfile.c 2012-06-26 20:14:01 +0000
1028+++ gdb/symfile.c 2012-12-13 13:30:32 +0000
1029@@ -2889,8 +2889,8 @@
1030 last_objfile_name);
1031 }
1032 fprintf_unfiltered (gdb_stdlog,
1033- "Created symtab 0x%lx for module %s.\n",
1034- (long) symtab, filename);
1035+ "Created symtab %s for module %s.\n",
1036+ host_address_to_string (symtab), filename);
1037 }
1038
1039 return (symtab);
1040
1041=== modified file 'gdb/testsuite/ChangeLog'
1042--- gdb/testsuite/ChangeLog 2012-08-16 17:08:40 +0000
1043+++ gdb/testsuite/ChangeLog 2012-12-13 13:30:32 +0000
1044@@ -1,3 +1,63 @@
1045+2012-11-15 Luis Machado <lgustavo@codesourcery.com>
1046+
1047+ * gdb.mi/mi-var-create-rtti.c: New file.
1048+ * gdb.mi/mi-var-create-rtti.exp: New file.
1049+
1050+2012-10-15 Jan Kratochvil <jan.kratochvil@redhat.com>
1051+ Doug Evans <dje@google.com>
1052+
1053+ Fix recent gdb_breakpoint regression.
1054+ * gdb.java/jmisc.exp: gdb_breakpoint for $function - remove curly
1055+ braces from the parameter.
1056+ * gdb.java/jprint.exp: Likewise.
1057+
1058+2012-10-15 Doug Evans <dje@google.com>
1059+
1060+ * lib/gdb.exp (runto): Fix call to gdb_breakpoint.
1061+
1062+2012-10-11 Doug Evans <dje@google.com>
1063+
1064+ PR breakpoints/14643.
1065+ * gdb.linespec/ls-errs.exp: Change tests of "b if|task|thread".
1066+ * gdb.linespec/thread.c: New file.
1067+ * gdb.linespec/thread.exp: New file.
1068+
1069+ * lib/gdb.exp (gdb_breakpoint): Fix varargs scan.
1070+ Recognize "message" -> print pass and fail. Add eof case.
1071+ (runto): Recognize message, no-message. Print pass/fail if requested,
1072+ with same treatment as gdb_breakpoint.
1073+ (runto_main): Pass no-message to runto.
1074+ (gdb_internal_error_resync): Add log message.
1075+
1076+2012-10-06 Jan Kratochvil <jan.kratochvil@redhat.com>
1077+
1078+ Fix crash during stepping on ppc32.
1079+ * gdb.base/step-symless.c: New file.
1080+ * gdb.base/step-symless.exp: New file.
1081+
1082+2012-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
1083+
1084+ PR 14119
1085+ * gdb.arch/amd64-tailcall-ret.S: New file.
1086+ * gdb.arch/amd64-tailcall-ret.c: New file.
1087+ * gdb.arch/amd64-tailcall-ret.exp: New file.
1088+ * gdb.reverse/amd64-tailcall-reverse.S: New file.
1089+ * gdb.reverse/amd64-tailcall-reverse.c: New file.
1090+ * gdb.reverse/amd64-tailcall-reverse.exp: New file.
1091+
1092+2012-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
1093+
1094+ PR 14548
1095+ * gdb.reverse/singlejmp-reverse-nodebug.S: New file.
1096+ * gdb.reverse/singlejmp-reverse-nodebug.c: New file.
1097+ * gdb.reverse/singlejmp-reverse.S: New file.
1098+ * gdb.reverse/singlejmp-reverse.c: New file.
1099+ * gdb.reverse/singlejmp-reverse.exp: New file.
1100+
1101+2012-09-13 Jan Kratochvil <jan.kratochvil@redhat.com>
1102+
1103+ * gdb.base/valgrind-infcall.exp: Remove comment about Ubuntu.
1104+
1105 2012-08-16 Tom Tromey <tromey@redhat.com>
1106
1107 * gdb.python/py-mi.exp: Add test for printer whose children
1108
1109=== modified file 'gdb/testsuite/gdb.base/valgrind-infcall.exp'
1110--- gdb/testsuite/gdb.base/valgrind-infcall.exp 2012-08-07 18:05:39 +0000
1111+++ gdb/testsuite/gdb.base/valgrind-infcall.exp 2012-12-13 13:30:32 +0000
1112@@ -96,7 +96,6 @@
1113 gdb_test_multiple "continue" "" {
1114 -re "Invalid free\\(\\).*: main .*\r\n$gdb_prompt $" {
1115 pass $test
1116- # In Ubuntu 10.04.4 environments 'break' does not work here.
1117 set loop 0
1118 }
1119 -re "Remote connection closed.*\r\n$gdb_prompt $" {
1120
1121=== modified file 'gdb/testsuite/gdb.java/jmisc.exp'
1122--- gdb/testsuite/gdb.java/jmisc.exp 2012-06-22 16:44:14 +0000
1123+++ gdb/testsuite/gdb.java/jmisc.exp 2012-12-13 13:30:32 +0000
1124@@ -43,8 +43,8 @@
1125 # signature.
1126 runto_main
1127 set function "${testfile}.main(java.lang.String\[\])"
1128- gdb_breakpoint "$function" { allow-pending }
1129- gdb_breakpoint "${function}void" { allow-pending }
1130+ gdb_breakpoint "$function" allow-pending
1131+ gdb_breakpoint "${function}void" allow-pending
1132 gdb_continue_to_breakpoint $function
1133
1134 gdb_test_multiple "ptype jmisc" "ptype jmisc" {
1135
1136=== modified file 'gdb/testsuite/gdb.java/jprint.exp'
1137--- gdb/testsuite/gdb.java/jprint.exp 2012-06-22 16:44:14 +0000
1138+++ gdb/testsuite/gdb.java/jprint.exp 2012-12-13 13:30:32 +0000
1139@@ -43,8 +43,8 @@
1140 # signature.
1141 runto_main
1142 set function "${testfile}.main(java.lang.String\[\])"
1143- gdb_breakpoint "$function" { allow-pending }
1144- gdb_breakpoint "${function}void" { allow-pending }
1145+ gdb_breakpoint "$function" allow-pending
1146+ gdb_breakpoint "${function}void" allow-pending
1147 gdb_continue_to_breakpoint $function
1148
1149 gdb_test "p jvclass.addprint(4,5,6)" " = 15" "unambiguous static call"
1150
1151=== modified file 'gdb/testsuite/gdb.linespec/ls-errs.exp'
1152--- gdb/testsuite/gdb.linespec/ls-errs.exp 2012-07-30 18:03:53 +0000
1153+++ gdb/testsuite/gdb.linespec/ls-errs.exp 2012-12-13 13:30:32 +0000
1154@@ -171,7 +171,7 @@
1155 }
1156
1157 foreach x {"if" "task" "thread"} {
1158- add the_tests $x unexpected_opt "keyword" $x
1159+ add the_tests $x invalid_function $x
1160 }
1161
1162 add the_tests "'main.c'flubber" unexpected_opt "string" "flubber"
1163
1164=== modified file 'gdb/testsuite/lib/gdb.exp'
1165--- gdb/testsuite/lib/gdb.exp 2012-07-12 16:39:42 +0000
1166+++ gdb/testsuite/lib/gdb.exp 2012-12-13 13:30:32 +0000
1167@@ -334,29 +334,44 @@
1168
1169 # Set a breakpoint at FUNCTION. If there is an additional argument it is
1170 # a list of options; the supported options are allow-pending, temporary,
1171-# and no-message.
1172+# message, no-message, and passfail.
1173+# The result is 1 for success, 0 for failure.
1174+#
1175+# Note: The handling of message vs no-message is messed up, but it's based
1176+# on historical usage. By default this function does not print passes,
1177+# only fails.
1178+# no-message: turns off printing of fails (and passes, but they're already off)
1179+# message: turns on printing of passes (and fails, but they're already on)
1180
1181 proc gdb_breakpoint { function args } {
1182 global gdb_prompt
1183 global decimal
1184
1185 set pending_response n
1186- if {[lsearch -exact [lindex $args 0] allow-pending] != -1} {
1187+ if {[lsearch -exact $args allow-pending] != -1} {
1188 set pending_response y
1189 }
1190
1191 set break_command "break"
1192 set break_message "Breakpoint"
1193- if {[lsearch -exact [lindex $args 0] temporary] != -1} {
1194+ if {[lsearch -exact $args temporary] != -1} {
1195 set break_command "tbreak"
1196 set break_message "Temporary breakpoint"
1197 }
1198
1199- set no_message 0
1200- if {[lsearch -exact [lindex $args 0] no-message] != -1} {
1201- set no_message 1
1202+ set print_pass 0
1203+ set print_fail 1
1204+ set no_message_loc [lsearch -exact $args no-message]
1205+ set message_loc [lsearch -exact $args message]
1206+ # The last one to appear in args wins.
1207+ if { $no_message_loc > $message_loc } {
1208+ set print_fail 0
1209+ } elseif { $message_loc > $no_message_loc } {
1210+ set print_pass 1
1211 }
1212
1213+ set test_name "setting breakpoint at $function"
1214+
1215 send_gdb "$break_command $function\n"
1216 # The first two regexps are what we get with -g, the third is without -g.
1217 gdb_expect 30 {
1218@@ -365,8 +380,8 @@
1219 -re "$break_message \[0-9\]* at .*$gdb_prompt $" {}
1220 -re "$break_message \[0-9\]* \\(.*\\) pending.*$gdb_prompt $" {
1221 if {$pending_response == "n"} {
1222- if { $no_message == 0 } {
1223- fail "setting breakpoint at $function"
1224+ if { $print_fail } {
1225+ fail $test_name
1226 }
1227 return 0
1228 }
1229@@ -376,23 +391,34 @@
1230 exp_continue
1231 }
1232 -re "A problem internal to GDB has been detected" {
1233- fail "setting breakpoint at $function in runto (GDB internal error)"
1234+ if { $print_fail } {
1235+ fail "$test_name (GDB internal error)"
1236+ }
1237 gdb_internal_error_resync
1238 return 0
1239 }
1240 -re "$gdb_prompt $" {
1241- if { $no_message == 0 } {
1242- fail "setting breakpoint at $function"
1243+ if { $print_fail } {
1244+ fail $test_name
1245+ }
1246+ return 0
1247+ }
1248+ eof {
1249+ if { $print_fail } {
1250+ fail "$test_name (eof)"
1251 }
1252 return 0
1253 }
1254 timeout {
1255- if { $no_message == 0 } {
1256- fail "setting breakpoint at $function (timeout)"
1257+ if { $print_fail } {
1258+ fail "$test_name (timeout)"
1259 }
1260 return 0
1261 }
1262 }
1263+ if { $print_pass } {
1264+ pass $test_name
1265+ }
1266 return 1;
1267 }
1268
1269@@ -400,8 +426,15 @@
1270 # Since this is the only breakpoint that will be set, if it stops
1271 # at a breakpoint, we will assume it is the one we want. We can't
1272 # just compare to "function" because it might be a fully qualified,
1273-# single quoted C++ function specifier. If there's an additional argument,
1274-# pass it to gdb_breakpoint.
1275+# single quoted C++ function specifier.
1276+#
1277+# If there are additional arguments, pass them to gdb_breakpoint.
1278+# We recognize no-message/message ourselves.
1279+# The default is no-message.
1280+# no-message is messed up here, like gdb_breakpoint: to preserve
1281+# historical usage fails are always printed by default.
1282+# no-message: turns off printing of fails (and passes, but they're already off)
1283+# message: turns on printing of passes (and fails, but they're already on)
1284
1285 proc runto { function args } {
1286 global gdb_prompt
1287@@ -409,7 +442,28 @@
1288
1289 delete_breakpoints
1290
1291- if ![gdb_breakpoint $function [lindex $args 0]] {
1292+ # Default to "no-message".
1293+ set args "no-message $args"
1294+
1295+ set print_pass 0
1296+ set print_fail 1
1297+ set no_message_loc [lsearch -exact $args no-message]
1298+ set message_loc [lsearch -exact $args message]
1299+ # The last one to appear in args wins.
1300+ if { $no_message_loc > $message_loc } {
1301+ set print_fail 0
1302+ } elseif { $message_loc > $no_message_loc } {
1303+ set print_pass 1
1304+ }
1305+
1306+ set test_name "running to $function in runto"
1307+
1308+ # We need to use eval here to pass our varargs args to gdb_breakpoint
1309+ # which is also a varargs function.
1310+ # But we also have to be careful because $function may have multiple
1311+ # elements, and we don't want Tcl to move the remaining elements after
1312+ # the first to $args. That is why $function is wrapped in {}.
1313+ if ![eval gdb_breakpoint {$function} $args] {
1314 return 0;
1315 }
1316
1317@@ -419,30 +473,46 @@
1318 # the "in func" output we get without -g.
1319 gdb_expect 30 {
1320 -re "Break.* at .*:$decimal.*$gdb_prompt $" {
1321+ if { $print_pass } {
1322+ pass $test_name
1323+ }
1324 return 1
1325 }
1326 -re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in .*$gdb_prompt $" {
1327+ if { $print_pass } {
1328+ pass $test_name
1329+ }
1330 return 1
1331 }
1332 -re "The target does not support running in non-stop mode.\r\n$gdb_prompt $" {
1333- unsupported "Non-stop mode not supported"
1334+ if { $print_fail } {
1335+ unsupported "Non-stop mode not supported"
1336+ }
1337 return 0
1338 }
1339 -re ".*A problem internal to GDB has been detected" {
1340- fail "running to $function in runto (GDB internal error)"
1341+ if { $print_fail } {
1342+ fail "$test_name (GDB internal error)"
1343+ }
1344 gdb_internal_error_resync
1345 return 0
1346 }
1347 -re "$gdb_prompt $" {
1348- fail "running to $function in runto"
1349+ if { $print_fail } {
1350+ fail $test_name
1351+ }
1352 return 0
1353 }
1354 eof {
1355- fail "running to $function in runto (end of file)"
1356+ if { $print_fail } {
1357+ fail "$test_name (eof)"
1358+ }
1359 return 0
1360 }
1361 timeout {
1362- fail "running to $function in runto (timeout)"
1363+ if { $print_fail } {
1364+ fail "$test_name (timeout)"
1365+ }
1366 return 0
1367 }
1368 }
1369@@ -455,7 +525,7 @@
1370 # If you don't want that, use gdb_start_cmd.
1371
1372 proc runto_main { } {
1373- return [runto main]
1374+ return [runto main no-message]
1375 }
1376
1377 ### Continue, and expect to hit a breakpoint.
1378@@ -508,6 +578,8 @@
1379 proc gdb_internal_error_resync {} {
1380 global gdb_prompt
1381
1382+ verbose -log "Resyncing due to internal error."
1383+
1384 set count 0
1385 while {$count < 10} {
1386 gdb_expect {
1387
1388=== modified file 'gdb/value.c'
1389--- gdb/value.c 2012-06-13 15:50:18 +0000
1390+++ gdb/value.c 2012-12-13 13:30:32 +0000
1391@@ -850,8 +850,12 @@
1392 result = value_type (value);
1393 if (opts.objectprint)
1394 {
1395- if (TYPE_CODE (result) == TYPE_CODE_PTR
1396+ /* If result's target type is TYPE_CODE_STRUCT, proceed to
1397+ fetch its rtti type. */
1398+ if ((TYPE_CODE (result) == TYPE_CODE_PTR
1399 || TYPE_CODE (result) == TYPE_CODE_REF)
1400+ && TYPE_CODE (check_typedef (TYPE_TARGET_TYPE (result)))
1401+ == TYPE_CODE_STRUCT)
1402 {
1403 struct type *real_type;
1404
1405
1406=== modified file 'gdb/version.in'
1407--- gdb/version.in 2012-09-13 14:19:38 +0000
1408+++ gdb/version.in 2012-12-13 13:30:32 +0000
1409@@ -1,1 +1,1 @@
1410-7.5-2012.09-1~bzr
1411+7.5-2012.12-1~bzr
1412
1413=== modified file 'libiberty/ChangeLog'
1414--- libiberty/ChangeLog 2012-07-13 23:39:45 +0000
1415+++ libiberty/ChangeLog 2012-12-13 13:30:32 +0000
1416@@ -1,3 +1,8 @@
1417+2012-07-31 Mike Frysinger <vapier@gentoo.org>
1418+
1419+ * md5.c (md5_finish_ctx): Declare swap_bytes. Assign SWAP() output
1420+ to swap_bytes, and then call memcpy to move it to ctx->buffer.
1421+
1422 2012-07-13 Doug Evans <dje@google.com>
1423
1424 * filename_cmp.c (filename_hash, filename_eq): New functions.
1425
1426=== modified file 'libiberty/md5.c'
1427--- libiberty/md5.c 2011-09-23 20:01:11 +0000
1428+++ libiberty/md5.c 2012-12-13 13:30:32 +0000
1429@@ -103,6 +103,7 @@
1430 {
1431 /* Take yet unprocessed bytes into account. */
1432 md5_uint32 bytes = ctx->buflen;
1433+ md5_uint32 swap_bytes;
1434 size_t pad;
1435
1436 /* Now count remaining bytes. */
1437@@ -113,10 +114,13 @@
1438 pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
1439 memcpy (&ctx->buffer[bytes], fillbuf, pad);
1440
1441- /* Put the 64-bit file length in *bits* at the end of the buffer. */
1442- *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
1443- *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
1444- (ctx->total[0] >> 29));
1445+ /* Put the 64-bit file length in *bits* at the end of the buffer.
1446+ Use memcpy to avoid aliasing problems. On most systems, this
1447+ will be optimized away to the same code. */
1448+ swap_bytes = SWAP (ctx->total[0] << 3);
1449+ memcpy (&ctx->buffer[bytes + pad], &swap_bytes, sizeof (swap_bytes));
1450+ swap_bytes = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
1451+ memcpy (&ctx->buffer[bytes + pad + 4], &swap_bytes, sizeof (swap_bytes));
1452
1453 /* Process last bytes. */
1454 md5_process_block (ctx->buffer, bytes + pad + 8, ctx);

Subscribers

People subscribed via source and target branches