Compare commits

...

6 Commits
master ... f17

Author SHA1 Message Date
Jan Kratochvil 83616a8dbc Fix internal error on finish with inlined frame (BZ 894678). 2013-01-13 13:26:21 +01:00
Jan Kratochvil 133704520b [testsuite] Fix gdb-orphanripper.c lockup on F-17 (/dev/pts/* glibc chown). 2013-01-13 08:21:23 +01:00
Jan Kratochvil c426152679 entry values: Fix resolving in inlined frames. 2012-10-05 16:16:39 +02:00
Jan Kratochvil 765eea176b Fix "ambiguous linespec" regression: break lineno.
- Permit passing pointers as address number even for C++ methods (Keith Seitz).
2012-09-27 22:24:18 +02:00
Jan Kratochvil 35031c9fb4 Support constant DW_AT_high_pc produced by FSF GCC HEAD (Mark Wielaard). 2012-08-22 16:07:52 +02:00
Jan Kratochvil ac0dd8df9b Support DW_OP_GNU_parameter_ref for -O2 -g inferiors (BZ 827375). 2012-06-14 09:41:53 +02:00
9 changed files with 3938 additions and 5 deletions

78
gdb-break-lineno.patch Normal file
View File

@ -0,0 +1,78 @@
http://sourceware.org/ml/gdb-cvs/2012-06/msg00077.html
### src/gdb/ChangeLog 2012/06/11 18:44:58 1.14345
### src/gdb/ChangeLog 2012/06/11 19:16:21 1.14346
## -1,3 +1,10 @@
+2012-06-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix regression by the "ambiguous linespec" series.
+ * breakpoint.c (parse_breakpoint_sals): New variable cursal. Use
+ get_last_displayed_symtab and get_last_displayed_line and depending
+ on CURSAL.
+
2012-06-11 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (dw2_get_primary_filename_reader): New function.
--- src/gdb/breakpoint.c 2012/06/05 19:50:50 1.679
+++ src/gdb/breakpoint.c 2012/06/11 19:16:23 1.680
@@ -8802,19 +8802,26 @@
}
else
{
+ struct symtab_and_line cursal = get_current_source_symtab_and_line ();
+
/* Force almost all breakpoints to be in terms of the
current_source_symtab (which is decode_line_1's default).
This should produce the results we want almost all of the
- time while leaving default_breakpoint_* alone. */
- if (last_displayed_sal_is_valid ())
+ time while leaving default_breakpoint_* alone.
+
+ ObjC: However, don't match an Objective-C method name which
+ may have a '+' or '-' succeeded by a '['. */
+ if (last_displayed_sal_is_valid ()
+ && (!cursal.symtab
+ || ((strchr ("+-", (*address)[0]) != NULL)
+ && ((*address)[1] != '['))))
decode_line_full (address, DECODE_LINE_FUNFIRSTLINE,
get_last_displayed_symtab (),
get_last_displayed_line (),
canonical, NULL, NULL);
else
decode_line_full (address, DECODE_LINE_FUNFIRSTLINE,
- (struct symtab *) NULL, 0,
- canonical, NULL, NULL);
+ cursal.symtab, cursal.line, canonical, NULL, NULL);
}
}
### src/gdb/testsuite/ChangeLog 2012/06/11 17:44:06 1.3220
### src/gdb/testsuite/ChangeLog 2012/06/11 19:16:24 1.3221
## -1,5 +1,11 @@
2012-06-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Fix regression by the "ambiguous linespec" series.
+ * gdb.base/break.exp (list marker1, break lineno, delete $bpnum): New
+ tests.
+
+2012-06-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+
* lib/future.exp: Set $use_gdb_compile even if only find_go_linker is
missing.
--- src/gdb/testsuite/gdb.base/break.exp 2012/04/05 18:50:28 1.55
+++ src/gdb/testsuite/gdb.base/break.exp 2012/06/11 19:16:24 1.56
@@ -371,6 +371,13 @@
}
}
+# Test the 'list' commands sets current file for the 'break LINENO' command.
+set bp_marker1 [gdb_get_line_number "set breakpoint 16 here" ${srcfile1}]
+gdb_test "list marker1" ".*"
+gdb_test "break $bp_marker1" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*${srcfile1}, line ${bp_marker1}\\." \
+ "break lineno"
+gdb_test_no_output {delete $bpnum}
+
#
# run until the breakpoint at a line number
#

990
gdb-check-type.patch Normal file
View File

@ -0,0 +1,990 @@
http://sourceware.org/ml/gdb-cvs/2012-08/msg00133.html
### src/gdb/ChangeLog 2012/08/17 03:06:10 1.14599
### src/gdb/ChangeLog 2012/08/17 17:36:56 1.14600
## -1,3 +1,48 @@
+2012-08-17 Keith Seitz <keiths@redhat.com>
+
+ PR c++/13356
+ * gdbtypes.c (strict_type_checking): New variable.
+ (show_strict_type_checking): New function.
+ (rank_one_type): Return NS_POINTER_INTEGER_CONVERSION_BADNESS
+ if strict type checking is disabled.
+ (_initialize_gdbtypes): Add "check type" subcommand.
+ * gdbtypes.h (NS_INTEGER_POINTER_CONVERSION_BADNESS): New struct.
+
+2012-08-17 Keith Seitz <keiths@redhat.com>
+
+ * language.h (type_mode): Remove.
+ (type_check): Remove.
+ (struct language_defn): Remove la_type_check.
+ (STRICT_TYPE): Remove unused macro.
+ (type_error): Remove.
+ * language.c (set_type_range_case): Renamed to ...
+ (set_range_case): ... this. Update all callers.
+ Remove type_mode/type_check.
+ (type_mode): Remove.
+ (type_check): Remove.
+ (show_type_command): Remove.
+ (set_type_command): Remove.
+ (language_info): Remove type checking output.
+ (type_error): Remove unused function.
+ (range_error): Update comment.
+ (unknown_language_defn): Remove la_type_check.
+ (auto_language_defn): Likewise.
+ (local_language_defn): Likewise.
+ (_initialize_language): Remove "check type" subcommand.
+ * ada-lang.c (ada_language_defn): Remove la_type_check.
+ * c-lang.c (c_language_defn): Likewise.
+ (cplus_language_defn): Likewise.
+ (asm_language_defn): Likewise.
+ (minimal_language_defn): Likewise.
+ * d-lang.c (d_language_defn): Likewise.
+ * f-lang.c (f_language_defn): Likewise.
+ * go-lang.c (go_language_defn): Likewise.
+ * jv-lang.c (java_language_defn): Likewise.
+ * m2-lang.c (m2_language_defn): Likewise.
+ * objc-lang.c (objc_language_defn): Likewise.
+ * opencl-lang.c (opencl_language_defn): Likewise.
+ * p-lang.c (pascal_language_defn): Likewise.
+
2012-08-16 Mike Frysinger <vapier@gentoo.org>
* infcmd.c (_initialize_infcmd): Remove trailing ) in next help text.
Index: gdb-7.4.50.20120120/gdb/gdbtypes.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/gdbtypes.c 2012-09-27 22:08:02.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/gdbtypes.c 2012-09-27 22:10:37.453588076 +0200
@@ -62,6 +62,7 @@ const struct rank BASE_CONVERSION_BADNES
const struct rank REFERENCE_CONVERSION_BADNESS = {2,0};
const struct rank NULL_POINTER_CONVERSION_BADNESS = {2,0};
const struct rank NS_POINTER_CONVERSION_BADNESS = {10,0};
+const struct rank NS_INTEGER_POINTER_CONVERSION_BADNESS = {3,0};
/* Floatformat pairs. */
const struct floatformat *floatformats_ieee_half[BFD_ENDIAN_UNKNOWN] = {
@@ -134,6 +135,19 @@ show_overload_debug (struct ui_file *fil
value);
}
+/* A flag to enable strict type checking. */
+
+static int strict_type_checking = 1;
+
+/* A function to show the status of strict type checking. */
+
+static void
+show_strict_type_checking (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c, const char *value)
+{
+ fprintf_filtered (file, _("Strict type checking is %s.\n"), value);
+}
+
struct extra
{
char str[128];
@@ -2619,12 +2633,20 @@ rank_one_type (struct type *parm, struct
case TYPE_CODE_FUNC:
return rank_one_type (TYPE_TARGET_TYPE (parm), arg, NULL);
case TYPE_CODE_INT:
- if (value != NULL && TYPE_CODE (value_type (value)) == TYPE_CODE_INT
- && value_as_long (value) == 0)
+ if (value != NULL && TYPE_CODE (value_type (value)) == TYPE_CODE_INT)
{
- /* Null pointer conversion: allow it to be cast to a pointer.
- [4.10.1 of C++ standard draft n3290] */
- return NULL_POINTER_CONVERSION_BADNESS;
+ if (value_as_long (value) == 0)
+ {
+ /* Null pointer conversion: allow it to be cast to a pointer.
+ [4.10.1 of C++ standard draft n3290] */
+ return NULL_POINTER_CONVERSION_BADNESS;
+ }
+ else
+ {
+ /* If type checking is disabled, allow the conversion. */
+ if (!strict_type_checking)
+ return NS_INTEGER_POINTER_CONVERSION_BADNESS;
+ }
}
/* fall through */
case TYPE_CODE_ENUM:
@@ -4597,4 +4619,13 @@ _initialize_gdbtypes (void)
NULL, NULL,
show_opaque_type_resolution,
&setlist, &showlist);
+
+ /* Add an option to permit non-strict type checking. */
+ add_setshow_boolean_cmd ("type", class_support,
+ &strict_type_checking,
+ _("Set strict type checking."),
+ _("Show strict type checking."),
+ NULL, NULL,
+ show_strict_type_checking,
+ &setchecklist, &showchecklist);
}
Index: gdb-7.4.50.20120120/gdb/gdbtypes.h
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/gdbtypes.h 2012-09-27 22:08:10.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/gdbtypes.h 2012-09-27 22:09:46.061565471 +0200
@@ -1720,6 +1720,9 @@ extern const struct rank NULL_POINTER_CO
/* Converting a pointer to an int is usually OK. */
extern const struct rank NS_POINTER_CONVERSION_BADNESS;
+/* Badness of converting a (non-zero) integer constant
+ to a pointer. */
+extern const struct rank NS_INTEGER_POINTER_CONVERSION_BADNESS;
extern struct rank sum_ranks (struct rank a, struct rank b);
extern int compare_ranks (struct rank a, struct rank b);
Index: gdb-7.4.50.20120120/gdb/language.h
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/language.h 2012-01-04 19:57:01.000000000 +0100
+++ gdb-7.4.50.20120120/gdb/language.h 2012-09-27 22:09:46.107565505 +0200
@@ -55,27 +55,6 @@ extern enum range_check
}
range_check;
-/* type_mode ==
- type_mode_auto: type_check set automatically to default of language.
- type_mode_manual: type_check set manually by user. */
-
-extern enum type_mode
- {
- type_mode_auto, type_mode_manual
- }
-type_mode;
-
-/* type_check ==
- type_check_on: Types are checked in GDB expressions, producing errors.
- type_check_warn: Types are checked, producing warnings.
- type_check_off: Types are not checked in GDB expressions. */
-
-extern enum type_check
- {
- type_check_off, type_check_warn, type_check_on
- }
-type_check;
-
/* case_mode ==
case_mode_auto: case_sensitivity set upon selection of scope.
case_mode_manual: case_sensitivity set only by user. */
@@ -152,10 +131,6 @@ struct language_defn
enum range_check la_range_check;
- /* Default type checking. */
-
- enum type_check la_type_check;
-
/* Default case sensitivity. */
enum case_sensitivity la_case_sensitivity;
@@ -409,9 +384,6 @@ struct type *language_lookup_primitive_t
/* These macros define the behaviour of the expression
evaluator. */
-/* Should we strictly type check expressions? */
-#define STRICT_TYPE (type_check != type_check_off)
-
/* Should we range check values against the domain of their type? */
#define RANGE_CHECK (range_check != range_check_off)
@@ -483,8 +455,6 @@ extern void binop_type_check (struct val
/* Error messages */
-extern void type_error (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
-
extern void range_error (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
/* Data: Does this value represent "truth" to the current language? */
Index: gdb-7.4.50.20120120/gdb/language.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/language.c 2012-01-04 19:57:01.000000000 +0100
+++ gdb-7.4.50.20120120/gdb/language.c 2012-09-27 22:09:46.117565500 +0200
@@ -55,7 +55,7 @@ static void show_check (char *, int);
static void set_check (char *, int);
-static void set_type_range_case (void);
+static void set_range_case (void);
static void unk_lang_emit_char (int c, struct type *type,
struct ui_file *stream, int quoter);
@@ -81,8 +81,6 @@ extern const struct language_defn unknow
enum range_mode range_mode = range_mode_auto;
enum range_check range_check = range_check_off;
-enum type_mode type_mode = type_mode_auto;
-enum type_check type_check = type_check_off;
enum case_mode case_mode = case_mode_auto;
enum case_sensitivity case_sensitivity = case_sensitive_on;
@@ -174,7 +172,7 @@ set_language_command (char *ignore, int
/* Enter manual mode. Set the specified language. */
language_mode = language_mode_manual;
current_language = languages[i];
- set_type_range_case ();
+ set_range_case ();
expected_language = current_language;
return;
}
@@ -186,79 +184,6 @@ set_language_command (char *ignore, int
language);
}
-/* Show command. Display a warning if the type setting does
- not match the current language. */
-static void
-show_type_command (struct ui_file *file, int from_tty,
- struct cmd_list_element *c, const char *value)
-{
- if (type_mode == type_mode_auto)
- {
- char *tmp = NULL;
-
- switch (type_check)
- {
- case type_check_on:
- tmp = "on";
- break;
- case type_check_off:
- tmp = "off";
- break;
- case type_check_warn:
- tmp = "warn";
- break;
- default:
- internal_error (__FILE__, __LINE__,
- "Unrecognized type check setting.");
- }
-
- fprintf_filtered (gdb_stdout,
- _("Type checking is \"auto; currently %s\".\n"),
- tmp);
- }
- else
- fprintf_filtered (gdb_stdout, _("Type checking is \"%s\".\n"),
- value);
-
- if (type_check != current_language->la_type_check)
- warning (_("the current type check setting"
- " does not match the language.\n"));
-}
-
-/* Set command. Change the setting for type checking. */
-static void
-set_type_command (char *ignore, int from_tty, struct cmd_list_element *c)
-{
- if (strcmp (type, "on") == 0)
- {
- type_check = type_check_on;
- type_mode = type_mode_manual;
- }
- else if (strcmp (type, "warn") == 0)
- {
- type_check = type_check_warn;
- type_mode = type_mode_manual;
- }
- else if (strcmp (type, "off") == 0)
- {
- type_check = type_check_off;
- type_mode = type_mode_manual;
- }
- else if (strcmp (type, "auto") == 0)
- {
- type_mode = type_mode_auto;
- set_type_range_case ();
- return;
- }
- else
- internal_error (__FILE__, __LINE__,
- _("Unrecognized type check setting: \"%s\""), type);
-
- if (type_check != current_language->la_type_check)
- warning (_("the current type check setting"
- " does not match the language.\n"));
-}
-
/* Show command. Display a warning if the range setting does
not match the current language. */
static void
@@ -320,7 +245,7 @@ set_range_command (char *ignore, int fro
else if (strcmp (range, "auto") == 0)
{
range_mode = range_mode_auto;
- set_type_range_case ();
+ set_range_case ();
return;
}
else
@@ -389,7 +314,7 @@ set_case_command (char *ignore, int from
else if (strcmp (case_sensitive, "auto") == 0)
{
case_mode = case_mode_auto;
- set_type_range_case ();
+ set_range_case ();
return;
}
else
@@ -409,14 +334,11 @@ set_case_command (char *ignore, int from
If SHOW is non-zero, then print out the current language,
type and range checking status. */
static void
-set_type_range_case (void)
+set_range_case (void)
{
if (range_mode == range_mode_auto)
range_check = current_language->la_range_check;
- if (type_mode == type_mode_auto)
- type_check = current_language->la_type_check;
-
if (case_mode == case_mode_auto)
case_sensitivity = current_language->la_case_sensitivity;
}
@@ -437,7 +359,7 @@ set_language (enum language lang)
if (languages[i]->la_language == lang)
{
current_language = languages[i];
- set_type_range_case ();
+ set_range_case ();
break;
}
}
@@ -461,8 +383,6 @@ language_info (int quietly)
if (!quietly)
{
- printf_unfiltered (_("Type checking: %s\n"), type);
- show_type_command (NULL, 1, NULL, NULL);
printf_unfiltered (_("Range checking: %s\n"), range);
show_range_command (NULL, 1, NULL, NULL);
printf_unfiltered (_("Case sensitivity: %s\n"), case_sensitive);
@@ -500,38 +420,11 @@ value_true (struct value *val)
error messages that occur during type- and range-
checking. */
-/* These are called when a language fails a type- or range-check. The
+/* This is called when a language fails a range-check. The
first argument should be a printf()-style format string, and the
- rest of the arguments should be its arguments. If
- [type|range]_check is [type|range]_check_on, an error is printed;
- if [type|range]_check_warn, a warning; otherwise just the
- message. */
-
-void
-type_error (const char *string,...)
-{
- va_list args;
-
- va_start (args, string);
- switch (type_check)
- {
- case type_check_warn:
- vwarning (string, args);
- break;
- case type_check_on:
- verror (string, args);
- break;
- case type_check_off:
- /* FIXME: cagney/2002-01-30: Should this function print anything
- when type error is off? */
- vfprintf_filtered (gdb_stderr, string, args);
- fprintf_filtered (gdb_stderr, "\n");
- break;
- default:
- internal_error (__FILE__, __LINE__, _("bad switch"));
- }
- va_end (args);
-}
+ rest of the arguments should be its arguments. If range_check is
+ range_check_on, an error is printed; if range_check_warn, a warning;
+ otherwise just the message. */
void
range_error (const char *string,...)
@@ -902,7 +795,6 @@ const struct language_defn unknown_langu
"unknown",
language_unknown,
range_check_off,
- type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_no,
@@ -945,7 +837,6 @@ const struct language_defn auto_language
"auto",
language_auto,
range_check_off,
- type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_no,
@@ -986,7 +877,6 @@ const struct language_defn local_languag
"local",
language_auto,
range_check_off,
- type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_no,
@@ -1132,13 +1022,6 @@ _initialize_language (void)
add_alias_cmd ("c", "check", no_class, 1, &showlist);
add_alias_cmd ("ch", "check", no_class, 1, &showlist);
- add_setshow_enum_cmd ("type", class_support, type_or_range_names, &type,
- _("Set type checking. (on/warn/off/auto)"),
- _("Show type checking. (on/warn/off/auto)"),
- NULL, set_type_command,
- show_type_command,
- &setchecklist, &showchecklist);
-
add_setshow_enum_cmd ("range", class_support, type_or_range_names,
&range,
_("Set range checking. (on/warn/off/auto)"),
Index: gdb-7.4.50.20120120/gdb/ada-lang.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/ada-lang.c 2012-09-27 22:08:06.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/ada-lang.c 2012-09-27 22:09:46.122565495 +0200
@@ -12327,7 +12327,6 @@ const struct language_defn ada_language_
"ada", /* Language name */
language_ada,
range_check_off,
- type_check_off,
case_sensitive_on, /* Yes, Ada is case-insensitive, but
that's not quite what this means. */
array_row_major,
Index: gdb-7.4.50.20120120/gdb/c-lang.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/c-lang.c 2012-01-04 09:16:59.000000000 +0100
+++ gdb-7.4.50.20120120/gdb/c-lang.c 2012-09-27 22:09:46.142565511 +0200
@@ -832,7 +832,6 @@ const struct language_defn c_language_de
"c", /* Language name */
language_c,
range_check_off,
- type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_c,
@@ -955,7 +954,6 @@ const struct language_defn cplus_languag
"c++", /* Language name */
language_cplus,
range_check_off,
- type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_c,
@@ -996,7 +994,6 @@ const struct language_defn asm_language_
"asm", /* Language name */
language_asm,
range_check_off,
- type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_c,
@@ -1042,7 +1039,6 @@ const struct language_defn minimal_langu
"minimal", /* Language name */
language_minimal,
range_check_off,
- type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_c,
Index: gdb-7.4.50.20120120/gdb/d-lang.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/d-lang.c 2012-01-04 09:17:00.000000000 +0100
+++ gdb-7.4.50.20120120/gdb/d-lang.c 2012-09-27 22:09:46.155565513 +0200
@@ -240,7 +240,6 @@ static const struct language_defn d_lang
"d",
language_d,
range_check_off,
- type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_c,
Index: gdb-7.4.50.20120120/gdb/f-lang.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/f-lang.c 2012-09-27 22:08:05.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/f-lang.c 2012-09-27 22:09:46.155565513 +0200
@@ -264,7 +264,6 @@ const struct language_defn f_language_de
"fortran",
language_fortran,
range_check_on,
- type_check_on,
case_sensitive_off,
array_column_major,
macro_expansion_no,
Index: gdb-7.4.50.20120120/gdb/jv-lang.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/jv-lang.c 2012-09-27 22:08:05.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/jv-lang.c 2012-09-27 22:09:46.157565513 +0200
@@ -1168,7 +1168,6 @@ const struct language_defn java_language
"java", /* Language name */
language_java,
range_check_off,
- type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_no,
Index: gdb-7.4.50.20120120/gdb/m2-lang.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/m2-lang.c 2012-01-04 09:17:05.000000000 +0100
+++ gdb-7.4.50.20120120/gdb/m2-lang.c 2012-09-27 22:09:46.170565519 +0200
@@ -370,7 +370,6 @@ const struct language_defn m2_language_d
"modula-2",
language_m2,
range_check_on,
- type_check_on,
case_sensitive_on,
array_row_major,
macro_expansion_no,
Index: gdb-7.4.50.20120120/gdb/objc-lang.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/objc-lang.c 2012-01-04 09:17:08.000000000 +0100
+++ gdb-7.4.50.20120120/gdb/objc-lang.c 2012-09-27 22:09:46.173565521 +0200
@@ -509,7 +509,6 @@ const struct language_defn objc_language
"objective-c", /* Language name */
language_objc,
range_check_off,
- type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_c,
Index: gdb-7.4.50.20120120/gdb/opencl-lang.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/opencl-lang.c 2012-01-04 09:17:09.000000000 +0100
+++ gdb-7.4.50.20120120/gdb/opencl-lang.c 2012-09-27 22:09:46.192565526 +0200
@@ -993,7 +993,6 @@ const struct language_defn opencl_langua
"opencl", /* Language name */
language_opencl,
range_check_off,
- type_check_off,
case_sensitive_on,
array_row_major,
macro_expansion_c,
Index: gdb-7.4.50.20120120/gdb/p-lang.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/p-lang.c 2012-01-04 09:17:09.000000000 +0100
+++ gdb-7.4.50.20120120/gdb/p-lang.c 2012-09-27 22:09:46.193565530 +0200
@@ -429,7 +429,6 @@ const struct language_defn pascal_langua
"pascal", /* Language name */
language_pascal,
range_check_on,
- type_check_on,
case_sensitive_on,
array_row_major,
macro_expansion_no,
Index: gdb-7.4.50.20120120/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/doc/gdb.texinfo 2012-09-27 22:08:10.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/doc/gdb.texinfo 2012-09-27 22:09:46.222565541 +0200
@@ -12202,29 +12202,18 @@ List all the filename extensions and the
@node Checks
@section Type and Range Checking
-@quotation
-@emph{Warning:} In this release, the @value{GDBN} commands for type and range
-checking are included, but they do not yet have any effect. This
-section documents the intended facilities.
-@end quotation
-@c FIXME remove warning when type/range code added
-
Some languages are designed to guard you against making seemingly common
errors through a series of compile- and run-time checks. These include
-checking the type of arguments to functions and operators, and making
+checking the type of arguments to functions and operators and making
sure mathematical overflows are caught at run time. Checks such as
these help to ensure a program's correctness once it has been compiled
-by eliminating type mismatches, and providing active checks for range
+by eliminating type mismatches and providing active checks for range
errors when your program is running.
-@value{GDBN} can check for conditions like the above if you wish.
-Although @value{GDBN} does not check the statements in your program,
-it can check expressions entered directly into @value{GDBN} for
-evaluation via the @code{print} command, for example. As with the
-working language, @value{GDBN} can also decide whether or not to check
-automatically based on your program's source language.
-@xref{Supported Languages, ,Supported Languages}, for the default
-settings of supported languages.
+By default @value{GDBN} checks for these errors according to the
+rules of the current source language. Although @value{GDBN} does not check
+the statements in your program, it can check expressions entered directly
+into @value{GDBN} for evaluation via the @code{print} command, for example.
@menu
* Type Checking:: An overview of type checking
@@ -12236,69 +12225,51 @@ settings of supported languages.
@node Type Checking
@subsection An Overview of Type Checking
-Some languages, such as Modula-2, are strongly typed, meaning that the
+Some languages, such as C and C@t{++}, are strongly typed, meaning that the
arguments to operators and functions have to be of the correct type,
otherwise an error occurs. These checks prevent type mismatch
errors from ever causing any run-time problems. For example,
@smallexample
-1 + 2 @result{} 3
+int klass::my_method(char *b) @{ return b ? 1 : 2; @}
+
+(@value{GDBP}) print obj.my_method (0)
+$1 = 2
@exdent but
-@error{} 1 + 2.3
+(@value{GDBP}) print obj.my_method (0x1234)
+Cannot resolve method klass::my_method to any overloaded instance
@end smallexample
-The second example fails because the @code{CARDINAL} 1 is not
-type-compatible with the @code{REAL} 2.3.
+The second example fails because in C@t{++} the integer constant
+@samp{0x1234} is not type-compatible with the pointer parameter type.
-For the expressions you use in @value{GDBN} commands, you can tell the
-@value{GDBN} type checker to skip checking;
+For the expressions you use in @value{GDBN} commands, you can tell
+@value{GDBN} to not enforce strict type checking or
to treat any mismatches as errors and abandon the expression;
-or to only issue warnings when type mismatches occur,
-but evaluate the expression anyway. When you choose the last of
-these, @value{GDBN} evaluates expressions like the second example above, but
-also issues a warning.
+When type checking is disabled, @value{GDBN} successfully evaluates
+expressions like the second example above.
-Even if you turn type checking off, there may be other reasons
+Even if type checking is off, there may be other reasons
related to type that prevent @value{GDBN} from evaluating an expression.
For instance, @value{GDBN} does not know how to add an @code{int} and
a @code{struct foo}. These particular type errors have nothing to do
-with the language in use, and usually arise from expressions, such as
-the one described above, which make little sense to evaluate anyway.
-
-Each language defines to what degree it is strict about type. For
-instance, both Modula-2 and C require the arguments to arithmetical
-operators to be numbers. In C, enumerated types and pointers can be
-represented as numbers, so that they are valid arguments to mathematical
-operators. @xref{Supported Languages, ,Supported Languages}, for further
-details on specific languages.
+with the language in use and usually arise from expressions which make
+little sense to evaluate anyway.
-@value{GDBN} provides some additional commands for controlling the type checker:
+@value{GDBN} provides some additional commands for controlling type checking:
@kindex set check type
@kindex show check type
@table @code
-@item set check type auto
-Set type checking on or off based on the current working language.
-@xref{Supported Languages, ,Supported Languages}, for the default settings for
-each language.
-
@item set check type on
@itemx set check type off
-Set type checking on or off, overriding the default setting for the
-current working language. Issue a warning if the setting does not
-match the language default. If any type mismatches occur in
+Set strict type checking on or off. If any type mismatches occur in
evaluating an expression while type checking is on, @value{GDBN} prints a
message and aborts evaluation of the expression.
-@item set check type warn
-Cause the type checker to issue warnings, but to always attempt to
-evaluate the expression. Evaluating the expression may still
-be impossible for other reasons. For example, @value{GDBN} cannot add
-numbers and structures.
-
-@item show type
-Show the current setting of the type checker, and whether or not @value{GDBN}
-is setting it automatically.
+@item show check type
+Show the current setting of type checking and whether @value{GDBN}
+is enforcing strict type checking rules.
@end table
@cindex range checking
@@ -12748,8 +12719,8 @@ specification.
@cindex C and C@t{++} defaults
-If you allow @value{GDBN} to set type and range checking automatically, they
-both default to @code{off} whenever the working language changes to
+If you allow @value{GDBN} to set range checking automatically, it
+defaults to @code{off} whenever the working language changes to
C or C@t{++}. This happens regardless of whether you or @value{GDBN}
selects the working language.
@@ -12760,37 +12731,15 @@ these files, it sets the working languag
@xref{Automatically, ,Having @value{GDBN} Infer the Source Language},
for further details.
-@c Type checking is (a) primarily motivated by Modula-2, and (b)
-@c unimplemented. If (b) changes, it might make sense to let this node
-@c appear even if Mod-2 does not, but meanwhile ignore it. roland 16jul93.
-
@node C Checks
@subsubsection C and C@t{++} Type and Range Checks
@cindex C and C@t{++} checks
-By default, when @value{GDBN} parses C or C@t{++} expressions, type checking
-is not used. However, if you turn type checking on, @value{GDBN}
-considers two variables type equivalent if:
-
-@itemize @bullet
-@item
-The two variables are structured and have the same structure, union, or
-enumerated tag.
-
-@item
-The two variables have the same type name, or types that have been
-declared equivalent through @code{typedef}.
-
-@ignore
-@c leaving this out because neither J Gilmore nor R Pesch understand it.
-@c FIXME--beers?
-@item
-The two @code{struct}, @code{union}, or @code{enum} variables are
-declared in the same declaration. (Note: this may not be true for all C
-compilers.)
-@end ignore
-@end itemize
+By default, when @value{GDBN} parses C or C@t{++} expressions, strict type
+checking is used. However, if you turn type checking off, @value{GDBN}
+will allow certain non-standard conversions, such as promoting integer
+constants to pointers.
Range checking, if turned on, is done on mathematical operations. Array
indices are not checked, since they are often used to index a pointer
Index: gdb-7.4.50.20120120/gdb/testsuite/gdb.base/default.exp
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/testsuite/gdb.base/default.exp 2012-09-27 22:08:03.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/testsuite/gdb.base/default.exp 2012-09-27 22:09:46.236565549 +0200
@@ -499,12 +499,13 @@ gdb_test "section" "Must specify section
gdb_test "set annotate" "Argument required .integer to set it to.*" "set annotate"
#test set args
gdb_test_no_output "set args" "set args"
-#test set check "c" abbreviation
-gdb_test "set c" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check \"c\" abbreviation"
-#test set check "ch" abbreviation
-gdb_test "set ch" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check \"ch\" abbreviation"
-#test set check
-gdb_test "set check" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check"
+
+# Test set check abbreviations
+foreach x {"c" "ch" "check"} {
+ gdb_test "set $x" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set strict type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." \
+ "set check \"$x\" abbreviation"
+}
+
#test set check range
gdb_test "set check range" ".*" "set check range"
#test set check type
@@ -583,16 +584,17 @@ gdb_test "shell echo Hi dad!" "Hi dad!"
gdb_test "show annotate" "Annotation_level is 0." "show annotate"
#test show args
gdb_test "show args" "Argument list to give program being debugged when it is started is \"\"." "show args"
-#test show check "c" abbreviation
-gdb_test "show c" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Type checking is \"auto; currently off\".*" "show check \"c\" abbreviation"
-#test show check "ch" abbreviation
-gdb_test "show ch" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Type checking is \"auto; currently off\"." "show check \"ch\" abbreviation"
-#test show check
-gdb_test "show check" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Type checking is \"auto; currently off\"." "show check"
+
+# test show check abbreviations
+foreach x {"c" "ch" "check"} {
+ gdb_test "show $x" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Strict type checking is on\..*" \
+ "show check \"$x\" abbreviation"
+}
+
#test show check range
gdb_test "show check range" "Range checking is \"auto; currently off\"." "show check range"
#test show check type
-gdb_test "show check type" "Type checking is \"auto; currently off\"." "show check type"
+gdb_test "show check type" "Strict type checking is on\." "show check type"
#test show commands
gdb_test "show commands" ".*" "show commands"
#test show complaints
Index: gdb-7.4.50.20120120/gdb/testsuite/gdb.base/help.exp
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/testsuite/gdb.base/help.exp 2012-09-27 22:08:06.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/testsuite/gdb.base/help.exp 2012-09-27 22:09:46.247565554 +0200
@@ -378,22 +378,26 @@ gdb_test "help section" "Change the base
gdb_test "help set annotate" "Set annotation_level\.\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\)\[\r\n\]+2 == output annotated suitably for use by programs that control GDB\." "help set annotate"
# test help set args
gdb_test "help set args" "Set argument list to give program being debugged when it is started\.\[\r\n\]+Follow this command with any number of args, to be passed to the program\."
-# test help set check "c" abbreviation
-test_prefix_command_help {"set c" "set check"} {
- "Set the status of the type/range checker\.\[\r\n\]+"
-} "help set check \"c\" abbreviation"
-# test help set check "ch" abbreviation
-test_prefix_command_help {"set ch" "set check"} {
- "Set the status of the type/range checker\.\[\r\n\]+"
-} "help set check \"ch\" abbreviation"
-# test help set check
+
+# Test help set check abbreviations
+foreach x {"c" "ch"} {
+ test_prefix_command_help [list "set $x" "set check"] {
+ "Set the status of the type/range checker\.\[\r\n\]+"
+ } "help set check \"$x\" abbreviation"
+}
+
+# Test help set check
test_prefix_command_help {"set check"} {
"Set the status of the type/range checker\.\[\r\n\]+"
}
+
# test help set check range
gdb_test "help set check range" "Set range checking\. \\(on/warn/off/auto\\)" "help set check range"
-# test help set check type
-gdb_test "help set check type" "Set type checking\. \\(on/warn/off/auto\\)." "help set check type"
+
+# Test help set check type
+gdb_test "help set check type" "Set strict type checking\." \
+ "help set check type"
+
# test help set complaints
gdb_test "help set complaints" "Set max number of complaints about incorrect symbols\." "help set complaints"
# test help set confirm
@@ -491,18 +495,25 @@ gdb_test "help shell" "Execute the rest
gdb_test "help show annotate" "Show annotation_level\.\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\)\[\r\n\]+2 == output annotated suitably for use by programs that control GDB\." "help show annotate"
# test help show args
gdb_test "help show args" "Show argument list to give program being debugged when it is started\.\[\r\n\]+Follow this command with any number of args, to be passed to the program\."
-# test help show check "c" abbreviation
-test_prefix_command_help {"show c" "show check"} {
- "Show the status of the type/range checker\.\[\r\n\]+"
-} "help show check \"c\" abbreviation"
+
+# Test help show check abbreviations
+foreach x {"c" "check"} {
+ test_prefix_command_help [list "show $x" "show check"] {
+ "Show the status of the type/range checker\.\[\r\n\]+"
+ } "help show check \"$x\" abbreviation"
+}
+
# test help show check
test_prefix_command_help {"show check"} {
"Show the status of the type/range checker\.\[\r\n\]+"
}
# test help show check range
gdb_test "help show check range" "Show range checking\. \\(on/warn/off/auto\\)" "help show check range"
+
# test help show check type
-gdb_test "help show check type" "Show type checking\. \\(on/warn/off/auto\\)" "help show check type"
+gdb_test "help show check type" "Show strict type checking\." \
+ "help show check type"
+
# test help show commands
gdb_test "help show commands" "Show the history of commands you typed\.\[\r\n\]+You can supply a command number to start with, or a `\[+\]' to start after\[\r\n\]+the previous command number shown\." "help show commands"
# test help show complaints
Index: gdb-7.4.50.20120120/gdb/testsuite/gdb.base/setshow.exp
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/testsuite/gdb.base/setshow.exp 2012-01-16 17:21:45.000000000 +0100
+++ gdb-7.4.50.20120120/gdb/testsuite/gdb.base/setshow.exp 2012-09-27 22:09:46.254565557 +0200
@@ -110,19 +110,22 @@ gdb_test "show check range" "Range check
#test set check range auto
gdb_test_no_output "set check range auto" "set check range auto"
#test show check range auto
-gdb_test "show check range" "Range checking is \"auto; currently .*" "show check range (auto)"
-#test set check type on
-gdb_test "set check type on" ".*" "set check type on"
-#test show check type on
-gdb_test "show check type" "Type checking is \"on\"..*" "show check type (on)"
-#test set check type off with trailing space
-gdb_test_no_output "set check type off " "set check type off"
-#test show check type off
-gdb_test "show check type" "Type checking is \"off\"..*" "show check type (off)"
-#test set check type auto
-gdb_test_no_output "set check type auto" "set check type auto"
-#test show check type
-gdb_test "show check type" "Type checking is \"auto; currently .*" "show check type (auto)"
+gdb_test "show check range" "Range checking is \"auto; currently .*" "show check range (auto)"
+
+# Test set check type on
+gdb_test "set check type on" ".*" "set check type on"
+
+# Test show check type on
+gdb_test "show check type" "Strict type checking is on\..*" \
+ "show check type (on)"
+
+# Test set check type off with trailing space
+gdb_test_no_output "set check type off " "set check type off"
+
+# Test show check type off
+gdb_test "show check type" "Strict type checking is off\..*" \
+ "show check type (off)"
+
#test set complaints 100
gdb_test_no_output "set complaints 100" "set complaints 100"
#test show complaints 100
Index: gdb-7.4.50.20120120/gdb/testsuite/gdb.cp/converts.exp
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/testsuite/gdb.cp/converts.exp 2012-01-04 09:17:46.000000000 +0100
+++ gdb-7.4.50.20120120/gdb/testsuite/gdb.cp/converts.exp 2012-09-27 22:09:46.255565557 +0200
@@ -70,9 +70,37 @@ gdb_test_multiple "p foo3_1 (0, 0)" $t {
pass $t
}
}
+
gdb_test "p foo3_1 (0, 1)" \
"Cannot resolve function foo3_1 to any overloaded instance"
gdb_test "p foo3_1 (0, (const char**) 1)" " = 31"
gdb_test "p foo3_2 (0, 0)" "= 32"
gdb_test "p foo3_2 (0, (char const**) 0)" " = 320"
+# Test for strict type checking
+set error_str "Cannot resolve function %s to any overloaded instance"
+gdb_test "show check type" "Strict type checking is on\."
+gdb_test "p foo1_type_check (123)" [format $error_str "foo1_type_check"]
+gdb_test "p foo2_type_check (0, 1)" [format $error_str "foo2_type_check"]
+gdb_test "p foo2_type_check (1, 0)" [format $error_str "foo2_type_check"]
+gdb_test "p foo2_type_check (1, 1)" [format $error_str "foo2_type_check"]
+gdb_test "p foo3_type_check (0, 0, 1)" [format $error_str "foo3_type_check"]
+gdb_test "p foo3_type_check (0, 1, 0)" [format $error_str "foo3_type_check"]
+gdb_test "p foo3_type_check (1, 0, 0)" [format $error_str "foo3_type_check"]
+gdb_test "p foo3_type_check (0, 1, 1)" [format $error_str "foo3_type_check"]
+gdb_test "p foo3_type_check (1, 1, 0)" [format $error_str "foo3_type_check"]
+gdb_test "p foo3_type_check (1, 1, 1)" [format $error_str "foo3_type_check"]
+
+gdb_test_no_output "set check type off"
+gdb_test "show check type" "Strict type checking is off\."
+gdb_test "p foo1_type_check (123)" " = 1000"
+gdb_test "p foo2_type_check (0, 1)" " = 1001"
+gdb_test "p foo2_type_check (1, 0)" " = 1001"
+gdb_test "p foo2_type_check (1, 1)" " = 1001"
+gdb_test "p foo3_type_check (0, 0, 1)" " = 1002"
+gdb_test "p foo3_type_check (0, 1, 0)" " = 1002"
+gdb_test "p foo3_type_check (1, 0, 0)" " = 1002"
+gdb_test "p foo3_type_check (0, 1, 1)" " = 1002"
+gdb_test "p foo3_type_check (1, 1, 0)" " = 1002"
+gdb_test "p foo3_type_check (1, 1, 1)" " = 1002"
+gdb_test "p foo3_2 (1,1)" " = 32"
Index: gdb-7.4.50.20120120/gdb/testsuite/gdb.cp/converts.cc
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/testsuite/gdb.cp/converts.cc 2011-10-14 22:22:50.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/testsuite/gdb.cp/converts.cc 2012-09-27 22:09:46.256565557 +0200
@@ -27,6 +27,10 @@ int foo3_1 (int a, const char **b) { ret
int foo3_2 (int a, int b) { return 32; }
int foo3_2 (int a, const char **b) { return 320; }
+int foo1_type_check (char *a) { return 1000; }
+int foo2_type_check (char *a, char *b) { return 1001; }
+int foo3_type_check (char *a, char *b, char *c) { return 1002; }
+
int main()
{
@@ -62,5 +66,9 @@ int main()
foo3_2 (0, static_cast<char const**> (0));
foo3_2 (0, 0);
+ foo1_type_check (a);
+ foo2_type_check (a, a);
+ foo3_type_check (a, a, a);
+
return 0; // end of main
}

889
gdb-entryval-inlined.patch Normal file
View File

@ -0,0 +1,889 @@
http://sourceware.org/ml/gdb-patches/2012-10/msg00095.html
Subject: [patch] entry values: Fix resolving in inlined frames
Hi,
Breakpoint 1, fn2 (y=<optimized out>, x=6) at gdb.arch/amd64-entry-value-inline.c:32
32 y = -2 + x; /* break-here */
(gdb) info addr y
(gdb) bt
#0 fn2 (y=<optimized out>, x=6) at gdb.arch/amd64-entry-value-inline.c:32
#1 fn3 (x=x@entry=6, y=y@entry=25) at gdb.arch/amd64-entry-value-inline.c:42
#2 0x00000000004004af in main () at gdb.arch/amd64-entry-value-inline.c:48
(gdb) info frame
Stack level 0, frame at 0x7fffffffdb68:
rip = 0x4005bc in fn2 (gdb.arch/amd64-entry-value-inline.c:32); saved rip 0x4004af
inlined into frame 1
[...]
(gdb) set debug entry-values 1
(gdb) p y
DW_OP_GNU_entry_value resolving expects callee fn1 at 0x4005a0 but the called frame is for fn3 at 0x4005b0
FAIL:
-----
$1 = <optimized out>
PASS:
-----
$1 = 25
(gdb) p/x $pc
$2 = 0x4005bc
(gdb) up
#1 fn3 (x=x@entry=6, y=y@entry=25) at gdb.arch/amd64-entry-value-inline.c:42
(gdb) p/x $pc
$3 = 0x4005bc
The problem is that DW_TAG_GNU_call_site <-> DW_OP_GNU_entry_value binding
exists between DW_TAG_subprogram, nor DW_TAG_inlined_subroutine as described
by Jakub Jelinek. This makes sense, when we look at DW_TAG_GNU_call_site and
we just unwind the current inlined frame we get the same PC - this is no new
information.
TAILCALL_FRAME is a different case, while also an artificial frame the
sequence cannot be determined at compile time and the binding
DW_TAG_GNU_call_site <-> DW_OP_GNU_entry_value exists also for
TAILCALL_FRAMEs.
I will check it in.
No regressions on {x86_64,x86_64-m32,i686}-fedora18-linux-gnu.
Thanks,
Jan
gdb/
2012-10-05 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix entry values resolving in inlined frames.
* dwarf2loc.c (dwarf_expr_reg_to_entry_parameter): Move func_addr,
gdbarch and caller_frame initialization later. Skip INLINE_FRAME
entries of FRAME.
gdb/testsuite/
2012-10-05 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix entry values resolving in inlined frames.
* gdb.arch/amd64-entry-value-inline.S: New file.
* gdb.arch/amd64-entry-value-inline.c: New file.
* gdb.arch/amd64-entry-value-inline.exp: New file.
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index e8d39fe..0bdc042 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -937,10 +937,9 @@ dwarf_expr_reg_to_entry_parameter (struc
union call_site_parameter_u kind_u,
struct dwarf2_per_cu_data **per_cu_return)
{
- CORE_ADDR func_addr = get_frame_func (frame);
- CORE_ADDR caller_pc;
- struct gdbarch *gdbarch = get_frame_arch (frame);
- struct frame_info *caller_frame = get_prev_frame (frame);
+ CORE_ADDR func_addr, caller_pc;
+ struct gdbarch *gdbarch;
+ struct frame_info *caller_frame;
struct call_site *call_site;
int iparams;
struct value *val;
@@ -949,6 +948,18 @@ dwarf_expr_reg_to_entry_parameter (struc
struct call_site_parameter *parameter = NULL;
CORE_ADDR target_addr;
+ /* Skip any inlined frames, entry value call sites work between real
+ functions. They do not make sense between inline functions as even PC
+ does not change there. */
+ while (get_frame_type (frame) == INLINE_FRAME)
+ {
+ frame = get_prev_frame (frame);
+ gdb_assert (frame != NULL);
+ }
+
+ func_addr = get_frame_func (frame);
+ gdbarch = get_frame_arch (frame);
+ caller_frame = get_prev_frame (frame);
if (gdbarch != frame_unwind_arch (frame))
{
struct minimal_symbol *msym = lookup_minimal_symbol_by_pc (func_addr);
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S
new file mode 100644
index 0000000..5f353f5
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S
@@ -0,0 +1,672 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* This file is compiled from gdb.arch/amd64-entry-value-inline.c
+ using -g -dA -S -O2. */
+
+ .file "amd64-entry-value-inline.c"
+ .text
+.Ltext0:
+ .p2align 4,,15
+ .type fn1, @function
+fn1:
+.LFB0:
+ .file 1 "gdb.arch/amd64-entry-value-inline.c"
+ # gdb.arch/amd64-entry-value-inline.c:22
+ .loc 1 22 0
+ .cfi_startproc
+.LVL0:
+# BLOCK 2 freq:10000 seq:0
+# PRED: ENTRY [100.0%] (FALLTHRU)
+ # gdb.arch/amd64-entry-value-inline.c:23
+ .loc 1 23 0
+ movl v(%rip), %eax
+ addl $1, %eax
+ movl %eax, v(%rip)
+# SUCC: EXIT [100.0%]
+ ret
+ .cfi_endproc
+.LFE0:
+ .size fn1, .-fn1
+ .p2align 4,,15
+ .globl fn3
+ .type fn3, @function
+fn3:
+.LFB2:
+ # gdb.arch/amd64-entry-value-inline.c:41
+ .loc 1 41 0
+ .cfi_startproc
+.LVL1:
+# BLOCK 2 freq:10000 seq:0
+# PRED: ENTRY [100.0%] (FALLTHRU)
+.LBB4:
+.LBB5:
+ # gdb.arch/amd64-entry-value-inline.c:29
+ .loc 1 29 0
+ testl %esi, %esi
+.LBE5:
+.LBE4:
+ # gdb.arch/amd64-entry-value-inline.c:41
+ .loc 1 41 0
+ pushq %rbx
+ .cfi_def_cfa_offset 16
+ .cfi_offset 3, -16
+ # gdb.arch/amd64-entry-value-inline.c:41
+ .loc 1 41 0
+ movl %edi, %ebx
+.LBB7:
+.LBB6:
+# SUCC: 3 [39.0%] (FALLTHRU,CAN_FALLTHRU) 4 [61.0%] (CAN_FALLTHRU)
+ # gdb.arch/amd64-entry-value-inline.c:29
+ .loc 1 29 0
+ je .L3
+# BLOCK 3 freq:3898 seq:1
+# PRED: 2 [39.0%] (FALLTHRU,CAN_FALLTHRU)
+ # gdb.arch/amd64-entry-value-inline.c:31
+ .loc 1 31 0
+ call fn1
+.LVL2:
+ # gdb.arch/amd64-entry-value-inline.c:32
+ .loc 1 32 0
+ leal -2(%rbx), %eax
+.LVL3:
+ # gdb.arch/amd64-entry-value-inline.c:33
+ .loc 1 33 0
+ movl %eax, %edi
+ imull %eax, %edi
+ addl $1, %edi
+.LVL4:
+ imull %edi, %eax
+.LVL5:
+ # gdb.arch/amd64-entry-value-inline.c:34
+ .loc 1 34 0
+ leal (%rbx,%rax), %edi
+ call fn1
+.LVL6:
+# SUCC: 4 [100.0%] (FALLTHRU,CAN_FALLTHRU)
+# BLOCK 4 freq:10000 seq:2
+# PRED: 2 [61.0%] (CAN_FALLTHRU) 3 [100.0%] (FALLTHRU,CAN_FALLTHRU)
+.L3:
+.LBE6:
+.LBE7:
+ # gdb.arch/amd64-entry-value-inline.c:43
+ .loc 1 43 0
+ movl %ebx, %eax
+ popq %rbx
+ .cfi_def_cfa_offset 8
+.LVL7:
+# SUCC: EXIT [100.0%]
+ ret
+ .cfi_endproc
+.LFE2:
+ .size fn3, .-fn3
+ .section .text.startup,"ax",@progbits
+ .p2align 4,,15
+ .globl main
+ .type main, @function
+main:
+.LFB3:
+ # gdb.arch/amd64-entry-value-inline.c:47
+ .loc 1 47 0
+ .cfi_startproc
+# BLOCK 2 freq:10000 seq:0
+# PRED: ENTRY [100.0%] (FALLTHRU)
+ # gdb.arch/amd64-entry-value-inline.c:48
+ .loc 1 48 0
+ movl $25, %esi
+ movl $6, %edi
+ call fn3
+.LVL8:
+ # gdb.arch/amd64-entry-value-inline.c:50
+ .loc 1 50 0
+ xorl %eax, %eax
+# SUCC: EXIT [100.0%]
+ ret
+ .cfi_endproc
+.LFE3:
+ .size main, .-main
+ .local v
+ .comm v,4,4
+ .text
+.Letext0:
+ .section .debug_info,"",@progbits
+.Ldebug_info0:
+ .long 0x164 # Length of Compilation Unit Info
+ .value 0x4 # DWARF version number
+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section
+ .byte 0x8 # Pointer Size (in bytes)
+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
+ .long .LASF0 # DW_AT_producer: "GNU C 4.8.0 20121005 (experimental) -mtune=generic -march=x86-64 -g -O2"
+ .byte 0x1 # DW_AT_language
+ .long .LASF1 # DW_AT_name: "gdb.arch/amd64-entry-value-inline.c"
+ .long .LASF2 # DW_AT_comp_dir: ""
+ .long .Ldebug_ranges0+0x30 # DW_AT_ranges
+ .quad 0 # DW_AT_low_pc
+ .long .Ldebug_line0 # DW_AT_stmt_list
+ .uleb128 0x2 # (DIE (0x29) DW_TAG_subprogram)
+ .ascii "fn1\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x15 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .quad .LFB0 # DW_AT_low_pc
+ .quad .LFE0-.LFB0 # DW_AT_high_pc
+ .uleb128 0x1 # DW_AT_frame_base
+ .byte 0x9c # DW_OP_call_frame_cfa
+ # DW_AT_GNU_all_call_sites
+ .long 0x52 # DW_AT_sibling
+ .uleb128 0x3 # (DIE (0x46) DW_TAG_formal_parameter)
+ .ascii "x\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x15 # DW_AT_decl_line
+ .long 0x52 # DW_AT_type
+ .uleb128 0x1 # DW_AT_location
+ .byte 0x55 # DW_OP_reg5
+ .byte 0 # end of children of DIE 0x29
+ .uleb128 0x4 # (DIE (0x52) DW_TAG_base_type)
+ .byte 0x4 # DW_AT_byte_size
+ .byte 0x5 # DW_AT_encoding
+ .ascii "int\0" # DW_AT_name
+ .uleb128 0x5 # (DIE (0x59) DW_TAG_subprogram)
+ .ascii "fn2\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x1b # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 0x52 # DW_AT_type
+ .byte 0x1 # DW_AT_inline
+ .long 0x7c # DW_AT_sibling
+ .uleb128 0x6 # (DIE (0x69) DW_TAG_formal_parameter)
+ .ascii "x\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x1b # DW_AT_decl_line
+ .long 0x52 # DW_AT_type
+ .uleb128 0x6 # (DIE (0x72) DW_TAG_formal_parameter)
+ .ascii "y\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x1b # DW_AT_decl_line
+ .long 0x52 # DW_AT_type
+ .byte 0 # end of children of DIE 0x59
+ .uleb128 0x7 # (DIE (0x7c) DW_TAG_subprogram)
+ # DW_AT_external
+ .ascii "fn3\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x28 # DW_AT_decl_line
+ # DW_AT_prototyped
+ .long 0x52 # DW_AT_type
+ .quad .LFB2 # DW_AT_low_pc
+ .quad .LFE2-.LFB2 # DW_AT_high_pc
+ .uleb128 0x1 # DW_AT_frame_base
+ .byte 0x9c # DW_OP_call_frame_cfa
+ # DW_AT_GNU_all_call_sites
+ .long 0x115 # DW_AT_sibling
+ .uleb128 0x8 # (DIE (0x9d) DW_TAG_formal_parameter)
+ .ascii "x\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x28 # DW_AT_decl_line
+ .long 0x52 # DW_AT_type
+ .long .LLST0 # DW_AT_location
+ .uleb128 0x8 # (DIE (0xaa) DW_TAG_formal_parameter)
+ .ascii "y\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x28 # DW_AT_decl_line
+ .long 0x52 # DW_AT_type
+ .long .LLST1 # DW_AT_location
+ .uleb128 0x9 # (DIE (0xb7) DW_TAG_inlined_subroutine)
+ .long 0x59 # DW_AT_abstract_origin
+ .quad .LBB4 # DW_AT_entry_pc
+ .long .Ldebug_ranges0+0 # DW_AT_ranges
+ .byte 0x1 # DW_AT_call_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x2a # DW_AT_call_line
+ .uleb128 0xa # (DIE (0xca) DW_TAG_formal_parameter)
+ .long 0x72 # DW_AT_abstract_origin
+ .long .LLST2 # DW_AT_location
+ .uleb128 0xa # (DIE (0xd3) DW_TAG_formal_parameter)
+ .long 0x69 # DW_AT_abstract_origin
+ .long .LLST0 # DW_AT_location
+ .uleb128 0xb # (DIE (0xdc) DW_TAG_GNU_call_site)
+ .quad .LVL2 # DW_AT_low_pc
+ .long 0x29 # DW_AT_abstract_origin
+ .long 0xf4 # DW_AT_sibling
+ .uleb128 0xc # (DIE (0xed) DW_TAG_GNU_call_site_parameter)
+ .uleb128 0x1 # DW_AT_location
+ .byte 0x55 # DW_OP_reg5
+ .uleb128 0x2 # DW_AT_GNU_call_site_value
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 0
+ .byte 0 # end of children of DIE 0xdc
+ .uleb128 0xd # (DIE (0xf4) DW_TAG_GNU_call_site)
+ .quad .LVL6 # DW_AT_low_pc
+ .long 0x29 # DW_AT_abstract_origin
+ .uleb128 0xc # (DIE (0x101) DW_TAG_GNU_call_site_parameter)
+ .uleb128 0x1 # DW_AT_location
+ .byte 0x55 # DW_OP_reg5
+ .uleb128 0xd # DW_AT_GNU_call_site_value
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 -2
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 -2
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 -2
+ .byte 0x1e # DW_OP_mul
+ .byte 0x23 # DW_OP_plus_uconst
+ .uleb128 0x1
+ .byte 0x1e # DW_OP_mul
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 0
+ .byte 0x22 # DW_OP_plus
+ .byte 0 # end of children of DIE 0xf4
+ .byte 0 # end of children of DIE 0xb7
+ .byte 0 # end of children of DIE 0x7c
+ .uleb128 0xe # (DIE (0x115) DW_TAG_subprogram)
+ # DW_AT_external
+ .long .LASF3 # DW_AT_name: "main"
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x2e # DW_AT_decl_line
+ .long 0x52 # DW_AT_type
+ .quad .LFB3 # DW_AT_low_pc
+ .quad .LFE3-.LFB3 # DW_AT_high_pc
+ .uleb128 0x1 # DW_AT_frame_base
+ .byte 0x9c # DW_OP_call_frame_cfa
+ # DW_AT_GNU_all_call_sites
+ .long 0x14f # DW_AT_sibling
+ .uleb128 0xd # (DIE (0x136) DW_TAG_GNU_call_site)
+ .quad .LVL8 # DW_AT_low_pc
+ .long 0x7c # DW_AT_abstract_origin
+ .uleb128 0xc # (DIE (0x143) DW_TAG_GNU_call_site_parameter)
+ .uleb128 0x1 # DW_AT_location
+ .byte 0x55 # DW_OP_reg5
+ .uleb128 0x1 # DW_AT_GNU_call_site_value
+ .byte 0x36 # DW_OP_lit6
+ .uleb128 0xc # (DIE (0x148) DW_TAG_GNU_call_site_parameter)
+ .uleb128 0x1 # DW_AT_location
+ .byte 0x54 # DW_OP_reg4
+ .uleb128 0x1 # DW_AT_GNU_call_site_value
+ .byte 0x49 # DW_OP_lit25
+ .byte 0 # end of children of DIE 0x136
+ .byte 0 # end of children of DIE 0x115
+ .uleb128 0xf # (DIE (0x14f) DW_TAG_variable)
+ .ascii "v\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c)
+ .byte 0x12 # DW_AT_decl_line
+ .long 0x162 # DW_AT_type
+ .uleb128 0x9 # DW_AT_location
+ .byte 0x3 # DW_OP_addr
+ .quad v
+ .uleb128 0x10 # (DIE (0x162) DW_TAG_volatile_type)
+ .long 0x52 # DW_AT_type
+ .byte 0 # end of children of DIE 0xb
+ .section .debug_abbrev,"",@progbits
+.Ldebug_abbrev0:
+ .uleb128 0x1 # (abbrev code)
+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x25 # (DW_AT_producer)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x13 # (DW_AT_language)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x1b # (DW_AT_comp_dir)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x55 # (DW_AT_ranges)
+ .uleb128 0x17 # (DW_FORM_sec_offset)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x10 # (DW_AT_stmt_list)
+ .uleb128 0x17 # (DW_FORM_sec_offset)
+ .byte 0
+ .byte 0
+ .uleb128 0x2 # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x27 # (DW_AT_prototyped)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x7 # (DW_FORM_data8)
+ .uleb128 0x40 # (DW_AT_frame_base)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x3 # (abbrev code)
+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
+ .byte 0 # DW_children_no
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .byte 0
+ .byte 0
+ .uleb128 0x4 # (abbrev code)
+ .uleb128 0x24 # (TAG: DW_TAG_base_type)
+ .byte 0 # DW_children_no
+ .uleb128 0xb # (DW_AT_byte_size)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3e # (DW_AT_encoding)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .byte 0
+ .byte 0
+ .uleb128 0x5 # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x27 # (DW_AT_prototyped)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x20 # (DW_AT_inline)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x6 # (abbrev code)
+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
+ .byte 0 # DW_children_no
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x7 # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x3f # (DW_AT_external)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x27 # (DW_AT_prototyped)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x7 # (DW_FORM_data8)
+ .uleb128 0x40 # (DW_AT_frame_base)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x8 # (abbrev code)
+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
+ .byte 0 # DW_children_no
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0x17 # (DW_FORM_sec_offset)
+ .byte 0
+ .byte 0
+ .uleb128 0x9 # (abbrev code)
+ .uleb128 0x1d # (TAG: DW_TAG_inlined_subroutine)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x31 # (DW_AT_abstract_origin)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x52 # (DW_AT_entry_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x55 # (DW_AT_ranges)
+ .uleb128 0x17 # (DW_FORM_sec_offset)
+ .uleb128 0x58 # (DW_AT_call_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x59 # (DW_AT_call_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .byte 0
+ .byte 0
+ .uleb128 0xa # (abbrev code)
+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter)
+ .byte 0 # DW_children_no
+ .uleb128 0x31 # (DW_AT_abstract_origin)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0x17 # (DW_FORM_sec_offset)
+ .byte 0
+ .byte 0
+ .uleb128 0xb # (abbrev code)
+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x31 # (DW_AT_abstract_origin)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0xc # (abbrev code)
+ .uleb128 0x410a # (TAG: DW_TAG_GNU_call_site_parameter)
+ .byte 0 # DW_children_no
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .uleb128 0x2111 # (DW_AT_GNU_call_site_value)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .byte 0
+ .byte 0
+ .uleb128 0xd # (abbrev code)
+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x31 # (DW_AT_abstract_origin)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0xe # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x3f # (DW_AT_external)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x7 # (DW_FORM_data8)
+ .uleb128 0x40 # (DW_AT_frame_base)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
+ .uleb128 0x19 # (DW_FORM_flag_present)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0xf # (abbrev code)
+ .uleb128 0x34 # (TAG: DW_TAG_variable)
+ .byte 0 # DW_children_no
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0x18 # (DW_FORM_exprloc)
+ .byte 0
+ .byte 0
+ .uleb128 0x10 # (abbrev code)
+ .uleb128 0x35 # (TAG: DW_TAG_volatile_type)
+ .byte 0 # DW_children_no
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .byte 0
+ .section .debug_loc,"",@progbits
+.Ldebug_loc0:
+.LLST0:
+ .quad .LVL1 # Location list begin address (*.LLST0)
+ .quad .LVL2-1 # Location list end address (*.LLST0)
+ .value 0x1 # Location expression size
+ .byte 0x55 # DW_OP_reg5
+ .quad .LVL2-1 # Location list begin address (*.LLST0)
+ .quad .LVL7 # Location list end address (*.LLST0)
+ .value 0x1 # Location expression size
+ .byte 0x53 # DW_OP_reg3
+ .quad .LVL7 # Location list begin address (*.LLST0)
+ .quad .LFE2 # Location list end address (*.LLST0)
+ .value 0x1 # Location expression size
+ .byte 0x50 # DW_OP_reg0
+ .quad 0 # Location list terminator begin (*.LLST0)
+ .quad 0 # Location list terminator end (*.LLST0)
+.LLST1:
+ .quad .LVL1 # Location list begin address (*.LLST1)
+ .quad .LVL2-1 # Location list end address (*.LLST1)
+ .value 0x1 # Location expression size
+ .byte 0x54 # DW_OP_reg4
+ .quad .LVL2-1 # Location list begin address (*.LLST1)
+ .quad .LFE2 # Location list end address (*.LLST1)
+ .value 0x4 # Location expression size
+ .byte 0xf3 # DW_OP_GNU_entry_value
+ .uleb128 0x1
+ .byte 0x54 # DW_OP_reg4
+ .byte 0x9f # DW_OP_stack_value
+ .quad 0 # Location list terminator begin (*.LLST1)
+ .quad 0 # Location list terminator end (*.LLST1)
+.LLST2:
+ .quad .LVL1 # Location list begin address (*.LLST2)
+ .quad .LVL2-1 # Location list end address (*.LLST2)
+ .value 0x1 # Location expression size
+ .byte 0x54 # DW_OP_reg4
+ .quad .LVL2-1 # Location list begin address (*.LLST2)
+ .quad .LVL3 # Location list end address (*.LLST2)
+ .value 0x4 # Location expression size
+ .byte 0xf3 # DW_OP_GNU_entry_value
+ .uleb128 0x1
+ .byte 0x54 # DW_OP_reg4
+ .byte 0x9f # DW_OP_stack_value
+ .quad .LVL3 # Location list begin address (*.LLST2)
+ .quad .LVL4 # Location list end address (*.LLST2)
+ .value 0x1 # Location expression size
+ .byte 0x50 # DW_OP_reg0
+ .quad .LVL4 # Location list begin address (*.LLST2)
+ .quad .LVL5 # Location list end address (*.LLST2)
+ .value 0x6 # Location expression size
+ .byte 0x70 # DW_OP_breg0
+ .sleb128 0
+ .byte 0x75 # DW_OP_breg5
+ .sleb128 0
+ .byte 0x1e # DW_OP_mul
+ .byte 0x9f # DW_OP_stack_value
+ .quad .LVL5 # Location list begin address (*.LLST2)
+ .quad .LVL6-1 # Location list end address (*.LLST2)
+ .value 0x1 # Location expression size
+ .byte 0x50 # DW_OP_reg0
+ .quad .LVL6-1 # Location list begin address (*.LLST2)
+ .quad .LVL6 # Location list end address (*.LLST2)
+ .value 0xb # Location expression size
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 -2
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 -2
+ .byte 0x73 # DW_OP_breg3
+ .sleb128 -2
+ .byte 0x1e # DW_OP_mul
+ .byte 0x23 # DW_OP_plus_uconst
+ .uleb128 0x1
+ .byte 0x1e # DW_OP_mul
+ .byte 0x9f # DW_OP_stack_value
+ .quad 0 # Location list terminator begin (*.LLST2)
+ .quad 0 # Location list terminator end (*.LLST2)
+ .section .debug_aranges,"",@progbits
+ .long 0x3c # Length of Address Ranges Info
+ .value 0x2 # DWARF Version
+ .long .Ldebug_info0 # Offset of Compilation Unit Info
+ .byte 0x8 # Size of Address
+ .byte 0 # Size of Segment Descriptor
+ .value 0 # Pad to 16 byte boundary
+ .value 0
+ .quad .Ltext0 # Address
+ .quad .Letext0-.Ltext0 # Length
+ .quad .LFB3 # Address
+ .quad .LFE3-.LFB3 # Length
+ .quad 0
+ .quad 0
+ .section .debug_ranges,"",@progbits
+.Ldebug_ranges0:
+ .quad .LBB4 # Offset 0
+ .quad .LBE4
+ .quad .LBB7
+ .quad .LBE7
+ .quad 0
+ .quad 0
+ .quad .Ltext0 # Offset 0x30
+ .quad .Letext0
+ .quad .LFB3 # Offset 0x40
+ .quad .LFE3
+ .quad 0
+ .quad 0
+ .section .debug_line,"",@progbits
+.Ldebug_line0:
+ .section .debug_str,"MS",@progbits,1
+.LASF0:
+ .string "GNU C 4.8.0 20121005+patches (experimental) -mtune=generic -march=x86-64 -g -O2"
+.LASF1:
+ .string "gdb.arch/amd64-entry-value-inline.c"
+.LASF2:
+ .string ""
+.LASF3:
+ .string "main"
+ .ident "GCC: (GNU) 4.8.0 20121005 (experimental)"
+ .section .note.GNU-stack,"",@progbits
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.c b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.c
new file mode 100644
index 0000000..f7fefb8
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.c
@@ -0,0 +1,50 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+static volatile int v;
+
+static __attribute__((noinline, noclone)) void
+fn1 (int x)
+{
+ v++;
+}
+
+static int
+fn2 (int x, int y)
+{
+ if (y)
+ {
+ fn1 (x);
+ y = -2 + x; /* break-here */
+ y = y * y * y + y;
+ fn1 (x + y);
+ }
+ return x;
+}
+
+__attribute__((noinline, noclone)) int
+fn3 (int x, int y)
+{
+ return fn2 (x, y);
+}
+
+int
+main ()
+{
+ fn3 (6, 25);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp
new file mode 100644
index 0000000..6aa92c1
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp
@@ -0,0 +1,41 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testfile amd64-entry-value-inline
+set opts {}
+set srcfile ${testfile}.S
+
+if [info exists COMPILE] {
+ # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-inline.exp COMPILE=1"
+ set srcfile ${testfile}.c
+ lappend opts debug optimize=-O2
+} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
+ verbose "Skipping ${testfile}."
+ return
+}
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $opts] } {
+ return -1
+}
+
+if ![runto_main] {
+ return -1
+}
+
+set srcfile $testfile.c
+gdb_breakpoint [gdb_get_line_number "break-here"]
+
+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+gdb_test "p y" " = 25"

103
gdb-highpc-const.patch Normal file
View File

@ -0,0 +1,103 @@
http://sourceware.org/ml/gdb-cvs/2012-04/msg00225.html
### src/gdb/ChangeLog 2012/04/27 18:50:35 1.14177
### src/gdb/ChangeLog 2012/04/27 18:55:19 1.14178
## -1,3 +1,10 @@
+2012-04-27 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf2read.c (dwarf2_get_pc_bounds): Check DW_AT_high_pc form to
+ see whether it is an address or a constant offset from DW_AT_low_pc.
+ (dwarf2_record_block_ranges): Likewise.
+ (read_partial_die): Likewise.
+
2012-04-26 Mark Wielaard <mjw@redhat.com>
* MAINTAINERS (Write After Approval): Add myself to the list.
--- src/gdb/dwarf2read.c 2012/04/26 20:32:30 1.640
+++ src/gdb/dwarf2read.c 2012/04/27 18:55:19 1.641
@@ -6706,17 +6706,23 @@
struct partial_symtab *pst)
{
struct attribute *attr;
+ struct attribute *attr_high;
CORE_ADDR low = 0;
CORE_ADDR high = 0;
int ret = 0;
- attr = dwarf2_attr (die, DW_AT_high_pc, cu);
- if (attr)
+ attr_high = dwarf2_attr (die, DW_AT_high_pc, cu);
+ if (attr_high)
{
- high = DW_ADDR (attr);
attr = dwarf2_attr (die, DW_AT_low_pc, cu);
if (attr)
- low = DW_ADDR (attr);
+ {
+ low = DW_ADDR (attr);
+ if (attr_high->form == DW_FORM_addr)
+ high = DW_ADDR (attr_high);
+ else
+ high = low + DW_UNSND (attr_high);
+ }
else
/* Found high w/o low attribute. */
return 0;
@@ -6864,16 +6870,20 @@
{
struct objfile *objfile = cu->objfile;
struct attribute *attr;
+ struct attribute *attr_high;
- attr = dwarf2_attr (die, DW_AT_high_pc, cu);
- if (attr)
+ attr_high = dwarf2_attr (die, DW_AT_high_pc, cu);
+ if (attr_high)
{
- CORE_ADDR high = DW_ADDR (attr);
-
attr = dwarf2_attr (die, DW_AT_low_pc, cu);
if (attr)
{
CORE_ADDR low = DW_ADDR (attr);
+ CORE_ADDR high;
+ if (attr_high->form == DW_FORM_addr)
+ high = DW_ADDR (attr_high);
+ else
+ high = low + DW_UNSND (attr_high);
record_block_range (block, baseaddr + low, baseaddr + high - 1);
}
@@ -9925,6 +9935,7 @@
struct attribute attr;
int has_low_pc_attr = 0;
int has_high_pc_attr = 0;
+ int high_pc_relative = 0;
memset (part_die, 0, sizeof (struct partial_die_info));
@@ -9981,7 +9992,13 @@
break;
case DW_AT_high_pc:
has_high_pc_attr = 1;
- part_die->highpc = DW_ADDR (&attr);
+ if (attr.form == DW_FORM_addr)
+ part_die->highpc = DW_ADDR (&attr);
+ else
+ {
+ high_pc_relative = 1;
+ part_die->highpc = DW_UNSND (&attr);
+ }
break;
case DW_AT_location:
/* Support the .debug_loc offsets. */
@@ -10061,6 +10078,9 @@
}
}
+ if (high_pc_relative)
+ part_die->highpc += part_die->lowpc;
+
if (has_low_pc_attr && has_high_pc_attr)
{
/* When using the GNU linker, .gnu.linkonce. sections are used to

View File

@ -48,10 +48,12 @@
static const char *progname;
static volatile int signal_chld_hit = 0;
static volatile pid_t child;
static void signal_chld (int signo)
{
signal_chld_hit = 1;
if (child && kill (child, 0) != 0)
signal_chld_hit = 1;
}
static volatile int signal_alrm_hit = 0;
@ -62,7 +64,6 @@ static void signal_alrm (int signo)
}
static char childptyname[LINE_MAX];
static pid_t child;
static void print_child_error (const char *reason, char **argv)
{
@ -203,8 +204,13 @@ static int spawn (char **argv, int timeout)
pollfd.fd = amaster;
pollfd.events = POLLIN;
i = ppoll (&pollfd, 1, NULL, &set);
if (i == -1 && errno == EINTR && signal_chld_hit)
break;
if (i == -1 && errno == EINTR)
{
if (signal_chld_hit)
break;
/* Non-CHILD child may have exited. */
continue;
}
assert (i == 1);
/* Data available? Process it first. */
if (pollfd.revents & POLLIN)

426
gdb-parameterref-1of2.patch Normal file
View File

@ -0,0 +1,426 @@
http://sourceware.org/ml/gdb-patches/2012-06/msg00458.html
Subject: [patch 1/2] Generalize call_site.parameter key ("code cleanup")
Hi,
previously parameter could be identified either via DW_OP_reg or via
DW_OP_fbreg (both in DW_AT_location). As [patch 2/2] adds new identification
via DW_AT_abstract_origin generalize this two state deciding into more general
enum.
Thanks,
Jan
gdb/
2012-06-14 Jan Kratochvil <jan.kratochvil@redhat.com>
Code cleanup: Generalize call_site.parameter key.
* dwarf2expr.c (execute_stack_op) <DW_OP_GNU_entry_value>: Remove
variable dwarf_reg. New variable kind_u. Update parameters to
push_dwarf_reg_entry_value.
(ctx_no_push_dwarf_reg_entry_value): Update parameters.
* dwarf2expr.h (enum call_site_parameter_kind)
(union call_site_parameter_u): Forward declarations.
(struct dwarf_expr_context_funcs): Update parameters and their
description for push_dwarf_reg_entry_value.
(ctx_no_push_dwarf_reg_entry_value): Update parameters.
* dwarf2loc.c (call_site_parameter_matches): New function.
(dwarf_expr_reg_to_entry_parameter): Update parameters and their
description. Use call_site_parameter_matches.
(dwarf_expr_push_dwarf_reg_entry_value, value_of_dwarf_reg_entry):
Update parameters and their description.
(value_of_dwarf_block_entry): Remove variables dwarf_reg and fb_offset.
New variable kind_u. Adjust the caller for updated parameters.
(needs_dwarf_reg_entry_value): Update parameters.
* dwarf2read.c (read_call_site_scope): New variable loc. Use it
instead of attr. Update for the changed fields of struct
call_site_parameter.
* gdbtypes.h: Include dwarf2expr.h.
(enum call_site_parameter_kind): New.
(struct call_site.parameter): New field kind. Wrap dwarf_reg and
fb_offset into new union u.
Index: gdb-7.4.50.20120120/gdb/dwarf2expr.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/dwarf2expr.c 2012-06-14 08:55:44.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/dwarf2expr.c 2012-06-14 08:59:51.223967311 +0200
@@ -1349,33 +1349,35 @@ execute_stack_op (struct dwarf_expr_cont
case DW_OP_GNU_entry_value:
{
ULONGEST len;
- int dwarf_reg;
CORE_ADDR deref_size;
+ union call_site_parameter_u kind_u;
op_ptr = read_uleb128 (op_ptr, op_end, &len);
if (op_ptr + len > op_end)
error (_("DW_OP_GNU_entry_value: too few bytes available."));
- dwarf_reg = dwarf_block_to_dwarf_reg (op_ptr, op_ptr + len);
- if (dwarf_reg != -1)
+ kind_u.dwarf_reg = dwarf_block_to_dwarf_reg (op_ptr, op_ptr + len);
+ if (kind_u.dwarf_reg != -1)
{
op_ptr += len;
- ctx->funcs->push_dwarf_reg_entry_value (ctx, dwarf_reg,
- 0 /* unused */,
+ ctx->funcs->push_dwarf_reg_entry_value (ctx,
+ CALL_SITE_PARAMETER_DWARF_REG,
+ kind_u,
-1 /* deref_size */);
goto no_push;
}
- dwarf_reg = dwarf_block_to_dwarf_reg_deref (op_ptr, op_ptr + len,
- &deref_size);
- if (dwarf_reg != -1)
+ kind_u.dwarf_reg = dwarf_block_to_dwarf_reg_deref (op_ptr,
+ op_ptr + len,
+ &deref_size);
+ if (kind_u.dwarf_reg != -1)
{
if (deref_size == -1)
deref_size = ctx->addr_size;
op_ptr += len;
- ctx->funcs->push_dwarf_reg_entry_value (ctx, dwarf_reg,
- 0 /* unused */,
- deref_size);
+ ctx->funcs->push_dwarf_reg_entry_value (ctx,
+ CALL_SITE_PARAMETER_DWARF_REG,
+ kind_u, deref_size);
goto no_push;
}
@@ -1532,7 +1534,8 @@ ctx_no_get_base_type (struct dwarf_expr_
void
ctx_no_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx,
- int dwarf_reg, CORE_ADDR fb_offset,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u,
int deref_size)
{
internal_error (__FILE__, __LINE__,
Index: gdb-7.4.50.20120120/gdb/dwarf2expr.h
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/dwarf2expr.h 2012-06-14 08:55:44.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/dwarf2expr.h 2012-06-14 08:55:59.937479777 +0200
@@ -24,6 +24,8 @@
#define DWARF2EXPR_H
struct dwarf_expr_context;
+enum call_site_parameter_kind;
+union call_site_parameter_u;
/* Virtual method table for struct dwarf_expr_context below. */
@@ -63,14 +65,12 @@ struct dwarf_expr_context_funcs
struct type *(*get_base_type) (struct dwarf_expr_context *ctx, size_t die);
/* Push on DWARF stack an entry evaluated for DW_TAG_GNU_call_site's
- DWARF_REG/FB_OFFSET at the caller of specified BATON. If DWARF register
- number DWARF_REG specifying the push_dwarf_reg_entry_value parameter is
- not -1 FB_OFFSET is ignored. Otherwise FB_OFFSET specifies stack
- parameter offset against caller's stack pointer (which equals the callee's
- frame base). If DEREF_SIZE is not -1 then use
- DW_AT_GNU_call_site_data_value instead of DW_AT_GNU_call_site_value. */
+ parameter matching KIND and KIND_U at the caller of specified BATON.
+ If DEREF_SIZE is not -1 then use DW_AT_GNU_call_site_data_value instead of
+ DW_AT_GNU_call_site_value. */
void (*push_dwarf_reg_entry_value) (struct dwarf_expr_context *ctx,
- int dwarf_reg, CORE_ADDR fb_offset,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u,
int deref_size);
/* Not yet implemented. */
@@ -276,7 +276,8 @@ CORE_ADDR ctx_no_get_tls_address (void *
void ctx_no_dwarf_call (struct dwarf_expr_context *ctx, size_t die_offset);
struct type *ctx_no_get_base_type (struct dwarf_expr_context *ctx, size_t die);
void ctx_no_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx,
- int dwarf_reg, CORE_ADDR fb_offset,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u,
int deref_size);
int dwarf_block_to_dwarf_reg (const gdb_byte *buf, const gdb_byte *buf_end);
Index: gdb-7.4.50.20120120/gdb/dwarf2loc.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/dwarf2loc.c 2012-06-14 08:55:44.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/dwarf2loc.c 2012-06-14 08:55:59.938479774 +0200
@@ -905,16 +905,34 @@ call_site_find_chain (struct gdbarch *gd
return retval;
}
-/* Fetch call_site_parameter from caller matching the parameters. FRAME is for
- callee. See DWARF_REG and FB_OFFSET description at struct
- dwarf_expr_context_funcs->push_dwarf_reg_entry_value.
+/* Return 1 if KIND and KIND_U match PARAMETER. Return 0 otherwise. */
+
+static int
+call_site_parameter_matches (struct call_site_parameter *parameter,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u)
+{
+ if (kind == parameter->kind)
+ switch (kind)
+ {
+ case CALL_SITE_PARAMETER_DWARF_REG:
+ return kind_u.dwarf_reg == parameter->u.dwarf_reg;
+ case CALL_SITE_PARAMETER_FB_OFFSET:
+ return kind_u.fb_offset == parameter->u.fb_offset;
+ }
+ return 0;
+}
+
+/* Fetch call_site_parameter from caller matching KIND and KIND_U.
+ FRAME is for callee.
Function always returns non-NULL, it throws NO_ENTRY_VALUE_ERROR
otherwise. */
static struct call_site_parameter *
-dwarf_expr_reg_to_entry_parameter (struct frame_info *frame, int dwarf_reg,
- CORE_ADDR fb_offset,
+dwarf_expr_reg_to_entry_parameter (struct frame_info *frame,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u,
struct dwarf2_per_cu_data **per_cu_return)
{
CORE_ADDR func_addr = get_frame_func (frame);
@@ -979,12 +997,7 @@ dwarf_expr_reg_to_entry_parameter (struc
for (iparams = 0; iparams < call_site->parameter_count; iparams++)
{
parameter = &call_site->parameter[iparams];
- if (parameter->dwarf_reg == -1 && dwarf_reg == -1)
- {
- if (parameter->fb_offset == fb_offset)
- break;
- }
- else if (parameter->dwarf_reg == dwarf_reg)
+ if (call_site_parameter_matches (parameter, kind, kind_u))
break;
}
if (iparams == call_site->parameter_count)
@@ -1041,17 +1054,17 @@ dwarf_entry_parameter_to_value (struct c
return dwarf2_evaluate_loc_desc (type, caller_frame, data, size + 1, per_cu);
}
-/* Execute call_site_parameter's DWARF block matching DEREF_SIZE for caller of
- the CTX's frame. CTX must be of dwarf_expr_ctx_funcs kind. See DWARF_REG
- and FB_OFFSET description at struct
- dwarf_expr_context_funcs->push_dwarf_reg_entry_value.
+/* Execute DWARF block of call_site_parameter which matches KIND and KIND_U.
+ Choose DEREF_SIZE value of that parameter. Search caller of the CTX's
+ frame. CTX must be of dwarf_expr_ctx_funcs kind.
The CTX caller can be from a different CU - per_cu_dwarf_call implementation
can be more simple as it does not support cross-CU DWARF executions. */
static void
dwarf_expr_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx,
- int dwarf_reg, CORE_ADDR fb_offset,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u,
int deref_size)
{
struct dwarf_expr_baton *debaton;
@@ -1068,7 +1081,7 @@ dwarf_expr_push_dwarf_reg_entry_value (s
frame = debaton->frame;
caller_frame = get_prev_frame (frame);
- parameter = dwarf_expr_reg_to_entry_parameter (frame, dwarf_reg, fb_offset,
+ parameter = dwarf_expr_reg_to_entry_parameter (frame, kind, kind_u,
&caller_per_cu);
data_src = deref_size == -1 ? parameter->value : parameter->data_value;
size = deref_size == -1 ? parameter->value_size : parameter->data_value_size;
@@ -1238,17 +1251,17 @@ static const struct lval_funcs entry_dat
entry_data_value_free_closure
};
-/* Read parameter of TYPE at (callee) FRAME's function entry. DWARF_REG and
- FB_OFFSET are used to match DW_AT_location at the caller's
- DW_TAG_GNU_call_site_parameter. See DWARF_REG and FB_OFFSET description at
- struct dwarf_expr_context_funcs->push_dwarf_reg_entry_value.
+/* Read parameter of TYPE at (callee) FRAME's function entry. KIND and KIND_U
+ are used to match DW_AT_location at the caller's
+ DW_TAG_GNU_call_site_parameter.
Function always returns non-NULL value. It throws NO_ENTRY_VALUE_ERROR if it
cannot resolve the parameter for any reason. */
static struct value *
value_of_dwarf_reg_entry (struct type *type, struct frame_info *frame,
- int dwarf_reg, CORE_ADDR fb_offset)
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u)
{
struct type *checked_type = check_typedef (type);
struct type *target_type = TYPE_TARGET_TYPE (checked_type);
@@ -1258,7 +1271,7 @@ value_of_dwarf_reg_entry (struct type *t
struct dwarf2_per_cu_data *caller_per_cu;
CORE_ADDR addr;
- parameter = dwarf_expr_reg_to_entry_parameter (frame, dwarf_reg, fb_offset,
+ parameter = dwarf_expr_reg_to_entry_parameter (frame, kind, kind_u,
&caller_per_cu);
outer_val = dwarf_entry_parameter_to_value (parameter, -1 /* deref_size */,
@@ -1310,15 +1323,16 @@ static struct value *
value_of_dwarf_block_entry (struct type *type, struct frame_info *frame,
const gdb_byte *block, size_t block_len)
{
- int dwarf_reg;
- CORE_ADDR fb_offset;
-
- dwarf_reg = dwarf_block_to_dwarf_reg (block, block + block_len);
- if (dwarf_reg != -1)
- return value_of_dwarf_reg_entry (type, frame, dwarf_reg, 0 /* unused */);
+ union call_site_parameter_u kind_u;
- if (dwarf_block_to_fb_offset (block, block + block_len, &fb_offset))
- return value_of_dwarf_reg_entry (type, frame, -1, fb_offset);
+ kind_u.dwarf_reg = dwarf_block_to_dwarf_reg (block, block + block_len);
+ if (kind_u.dwarf_reg != -1)
+ return value_of_dwarf_reg_entry (type, frame, CALL_SITE_PARAMETER_DWARF_REG,
+ kind_u);
+
+ if (dwarf_block_to_fb_offset (block, block + block_len, &kind_u.fb_offset))
+ return value_of_dwarf_reg_entry (type, frame, CALL_SITE_PARAMETER_FB_OFFSET,
+ kind_u);
/* This can normally happen - throw NO_ENTRY_VALUE_ERROR to get the message
suppressed during normal operation. The expression can be arbitrary if
@@ -2391,7 +2405,8 @@ needs_frame_dwarf_call (struct dwarf_exp
static void
needs_dwarf_reg_entry_value (struct dwarf_expr_context *ctx,
- int dwarf_reg, CORE_ADDR fb_offset, int deref_size)
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u, int deref_size)
{
struct needs_frame_baton *nf_baton = ctx->baton;
Index: gdb-7.4.50.20120120/gdb/dwarf2read.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/dwarf2read.c 2012-06-14 08:55:46.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/dwarf2read.c 2012-06-14 08:58:31.874143194 +0200
@@ -6368,6 +6368,7 @@ read_call_site_scope (struct die_info *d
{
struct dwarf2_locexpr_baton *dlbaton;
struct call_site_parameter *parameter;
+ struct attribute *loc;
if (child_die->tag != DW_TAG_GNU_call_site_parameter)
{
@@ -6381,8 +6382,8 @@ read_call_site_scope (struct die_info *d
/* DW_AT_location specifies the register number. Value of the data
assumed for the register is contained in DW_AT_GNU_call_site_value. */
- attr = dwarf2_attr (child_die, DW_AT_location, cu);
- if (!attr || !attr_form_is_block (attr))
+ loc = dwarf2_attr (child_die, DW_AT_location, cu);
+ if (loc == NULL || !attr_form_is_block (loc))
{
complaint (&symfile_complaints,
_("No DW_FORM_block* DW_AT_location for "
@@ -6390,19 +6391,26 @@ read_call_site_scope (struct die_info *d
child_die->offset, objfile->name);
continue;
}
- parameter->dwarf_reg = dwarf_block_to_dwarf_reg (DW_BLOCK (attr)->data,
- &DW_BLOCK (attr)->data[DW_BLOCK (attr)->size]);
- if (parameter->dwarf_reg == -1
- && !dwarf_block_to_sp_offset (gdbarch, DW_BLOCK (attr)->data,
- &DW_BLOCK (attr)->data[DW_BLOCK (attr)->size],
- &parameter->fb_offset))
+ else
{
- complaint (&symfile_complaints,
- _("Only single DW_OP_reg or DW_OP_fbreg is supported "
- "for DW_FORM_block* DW_AT_location for "
- "DW_TAG_GNU_call_site child DIE 0x%x [in module %s]"),
- child_die->offset, objfile->name);
- continue;
+ parameter->u.dwarf_reg = dwarf_block_to_dwarf_reg
+ (DW_BLOCK (loc)->data, &DW_BLOCK (loc)->data[DW_BLOCK (loc)->size]);
+ if (parameter->u.dwarf_reg != -1)
+ parameter->kind = CALL_SITE_PARAMETER_DWARF_REG;
+ else if (dwarf_block_to_sp_offset (gdbarch, DW_BLOCK (loc)->data,
+ &DW_BLOCK (loc)->data[DW_BLOCK (loc)->size],
+ &parameter->u.fb_offset))
+ parameter->kind = CALL_SITE_PARAMETER_FB_OFFSET;
+ else
+ {
+ complaint (&symfile_complaints,
+ _("Only single DW_OP_reg or DW_OP_fbreg is supported "
+ "for DW_FORM_block* DW_AT_location is supported for "
+ "DW_TAG_GNU_call_site child DIE 0x%x "
+ "[in module %s]"),
+ child_die->offset, objfile->name);
+ continue;
+ }
}
attr = dwarf2_attr (child_die, DW_AT_GNU_call_site_value, cu);
Index: gdb-7.4.50.20120120/gdb/gdbtypes.h
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/gdbtypes.h 2012-06-14 08:55:45.000000000 +0200
+++ gdb-7.4.50.20120120/gdb/gdbtypes.h 2012-06-14 08:55:59.943479763 +0200
@@ -23,6 +23,7 @@
#define GDBTYPES_H 1
#include "hashtab.h"
+#include "dwarf2expr.h"
/* Forward declarations for prototypes. */
struct field;
@@ -1010,6 +1011,17 @@ struct func_type
struct call_site *tail_call_list;
};
+/* struct call_site_parameter can be referenced in callees by several ways. */
+
+enum call_site_parameter_kind
+{
+ /* Use field call_site_parameter.u.dwarf_reg. */
+ CALL_SITE_PARAMETER_DWARF_REG,
+
+ /* Use field call_site_parameter.u.fb_offset. */
+ CALL_SITE_PARAMETER_FB_OFFSET
+};
+
/* A place where a function gets called from, represented by
DW_TAG_GNU_call_site. It can be looked up from symtab->call_site_htab. */
@@ -1043,15 +1055,19 @@ struct call_site
/* Describe DW_TAG_GNU_call_site's DW_TAG_formal_parameter. */
struct call_site_parameter
{
- /* DW_TAG_formal_parameter's DW_AT_location's DW_OP_regX as DWARF
- register number, for register passed parameters. If -1 then use
- fb_offset. */
- int dwarf_reg;
-
- /* Offset from the callee's frame base, for stack passed parameters.
- This equals offset from the caller's stack pointer. Valid only if
- DWARF_REGNUM is -1. */
- CORE_ADDR fb_offset;
+ ENUM_BITFIELD (call_site_parameter_kind) kind : 2;
+
+ union call_site_parameter_u
+ {
+ /* DW_TAG_formal_parameter's DW_AT_location's DW_OP_regX as DWARF
+ register number, for register passed parameters. */
+ int dwarf_reg;
+
+ /* Offset from the callee's frame base, for stack passed parameters.
+ This equals offset from the caller's stack pointer. */
+ CORE_ADDR fb_offset;
+ }
+ u;
/* DW_TAG_formal_parameter's DW_AT_GNU_call_site_value. It is never
NULL. */

876
gdb-parameterref-2of2.patch Normal file
View File

@ -0,0 +1,876 @@
http://sourceware.org/ml/gdb-patches/2012-06/msg00459.html
Subject: [patch 2/2] Support gcc-4.7 DW_OP_GNU_parameter_ref
Hi,
this add-on to gdb.arch/amd64-entry-value.exp has been somehow forgotten:
[PATCH] Improve debug info for IPA-SRA optimized code - add DW_OP_GNU_parameter_ref support (PR debug/47858)
http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00649.html
And for gcc-4.7+ -O2 -g code GDB may print (instead of the calculated value):
(gdb) p y
Unhandled dwarf expression opcode 0xfa
The support is pretty simple, there is just now third kind of binding between
callers and callees parameter values.
No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu.
Thanks,
Jan
gdb/
2012-06-14 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2expr.c (execute_stack_op): Support DW_OP_GNU_parameter_ref.
* dwarf2loc.c (call_site_parameter_matches): Support
CALL_SITE_PARAMETER_PARAM_OFFSET.
(needs_dwarf_reg_entry_value): Push stub value.
* dwarf2read.c (read_call_site_scope): New variable origin. Support
CALL_SITE_PARAMETER_PARAM_OFFSET and its DW_AT_abstract_origin.
* gdbtypes.h (enum call_site_parameter_kind): New item
CALL_SITE_PARAMETER_PARAM_OFFSET.
(struct call_site.parameter.u): New field param_offset.
gdb/testsuite/
2012-06-14 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/amd64-entry-value-param.S: New file.
* gdb.arch/amd64-entry-value-param.c: New file.
* gdb.arch/amd64-entry-value-param.exp: New file.
Index: gdb-7.4.50.20120120/gdb/dwarf2expr.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/dwarf2expr.c 2012-06-14 09:23:37.499446172 +0200
+++ gdb-7.4.50.20120120/gdb/dwarf2expr.c 2012-06-14 09:24:54.042413217 +0200
@@ -1386,6 +1386,20 @@ execute_stack_op (struct dwarf_expr_cont
"or for DW_OP_breg*(0)+DW_OP_deref*"));
}
+ case DW_OP_GNU_parameter_ref:
+ {
+ union call_site_parameter_u kind_u;
+
+ kind_u.param_offset = extract_unsigned_integer (op_ptr, 4,
+ byte_order);
+ op_ptr += 4;
+ ctx->funcs->push_dwarf_reg_entry_value (ctx,
+ CALL_SITE_PARAMETER_PARAM_OFFSET,
+ kind_u,
+ -1 /* deref_size */);
+ }
+ goto no_push;
+
case DW_OP_GNU_const_type:
{
ULONGEST type_die;
Index: gdb-7.4.50.20120120/gdb/dwarf2loc.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/dwarf2loc.c 2012-06-14 09:23:37.499446172 +0200
+++ gdb-7.4.50.20120120/gdb/dwarf2loc.c 2012-06-14 09:25:44.843434819 +0200
@@ -919,6 +919,8 @@ call_site_parameter_matches (struct call
return kind_u.dwarf_reg == parameter->u.dwarf_reg;
case CALL_SITE_PARAMETER_FB_OFFSET:
return kind_u.fb_offset == parameter->u.fb_offset;
+ case CALL_SITE_PARAMETER_PARAM_OFFSET:
+ return kind_u.param_offset == parameter->u.param_offset;
}
return 0;
}
@@ -2411,6 +2413,9 @@ needs_dwarf_reg_entry_value (struct dwar
struct needs_frame_baton *nf_baton = ctx->baton;
nf_baton->needs_frame = 1;
+
+ /* The expression may require some stub values on DWARF stack. */
+ dwarf_expr_push_address (ctx, 0, 0);
}
/* Virtual method table for dwarf2_loc_desc_needs_frame below. */
Index: gdb-7.4.50.20120120/gdb/dwarf2read.c
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/dwarf2read.c 2012-06-14 09:23:37.498446171 +0200
+++ gdb-7.4.50.20120120/gdb/dwarf2read.c 2012-06-14 09:24:34.145405249 +0200
@@ -6368,7 +6368,7 @@ read_call_site_scope (struct die_info *d
{
struct dwarf2_locexpr_baton *dlbaton;
struct call_site_parameter *parameter;
- struct attribute *loc;
+ struct attribute *loc, *origin;
if (child_die->tag != DW_TAG_GNU_call_site_parameter)
{
@@ -6379,11 +6379,23 @@ read_call_site_scope (struct die_info *d
gdb_assert (call_site->parameter_count < nparams);
parameter = &call_site->parameter[call_site->parameter_count];
- /* DW_AT_location specifies the register number. Value of the data
- assumed for the register is contained in DW_AT_GNU_call_site_value. */
+ /* DW_AT_location specifies the register number or DW_AT_abstract_origin
+ specifies DW_TAG_formal_parameter. Value of the data assumed for the
+ register is contained in DW_AT_GNU_call_site_value. */
loc = dwarf2_attr (child_die, DW_AT_location, cu);
- if (loc == NULL || !attr_form_is_block (loc))
+ origin = dwarf2_attr (child_die, DW_AT_abstract_origin, cu);
+ if (loc == NULL && origin != NULL && is_ref_attr (origin))
+ {
+ unsigned offset;
+
+ parameter->kind = CALL_SITE_PARAMETER_PARAM_OFFSET;
+ offset = dwarf2_get_ref_die_offset (origin);
+ gdb_assert (offset >= cu->header.offset);
+ parameter->u.param_offset = (offset
+ - cu->header.offset);
+ }
+ else if (loc == NULL || origin != NULL || !attr_form_is_block (loc))
{
complaint (&symfile_complaints,
_("No DW_FORM_block* DW_AT_location for "
Index: gdb-7.4.50.20120120/gdb/gdbtypes.h
===================================================================
--- gdb-7.4.50.20120120.orig/gdb/gdbtypes.h 2012-06-14 09:23:37.498446171 +0200
+++ gdb-7.4.50.20120120/gdb/gdbtypes.h 2012-06-14 09:24:34.189405275 +0200
@@ -1019,7 +1019,10 @@ enum call_site_parameter_kind
CALL_SITE_PARAMETER_DWARF_REG,
/* Use field call_site_parameter.u.fb_offset. */
- CALL_SITE_PARAMETER_FB_OFFSET
+ CALL_SITE_PARAMETER_FB_OFFSET,
+
+ /* Use field call_site_parameter.u.param_offset. */
+ CALL_SITE_PARAMETER_PARAM_OFFSET
};
/* A place where a function gets called from, represented by
@@ -1066,6 +1069,11 @@ struct call_site
/* Offset from the callee's frame base, for stack passed parameters.
This equals offset from the caller's stack pointer. */
CORE_ADDR fb_offset;
+
+ /* Offset relative to the start of this PER_CU to
+ DW_TAG_formal_parameter which is referenced by both caller and
+ the callee. */
+ unsigned param_offset;
}
u;
Index: gdb-7.4.50.20120120/gdb/testsuite/gdb.arch/amd64-entry-value-param.S
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120120/gdb/testsuite/gdb.arch/amd64-entry-value-param.S 2012-06-14 09:24:34.190405269 +0200
@@ -0,0 +1,611 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* This file is compiled from gdb.arch/amd64-entry-value-param.c
+ using -g -dA -S -O2. */
+
+ .file "amd64-entry-value-param.c"
+ .text
+.Ltext0:
+ .p2align 4,,15
+ .type foo.isra.0.constprop.2, @function
+foo.isra.0.constprop.2:
+.LFB4:
+ .file 1 "gdb.arch/amd64-entry-value-param.c"
+ /* gdb.arch/amd64-entry-value-param.c:21 */
+ .loc 1 21 0
+ .cfi_startproc
+.LVL0:
+/* BLOCK 2 freq:10000 seq:0 */
+/* PRED: ENTRY [100.0%] (fallthru) */
+ /* gdb.arch/amd64-entry-value-param.c:26 */
+ .loc 1 26 0
+ movl vv(%rip), %eax
+ addl $1, %eax
+ movl %eax, vv(%rip)
+ /* gdb.arch/amd64-entry-value-param.c:27 */
+ .loc 1 27 0
+ leal 3(%rdi), %eax
+/* SUCC: EXIT [100.0%] */
+ /* gdb.arch/amd64-entry-value-param.c:28 */
+ .loc 1 28 0
+ ret
+ .cfi_endproc
+.LFE4:
+ .size foo.isra.0.constprop.2, .-foo.isra.0.constprop.2
+ .p2align 4,,15
+ .type bar.constprop.1, @function
+bar.constprop.1:
+.LFB5:
+ /* gdb.arch/amd64-entry-value-param.c:31 */
+ .loc 1 31 0
+ .cfi_startproc
+/* BLOCK 2 freq:10000 seq:0 */
+/* PRED: ENTRY [100.0%] (fallthru) */
+.LVL1:
+ pushq %rbx
+.LCFI0:
+ .cfi_def_cfa_offset 16
+ .cfi_offset 3, -16
+ /* gdb.arch/amd64-entry-value-param.c:33 */
+ .loc 1 33 0
+ movl $10, %edi
+ call foo.isra.0.constprop.2
+.LVL2:
+ movl $10, %edi
+ movl %eax, %ebx
+ call foo.isra.0.constprop.2
+.LVL3:
+ movl $16, %edi
+ addl %eax, %ebx
+ call foo.isra.0.constprop.2
+.LVL4:
+ leal 10(%rbx,%rax), %eax
+ /* gdb.arch/amd64-entry-value-param.c:34 */
+ .loc 1 34 0
+ popq %rbx
+.LCFI1:
+ .cfi_def_cfa_offset 8
+/* SUCC: EXIT [100.0%] */
+ ret
+ .cfi_endproc
+.LFE5:
+ .size bar.constprop.1, .-bar.constprop.1
+ .section .text.startup,"ax",@progbits
+ .p2align 4,,15
+ .globl main
+ .type main, @function
+main:
+.LFB2:
+ /* gdb.arch/amd64-entry-value-param.c:38 */
+ .loc 1 38 0
+ .cfi_startproc
+/* BLOCK 2 freq:10000 seq:0 */
+/* PRED: ENTRY [100.0%] (fallthru) */
+ /* gdb.arch/amd64-entry-value-param.c:39 */
+ .loc 1 39 0
+ jmp bar.constprop.1
+/* SUCC: EXIT [100.0%] (ab,sibcall) */
+.LVL5:
+ .cfi_endproc
+.LFE2:
+ .size main, .-main
+ .comm vv,4,4
+ .text
+.Letext0:
+ .section .debug_info,"",@progbits
+.Ldebug_info0:
+ .4byte 0x1b7 /* Length of Compilation Unit Info */
+ .2byte 0x2 /* DWARF version number */
+ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
+ .byte 0x8 /* Pointer Size (in bytes) */
+ .uleb128 0x1 /* (DIE (0xb) DW_TAG_compile_unit) */
+ .4byte .LASF0 /* DW_AT_producer: "GNU C 4.7.1 20120612 (prerelease)" */
+ .byte 0x1 /* DW_AT_language */
+ .4byte .LASF1 /* DW_AT_name: "gdb.arch/amd64-entry-value-param.c" */
+ .4byte .LASF2 /* DW_AT_comp_dir: "" */
+ .4byte .Ldebug_ranges0+0 /* DW_AT_ranges */
+ .quad 0 /* DW_AT_low_pc */
+ .quad 0 /* DW_AT_entry_pc */
+ .4byte .Ldebug_line0 /* DW_AT_stmt_list */
+ .uleb128 0x2 /* (DIE (0x31) DW_TAG_subprogram) */
+ .ascii "foo\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x15 /* DW_AT_decl_line */
+ .byte 0x1 /* DW_AT_prototyped */
+ .4byte 0x79 /* DW_AT_type */
+ .byte 0 /* DW_AT_inline */
+ .4byte 0x79 /* DW_AT_sibling */
+ .uleb128 0x3 /* (DIE (0x42) DW_TAG_formal_parameter) */
+ .ascii "x\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x15 /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .uleb128 0x3 /* (DIE (0x4b) DW_TAG_formal_parameter) */
+ .ascii "y\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x15 /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .uleb128 0x3 /* (DIE (0x54) DW_TAG_formal_parameter) */
+ .ascii "z\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x15 /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .uleb128 0x4 /* (DIE (0x5d) DW_TAG_variable) */
+ .ascii "a\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x17 /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .uleb128 0x4 /* (DIE (0x66) DW_TAG_variable) */
+ .ascii "b\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x18 /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .uleb128 0x4 /* (DIE (0x6f) DW_TAG_variable) */
+ .ascii "c\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x19 /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .byte 0 /* end of children of DIE 0x31 */
+ .uleb128 0x5 /* (DIE (0x79) DW_TAG_base_type) */
+ .byte 0x4 /* DW_AT_byte_size */
+ .byte 0x5 /* DW_AT_encoding */
+ .ascii "int\0" /* DW_AT_name */
+ .uleb128 0x2 /* (DIE (0x80) DW_TAG_subprogram) */
+ .ascii "bar\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x1f /* DW_AT_decl_line */
+ .byte 0x1 /* DW_AT_prototyped */
+ .4byte 0x79 /* DW_AT_type */
+ .byte 0x1 /* DW_AT_inline */
+ .4byte 0x9b /* DW_AT_sibling */
+ .uleb128 0x3 /* (DIE (0x91) DW_TAG_formal_parameter) */
+ .ascii "x\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x1f /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .byte 0 /* end of children of DIE 0x80 */
+ .uleb128 0x6 /* (DIE (0x9b) DW_TAG_subprogram) */
+ .4byte 0x31 /* DW_AT_abstract_origin */
+ .quad .LFB4 /* DW_AT_low_pc */
+ .quad .LFE4 /* DW_AT_high_pc */
+ .byte 0x2 /* DW_AT_frame_base */
+ .byte 0x77 /* DW_OP_breg7 */
+ .sleb128 8
+ .byte 0x1 /* DW_AT_GNU_all_call_sites */
+ .4byte 0xf1 /* DW_AT_sibling */
+ .uleb128 0x7 /* (DIE (0xb8) DW_TAG_formal_parameter) */
+ .4byte 0x42 /* DW_AT_abstract_origin */
+ .byte 0x1 /* DW_AT_location */
+ .byte 0x55 /* DW_OP_reg5 */
+ .uleb128 0x7 /* (DIE (0xbf) DW_TAG_formal_parameter) */
+ .4byte 0x4b /* DW_AT_abstract_origin */
+ .byte 0x6 /* DW_AT_location */
+ .byte 0xfa /* DW_OP_GNU_parameter_ref */
+ .4byte 0x4b
+ .byte 0x9f /* DW_OP_stack_value */
+ .uleb128 0x8 /* (DIE (0xcb) DW_TAG_variable) */
+ .4byte 0x5d /* DW_AT_abstract_origin */
+ .byte 0x5 /* DW_AT_location */
+ .byte 0x75 /* DW_OP_breg5 */
+ .sleb128 0
+ .byte 0x31 /* DW_OP_lit1 */
+ .byte 0x24 /* DW_OP_shl */
+ .byte 0x9f /* DW_OP_stack_value */
+ .uleb128 0x8 /* (DIE (0xd6) DW_TAG_variable) */
+ .4byte 0x66 /* DW_AT_abstract_origin */
+ .byte 0x8 /* DW_AT_location */
+ .byte 0xfa /* DW_OP_GNU_parameter_ref */
+ .4byte 0x4b
+ .byte 0x31 /* DW_OP_lit1 */
+ .byte 0x24 /* DW_OP_shl */
+ .byte 0x9f /* DW_OP_stack_value */
+ .uleb128 0x9 /* (DIE (0xe4) DW_TAG_variable) */
+ .4byte 0x6f /* DW_AT_abstract_origin */
+ .byte 0x6 /* DW_AT_const_value */
+ .uleb128 0xa /* (DIE (0xea) DW_TAG_formal_parameter) */
+ .4byte 0x54 /* DW_AT_abstract_origin */
+ .byte 0x3 /* DW_AT_const_value */
+ .byte 0 /* end of children of DIE 0x9b */
+ .uleb128 0xb /* (DIE (0xf1) DW_TAG_subprogram) */
+ .4byte 0x80 /* DW_AT_abstract_origin */
+ .quad .LFB5 /* DW_AT_low_pc */
+ .quad .LFE5 /* DW_AT_high_pc */
+ .4byte .LLST0 /* DW_AT_frame_base */
+ .byte 0x1 /* DW_AT_GNU_all_call_sites */
+ .4byte 0x16c /* DW_AT_sibling */
+ .uleb128 0xa /* (DIE (0x10f) DW_TAG_formal_parameter) */
+ .4byte 0x91 /* DW_AT_abstract_origin */
+ .byte 0xa /* DW_AT_const_value */
+ .uleb128 0xc /* (DIE (0x115) DW_TAG_GNU_call_site) */
+ .quad .LVL2 /* DW_AT_low_pc */
+ .4byte 0x9b /* DW_AT_abstract_origin */
+ .4byte 0x133 /* DW_AT_sibling */
+ .uleb128 0xd /* (DIE (0x126) DW_TAG_GNU_call_site_parameter) */
+ .byte 0x1 /* DW_AT_location */
+ .byte 0x55 /* DW_OP_reg5 */
+ .byte 0x1 /* DW_AT_GNU_call_site_value */
+ .byte 0x3a /* DW_OP_lit10 */
+ .uleb128 0xe /* (DIE (0x12b) DW_TAG_GNU_call_site_parameter) */
+ .4byte 0x4b /* DW_AT_abstract_origin */
+ .byte 0x1 /* DW_AT_GNU_call_site_value */
+ .byte 0x32 /* DW_OP_lit2 */
+ .byte 0 /* end of children of DIE 0x115 */
+ .uleb128 0xc /* (DIE (0x133) DW_TAG_GNU_call_site) */
+ .quad .LVL3 /* DW_AT_low_pc */
+ .4byte 0x9b /* DW_AT_abstract_origin */
+ .4byte 0x151 /* DW_AT_sibling */
+ .uleb128 0xd /* (DIE (0x144) DW_TAG_GNU_call_site_parameter) */
+ .byte 0x1 /* DW_AT_location */
+ .byte 0x55 /* DW_OP_reg5 */
+ .byte 0x1 /* DW_AT_GNU_call_site_value */
+ .byte 0x3a /* DW_OP_lit10 */
+ .uleb128 0xe /* (DIE (0x149) DW_TAG_GNU_call_site_parameter) */
+ .4byte 0x4b /* DW_AT_abstract_origin */
+ .byte 0x1 /* DW_AT_GNU_call_site_value */
+ .byte 0x34 /* DW_OP_lit4 */
+ .byte 0 /* end of children of DIE 0x133 */
+ .uleb128 0xf /* (DIE (0x151) DW_TAG_GNU_call_site) */
+ .quad .LVL4 /* DW_AT_low_pc */
+ .4byte 0x9b /* DW_AT_abstract_origin */
+ .uleb128 0xd /* (DIE (0x15e) DW_TAG_GNU_call_site_parameter) */
+ .byte 0x1 /* DW_AT_location */
+ .byte 0x55 /* DW_OP_reg5 */
+ .byte 0x1 /* DW_AT_GNU_call_site_value */
+ .byte 0x40 /* DW_OP_lit16 */
+ .uleb128 0xe /* (DIE (0x163) DW_TAG_GNU_call_site_parameter) */
+ .4byte 0x4b /* DW_AT_abstract_origin */
+ .byte 0x1 /* DW_AT_GNU_call_site_value */
+ .byte 0x3a /* DW_OP_lit10 */
+ .byte 0 /* end of children of DIE 0x151 */
+ .byte 0 /* end of children of DIE 0xf1 */
+ .uleb128 0x10 /* (DIE (0x16c) DW_TAG_subprogram) */
+ .byte 0x1 /* DW_AT_external */
+ .4byte .LASF3 /* DW_AT_name: "main" */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x25 /* DW_AT_decl_line */
+ .byte 0x1 /* DW_AT_prototyped */
+ .4byte 0x79 /* DW_AT_type */
+ .quad .LFB2 /* DW_AT_low_pc */
+ .quad .LFE2 /* DW_AT_high_pc */
+ .byte 0x2 /* DW_AT_frame_base */
+ .byte 0x77 /* DW_OP_breg7 */
+ .sleb128 8
+ .byte 0x1 /* DW_AT_GNU_all_call_sites */
+ .4byte 0x1a0 /* DW_AT_sibling */
+ .uleb128 0x11 /* (DIE (0x191) DW_TAG_GNU_call_site) */
+ .quad .LVL5 /* DW_AT_low_pc */
+ .byte 0x1 /* DW_AT_GNU_tail_call */
+ .4byte 0xf1 /* DW_AT_abstract_origin */
+ .byte 0 /* end of children of DIE 0x16c */
+ .uleb128 0x12 /* (DIE (0x1a0) DW_TAG_variable) */
+ .ascii "vv\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x12 /* DW_AT_decl_line */
+ .4byte 0x1b5 /* DW_AT_type */
+ .byte 0x1 /* DW_AT_external */
+ .byte 0x9 /* DW_AT_location */
+ .byte 0x3 /* DW_OP_addr */
+ .quad vv
+ .uleb128 0x13 /* (DIE (0x1b5) DW_TAG_volatile_type) */
+ .4byte 0x79 /* DW_AT_type */
+ .byte 0 /* end of children of DIE 0xb */
+ .section .debug_abbrev,"",@progbits
+.Ldebug_abbrev0:
+ .uleb128 0x1 /* (abbrev code) */
+ .uleb128 0x11 /* (TAG: DW_TAG_compile_unit) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x25 /* (DW_AT_producer) */
+ .uleb128 0xe /* (DW_FORM_strp) */
+ .uleb128 0x13 /* (DW_AT_language) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0xe /* (DW_FORM_strp) */
+ .uleb128 0x1b /* (DW_AT_comp_dir) */
+ .uleb128 0xe /* (DW_FORM_strp) */
+ .uleb128 0x55 /* (DW_AT_ranges) */
+ .uleb128 0x6 /* (DW_FORM_data4) */
+ .uleb128 0x11 /* (DW_AT_low_pc) */
+ .uleb128 0x1 /* (DW_FORM_addr) */
+ .uleb128 0x52 /* (DW_AT_entry_pc) */
+ .uleb128 0x1 /* (DW_FORM_addr) */
+ .uleb128 0x10 /* (DW_AT_stmt_list) */
+ .uleb128 0x6 /* (DW_FORM_data4) */
+ .byte 0
+ .byte 0
+ .uleb128 0x2 /* (abbrev code) */
+ .uleb128 0x2e /* (TAG: DW_TAG_subprogram) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0x8 /* (DW_FORM_string) */
+ .uleb128 0x3a /* (DW_AT_decl_file) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3b /* (DW_AT_decl_line) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x27 /* (DW_AT_prototyped) */
+ .uleb128 0xc /* (DW_FORM_flag) */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x20 /* (DW_AT_inline) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x1 /* (DW_AT_sibling) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .uleb128 0x3 /* (abbrev code) */
+ .uleb128 0x5 /* (TAG: DW_TAG_formal_parameter) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0x8 /* (DW_FORM_string) */
+ .uleb128 0x3a /* (DW_AT_decl_file) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3b /* (DW_AT_decl_line) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .uleb128 0x4 /* (abbrev code) */
+ .uleb128 0x34 /* (TAG: DW_TAG_variable) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0x8 /* (DW_FORM_string) */
+ .uleb128 0x3a /* (DW_AT_decl_file) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3b /* (DW_AT_decl_line) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .uleb128 0x5 /* (abbrev code) */
+ .uleb128 0x24 /* (TAG: DW_TAG_base_type) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0xb /* (DW_AT_byte_size) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3e /* (DW_AT_encoding) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0x8 /* (DW_FORM_string) */
+ .byte 0
+ .byte 0
+ .uleb128 0x6 /* (abbrev code) */
+ .uleb128 0x2e /* (TAG: DW_TAG_subprogram) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x11 /* (DW_AT_low_pc) */
+ .uleb128 0x1 /* (DW_FORM_addr) */
+ .uleb128 0x12 /* (DW_AT_high_pc) */
+ .uleb128 0x1 /* (DW_FORM_addr) */
+ .uleb128 0x40 /* (DW_AT_frame_base) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .uleb128 0x2117 /* (DW_AT_GNU_all_call_sites) */
+ .uleb128 0xc /* (DW_FORM_flag) */
+ .uleb128 0x1 /* (DW_AT_sibling) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .uleb128 0x7 /* (abbrev code) */
+ .uleb128 0x5 /* (TAG: DW_TAG_formal_parameter) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x2 /* (DW_AT_location) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .byte 0
+ .byte 0
+ .uleb128 0x8 /* (abbrev code) */
+ .uleb128 0x34 /* (TAG: DW_TAG_variable) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x2 /* (DW_AT_location) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .byte 0
+ .byte 0
+ .uleb128 0x9 /* (abbrev code) */
+ .uleb128 0x34 /* (TAG: DW_TAG_variable) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x1c /* (DW_AT_const_value) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .byte 0
+ .byte 0
+ .uleb128 0xa /* (abbrev code) */
+ .uleb128 0x5 /* (TAG: DW_TAG_formal_parameter) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x1c /* (DW_AT_const_value) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .byte 0
+ .byte 0
+ .uleb128 0xb /* (abbrev code) */
+ .uleb128 0x2e /* (TAG: DW_TAG_subprogram) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x11 /* (DW_AT_low_pc) */
+ .uleb128 0x1 /* (DW_FORM_addr) */
+ .uleb128 0x12 /* (DW_AT_high_pc) */
+ .uleb128 0x1 /* (DW_FORM_addr) */
+ .uleb128 0x40 /* (DW_AT_frame_base) */
+ .uleb128 0x6 /* (DW_FORM_data4) */
+ .uleb128 0x2117 /* (DW_AT_GNU_all_call_sites) */
+ .uleb128 0xc /* (DW_FORM_flag) */
+ .uleb128 0x1 /* (DW_AT_sibling) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .uleb128 0xc /* (abbrev code) */
+ .uleb128 0x4109 /* (TAG: DW_TAG_GNU_call_site) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x11 /* (DW_AT_low_pc) */
+ .uleb128 0x1 /* (DW_FORM_addr) */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x1 /* (DW_AT_sibling) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .uleb128 0xd /* (abbrev code) */
+ .uleb128 0x410a /* (TAG: DW_TAG_GNU_call_site_parameter) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x2 /* (DW_AT_location) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .uleb128 0x2111 /* (DW_AT_GNU_call_site_value) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .byte 0
+ .byte 0
+ .uleb128 0xe /* (abbrev code) */
+ .uleb128 0x410a /* (TAG: DW_TAG_GNU_call_site_parameter) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x2111 /* (DW_AT_GNU_call_site_value) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .byte 0
+ .byte 0
+ .uleb128 0xf /* (abbrev code) */
+ .uleb128 0x4109 /* (TAG: DW_TAG_GNU_call_site) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x11 /* (DW_AT_low_pc) */
+ .uleb128 0x1 /* (DW_FORM_addr) */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .uleb128 0x10 /* (abbrev code) */
+ .uleb128 0x2e /* (TAG: DW_TAG_subprogram) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x3f /* (DW_AT_external) */
+ .uleb128 0xc /* (DW_FORM_flag) */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0xe /* (DW_FORM_strp) */
+ .uleb128 0x3a /* (DW_AT_decl_file) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3b /* (DW_AT_decl_line) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x27 /* (DW_AT_prototyped) */
+ .uleb128 0xc /* (DW_FORM_flag) */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x11 /* (DW_AT_low_pc) */
+ .uleb128 0x1 /* (DW_FORM_addr) */
+ .uleb128 0x12 /* (DW_AT_high_pc) */
+ .uleb128 0x1 /* (DW_FORM_addr) */
+ .uleb128 0x40 /* (DW_AT_frame_base) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .uleb128 0x2117 /* (DW_AT_GNU_all_call_sites) */
+ .uleb128 0xc /* (DW_FORM_flag) */
+ .uleb128 0x1 /* (DW_AT_sibling) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .uleb128 0x11 /* (abbrev code) */
+ .uleb128 0x4109 /* (TAG: DW_TAG_GNU_call_site) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x11 /* (DW_AT_low_pc) */
+ .uleb128 0x1 /* (DW_FORM_addr) */
+ .uleb128 0x2115 /* (DW_AT_GNU_tail_call) */
+ .uleb128 0xc /* (DW_FORM_flag) */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .uleb128 0x12 /* (abbrev code) */
+ .uleb128 0x34 /* (TAG: DW_TAG_variable) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x3 /* (DW_AT_name) */
+ .uleb128 0x8 /* (DW_FORM_string) */
+ .uleb128 0x3a /* (DW_AT_decl_file) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x3b /* (DW_AT_decl_line) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x3f /* (DW_AT_external) */
+ .uleb128 0xc /* (DW_FORM_flag) */
+ .uleb128 0x2 /* (DW_AT_location) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .byte 0
+ .byte 0
+ .uleb128 0x13 /* (abbrev code) */
+ .uleb128 0x35 /* (TAG: DW_TAG_volatile_type) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .byte 0
+ .section .debug_loc,"",@progbits
+.Ldebug_loc0:
+.LLST0:
+ .quad .LFB5 /* Location list begin address (*.LLST0) */
+ .quad .LCFI0 /* Location list end address (*.LLST0) */
+ .2byte 0x2 /* Location expression size */
+ .byte 0x77 /* DW_OP_breg7 */
+ .sleb128 8
+ .quad .LCFI0 /* Location list begin address (*.LLST0) */
+ .quad .LCFI1 /* Location list end address (*.LLST0) */
+ .2byte 0x2 /* Location expression size */
+ .byte 0x77 /* DW_OP_breg7 */
+ .sleb128 16
+ .quad .LCFI1 /* Location list begin address (*.LLST0) */
+ .quad .LFE5 /* Location list end address (*.LLST0) */
+ .2byte 0x2 /* Location expression size */
+ .byte 0x77 /* DW_OP_breg7 */
+ .sleb128 8
+ .quad 0 /* Location list terminator begin (*.LLST0) */
+ .quad 0 /* Location list terminator end (*.LLST0) */
+ .section .debug_aranges,"",@progbits
+ .4byte 0x3c /* Length of Address Ranges Info */
+ .2byte 0x2 /* DWARF Version */
+ .4byte .Ldebug_info0 /* Offset of Compilation Unit Info */
+ .byte 0x8 /* Size of Address */
+ .byte 0 /* Size of Segment Descriptor */
+ .2byte 0 /* Pad to 16 byte boundary */
+ .2byte 0
+ .quad .Ltext0 /* Address */
+ .quad .Letext0-.Ltext0 /* Length */
+ .quad .LFB2 /* Address */
+ .quad .LFE2-.LFB2 /* Length */
+ .quad 0
+ .quad 0
+ .section .debug_ranges,"",@progbits
+.Ldebug_ranges0:
+ .quad .Ltext0 /* Offset 0 */
+ .quad .Letext0
+ .quad .LFB2 /* Offset 0x10 */
+ .quad .LFE2
+ .quad 0
+ .quad 0
+ .section .debug_line,"",@progbits
+.Ldebug_line0:
+ .section .debug_str,"MS",@progbits,1
+.LASF1:
+ .string "gdb.arch/amd64-entry-value-param.c"
+.LASF3:
+ .string "main"
+.LASF2:
+ .string ""
+.LASF0:
+ .string "GNU C 4.7.1 20120612 (prerelease)"
+ .ident "GCC: (GNU) 4.7.1 20120612 (prerelease)"
+ .section .note.GNU-stack,"",@progbits
Index: gdb-7.4.50.20120120/gdb/testsuite/gdb.arch/amd64-entry-value-param.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120120/gdb/testsuite/gdb.arch/amd64-entry-value-param.c 2012-06-14 09:24:34.191405263 +0200
@@ -0,0 +1,40 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+volatile int vv;
+
+static __attribute__((noinline)) int
+foo (int x, int y, int z)
+{
+ int a = x * 2;
+ int b = y * 2;
+ int c = z * 2;
+ vv++; /* break-here */
+ return x + z;
+}
+
+static __attribute__((noinline)) int
+bar (int x)
+{
+ return foo (x, 2, 3) + foo (x, 4, 3) + foo (x + 6, x, 3) + x;
+}
+
+int
+main (void)
+{
+ return bar (10);
+}
Index: gdb-7.4.50.20120120/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120120/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp 2012-06-14 09:24:34.192405264 +0200
@@ -0,0 +1,51 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testfile amd64-entry-value-param
+set srcfile ${testfile}.S
+set csrcfile ${testfile}.c
+set opts {}
+
+if [info exists COMPILE] {
+ # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-param.exp COMPILE=1"
+ set srcfile ${csrcfile}
+ lappend opts debug optimize=-O2
+} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
+ verbose "Skipping amd64-entry-value-param."
+ return
+}
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $opts] } {
+ return -1
+}
+
+if ![runto_main] {
+ return -1
+}
+
+set srcfile $csrcfile
+gdb_breakpoint [gdb_get_line_number "break-here"]
+
+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+gdb_test "p y" " = 2"
+gdb_test "p b" " = 4"
+
+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+gdb_test "p y" " = 4"
+gdb_test "p b" " = 8"
+
+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+gdb_test "p y" " = 10"
+gdb_test "p b" " = 20"

View File

@ -297,3 +297,527 @@ http://sourceware.org/ml/gdb-cvs/2012-02/msg00119.html
}
static int
http://sourceware.org/ml/gdb-cvs/2012-09/msg00081.html
### src/gdb/ChangeLog 2012/09/17 07:14:54 1.14469.2.32
### src/gdb/ChangeLog 2012/09/17 07:17:25 1.14469.2.33
## -1,4 +1,11 @@
2012-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ PR 14119
+ * frame.c (skip_inlined_frames): Skip also TAILCALL_FRAME frames.
+ (frame_pop): Drop also TAILCALL_FRAME frames.
+ * infcmd.c (finish_command): Ignore also TAILCALL_FRAME frames.
+
+2012-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
Pedro Alves <palves@redhat.com>
PR 14548
--- src/gdb/frame.c 2012/03/01 20:48:56 1.306
+++ src/gdb/frame.c 2012/09/17 07:17:27 1.306.2.1
@@ -309,7 +309,8 @@
static struct frame_info *
skip_inlined_frames (struct frame_info *frame)
{
- while (get_frame_type (frame) == INLINE_FRAME)
+ while (get_frame_type (frame) == INLINE_FRAME
+ || get_frame_type (frame) == TAILCALL_FRAME)
frame = get_prev_frame (frame);
return frame;
@@ -814,6 +815,11 @@
if (!prev_frame)
error (_("Cannot pop the initial frame."));
+ /* Ignore TAILCALL_FRAME type frames, they were executed already before
+ entering THISFRAME. */
+ while (get_frame_type (prev_frame) == TAILCALL_FRAME)
+ prev_frame = get_prev_frame (prev_frame);
+
/* Make a copy of all the register values unwound from this frame.
Save them in a scratch buffer so that there isn't a race between
trying to extract the old values from the current regcache while
--- src/gdb/infcmd.c 2012/06/29 22:46:44 1.306
+++ src/gdb/infcmd.c 2012/09/17 07:17:27 1.306.2.1
@@ -1777,6 +1777,11 @@
return;
}
+ /* Ignore TAILCALL_FRAME type frames, they were executed already before
+ entering THISFRAME. */
+ while (get_frame_type (frame) == TAILCALL_FRAME)
+ frame = get_prev_frame (frame);
+
/* Find the function we will return from. */
function = find_pc_function (get_frame_pc (get_selected_frame (NULL)));
### src/gdb/testsuite/ChangeLog 2012/09/17 07:14:55 1.3295.2.22
### src/gdb/testsuite/ChangeLog 2012/09/17 07:17:27 1.3295.2.23
## -1,5 +1,15 @@
2012-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+ PR 14119
+ * gdb.arch/amd64-tailcall-ret.S: New file.
+ * gdb.arch/amd64-tailcall-ret.c: New file.
+ * gdb.arch/amd64-tailcall-ret.exp: New file.
+ * gdb.reverse/amd64-tailcall-reverse.S: New file.
+ * gdb.reverse/amd64-tailcall-reverse.c: New file.
+ * gdb.reverse/amd64-tailcall-reverse.exp: New file.
+
+2012-09-17 Jan Kratochvil <jan.kratochvil@redhat.com>
+
PR 14548
* gdb.reverse/singlejmp-reverse-nodebug.S: New file.
* gdb.reverse/singlejmp-reverse-nodebug.c: New file.
--- src/gdb/testsuite/gdb.arch/amd64-tailcall-ret.S
+++ src/gdb/testsuite/gdb.arch/amd64-tailcall-ret.S 2013-01-13 07:24:23.894972000 +0000
@@ -0,0 +1,357 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* This source file was generated by:
+ gcc -o gdb.arch/amd64-tailcall-ret.S gdb.arch/amd64-tailcall-ret.c -Wall -S -dA -O2 -g
+ */
+
+ .file "amd64-tailcall-ret.c"
+ .text
+.Ltext0:
+ .p2align 4,,15
+ .type g, @function
+g:
+.LFB0:
+ .file 1 "gdb.arch/amd64-tailcall-ret.c"
+ # gdb.arch/amd64-tailcall-ret.c:22
+ .loc 1 22 0
+ .cfi_startproc
+# BLOCK 2 freq:10000 seq:0
+# PRED: ENTRY [100.0%] (fallthru)
+ # gdb.arch/amd64-tailcall-ret.c:23
+ .loc 1 23 0
+ movl $2, v(%rip)
+# SUCC: EXIT [100.0%]
+ ret
+ .cfi_endproc
+.LFE0:
+ .size g, .-g
+ .p2align 4,,15
+ .type f, @function
+f:
+.LFB1:
+ # gdb.arch/amd64-tailcall-ret.c:28
+ .loc 1 28 0
+ .cfi_startproc
+# BLOCK 2 freq:10000 seq:0
+# PRED: ENTRY [100.0%] (fallthru)
+ # gdb.arch/amd64-tailcall-ret.c:29
+ .loc 1 29 0
+ jmp g
+# SUCC: EXIT [100.0%] (ab,sibcall)
+.LVL0:
+ .cfi_endproc
+.LFE1:
+ .size f, .-f
+ .section .text.startup,"ax",@progbits
+ .p2align 4,,15
+ .globl main
+ .type main, @function
+main:
+.LFB2:
+ # gdb.arch/amd64-tailcall-ret.c:34
+ .loc 1 34 0
+ .cfi_startproc
+# BLOCK 2 freq:10000 seq:0
+# PRED: ENTRY [100.0%] (fallthru)
+ # gdb.arch/amd64-tailcall-ret.c:35
+ .loc 1 35 0
+ call f
+.LVL1:
+ # gdb.arch/amd64-tailcall-ret.c:36
+ .loc 1 36 0
+ call f
+.LVL2:
+ # gdb.arch/amd64-tailcall-ret.c:37
+ .loc 1 37 0
+ movl $3, v(%rip)
+ # gdb.arch/amd64-tailcall-ret.c:39
+ .loc 1 39 0
+ xorl %eax, %eax
+# SUCC: EXIT [100.0%]
+ ret
+ .cfi_endproc
+.LFE2:
+ .size main, .-main
+ .comm v,4,4
+ .text
+.Letext0:
+ .section .debug_info,"",@progbits
+.Ldebug_info0:
+ .long 0xd5 # Length of Compilation Unit Info
+ .value 0x2 # DWARF version number
+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section
+ .byte 0x8 # Pointer Size (in bytes)
+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit)
+ .long .LASF0 # DW_AT_producer: "GNU C 4.7.2 20120911 (prerelease)"
+ .byte 0x1 # DW_AT_language
+ .long .LASF1 # DW_AT_name: "gdb.arch/amd64-tailcall-ret.c"
+ .long .LASF2 # DW_AT_comp_dir: ""
+ .long .Ldebug_ranges0+0 # DW_AT_ranges
+ .quad 0 # DW_AT_low_pc
+ .quad 0 # DW_AT_entry_pc
+ .long .Ldebug_line0 # DW_AT_stmt_list
+ .uleb128 0x2 # (DIE (0x31) DW_TAG_subprogram)
+ .ascii "g\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-ret.c)
+ .byte 0x15 # DW_AT_decl_line
+ .byte 0x1 # DW_AT_prototyped
+ .quad .LFB0 # DW_AT_low_pc
+ .quad .LFE0 # DW_AT_high_pc
+ .byte 0x2 # DW_AT_frame_base
+ .byte 0x77 # DW_OP_breg7
+ .sleb128 8
+ .byte 0x1 # DW_AT_GNU_all_call_sites
+ .uleb128 0x3 # (DIE (0x4b) DW_TAG_subprogram)
+ .ascii "f\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-ret.c)
+ .byte 0x1b # DW_AT_decl_line
+ .byte 0x1 # DW_AT_prototyped
+ .quad .LFB1 # DW_AT_low_pc
+ .quad .LFE1 # DW_AT_high_pc
+ .byte 0x2 # DW_AT_frame_base
+ .byte 0x77 # DW_OP_breg7
+ .sleb128 8
+ .byte 0x1 # DW_AT_GNU_all_call_sites
+ .long 0x78 # DW_AT_sibling
+ .uleb128 0x4 # (DIE (0x69) DW_TAG_GNU_call_site)
+ .quad .LVL0 # DW_AT_low_pc
+ .byte 0x1 # DW_AT_GNU_tail_call
+ .long 0x31 # DW_AT_abstract_origin
+ .byte 0 # end of children of DIE 0x4b
+ .uleb128 0x5 # (DIE (0x78) DW_TAG_subprogram)
+ .byte 0x1 # DW_AT_external
+ .long .LASF3 # DW_AT_name: "main"
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-ret.c)
+ .byte 0x21 # DW_AT_decl_line
+ .byte 0x1 # DW_AT_prototyped
+ .long 0xb8 # DW_AT_type
+ .quad .LFB2 # DW_AT_low_pc
+ .quad .LFE2 # DW_AT_high_pc
+ .byte 0x2 # DW_AT_frame_base
+ .byte 0x77 # DW_OP_breg7
+ .sleb128 8
+ .byte 0x1 # DW_AT_GNU_all_call_sites
+ .long 0xb8 # DW_AT_sibling
+ .uleb128 0x6 # (DIE (0x9d) DW_TAG_GNU_call_site)
+ .quad .LVL1 # DW_AT_low_pc
+ .long 0x4b # DW_AT_abstract_origin
+ .uleb128 0x6 # (DIE (0xaa) DW_TAG_GNU_call_site)
+ .quad .LVL2 # DW_AT_low_pc
+ .long 0x4b # DW_AT_abstract_origin
+ .byte 0 # end of children of DIE 0x78
+ .uleb128 0x7 # (DIE (0xb8) DW_TAG_base_type)
+ .byte 0x4 # DW_AT_byte_size
+ .byte 0x5 # DW_AT_encoding
+ .ascii "int\0" # DW_AT_name
+ .uleb128 0x8 # (DIE (0xbf) DW_TAG_variable)
+ .ascii "v\0" # DW_AT_name
+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-ret.c)
+ .byte 0x12 # DW_AT_decl_line
+ .long 0xd3 # DW_AT_type
+ .byte 0x1 # DW_AT_external
+ .byte 0x9 # DW_AT_location
+ .byte 0x3 # DW_OP_addr
+ .quad v
+ .uleb128 0x9 # (DIE (0xd3) DW_TAG_volatile_type)
+ .long 0xb8 # DW_AT_type
+ .byte 0 # end of children of DIE 0xb
+ .section .debug_abbrev,"",@progbits
+.Ldebug_abbrev0:
+ .uleb128 0x1 # (abbrev code)
+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x25 # (DW_AT_producer)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x13 # (DW_AT_language)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x1b # (DW_AT_comp_dir)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x55 # (DW_AT_ranges)
+ .uleb128 0x6 # (DW_FORM_data4)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x52 # (DW_AT_entry_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x10 # (DW_AT_stmt_list)
+ .uleb128 0x6 # (DW_FORM_data4)
+ .byte 0
+ .byte 0
+ .uleb128 0x2 # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0 # DW_children_no
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x27 # (DW_AT_prototyped)
+ .uleb128 0xc # (DW_FORM_flag)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x40 # (DW_AT_frame_base)
+ .uleb128 0xa # (DW_FORM_block1)
+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
+ .uleb128 0xc # (DW_FORM_flag)
+ .byte 0
+ .byte 0
+ .uleb128 0x3 # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x27 # (DW_AT_prototyped)
+ .uleb128 0xc # (DW_FORM_flag)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x40 # (DW_AT_frame_base)
+ .uleb128 0xa # (DW_FORM_block1)
+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
+ .uleb128 0xc # (DW_FORM_flag)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x4 # (abbrev code)
+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site)
+ .byte 0 # DW_children_no
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x2115 # (DW_AT_GNU_tail_call)
+ .uleb128 0xc # (DW_FORM_flag)
+ .uleb128 0x31 # (DW_AT_abstract_origin)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x5 # (abbrev code)
+ .uleb128 0x2e # (TAG: DW_TAG_subprogram)
+ .byte 0x1 # DW_children_yes
+ .uleb128 0x3f # (DW_AT_external)
+ .uleb128 0xc # (DW_FORM_flag)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0xe # (DW_FORM_strp)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x27 # (DW_AT_prototyped)
+ .uleb128 0xc # (DW_FORM_flag)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x12 # (DW_AT_high_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x40 # (DW_AT_frame_base)
+ .uleb128 0xa # (DW_FORM_block1)
+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
+ .uleb128 0xc # (DW_FORM_flag)
+ .uleb128 0x1 # (DW_AT_sibling)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x6 # (abbrev code)
+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site)
+ .byte 0 # DW_children_no
+ .uleb128 0x11 # (DW_AT_low_pc)
+ .uleb128 0x1 # (DW_FORM_addr)
+ .uleb128 0x31 # (DW_AT_abstract_origin)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .uleb128 0x7 # (abbrev code)
+ .uleb128 0x24 # (TAG: DW_TAG_base_type)
+ .byte 0 # DW_children_no
+ .uleb128 0xb # (DW_AT_byte_size)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3e # (DW_AT_encoding)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .byte 0
+ .byte 0
+ .uleb128 0x8 # (abbrev code)
+ .uleb128 0x34 # (TAG: DW_TAG_variable)
+ .byte 0 # DW_children_no
+ .uleb128 0x3 # (DW_AT_name)
+ .uleb128 0x8 # (DW_FORM_string)
+ .uleb128 0x3a # (DW_AT_decl_file)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x3b # (DW_AT_decl_line)
+ .uleb128 0xb # (DW_FORM_data1)
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .uleb128 0x3f # (DW_AT_external)
+ .uleb128 0xc # (DW_FORM_flag)
+ .uleb128 0x2 # (DW_AT_location)
+ .uleb128 0xa # (DW_FORM_block1)
+ .byte 0
+ .byte 0
+ .uleb128 0x9 # (abbrev code)
+ .uleb128 0x35 # (TAG: DW_TAG_volatile_type)
+ .byte 0 # DW_children_no
+ .uleb128 0x49 # (DW_AT_type)
+ .uleb128 0x13 # (DW_FORM_ref4)
+ .byte 0
+ .byte 0
+ .byte 0
+ .section .debug_aranges,"",@progbits
+ .long 0x3c # Length of Address Ranges Info
+ .value 0x2 # DWARF Version
+ .long .Ldebug_info0 # Offset of Compilation Unit Info
+ .byte 0x8 # Size of Address
+ .byte 0 # Size of Segment Descriptor
+ .value 0 # Pad to 16 byte boundary
+ .value 0
+ .quad .Ltext0 # Address
+ .quad .Letext0-.Ltext0 # Length
+ .quad .LFB2 # Address
+ .quad .LFE2-.LFB2 # Length
+ .quad 0
+ .quad 0
+ .section .debug_ranges,"",@progbits
+.Ldebug_ranges0:
+ .quad .Ltext0 # Offset 0
+ .quad .Letext0
+ .quad .LFB2 # Offset 0x10
+ .quad .LFE2
+ .quad 0
+ .quad 0
+ .section .debug_line,"",@progbits
+.Ldebug_line0:
+ .section .debug_str,"MS",@progbits,1
+.LASF0:
+ .string "GNU C 4.7.2 20120911 (prerelease)"
+.LASF1:
+ .string "gdb.arch/amd64-tailcall-ret.c"
+.LASF2:
+ .string ""
+.LASF3:
+ .string "main"
+ .ident "GCC: (GNU) 4.7.2 20120911 (prerelease)"
+ .section .note.GNU-stack,"",@progbits
--- src/gdb/testsuite/gdb.arch/amd64-tailcall-ret.c
+++ src/gdb/testsuite/gdb.arch/amd64-tailcall-ret.c 2013-01-13 07:24:24.648595000 +0000
@@ -0,0 +1,39 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+volatile int v;
+
+static __attribute__ ((noinline, noclone)) void
+g (void)
+{
+ v = 2;
+}
+
+static __attribute__ ((noinline, noclone)) void
+f (void)
+{
+ g ();
+}
+
+int
+main (void)
+{
+ f (); /* first */
+ f (); /* second */
+ v = 3;
+ return 0;
+}
--- src/gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp
+++ src/gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp 2013-01-13 07:24:25.267748000 +0000
@@ -0,0 +1,44 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+set testfile "amd64-tailcall-ret"
+set opts {}
+set srcfile "amd64-tailcall-ret.S"
+
+if [info exists COMPILE] {
+ # make check RUNTESTFLAGS="gdb.arch/amd64-tailcall-ret.exp COMPILE=1"
+ #standard_testfile
+ lappend opts debug optimize=-O2
+} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
+ verbose "Skipping ${testfile}."
+ return
+}
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $opts] } {
+ return -1
+}
+
+if ![runto_main] {
+ return -1
+}
+
+gdb_breakpoint "g"
+gdb_continue_to_breakpoint "g" ".* v = 2;"
+
+gdb_test "return" { f \(\); /\* second \*/} "return" \
+ {Make g return now\? \(y or n\) } "y"
+
+gdb_continue_to_breakpoint "g" ".* v = 2;"
+
+gdb_test "finish" " v = 3;"

View File

@ -35,7 +35,7 @@ Version: 7.4.50.%{snap}
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 48%{?dist}
Release: 54%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain
Group: Development/Debuggers
@ -625,6 +625,22 @@ Patch690: gdb-glibc-strstr-workaround.patch
# [ppc] Fix hardware watchpoints on PowerPC (BZ 827600, Edjunior Machado).
Patch691: gdb-ppc-watchpoint.patch
# Support DW_OP_GNU_parameter_ref for -O2 -g inferiors (BZ 827375).
Patch696: gdb-parameterref-1of2.patch
Patch697: gdb-parameterref-2of2.patch
# Support constant DW_AT_high_pc produced by FSF GCC HEAD (Mark Wielaard).
Patch724: gdb-highpc-const.patch
# Fix "ambiguous linespec" regression: break lineno.
Patch727: gdb-break-lineno.patch
# Permit passing pointers as address number even for C++ methods (Keith Seitz).
Patch728: gdb-check-type.patch
# entry values: Fix resolving in inlined frames.
Patch729: gdb-entryval-inlined.patch
%if 0%{!?rhel:1} || 0%{?rhel} > 6
# RL_STATE_FEDORA_GDB would not be found for:
# Patch642: gdb-readline62-ask-more-rh.patch
@ -945,6 +961,12 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch689 -p1
%patch690 -p1
%patch691 -p1
%patch696 -p1
%patch697 -p1
%patch724 -p1
%patch727 -p1
%patch728 -p1
%patch729 -p1
%patch393 -p1
%if 0%{!?el5:1} || 0%{?scl:1}
@ -1437,6 +1459,25 @@ fi
%endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch"
%changelog
* Sun Jan 13 2013 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120120-54.fc17
- Fix internal error on finish with inlined frame (BZ 894678).
* Sun Jan 13 2013 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120120-53.fc17
- [testsuite] Fix gdb-orphanripper.c lockup on F-17 (/dev/pts/* glibc chown).
* Fri Oct 5 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120120-52.fc17
- entry values: Fix resolving in inlined frames.
* Thu Sep 27 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120120-51.fc17
- Fix "ambiguous linespec" regression: break lineno.
- Permit passing pointers as address number even for C++ methods (Keith Seitz).
* Wed Aug 22 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120120-50.fc17
- Support constant DW_AT_high_pc produced by FSF GCC HEAD (Mark Wielaard).
* Thu Jun 14 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120120-49.fc17
- Support DW_OP_GNU_parameter_ref for -O2 -g inferiors (BZ 827375).
* Sat Jun 2 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120120-48.fc17
- [ppc] Fix hardware watchpoints on PowerPC (BZ 827600, Edjunior Machado).