Add the ability to throw an error to python debugger (#2188)

This patch makes it possible to throw an error from the python debugger client using the `throw` command.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
Daniel Balla
2018-03-28 16:46:24 +02:00
committed by László Langó
parent 79289714dc
commit 8af89d951e
8 changed files with 100 additions and 10 deletions
+3 -3
View File
@@ -4,8 +4,8 @@ Stopped at tests/debugger/do_help.js:15
Documented commands (type help <topic>):
========================================
b bt delete e f list n s src
backtrace c display eval finish memstats next scroll step
break continue dump exception help ms quit source
b bt delete e f list n s src
backtrace c display eval finish memstats next scroll step
break continue dump exception help ms quit source throw
(jerry-debugger) quit
+1
View File
@@ -0,0 +1 @@
throw new Error('Once upon a time there lived in a certain village a little country girl, the prettiest creature who was ever seen. Her mother was excessively fond of her; and her grandmother doted on her still more. This good woman had a little red riding hood made for her. It suited the girl so extremely well that everybody called her Little Red Riding Hood. One day her mother, having made some cakes, said to her, "Go, my dear, and see how your grandmother is doing, for I hear she has been very ill. Take her a cake, and this little pot of butter."')
+3
View File
@@ -0,0 +1,3 @@
Connecting to: localhost:5001
Stopped at tests/debugger/do_throw.js:19
(jerry-debugger) throw new Error('Once upon a time there lived in a certain village a little country girl, the prettiest creature who was ever seen. Her mother was excessively fond of her; and her grandmother doted on her still more. This good woman had a little red riding hood made for her. It suited the girl so extremely well that everybody called her Little Red Riding Hood. One day her mother, having made some cakes, said to her, "Go, my dear, and see how your grandmother is doing, for I hear she has been very ill. Take her a cake, and this little pot of butter."')
+19
View File
@@ -0,0 +1,19 @@
// Copyright JS Foundation and other contributors, http://js.foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
function inevitable() {
print("An error will be thrown.");
}
inevitable();