Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Dec 2013 17:50:31 +0800
From:      Howard Su <howard0su@gmail.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: [PATCH] Add stack unwind support for the functions in .ko
Message-ID:  <CAAvnz_r1WsxC0Q%2BNOWhSs0Wp_Vs9mjpusZVrixsW1v%2BfwiXDpA@mail.gmail.com>
In-Reply-To: <C6E93F79-BA1C-48E9-8689-775D88462921@bsdimp.com>
References:  <CAAvnz_pWZqw-HEB-GTJ_CkErjXrz3v7ozabMXE__vr=SfkBVSg@mail.gmail.com> <CAAvnz_p2vw9=HWbGPePKm_yDxM-bM1h6VaQBeJq9sYXPRb2-Lg@mail.gmail.com> <20131215173042.0dead636@bender.Home> <CAAvnz_qmn%2Ba%2B-aE4GkYw6TDOPzfST2j5WGvHqKX4WWVsVACSzQ@mail.gmail.com> <C6E93F79-BA1C-48E9-8689-775D88462921@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--001a11c2bd3826572304ee1c7138
Content-Type: text/plain; charset=ISO-8859-1

here is the new version which address the print registers out problem.

On Monday, December 16, 2013, Warner Losh wrote:

>
> On Dec 15, 2013, at 4:56 PM, Howard Su wrote:
>
> > On Monday, December 16, 2013, Andrew Turner wrote:
> >
> >> On Mon, 9 Dec 2013 22:44:14 +0800
> >> Howard Su <howard0su@gmail.com <javascript:;> <javascript:;>> wrote:
> >>
> >>> Here is a new version which solve the unreadable $a problem. (the fix
> >>> is in ddb/db_main.c in the end of the patch.)
> >>>
> >>> I attached the diff for review.
> >>
> >> I can't comment on the MD parts of the code, but the ARM change looks
> >> good. My only request is to add a kernel option to turn on printing the
> >> registers in the stack trace as it has been useful for tracking down
> >> bugs.
> >>
> > I read the MD code of MIPS. seems it faces the same situation like arm
> > (register pass parameter). I will follow its pattern to print out
> register.
> > better than an option?
>
> I thought MIPS printed the args from those registers as args and ARM was
> the odd man out...
>
> Warner
>
>

-- 
-Howard

--001a11c2bd3826572304ee1c7138
Content-Type: text/x-patch; charset=US-ASCII; name="unwind.patch"
Content-Disposition: attachment; filename="unwind.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: 9079f629886fc7c4_0.1

ZGlmZiAtLWdpdCBhL3N5cy9hcm0vYXJtL2RiX2ludGVyZmFjZS5jIGIvc3lzL2FybS9hcm0vZGJf
aW50ZXJmYWNlLmMKaW5kZXggNjkwNjY1MC4uNzdkOWU1MCAxMDA2NDQKLS0tIGEvc3lzL2FybS9h
cm0vZGJfaW50ZXJmYWNlLmMKKysrIGIvc3lzL2FybS9hcm0vZGJfaW50ZXJmYWNlLmMKQEAgLTE4
MiwzMCArMTgyLDM5IEBAIGRiX3JlYWRfYnl0ZXMoYWRkciwgc2l6ZSwgZGF0YSkKIAljaGFyCSpk
YXRhOwogewogCWNoYXIJKnNyYyA9IChjaGFyICopYWRkcjsKKwlqbXBfYnVmIGpiOworCXZvaWQg
KnByZXZfamI7CisJaW50IHJldDsKIAotCWlmIChkYl92YWxpZGF0ZV9hZGRyZXNzKCh1X2ludClz
cmMpKSB7Ci0JCWRiX3ByaW50ZigiYWRkcmVzcyAlcCBpcyBpbnZhbGlkXG4iLCBzcmMpOwotCQly
ZXR1cm4gKC0xKTsKLQl9Ci0KLQlpZiAoc2l6ZSA9PSA0ICYmIChhZGRyICYgMykgPT0gMCAmJiAo
KHVpbnRwdHJfdClkYXRhICYgMykgPT0gMCkgewotCQkqKChpbnQqKWRhdGEpID0gKigoaW50Kilz
cmMpOwotCQlyZXR1cm4gKDApOwotCX0KLQotCWlmIChzaXplID09IDIgJiYgKGFkZHIgJiAxKSA9
PSAwICYmICgodWludHB0cl90KWRhdGEgJiAxKSA9PSAwKSB7Ci0JCSooKHNob3J0KilkYXRhKSA9
ICooKHNob3J0KilzcmMpOwotCQlyZXR1cm4gKDApOwotCX0KKwlwcmV2X2piID0ga2RiX2ptcGJ1
ZihqYik7CisJcmV0ID0gc2V0am1wKGpiK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