Improve parsing of readelf output in process_core logic.

Sometimes readelf prepends an "fname: " note, to the line
with "psargs", and in that case just using awk with $2 does
not work.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6695352da641111f90be9f3e519accbf05107e91
This commit is contained in:
Jim Harris 2015-12-02 13:10:54 -07:00 committed by Gerrit Code Review
parent 1df5899cf5
commit df7eb6361a

View File

@ -82,7 +82,7 @@ function timing_finish() {
function process_core() {
ret=0
for core in $(find . -type f -name 'core*'); do
exe=$(eu-readelf -n "$core" | grep psargs | awk '{ print $2 }')
exe=$(eu-readelf -n "$core" | grep psargs | sed "s/.*psargs: \([^ \'\" ]*\).*/\1/")
echo "exe for $core is $exe"
if [[ ! -z "$exe" ]]; then
if hash gdb; then