Edjunior Barbosa Machado | 24 May 2013 05:19
Picon

[PATCH] Fix wp-replication.exp for targets that provide only 1 hw watchpoint

Thanks,
--
Edjunior

gdb/testsuite/ChangeLog
2013-05-24  Edjunior Barbosa Machado  <emachado <at> linux.vnet.ibm.com>

	* gdb.threads/wp-replication.exp: Fix accounting of hardware watchpoints
	on targets that provide only one hw watchpoint.

---
 gdb/testsuite/gdb.threads/wp-replication.exp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gdb/testsuite/gdb.threads/wp-replication.exp b/gdb/testsuite/gdb.threads/wp-replication.exp
index 8927a43..f73b763 100644
--- a/gdb/testsuite/gdb.threads/wp-replication.exp
+++ b/gdb/testsuite/gdb.threads/wp-replication.exp
 <at>  <at>  -78,6 +78,10  <at>  <at>  while { $done == 0 } {
     }
   }

+  if { $done == 1 } {
+    break
+  }
+
   gdb_test_multiple "continue" "watchpoint created successfully" {
     -re ".*Breakpoint 2, empty_cycle \\(\\).*$gdb_prompt $" {
       incr hwatch_count
--

-- 
(Continue reading)

Doug Evans | 24 May 2013 03:37
Picon
Favicon

[commit] New board file fission-dwp.exp

Hi.
This is a new board file for testing fission with dwp file generation.

Committed.

2013-05-23  Doug Evans  <dje <at> google.com>

	* boards/fission-dwp.exp: New file.

Index: boards/fission-dwp.exp
===================================================================
RCS file: boards/fission-dwp.exp
diff -N boards/fission-dwp.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ boards/fission-dwp.exp	24 May 2013 01:33:50 -0000	1.2
 <at>  <at>  -0,0 +1,49  <at>  <at> 
+# Copyright 2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
(Continue reading)

Doug Evans | 24 May 2013 02:31
Picon
Favicon

[commit] Handle no dwo files for cc-with-tweaks.sh -p.

Hi.
Some tests don't have any debug info, and thus no dwo files.
This patch updates cc-with-tweaks.sh to handle this.
Committed.

2013-05-23  Doug Evans  <dje <at> google.com>

	* contrib/cc-with-tweaks.sh (-p): Handle no dwo files.

diff -u -p -r1.9 cc-with-tweaks.sh
--- contrib/cc-with-tweaks.sh	25 Mar 2013 22:53:54 -0000	1.9
+++ contrib/cc-with-tweaks.sh	24 May 2013 00:28:02 -0000
 <at>  <at>  -179,10 +179,13  <at>  <at>  fi
 if [ "$want_dwp" = true ]; then
     dwo_files=$($READELF -wi "${output_file}" | grep _dwo_name | \
 	sed -e 's/^.*: //' | sort | uniq)
-    $DWP -o "${output_file}.dwp" ${dwo_files} > /dev/null
-    rc=$?
-    [ $rc != 0 ] && exit $rc
-    rm -f ${dwo_files}
+    rc=0
+    if [ -n "$dwo_files" ]; then
+	$DWP -o "${output_file}.dwp" ${dwo_files} > /dev/null
+	rc=$?
+	[ $rc != 0 ] && exit $rc
+	rm -f ${dwo_files}
+    fi
 fi

 rm -f "$index_file"
(Continue reading)

Svante Signell | 23 May 2013 18:36
Picon

Small patch to enable build of gdb-7.6 for GNU/Hurd

Hello,

Since gdb 7.4.1 a PATH_MAX usage was introduced in the file
gdb/nto-tdep.c:nto_init_solib_absolute_prefix(). This function is only
called in gdb/nto-procfs.c. This file is QNX Neutrino specific and is
not compiled for Hurd (while nto-tdep.c, also QNX-specific is).

The attached patch solve_PATH_MAX_issue.patch fixes the FTBFS for
GNU/Hurd. Alternately the build should be changed to exclude compilation
of nto-tdep.c for non-QNX architectures. The compilation of various
targets specific code is enabled by --enable-targets=all in
the .../gdb/Makefile ALL_TARGET_OBS variable. This seems to be common of
builds for all architectures in Debian.

In case you need feedback from me use Cc: since I'm not subscribed to
gdb-patches.

Thanks,
Svante Signell

Attachment (solve_PATH_MAX_issue.patch): text/x-patch, 1128 bytes
Simon Marchi | 22 May 2013 23:47
Picon
Favicon

Exit code of exited inferiors

Hi,

The current behaviour in Eclipse's CDT when a debugged process exits normally
is to remove it from the list. We would like to change it so that they stay in
the process list after they exit, probably showing them as "Exited" and
displaying the exit code.

The problem is there is no way to query GDB for the exit code of an exited
inferior. One way to do it would be to catch the thread-group-exited MI event,
which contains the exit code. It means that the CDT view would be required to
keep a state and could not be reconstructed from scratch, simply by querying
GDB. The current design seems to avoid keeping information in the view that GDB
can't give us.

For this reason, I suggest adding an exit-code field in the -list-thread-group
response when appropriate. Appropriate meaning after an inferior process has
exited, and before it is run again. This field would contain the exit code for
the last run of the inferior. Doing so would require a little modification, as
the exit_code and has_exit_code fields in struct inferior are wiped in
exit_inferior_1. I think it would be reasonable to keep them around until the
inferior is started again.

Is there any problem with this? There might be some cases where it does not
make sense. For example, after the inferior exits, if you change the executable
(using the "file" command), you have a state where the exit code does not match
the executable anymore. Not sure if this is an issue.

I am sending this patch to illustrate the proposed change. Thanks for your
comments!

(Continue reading)

Michael Eager | 22 May 2013 20:03

[PATCH] Revised display-linkage-name

Attached is a revised patch to display the linkage name (the linker symbol)
along with the function name when setting, listing, or hitting a breakpoint.
This is a revision of http://sourceware.org/ml/gdb-patches/2013-03/msg00806.html.
(BTW, the gdb-patches mailing list archive doesn't show the original email from
3/18/13, quoted in the referenced message.)

Changes:
   Add NEWS and docs.
   Add linkage name to "info break" listing.
   Add MI annotations.
   Add command to set/show display length limit, remove define.
   Add test case.

There is a minor inconsistency where the linkage name is displayed.
When setting/hitting a breakpoint, the linkage name is displayed
within brackets following the source name, before the arguments.  In
the "info breakpoint" command, the linkage name is displayed in brackets
after the arguments.  This is because SYMBOL_PRINT_NAME(sym) returns a
complete function signature, not just the function name.

The test case was added to gdb.cp for convenience, since it uses
the C++ compiler.  The patch is not dependent on C++.

Tom -- can you verify that the MI support is correct?   I don't have
any way to test this.

gdb/
2013-05-23  Michael Eager <eager <at> eagercon.com>

       * NEWS: Announcement.
(Continue reading)

mbilal | 22 May 2013 14:04

Re: [PATCH 1/7] PR gdb/15224 "set history filename" to by immediately converted to absolute path

On 05/15/2013 03:43 PM, mbilal wrote:
> Hi,
> Please find attached updated patch.
>
> On Wednesday, May 08, 2013 8:47 PM Pedro wrote:
>
> >Missing space before NULL.  That's a lot of casting.  We can just refer
> >to history_filename directly.  It'd be very good to have a comment 
> here with the
> >rationale for this -- there's one in init_history we can reuse.  So:
>
> Fixed
>
> On Wednesday, May 08, 2013 10:25 PM Pedro wrote:
> >In addition to my previous comments, I realized that this will do the
> >wrong thing with "set history filename ~/foo".  Best use tilde_expand
> >and gdb_realpath
>
> 'set history filename ~/foo' is working because following code is doing
> same as you described . I have also attached test case for this.
>
> if (arg != NULL)
>       {
>         /* Clear trailing whitespace of filename.  */
>         char *ptr = arg + strlen (arg) - 1;
>
>         while (ptr >= arg && (*ptr == ' ' || *ptr == '\t'))
>           ptr--;
>         *(ptr + 1) = '\0';
>
(Continue reading)

mbilal | 22 May 2013 14:00

[PATCH 2/7] [PR gdb/15224] Unify interactivity tests to use input_from_terminal_p

Hi,
Please find attached patch
In this patch, I am unifying interactivity check with 
input_from_terminal_p for adding the linebuffer value to add_history.

./Changelog

2013-05-22  Muhammad Bilal  <mbilal <at> codesourcery.com>

     PR gdb/15224
     * top.c (command_line_input): Unify interactivity tests to use
     input_from_terminal_p.
     * event-top.c (command_line_handler): Likewise.

diff --git a/gdb/top.c b/gdb/top.c
index 480b67e..bf53176 100644
--- a/gdb/top.c
+++ b/gdb/top.c
 <at>  <at>  -1082,8 +1082,7  <at>  <at>  command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
   *p = 0;

   /* Add line to history if appropriate.  */
-  if (instream == stdin
-      && ISATTY (stdin) && *linebuffer)
+  if (*linebuffer && input_from_terminal_p ())
     add_history (linebuffer);

   /* Note: lines consisting solely of comments are added to the command
(Continue reading)

GDB Administrator | 22 May 2013 03:51
Favicon

New ARI warning Wed May 22 01:51:06 UTC 2013 in -D 2013-05-22-gmt

408a409
> gdb/mi/mi-cmd-break.c:138: code: sprintf: Do not use sprintf, instead use xsnprintf or xstrprintf
gdb/mi/mi-cmd-break.c:138:	      sprintf (tmp, ', (unsigned char) argv[0][i]);
568a570
> gdb/python/python-internal.h:177: code: editCase function: Function name starts lower case but has
uppercased letters.
gdb/python/python-internal.h:177:gdb_Py_DECREF (void *op)

Doug Evans | 22 May 2013 02:45
Picon
Favicon

[RFC] Support temporary breakpoints in runto_main.

Hi.

If I imagine I'm new to gdb and see the name runto_main I can well
imagine not expecting the implementation of that command to leave the
breakpoint behind.
Leaving the breakpoint behind is not something I would expect from that name.

Thus to me I think the default for runto_main should be to use
a temporary breakpoint.  However, there are several tests that
have been written that assume it does.

And, there is one test that assumed it didn't: wp-replication.exp.
But that I fixed differently:
http://sourceware.org/ml/gdb-patches/2013-05/msg00797.html

This patch adds the ability to use temporary breakpoints,
and makes the default "permanent".  Thought it would be easy
to switch the default once all the various tests are updated.

This is only RFC as I'm happy to check it in, but it's not something
that "fixes" a bug or is currently useful.

2013-05-21  Doug Evans  <dje <at> google.com>

	* lib/gdb.exp (gdb_breakpoint): New option "permanent".
	(runto): Ditto.
	(runto_main): New argument "args".

Index: testsuite/lib/gdb.exp
===================================================================
(Continue reading)

Doug Evans | 22 May 2013 02:23
Picon
Favicon

[patch] Fix wp-replication.exp on llvm

Hi.

This test runs forever when compiled with llvm because the
breakpoint used to "runto main" is continually hit which
wp-replication.exp assumes doesn't happen.
This doesn't happen with at least relatively recent versions
of gcc due to different code generation.
With gcc note the jump over the call to empty_cycle.
gdb puts the breakpoint there serendipitously making the test pass.

(gdb) disas main
Dump of assembler code for function main:
   0x0000000000400a9c <+0>:	push   %rbp
   0x0000000000400a9d <+1>:	mov    %rsp,%rbp
   0x0000000000400aa0 <+4>:	sub    $0x60,%rsp
=> 0x0000000000400aa4 <+8>:	jmp    0x400aab <main+15>
   0x0000000000400aa6 <+10>:	callq  0x400a8c <empty_cycle>
   0x0000000000400aab <+15>:	mov    0x817(%rip),%eax        # 0x4012c8 <watch_count_done>
   0x0000000000400ab1 <+21>:	test   %eax,%eax
   0x0000000000400ab3 <+23>:	je     0x400aa6 <main+10>

int
main ()
{
  int res;
  pthread_t threads[NR_THREADS];
  int i;

  while (watch_count_done == 0)
    {
(Continue reading)


Gmane