• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revision567a3e54d211ab8d09119f99fed10b57db895450 (tree)
Time2018-03-09 09:00:59
AuthorSimon Marchi <simon.marchi@eric...>
CommiterSimon Marchi

Log Message

Fix misreporting of omitted bytes for large remote packets

In remote.c, when the output of "set debug remote" is truncated, the
number of characters reported is incorrect. What is reported is the
number of characters added by the quoting, not the number of characters
that were truncated.

gdb/ChangeLog:

* remote.c (putpkt_binary): Fix omitted bytes reporting.
(getpkt_or_notif_sane_1): Likewise.

Change Summary

Incremental Difference

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
1+2018-03-08 Simon Marchi <simon.marchi@ericsson.com>
2+
3+ * remote.c (putpkt_binary): Fix omitted bytes reporting.
4+ (getpkt_or_notif_sane_1): Likewise.
5+
16 2018-03-08 Simon Marchi <simon.marchi@polymtl.ca>
27
38 * build-id.c (build_id_to_debug_bfd): Use std::string.
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -8720,11 +8720,9 @@ putpkt_binary (const char *buf, int cnt)
87208720
87218721 fprintf_unfiltered (gdb_stdlog, "Sending packet: %s", str.c_str ());
87228722
8723- if (str.length () > REMOTE_DEBUG_MAX_CHAR)
8724- {
8725- fprintf_unfiltered (gdb_stdlog, "[%zu bytes omitted]",
8726- str.length () - REMOTE_DEBUG_MAX_CHAR);
8727- }
8723+ if (len > REMOTE_DEBUG_MAX_CHAR)
8724+ fprintf_unfiltered (gdb_stdlog, "[%d bytes omitted]",
8725+ len - REMOTE_DEBUG_MAX_CHAR);
87288726
87298727 fprintf_unfiltered (gdb_stdlog, "...");
87308728
@@ -9157,11 +9155,9 @@ getpkt_or_notif_sane_1 (char **buf, long *sizeof_buf, int forever,
91579155 fprintf_unfiltered (gdb_stdlog, "Packet received: %s",
91589156 str.c_str ());
91599157
9160- if (str.length () > REMOTE_DEBUG_MAX_CHAR)
9161- {
9162- fprintf_unfiltered (gdb_stdlog, "[%zu bytes omitted]",
9163- str.length () - REMOTE_DEBUG_MAX_CHAR);
9164- }
9158+ if (val > REMOTE_DEBUG_MAX_CHAR)
9159+ fprintf_unfiltered (gdb_stdlog, "[%d bytes omitted]",
9160+ val - REMOTE_DEBUG_MAX_CHAR);
91659161
91669162 fprintf_unfiltered (gdb_stdlog, "\n");
91679163 }