[1/3] gdb/testsuite: Add compiler options parameter to function_range helper

Message ID 8727ee862873e94564075655c3b0c3e367fdc732.1584984383.git.andrew.burgess@embecosm.com
State New
Headers show
Series
  • Keep duplicate line table entries
Related show

Commit Message

Andrew Burgess March 23, 2020, 5:30 p.m.
When using the Dejagnu DWARF compiler tests will often use the
function_range helper function to extract the extents of a function.
If the plan is to compiler the file with non-default compiler flags
then we must pass those same compiler flags through to the
function_range helper function.

This will be used in a later commit, there should be no change in the
testsuite behaviour after this commit.

gdb/testsuite/ChangeLog:

	* lib/dwarf.exp (function_range): Allow compiler options to be
	specified.
---
 gdb/testsuite/ChangeLog     | 5 +++++
 gdb/testsuite/lib/dwarf.exp | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

-- 
2.14.5

Comments

Tom Tromey April 1, 2020, 6:31 p.m. | #1
>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:


Andrew> 	* lib/dwarf.exp (function_range): Allow compiler options to be
Andrew> 	specified.

Seems fine, thanks.

Tom

Patch

diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index 417b22d2345..4371b56d4de 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -114,12 +114,12 @@  proc build_executable_from_fission_assembler { testname executable sources optio
 # static void func (void) {}
 #
 
-proc function_range { func src } {
+proc function_range { func src {options {debug}} } {
     global decimal gdb_prompt
 
     set exe [standard_temp_file func_addr[pid].x]
 
-    gdb_compile $src $exe executable {debug}
+    gdb_compile $src $exe executable $options
 
     gdb_exit
     gdb_start