Re: [PATCH] [SH] Prologue skipping if there is none

Kevin Buettner
2012-03-01T00:13:17Z

On Wed, 29 Feb 2012 12:05:01 +0100
Thomas Schwinge <thomas@schwinge.name> wrote:

> As we already had figured out, it introduces the following nine
> regressions (PASS -> FAIL):
>
> FAIL: gdb.base/store.exp: continue to add_charest
> FAIL: gdb.base/store.exp: continue to add_short
> FAIL: gdb.base/store.exp: continue to add_int
> FAIL: gdb.base/store.exp: continue to add_long
> FAIL: gdb.base/store.exp: continue to add_longest
> FAIL: gdb.base/structs.exp: advance to fun<n> for return; return 2 structs-td-tf
> FAIL: gdb.base/structs.exp: advance to fun<n> for finish; return 2 structs-td-tf
> FAIL: gdb.base/structs.exp: advance to fun<n> for return; return 2 structs-tf-td
> FAIL: gdb.base/structs.exp: advance to fun<n> for finish; return 2 structs-tf-td

I could live with these if there were a significant number of progressions
elsewhere.

> As already reported, an additional regression for sh-linux-gnu:
>
> Running /scratch/tschwing/FM_sh-linux-gnu/src/gdb-mainline/gdb/testsuite/gdb.threads/staticthreads.exp ...
> PASS: gdb.threads/staticthreads.exp: successfully compiled posix threads test case
> PASS: gdb.threads/staticthreads.exp: set print sevenbit-strings
> PASS: gdb.threads/staticthreads.exp: break sem_post
> -PASS: gdb.threads/staticthreads.exp: Continue to main's call of sem_post
> +FAIL: gdb.threads/staticthreads.exp: Continue to main's call of sem_post (the program exited)
> PASS: gdb.threads/staticthreads.exp: rerun to main
> PASS: gdb.threads/staticthreads.exp: handle SIG32 nostop noprint pass
> -PASS: gdb.threads/staticthreads.exp: handle SIG32 helps
> -PASS: gdb.threads/staticthreads.exp: info threads
> +FAIL: gdb.threads/staticthreads.exp: handle SIG32 helps (the program exited)
> +KFAIL: gdb.threads/staticthreads.exp: info threads (PRMS: gdb/1328)
> PASS: gdb.threads/staticthreads.exp: GDB exits with static thread program
>
> The breakpoint for sem_post is mis-calculated to be somewhere near the
> end of the function (after the epilogue, even).

This is bad. I think this could be fixed (by stopping the scan if a
return instruction is seen), but I'm not sure it's worth it at the
moment.

> And, as already reported, there is this progression for sh-linux-gnu:
>
> -FAIL: gdb.base/gdb1250.exp: setting breakpoint at abort
> +PASS: gdb.base/gdb1250.exp: backtrace from abort
>
> The PLT stub for abort happens to be the last one in the .plt section,
> and (I suppose) your more advanced limit_pc/func_end mechanism (instead
> of hard-coding 28 instructions) helps to avoid hitting the
> end-of-.plt-section border. (The question is whether it really makes
> sense to go looking for a prologue in a PLT stub, but that's what GDB is
> currently doing, and it should be without harm.)
>
> As for the other advancements that you reported, do you have any
> additional patches in your tree; see the questions in my 2012-02-21
> email, Message-ID: <8762f09stp.fsf@schwinge.name>.

It turns out that I do. It's unrelated to prologue analysis. I'll
post it separately in a few minutes. (I'll CC you on it.)

It's a small patch that I thought I had removed from my tree. Sorry
about the noise caused by that patch.

> I'll now try to carry over your ``more advanced limit_pc/func_end
> mechanism'' separately.

I wouldn't make it a high priority. Your patch provides very good
results and my additions (on the prologue analysis front) hurt more
than they help.

Thanks for all of your work on this matter.

Kevin