2009-05-04 16:53:01 +00:00
|
|
|
|
http://sourceware.org/gdb/wiki/ProjectArcher
|
|
|
|
|
http://sourceware.org/gdb/wiki/ArcherBranchManagement
|
|
|
|
|
|
|
|
|
|
GIT snapshot:
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
commit d1a09bf2f8e7e3f752a1bbeba135bc080bf0c865
|
2009-05-04 16:53:01 +00:00
|
|
|
|
|
2013-09-11 13:42:29 +00:00
|
|
|
|
tromey/python
|
2009-05-04 16:53:01 +00:00
|
|
|
|
|
|
|
|
|
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
diff --git a/README.archer b/README.archer
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..173b8ea
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/README.archer
|
|
|
|
|
@@ -0,0 +1,2 @@
|
|
|
|
|
+This branch originally held the Python code for gdb. It still exists
|
|
|
|
|
+because a small amount of code here has not yet been merged upstream.
|
|
|
|
|
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
|
|
|
|
|
index be69b6f..a4483e4 100644
|
|
|
|
|
--- a/gdb/Makefile.in
|
|
|
|
|
+++ b/gdb/Makefile.in
|
|
|
|
|
@@ -1515,6 +1515,12 @@ stamp-h: $(srcdir)/config.in config.status
|
|
|
|
|
CONFIG_LINKS= \
|
|
|
|
|
$(SHELL) config.status
|
|
|
|
|
|
|
|
|
|
+.gdbinit: $(srcdir)/gdbinit.in config.status
|
|
|
|
|
+ CONFIG_FILES=".gdbinit:gdbinit.in" \
|
|
|
|
|
+ CONFIG_COMMANDS= \
|
|
|
|
|
+ CONFIG_HEADERS= \
|
|
|
|
|
+ $(SHELL) config.status
|
|
|
|
|
+
|
|
|
|
|
config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh
|
|
|
|
|
$(SHELL) config.status --recheck
|
|
|
|
|
|
|
|
|
|
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
|
|
|
|
|
index 00c70bb..f93ffdd 100644
|
|
|
|
|
--- a/gdb/data-directory/Makefile.in
|
|
|
|
|
+++ b/gdb/data-directory/Makefile.in
|
|
|
|
|
@@ -64,7 +64,10 @@ PYTHON_FILE_LIST = \
|
|
|
|
|
gdb/printing.py \
|
2014-12-24 16:27:18 +00:00
|
|
|
|
gdb/prompt.py \
|
2014-08-11 14:08:48 +00:00
|
|
|
|
gdb/xmethod.py \
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ gdb/types.py \
|
2011-03-10 09:18:25 +00:00
|
|
|
|
gdb/command/__init__.py \
|
|
|
|
|
+ gdb/command/ignore_errors.py \
|
|
|
|
|
+ gdb/command/pahole.py \
|
2014-08-11 14:08:48 +00:00
|
|
|
|
gdb/command/xmethods.py \
|
2013-09-11 13:42:29 +00:00
|
|
|
|
gdb/command/frame_filters.py \
|
2013-07-08 14:47:04 +00:00
|
|
|
|
gdb/command/type_printers.py \
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
@@ -74,6 +77,8 @@ PYTHON_FILE_LIST = \
|
2013-07-08 14:47:04 +00:00
|
|
|
|
gdb/function/__init__.py \
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
gdb/function/caller_is.py \
|
2014-12-24 16:27:18 +00:00
|
|
|
|
gdb/function/strfns.py \
|
2011-03-10 09:18:25 +00:00
|
|
|
|
+ gdb/function/caller_is.py \
|
|
|
|
|
+ gdb/function/in_scope.py \
|
2014-12-24 16:27:18 +00:00
|
|
|
|
gdb/printer/__init__.py \
|
|
|
|
|
gdb/printer/bound_registers.py
|
2011-03-10 09:18:25 +00:00
|
|
|
|
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
|
|
|
|
|
index e086c33..5dfeb1d 100644
|
|
|
|
|
--- a/gdb/doc/gdb.texinfo
|
|
|
|
|
+++ b/gdb/doc/gdb.texinfo
|
|
|
|
|
@@ -1225,6 +1225,16 @@ for remote debugging.
|
2010-09-06 11:08:41 +00:00
|
|
|
|
Run using @var{device} for your program's standard input and output.
|
|
|
|
|
@c FIXME: kingdon thinks there is more to -tty. Investigate.
|
2010-04-16 16:29:50 +00:00
|
|
|
|
|
2010-09-06 11:08:41 +00:00
|
|
|
|
+@item -P
|
|
|
|
|
+@cindex @code{-P}
|
|
|
|
|
+@itemx --python
|
|
|
|
|
+@cindex @code{--python}
|
|
|
|
|
+Change interpretation of command line so that the argument immediately
|
|
|
|
|
+following this switch is taken to be the name of a Python script file.
|
|
|
|
|
+This option stops option processing; subsequent options are passed to
|
|
|
|
|
+Python as @code{sys.argv}. This option is only available if Python
|
|
|
|
|
+scripting support was enabled when @value{GDBN} was configured.
|
|
|
|
|
+
|
|
|
|
|
@c resolve the situation of these eventually
|
|
|
|
|
@item -tui
|
|
|
|
|
@cindex @code{--tui}
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
|
|
|
|
|
index 234ce5c..e940125 100644
|
|
|
|
|
--- a/gdb/doc/python.texi
|
|
|
|
|
+++ b/gdb/doc/python.texi
|
|
|
|
|
@@ -88,8 +88,6 @@ containing @code{end}. For example:
|
2010-09-06 11:08:41 +00:00
|
|
|
|
|
|
|
|
|
@smallexample
|
|
|
|
|
(@value{GDBP}) python
|
|
|
|
|
-Type python script
|
|
|
|
|
-End with a line saying just "end".
|
|
|
|
|
>print 23
|
|
|
|
|
>end
|
|
|
|
|
23
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in
|
|
|
|
|
index 05a38b2..9801fdf 100644
|
|
|
|
|
--- a/gdb/gdb-gdb.gdb.in
|
|
|
|
|
+++ b/gdb/gdb-gdb.gdb.in
|
2014-08-11 14:08:48 +00:00
|
|
|
|
@@ -1,5 +1,15 @@
|
|
|
|
|
echo Setting up the environment for debugging gdb.\n
|
|
|
|
|
|
|
|
|
|
+# Set up the Python library and "require" command.
|
|
|
|
|
+python
|
|
|
|
|
+from os.path import abspath
|
|
|
|
|
+gdb.datadir = abspath ('@srcdir@/python/lib')
|
|
|
|
|
+gdb.pythonlibdir = gdb.datadir
|
|
|
|
|
+gdb.__path__ = [gdb.datadir + '/gdb']
|
|
|
|
|
+sys.path.insert(0, gdb.datadir)
|
|
|
|
|
+end
|
|
|
|
|
+source @srcdir@/python/lib/gdb/__init__.py
|
2009-08-17 13:40:03 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
if !$gdb_init_done
|
|
|
|
|
set variable $gdb_init_done = 1
|
2010-04-16 16:29:50 +00:00
|
|
|
|
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
diff --git a/gdb/main.c b/gdb/main.c
|
|
|
|
|
index accd927..ed211f6 100644
|
|
|
|
|
--- a/gdb/main.c
|
|
|
|
|
+++ b/gdb/main.c
|
|
|
|
|
@@ -33,6 +33,7 @@
|
2009-08-11 16:28:33 +00:00
|
|
|
|
|
2014-08-11 14:08:48 +00:00
|
|
|
|
#include "interps.h"
|
|
|
|
|
#include "main.h"
|
|
|
|
|
+#include "python/python.h"
|
|
|
|
|
#include "source.h"
|
|
|
|
|
#include "cli/cli-cmds.h"
|
|
|
|
|
#include "objfiles.h"
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
@@ -444,6 +445,8 @@ captured_main (void *data)
|
2014-08-11 14:08:48 +00:00
|
|
|
|
char *cdarg = NULL;
|
|
|
|
|
char *ttyarg = NULL;
|
2009-08-17 13:40:03 +00:00
|
|
|
|
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ int python_script = 0;
|
2009-05-04 16:53:01 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
/* These are static so that we can take their address in an
|
|
|
|
|
initializer. */
|
|
|
|
|
static int print_help;
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
@@ -649,10 +652,14 @@ captured_main (void *data)
|
2014-08-11 14:08:48 +00:00
|
|
|
|
{"args", no_argument, &set_args, 1},
|
|
|
|
|
{"l", required_argument, 0, 'l'},
|
|
|
|
|
{"return-child-result", no_argument, &return_child_result, 1},
|
|
|
|
|
+#if HAVE_PYTHON
|
|
|
|
|
+ {"python", no_argument, 0, 'P'},
|
|
|
|
|
+ {"P", no_argument, 0, 'P'},
|
|
|
|
|
+#endif
|
|
|
|
|
{0, no_argument, 0, 0}
|
|
|
|
|
};
|
2012-06-16 04:55:29 +00:00
|
|
|
|
|
2014-08-11 14:08:48 +00:00
|
|
|
|
- while (1)
|
|
|
|
|
+ while (!python_script)
|
|
|
|
|
{
|
|
|
|
|
int option_index;
|
2009-05-04 16:53:01 +00:00
|
|
|
|
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
@@ -670,6 +677,9 @@ captured_main (void *data)
|
2014-08-11 14:08:48 +00:00
|
|
|
|
case 0:
|
|
|
|
|
/* Long option that just sets a flag. */
|
|
|
|
|
break;
|
|
|
|
|
+ case 'P':
|
|
|
|
|
+ python_script = 1;
|
|
|
|
|
+ break;
|
|
|
|
|
case OPT_SE:
|
|
|
|
|
symarg = optarg;
|
|
|
|
|
execarg = optarg;
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
@@ -851,7 +861,31 @@ captured_main (void *data)
|
2009-05-04 16:53:01 +00:00
|
|
|
|
|
2014-08-11 14:08:48 +00:00
|
|
|
|
/* Now that gdb_init has created the initial inferior, we're in
|
|
|
|
|
position to set args for that inferior. */
|
|
|
|
|
- if (set_args)
|
|
|
|
|
+ if (python_script)
|
|
|
|
|
+ {
|
|
|
|
|
+ /* The first argument is a python script to evaluate, and
|
|
|
|
|
+ subsequent arguments are passed to the script for
|
|
|
|
|
+ processing there. */
|
|
|
|
|
+ if (optind >= argc)
|
|
|
|
|
+ {
|
|
|
|
|
+ fprintf_unfiltered (gdb_stderr,
|
|
|
|
|
+ _("%s: Python script file name required\n"),
|
|
|
|
|
+ argv[0]);
|
|
|
|
|
+ exit (1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* FIXME: should handle inferior I/O intelligently here.
|
|
|
|
|
+ E.g., should be possible to run gdb in pipeline and have
|
|
|
|
|
+ Python (and gdb) output go to stderr or file; and if a
|
|
|
|
|
+ prompt is needed, open the tty. */
|
|
|
|
|
+ quiet = 1;
|
|
|
|
|
+ /* FIXME: should read .gdbinit if, and only if, a prompt is
|
|
|
|
|
+ requested by the script. Though... maybe this is not
|
|
|
|
|
+ ideal? */
|
|
|
|
|
+ /* FIXME: likewise, reading in history. */
|
|
|
|
|
+ inhibit_gdbinit = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (set_args)
|
|
|
|
|
{
|
|
|
|
|
/* The remaining options are the command-line options for the
|
|
|
|
|
inferior. The first one is the sym/exec file, and the rest
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
@@ -1129,7 +1163,8 @@ captured_main (void *data)
|
2009-05-04 16:53:01 +00:00
|
|
|
|
|
2014-08-11 14:08:48 +00:00
|
|
|
|
/* Read in the old history after all the command files have been
|
|
|
|
|
read. */
|
|
|
|
|
- init_history ();
|
|
|
|
|
+ if (!python_script)
|
|
|
|
|
+ init_history ();
|
2009-05-04 16:53:01 +00:00
|
|
|
|
|
2014-08-11 14:08:48 +00:00
|
|
|
|
if (batch_flag)
|
|
|
|
|
{
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
@@ -1140,13 +1175,25 @@ captured_main (void *data)
|
2014-08-11 14:08:48 +00:00
|
|
|
|
/* Show time and/or space usage. */
|
|
|
|
|
do_cleanups (pre_stat_chain);
|
2009-05-04 16:53:01 +00:00
|
|
|
|
|
2014-08-11 14:08:48 +00:00
|
|
|
|
- /* NOTE: cagney/1999-11-07: There is probably no reason for not
|
|
|
|
|
- moving this loop and the code found in captured_command_loop()
|
|
|
|
|
- into the command_loop() proper. The main thing holding back that
|
|
|
|
|
- change - SET_TOP_LEVEL() - has been eliminated. */
|
|
|
|
|
- while (1)
|
|
|
|
|
+#if HAVE_PYTHON
|
|
|
|
|
+ if (python_script)
|
|
|
|
|
{
|
|
|
|
|
- catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
|
|
|
|
|
+ extern int pagination_enabled;
|
|
|
|
|
+ pagination_enabled = 0;
|
|
|
|
|
+ run_python_script (argc - optind, &argv[optind]);
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+#endif
|
|
|
|
|
+ {
|
|
|
|
|
+ /* NOTE: cagney/1999-11-07: There is probably no reason for not
|
|
|
|
|
+ moving this loop and the code found in captured_command_loop()
|
|
|
|
|
+ into the command_loop() proper. The main thing holding back that
|
|
|
|
|
+ change - SET_TOP_LEVEL() - has been eliminated. */
|
|
|
|
|
+ while (1)
|
|
|
|
|
+ {
|
|
|
|
|
+ catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
|
|
|
|
|
+ }
|
|
|
|
|
}
|
|
|
|
|
/* No exit -- exit is through quit_command. */
|
|
|
|
|
}
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
@@ -1180,6 +1227,12 @@ print_gdb_help (struct ui_file *stream)
|
2014-08-11 14:08:48 +00:00
|
|
|
|
fputs_unfiltered (_("\
|
|
|
|
|
This is the GNU debugger. Usage:\n\n\
|
|
|
|
|
gdb [options] [executable-file [core-file or process-id]]\n\
|
|
|
|
|
+ gdb [options] --args executable-file [inferior-arguments ...]\n"), stream);
|
|
|
|
|
+#if HAVE_PYTHON
|
|
|
|
|
+ fputs_unfiltered (_("\
|
|
|
|
|
+ gdb [options] [--python|-P] script-file [script-arguments ...]\n"), stream);
|
|
|
|
|
+#endif
|
|
|
|
|
+ fputs_unfiltered (_("\n\
|
|
|
|
|
gdb [options] --args executable-file [inferior-arguments ...]\n\n\
|
|
|
|
|
"), stream);
|
|
|
|
|
fputs_unfiltered (_("\
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
@@ -1225,6 +1278,13 @@ Output and user interface control:\n\n\
|
2014-08-11 14:08:48 +00:00
|
|
|
|
fputs_unfiltered (_("\
|
|
|
|
|
--dbx DBX compatibility mode.\n\
|
|
|
|
|
--xdb XDB compatibility mode.\n\
|
|
|
|
|
+"), stream);
|
|
|
|
|
+#if HAVE_PYTHON
|
|
|
|
|
+ fputs_unfiltered (_("\
|
|
|
|
|
+ --python, -P Following argument is Python script file; remaining\n\
|
|
|
|
|
+ arguments are passed to script.\n"), stream);
|
|
|
|
|
+#endif
|
|
|
|
|
+ fputs_unfiltered (_("\
|
|
|
|
|
-q, --quiet, --silent\n\
|
|
|
|
|
Do not print version number on startup.\n\n\
|
|
|
|
|
"), stream);
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
diff --git a/gdb/python/lib/gdb/command/ignore_errors.py b/gdb/python/lib/gdb/command/ignore_errors.py
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..6fa48ff
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/gdb/python/lib/gdb/command/ignore_errors.py
|
2014-08-11 14:08:48 +00:00
|
|
|
|
@@ -0,0 +1,37 @@
|
|
|
|
|
+# Ignore errors in user commands.
|
2009-08-11 16:28:33 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+# Copyright (C) 2008 Free Software Foundation, Inc.
|
2009-05-04 16:53:01 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+# 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/>.
|
2009-05-04 16:53:01 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+import gdb
|
2009-05-04 16:53:01 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+class IgnoreErrorsCommand (gdb.Command):
|
|
|
|
|
+ """Execute a single command, ignoring all errors.
|
|
|
|
|
+Only one-line commands are supported.
|
|
|
|
|
+This is primarily useful in scripts."""
|
2009-05-04 16:53:01 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ def __init__ (self):
|
|
|
|
|
+ super (IgnoreErrorsCommand, self).__init__ ("ignore-errors",
|
|
|
|
|
+ gdb.COMMAND_OBSCURE,
|
|
|
|
|
+ # FIXME...
|
|
|
|
|
+ gdb.COMPLETE_COMMAND)
|
2009-05-04 16:53:01 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ def invoke (self, arg, from_tty):
|
|
|
|
|
+ try:
|
|
|
|
|
+ gdb.execute (arg, from_tty)
|
|
|
|
|
+ except:
|
|
|
|
|
+ pass
|
2009-05-04 16:53:01 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+IgnoreErrorsCommand ()
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..dee04f5
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/gdb/python/lib/gdb/command/pahole.py
|
2014-08-11 14:08:48 +00:00
|
|
|
|
@@ -0,0 +1,81 @@
|
|
|
|
|
+# pahole command for gdb
|
2009-05-04 16:53:01 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+# Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
|
2012-06-16 04:55:29 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+# 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/>.
|
2012-06-16 04:55:29 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+import gdb
|
2012-06-16 04:55:29 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+class Pahole (gdb.Command):
|
|
|
|
|
+ """Show the holes in a structure.
|
|
|
|
|
+This command takes a single argument, a type name.
|
|
|
|
|
+It prints the type and displays comments showing where holes are."""
|
2012-06-16 04:55:29 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ def __init__ (self):
|
|
|
|
|
+ super (Pahole, self).__init__ ("pahole", gdb.COMMAND_NONE,
|
|
|
|
|
+ gdb.COMPLETE_SYMBOL)
|
2012-06-16 04:55:29 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ def maybe_print_hole(self, bitpos, field_bitpos):
|
|
|
|
|
+ if bitpos != field_bitpos:
|
|
|
|
|
+ hole = field_bitpos - bitpos
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ print (' /* XXX %d bit hole, try to pack */' % hole)
|
2012-06-16 04:55:29 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ def pahole (self, type, level, name):
|
|
|
|
|
+ if name is None:
|
|
|
|
|
+ name = ''
|
|
|
|
|
+ tag = type.tag
|
|
|
|
|
+ if tag is None:
|
|
|
|
|
+ tag = ''
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ print ('%sstruct %s {' % (' ' * (2 * level), tag))
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ bitpos = 0
|
|
|
|
|
+ for field in type.fields ():
|
|
|
|
|
+ # Skip static fields.
|
|
|
|
|
+ if not hasattr (field, ('bitpos')):
|
|
|
|
|
+ continue
|
2009-09-26 22:03:42 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ ftype = field.type.strip_typedefs()
|
2011-03-10 09:18:25 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ self.maybe_print_hole(bitpos, field.bitpos)
|
|
|
|
|
+ bitpos = field.bitpos
|
|
|
|
|
+ if field.bitsize > 0:
|
|
|
|
|
+ fieldsize = field.bitsize
|
|
|
|
|
+ else:
|
|
|
|
|
+ # TARGET_CHAR_BIT here...
|
|
|
|
|
+ fieldsize = 8 * ftype.sizeof
|
2009-09-26 22:03:42 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ # TARGET_CHAR_BIT
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)))
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ bitpos = bitpos + fieldsize
|
2009-09-26 22:03:42 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ if ftype.code == gdb.TYPE_CODE_STRUCT:
|
|
|
|
|
+ self.pahole (ftype, level + 1, field.name)
|
|
|
|
|
+ else:
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ print (' ' * (2 + 2 * level))
|
|
|
|
|
+ print ('%s %s' % (str (ftype), field.name))
|
2009-09-26 22:03:42 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ if level == 0:
|
|
|
|
|
+ self.maybe_print_hole(bitpos, 8 * type.sizeof)
|
2009-09-26 22:03:42 +00:00
|
|
|
|
+
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ print (' ' * (14 + 2 * level))
|
|
|
|
|
+ print ('} %s' % name)
|
2009-09-26 22:03:42 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ def invoke (self, arg, from_tty):
|
|
|
|
|
+ type = gdb.lookup_type (arg)
|
|
|
|
|
+ type = type.strip_typedefs ()
|
|
|
|
|
+ if type.code != gdb.TYPE_CODE_STRUCT:
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ raise (TypeError, '%s is not a struct type' % arg)
|
|
|
|
|
+ print (' ' * 14)
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ self.pahole (type, 0, '')
|
2011-03-10 09:18:25 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+Pahole()
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
diff --git a/gdb/python/lib/gdb/function/in_scope.py b/gdb/python/lib/gdb/function/in_scope.py
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..8742680
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/gdb/python/lib/gdb/function/in_scope.py
|
2014-08-11 14:08:48 +00:00
|
|
|
|
@@ -0,0 +1,47 @@
|
|
|
|
|
+# In-scope function.
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+# Copyright (C) 2008 Free Software Foundation, Inc.
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
|
|
|
|
+# 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/>.
|
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+import gdb
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+class InScope (gdb.Function):
|
|
|
|
|
+ """Return True if all the given variables or macros are in scope.
|
|
|
|
|
+Takes one argument for each variable name to be checked."""
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ def __init__ (self):
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ super (InScope, self).__init__ ("in_scope")
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ def invoke (self, *vars):
|
|
|
|
|
+ if len (vars) == 0:
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ raise (TypeError, "in_scope takes at least one argument")
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ # gdb.Value isn't hashable so it can't be put in a map.
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ # Convert to string first.
|
|
|
|
|
+ wanted = set (map (lambda x: x.string (), vars))
|
|
|
|
|
+ found = set ()
|
|
|
|
|
+ block = gdb.selected_frame ().block ()
|
|
|
|
|
+ while block:
|
|
|
|
|
+ for sym in block:
|
|
|
|
|
+ if (sym.is_argument or sym.is_constant
|
|
|
|
|
+ or sym.is_function or sym.is_variable):
|
|
|
|
|
+ if sym.name in wanted:
|
|
|
|
|
+ found.add (sym.name)
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ block = block.superblock
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ return wanted == found
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+InScope ()
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
diff --git a/gdb/python/python.c b/gdb/python/python.c
|
|
|
|
|
index b1d8283..54a2d9b 100644
|
|
|
|
|
--- a/gdb/python/python.c
|
|
|
|
|
+++ b/gdb/python/python.c
|
|
|
|
|
@@ -93,6 +93,8 @@ const struct extension_language_defn extension_language_python =
|
2014-08-11 14:08:48 +00:00
|
|
|
|
#include "linespec.h"
|
|
|
|
|
#include "source.h"
|
|
|
|
|
#include "version.h"
|
|
|
|
|
+#include "inferior.h"
|
|
|
|
|
+#include "gdbthread.h"
|
|
|
|
|
#include "target.h"
|
|
|
|
|
#include "gdbthread.h"
|
|
|
|
|
#include "interps.h"
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
@@ -1220,6 +1222,83 @@ gdbpy_print_stack (void)
|
2014-08-11 14:08:48 +00:00
|
|
|
|
|
|
|
|
|
/* Return the current Progspace.
|
|
|
|
|
There always is one. */
|
|
|
|
|
+/* True if 'gdb -P' was used, false otherwise. */
|
|
|
|
|
+static int running_python_script;
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+/* True if we are currently in a call to 'gdb.cli', false otherwise. */
|
|
|
|
|
+static int in_cli;
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+/* Enter the command loop. */
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+static PyObject *
|
|
|
|
|
+gdbpy_cli (PyObject *unused1, PyObject *unused2)
|
|
|
|
|
+{
|
|
|
|
|
+ if (! running_python_script || in_cli)
|
|
|
|
|
+ return PyErr_Format (PyExc_RuntimeError, "cannot invoke CLI recursively");
|
|
|
|
|
+
|
|
|
|
|
+ if (ui_out_is_mi_like_p (current_uiout))
|
|
|
|
|
+ return PyErr_Format (PyExc_RuntimeError, _("Cannot invoke CLI from MI."));
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ in_cli = 1;
|
|
|
|
|
+ current_interp_command_loop ();
|
|
|
|
|
+ in_cli = 0;
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ Py_RETURN_NONE;
|
|
|
|
|
+}
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+/* Set up the Python argument vector and evaluate a script. This is
|
|
|
|
|
+ used to implement 'gdb -P'. */
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+void
|
|
|
|
|
+run_python_script (int argc, char **argv)
|
|
|
|
|
+{
|
|
|
|
|
+ FILE *input;
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ /* We never free this, since we plan to exit at the end. */
|
|
|
|
|
+ ensure_python_env (get_current_arch (), current_language);
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ running_python_script = 1;
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+
|
|
|
|
|
+#if PYTHON_ABI_VERSION < 3
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ PySys_SetArgv (argc - 1, argv + 1);
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+#else
|
|
|
|
|
+ {
|
|
|
|
|
+ wchar_t **wargv = alloca (sizeof (*wargv) * (argc + 1));
|
|
|
|
|
+ int i;
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 1; i < argc; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ size_t len = mbstowcs (NULL, argv[i], 0);
|
|
|
|
|
+ size_t len2;
|
|
|
|
|
+
|
|
|
|
|
+ if (len == (size_t) -1)
|
|
|
|
|
+ {
|
|
|
|
|
+ fprintf (stderr, "Invalid multibyte argument #%d \"%s\"\n",
|
|
|
|
|
+ i, argv[i]);
|
|
|
|
|
+ exit (1);
|
|
|
|
|
+ }
|
|
|
|
|
+ wargv[i] = alloca (sizeof (**wargv) * (len + 1));
|
|
|
|
|
+ len2 = mbstowcs (wargv[i], argv[i], len + 1);
|
|
|
|
|
+ assert (len2 == len);
|
|
|
|
|
+ }
|
|
|
|
|
+ wargv[argc] = NULL;
|
|
|
|
|
+ PySys_SetArgv (argc - 1, wargv + 1);
|
|
|
|
|
+ }
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+ input = fopen (argv[0], "r");
|
|
|
|
|
+ if (! input)
|
|
|
|
|
+ {
|
|
|
|
|
+ fprintf (stderr, "could not open %s: %s\n", argv[0], strerror (errno));
|
|
|
|
|
+ exit (1);
|
|
|
|
|
+ }
|
|
|
|
|
+ PyRun_SimpleFile (input, argv[0]);
|
|
|
|
|
+ fclose (input);
|
|
|
|
|
+ exit (0);
|
|
|
|
|
+}
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
+
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2014-08-11 14:08:48 +00:00
|
|
|
|
|
|
|
|
|
static PyObject *
|
|
|
|
|
gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
@@ -1913,6 +1992,8 @@ static PyMethodDef GdbMethods[] =
|
2014-08-11 14:08:48 +00:00
|
|
|
|
Evaluate command, a string, as a gdb CLI command. Optionally returns\n\
|
|
|
|
|
a Python String containing the output of the command if to_string is\n\
|
|
|
|
|
set to True." },
|
|
|
|
|
+ { "cli", gdbpy_cli, METH_NOARGS,
|
|
|
|
|
+ "Enter the gdb CLI" },
|
|
|
|
|
{ "parameter", gdbpy_parameter, METH_VARARGS,
|
|
|
|
|
"Return a gdb parameter's value" },
|
|
|
|
|
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
diff --git a/gdb/python/python.h b/gdb/python/python.h
|
|
|
|
|
index 9e99992..c776e59 100644
|
|
|
|
|
--- a/gdb/python/python.h
|
|
|
|
|
+++ b/gdb/python/python.h
|
2014-08-11 14:08:48 +00:00
|
|
|
|
@@ -25,4 +25,6 @@
|
|
|
|
|
/* This is all that python exports to gdb. */
|
|
|
|
|
extern const struct extension_language_defn extension_language_python;
|
|
|
|
|
|
|
|
|
|
+extern void run_python_script (int argc, char **argv);
|
|
|
|
|
+
|
|
|
|
|
#endif /* GDB_PYTHON_H */
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
|
|
|
|
|
index 0b11e12..e35e829 100644
|
|
|
|
|
--- a/gdb/testsuite/gdb.gdb/selftest.exp
|
|
|
|
|
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
|
|
|
|
|
@@ -92,6 +92,10 @@ proc do_steps_and_nexts {} {
|
2014-08-11 14:08:48 +00:00
|
|
|
|
set description "step over cmdarg_vec initialization"
|
|
|
|
|
set command "step"
|
|
|
|
|
}
|
|
|
|
|
+ -re ".*python_script = 0.*$gdb_prompt $" {
|
|
|
|
|
+ set description "step over python_script initialization"
|
|
|
|
|
+ set command "step"
|
|
|
|
|
+ }
|
|
|
|
|
-re ".*pre_stat_chain = make_command_stats_cleanup.*$gdb_prompt $" {
|
|
|
|
|
set description "next over make_command_stats_cleanup and everything it calls"
|
|
|
|
|
set command "next"
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
|
|
|
|
|
index e47f340..a7e0a52 100644
|
|
|
|
|
--- a/gdb/testsuite/gdb.python/py-frame.exp
|
|
|
|
|
+++ b/gdb/testsuite/gdb.python/py-frame.exp
|
|
|
|
|
@@ -95,6 +95,8 @@ gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.r
|
2012-06-16 04:55:29 +00:00
|
|
|
|
|
2013-07-08 14:47:04 +00:00
|
|
|
|
gdb_test "python print ('result = %s' % (gdb.selected_frame () == f1))" " = True" "test gdb.selected_frame"
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
|
2013-07-08 14:47:04 +00:00
|
|
|
|
+gdb_test "python print ('result = %s' % (f0.block ()))" "<gdb.Block object at 0x\[\[:xdigit:\]\]+>" "test Frame.block"
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+
|
|
|
|
|
# Can read SP register.
|
|
|
|
|
gdb_test "python print ('result = %s' % (gdb.selected_frame ().read_register ('sp') == gdb.parse_and_eval ('\$sp')))" \
|
|
|
|
|
" = True" \
|
|
|
|
|
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
|
|
|
|
|
index f081ff0..58cce09 100644
|
|
|
|
|
--- a/gdb/testsuite/gdb.python/py-value.exp
|
|
|
|
|
+++ b/gdb/testsuite/gdb.python/py-value.exp
|
|
|
|
|
@@ -388,6 +388,15 @@ proc test_value_after_death {} {
|
2012-06-16 04:55:29 +00:00
|
|
|
|
"print value's type"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
+# Regression test for a cast failure. The bug was that if we cast a
|
|
|
|
|
+# value to its own type, gdb could crash. This happened because we
|
|
|
|
|
+# could end up double-freeing a struct value.
|
|
|
|
|
+proc test_cast_regression {} {
|
|
|
|
|
+ gdb_test "python v = gdb.Value(5)" "" "create value for cast test"
|
|
|
|
|
+ gdb_test "python v = v.cast(v.type)" "" "cast value for cast test"
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
+ gdb_test "python print(v)" "5" "print value for cast test"
|
2012-06-16 04:55:29 +00:00
|
|
|
|
+}
|
2011-08-11 13:47:36 +00:00
|
|
|
|
+
|
2012-06-16 04:55:29 +00:00
|
|
|
|
# Regression test for invalid subscript operations. The bug was that
|
|
|
|
|
# the type of the value was not being checked before allowing a
|
|
|
|
|
# subscript operation to proceed.
|
- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
* Python Scripting
- You can now access frame registers from Python scripts.
- New attribute 'producer' for gdb.Symtab objects.
* New Python-based convenience functions:
- $_caller_is(name [, number_of_frames])
- $_caller_matches(regexp [, number_of_frames])
- $_any_caller_is(name [, number_of_frames])
- $_any_caller_matches(regexp [, number_of_frames])
* New commands
- queue-signal signal-name-or-number
Queue a signal to be delivered to the thread when it is resumed.
* On resume, GDB now always passes the signal the program had stopped
for to the thread the signal was sent to, even if the user changed
threads before resuming. Previously GDB would often (but not
always) deliver the signal to the thread that happens to be current
at resume time.
* Conversely, the "signal" command now consistently delivers the
requested signal to the current thread. GDB now asks for
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.
* "breakpoint always-inserted" modes "off" and "auto" merged.
Now, when 'breakpoint always-inserted mode' is set to "off", GDB
won't remove breakpoints from the target until all threads stop,
even in non-stop mode. The "auto" mode has been removed, and "off"
is now the default mode.
* MI changes
- The -list-thread-groups command outputs an exit-code field for
inferiors that have exited.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00
|
|
|
|
@@ -517,6 +526,7 @@ test_value_in_inferior
|
2012-06-16 04:55:29 +00:00
|
|
|
|
test_inferior_function_call
|
|
|
|
|
test_lazy_strings
|
|
|
|
|
test_value_after_death
|
|
|
|
|
+test_cast_regression
|
|
|
|
|
|
|
|
|
|
# Test either C or C++ values.
|
2014-02-10 17:10:42 +00:00
|
|
|
|
|